Archive Location Suffix isn't added in 1.2.141

Editor 1.2.141 doesn’t add Archive Location Suffix to arhive_files.json name, but the dmloader.js is looking for it by the name with that suffix.

2 Likes

Interesting find, I’ll look into it!

Alright, this isn’t any new behaviour in 141, right? :slight_smile:

The main usage for prefix and suffix is for you to be able to move (or host) the archive folder elsewhere than beside the regular bundle output.

The prefix could for example be used to specify a completely separate URL and domain where the archive folder is hosted. While suffix could be used to append a query string to the final URL, for example to circumvent caching with ?unique_build_id=123.

As far as I understand, this works as expected; the archive files and archive_files.json URLs are run through the archive_location_filter (which gets templated with the properties from game.project).

3 Likes

The problem is the the file names don’t get the suffix appended to them in the bundle. I have the suffix set to “1.0.4” and the files supposed to get the names like arhive_files.json1.0.4. And they don’t. I’m not sure now that the loader is looking for them by that new name though, because I’ve hardcoded that suffix to the index.html accidentally.1

Please note, the bundling step does not rename the actual files or archive directory based on prefix/suffix. Since these could be configured to be on a completely separate server etc… It’s up to the developer to move them after bundling, if needed.

However, there could be a discrepancy between Project->Build HTML5 and Project->Bundle->HTML5 Application.

When I tried just Build HTML5 it doesn’t seem to take suffix/prefix into account, while with bundling it worked… :thinking: ping @mats.gisselson @Erik_Angelin

1 Like

Okay, it might be that I’m wrong with pinpointing the problem. If the build process doesn’t rename the actual files, how the loader then is supposed to find them by that name? It all started with the application not loading when built with this version of the editor. And I’ve found out that it tries to load these files by the names with suffix applied.

I’m not sure I understand the last part, do you mean that after updating to 141 it behaves differently regarding prefix/suffix than before?

If you change prefix and/or suffix it is up to you to make sure the archives and JSON file are moved after bundling to the “expected” URL, so to speak. :slight_smile: But this isn’t any new thing in 141, it has been like this for a while.

Well yes, it behaved differently. It would load alright when there was suffix specified in the game.project. But after updating to the build 141 it stopped. I didn’t do anything special to ensure archives accessible by the modified URLs neither in the previous version nor in 141.

What version were you using before? I’ll do a quick test here with the different versions.

Do note however, that the way it works in 141 is as expected, prefix and suffix should be added during runtime.

1.2.140 I believe.

Ok, so if I specify the suffix in the game.project and then build a html5 bundle and then upload it to web the application shouldn’t load without other modifications? Like ensuring that the files are accessible with that suffix I specified (how does one ensure that?)?

Yes, if you have specified a suffix, like “1.0.4” in the case above, you will need to modify the archive files yourself before you upload them to the web. Since the urls would look something like this:

http://<some_url>/archive/game.arcd01.0.4

But it all depends what you use this suffix for! For example, if you use it as a query string (?a=b etc.) to avoid browser/server caching issues, then you don’t need to rename any files since the final URLs would look like this:

http://<some_url>/archive/game.arcd0?a=b

The actual file names are still the same (game.arcd0), which the server will look for and respond with.

1 Like

I see, thank you for the explanation and also pointing that it would be easier for me to set the suffix to something like ?a=b!

2 Likes