HTML5 and live update

since store_resource() doesn’t require rebooting

I don’t think this feature was really intended to work that way tbh.

then it’s still not an option

Is it a deal breaker to do reboot after the full archive has been downloaded?

1 Like

We could design the game to reboot at the end of the first level, but not having to reboot is much better, less confusing for the player.

I think it shouldn’t have to be? It’s essentially part of loading the next level?
If loading your game level take a long time, a message mentioning the updated "playlist " or similar, could help?

One reason I’m reluctant to support mounting automatically during the game, is that in the future, we want to support updating the downloadable archive with new content (not just splitting the data set into two, as we currently do).

The scenario I’m afraid of then is that an old resource (A v1) is currently loaded, and we load a new resource (B), which is referencing the previous resource (A) but it relies on an updated version of it (A v2). This might be disastrous if they are not in sync. By rebooting, we simply avoid this problem space.

I think supporting it in its current version was either an unintended feature, or was not completely thought through.

1 Like

When loading at runtime, we present the menu button on successful load, the player can then go to the level select screen and choose another level without finishing the current one. Works better for returning players.

Can it be delegated to the developer? With our use case for HTML5 game it’s not possible to update the game with the new content since the excluded resources are uploaded along with the actual game (same hosting, same directory). When we do update the game, we can check what version of resources was downloaded previously (older build) and redownload if needed. But at the moment we are fine with redownloading resources at each run, to do so I just delete liveupdate.* files at the start of the game.

I’d like to have an API to clear/replace archive when I want and to mount/unmount it when I want with specifying path to the archive when mounting.

Our main goal is to present the player with a playable level first and download the rest of the game in background while he or she plays.

The LiveUpdate feature was developed over a long period of time and in three phases:

  • v1. The ability to exclude content referenced by a collection proxy from the initial application bundle. The excluded content could later be downloaded, resource by resource, and used. The downloaded content was verified against the manifest bundled with the application. This requires no restart. New functions:
    • collectionproxy.missing_resources()
    • resource.store_resource()
  • v2. The ability to update the application manifest to replace existing content and add new content. Content is downloaded and stored resource by resource. When a new manifest is downloaded and stored it is used after reboot or restart. New functions:
    • resource.store_manifest()
  • v3. The ability to download an entire zip archive with multiple resources. This, combined with the new functionality in http.request(), allows you to directly download an entire archive to disk to increase speed and greatly reduce memory usage. This is done at the cost of loss in granularity (you can’t download files one by one) as well as download stability on a low quality connection (a dropped connection means you have to start the download from scratch). New functions:
    • resource.store_archive()
    • resource.us_using_liveupdate_data()

I believe resource.store_archive() updates the application manifest with the one from the zip archive (@JCash can confirm) and as such it requires a restart/reboot.

I believe this is covered by the features shipped with v1 on LiveUpdate. To download the rest of the game in the background you query your collection proxies for missing resources and download and store those one by one. When a proxy no longer has any missing resources it can be loaded. No need to reboot.

Being able to download an entire archive and using it without a reboot is something we probably can look into as well.

2 Likes

Thank you for this detailed history. Yes, generally v1 works for us, but downloading each resource one by one is much slower compared to downloading a single archive. That’s why we switched to downloading the entire archive first and storing each resource individually (this and stability issue).

In our setup It would make sense if store_archive() would not require rebooting when manifest update is not needed. Thus even more reducing overall resource installation time.

Thanks.

1 Like

@sergey.lerg
In the end, how did you end up using Live Update to avoid the FORMAT_ERROR message.
Do you download the full archive and unzip it manually?

Yes, download the full archive and unzip it manually. Plus deleting the previous downloaded archive if present.

Why unzip it manually?

That’s the only way that worked for us reliably.

I’m not unzipping it manually, I use resource.store_archive() and it works!

By the way, I’m noticing that the live update archive file is different wether I build an APK or an AAB.
Could it lead to a problem if an APK and AAB download and store the same live update archive file?

(if yes, does that mean it’s good practive to use a different live update file for APK and AAB build?)

In what way?

liveupdate.game.dmanifest files appear to be different from those 2 builds (apk and aab).

Ok, when you say “appear”, what do you mean?

When I do

git diff  /archive_from_apk_build_unzipped/liveupdate.game.dmanifest   /archive_from_aab_build_unzipped/liveupdate.game.dmanifest  

It says there is a difference, but I don’t know how to have more information.
The word “appear” might not be the best: there is a difference between those 2 files.

1 Like

Sorry to necro this thread, but I’m having the same original problem:

ERROR:GAMEOBJECT: Could not instantiate game object from prototype /main/sounds/Speaker.goc.
WARNING:RESOURCE: Unable to create resource: /main/sounds/Sounds.collectionc: FORMAT_ERROR
ERROR:GAMESYS: The collection /main/sounds/Sounds.collectionc could not be loaded.

Half way through the resource download I force quit the Android version of the game. Subsequent launches of the game result in this error. This collection has +100 sounds.

It works well if I let the downloads finish (ie. no force quitting).

I’m going to try out the zip archive strategy since it sounds more reliable.

Please do. And let us know how it goes!

It works nicely!

2 Likes