Hi there
Let me set the stage.
Say I have an app that is multiplayer. It is important that every player be playing with the same addressable assets.
We want to minimise downtime, and when releasing apps on mobile it can take up to 24 hours for an update to become ‘visible’ to players. ¹
So this isn’t ideal. We don’t want updates to lock players out of the application. With addressables, we don’t need to. We upload new asset bundles, and the server ensures that players must have downloaded the latest version of the assets to be eligible to play. Perfect.
However, inevitably we will want to add new types of content/behaviours to the game. Say I add a new Monobehaviour to the game, some new functionality for a character. If we create a new character, build our bundles, and upload that to the server, we will have big problems. Players will be forced to download the new assets, but they wont be able to load them because their version of the app does not have the right scripts. We would be force to make all players update the game, and so players will be locked out for up to 24 hours until they can update.
To work around the problem, I can make the script changes but hold off on creating the new character. I would build and upload the player, with no content changes. The script will exists in the built player in a dormant state. I allow players some time to update (24-48 hours) before the server blocks access unless they update. This way I can warn the players that there is a new update available, but I allow them some time to update*.*² Then, after that time, we create the new character, build the asset bundles and upload them. Players will download the new bundles and it’ll just work, because the new script was there the whole time…
Except…
Since the new character didn’t exist when building the player, the Link.xml wont know to preserve the new script. So my new build would have had the new behaviour stripped, since it isn’t used by any addressable assets at the time.
What is the solution here?
- Should I/Can I just preserve every script in my own assemblies? I understand stripping is important to reduce build times etc, but my own assemblies will not contain near as much code as the libraries and such that I am using. Would this be a solution?
- Maybe I can create the new character before building the player, so the addressable system is aware of the new character. Then I wait for 24-48 hours (until players are forced to update) before I upload the new bundles? My player does not ship with the bundles, the player will have to download them on start up. So the player will ask my server which bundles to download, and the server will point them to the old bundles until it is time to update to the new bundles? But would this work? The catalogue that ships with the player would be ‘expecting’ to see the new character, right?
1 From experience this time can be reduce a few minutes on Android with Timed Publishing. But on iOS, even after review and publishing manually, the app can take up to 24 hours to appear on the app store. On average, we found it takes our up around 3 to 4 hours.
2 This would be the ‘ideal’ update pipeline for the build as there is 0 downtime. This won’t be the only way to update the application. If there is a critical update that needs to be pushed out to the users, we can do that and we can tell our server to force users to update immediately, instead of allowing them 24-48 hours. As mentioned before, this would mean players are potentially locked out of the game for up to 24 hours, but the option would be there in case something goes wrong.