v0.7.3 - Load game data via Addressables


Another 'invisible' update which mostly changes things behind the scenes: This release moves most of the games Assets to Addressables and loads them dynamically as needed y the game.

The effect is a reduced 'time to interact'  from ~16 s to ~13 s. I hoped for more, but nearly 20% improvement is already a good step in the right direction. There are still some parts that can be tweaked! Also, ~4 s of that time appears to be download time. When the application is served from local browser cache, it starts in less than 10s.

Initial file size improved by nearly 40%, so connections with slower bandwidth probably see an even better improvement in startup time.

In addition to improving the load times, this release is also an important preparation for the upcoming releases. As mentioned in the last devlog, I plan to introduce an inventory in order to allow equipping items (which the characters themselves support already, since I am using the awesome Fantasy Heroes package). This also means more assets are going to be introduced, and none of them need to be loaded in the beginning of the game, hence they should not impact the start of the game!

Switching to Addressables meant: Getting rid of all direct Asset-References in the Scene! Otherwise, the Assets which become Addressables will be duplicated and be part of the Scene data as well as the Addressable Asset Bundles.

I mostly solved this by using AssetReferences in the Scene, which then get loaded asynchronously. Assets are now grouped in the following way:

* Basic Menu-Assets are part of the initial game data - the game menu needs to be available instantly!

* Character Creation Assets + UI Toolkit PlayerList are loaded while the player can start connecting to the server

* After a connection was established, the ingame assets (Monsters, Items, Effects, Additional Backround Music...) are loaded.

UI Toolkit does not support Addressables yet, so first I thought I would not be able to load the PlayerList and its Sprites as Addressables. But fortunately, SpriteAtlas came to the rescue! When I first load the SpriteAtlas which contains the Assets needed by UI Toolkit Elements, they are resolved and displayed correctly.

Hopefully, next time there is more visible stuff to see!

Changes

* Switched most of the Assets to Addressables, reducing initial build-size and therefore download-/startup time.
* Fixed rendering issues with the particle effects (needed to adapt to changes introduced by a newer version of the Unity Universal Render Pipeline)

Leave a comment

Log in with itch.io to leave a comment.