-
-
Notifications
You must be signed in to change notification settings - Fork 6
Updating strategies
PATCH requires builds and patches to be available on the server. This can waste a lot of space in the long term, in particular if your game is really big. That's why it is really important to plan a good and maintainable strategy to handle your updates.
A good strategy would be to only store your latest X builds on your server, for example 5. Based on your storage and resources you can expand that X accordingly. Same thing for patches: you can store on your server just patches among your latest X builds.
If you are afraid that your less active users will not be able to update anymore if they don't play for a very long time, the Launcher can solve this for you. Normally the repair functionality checks for files validity based on metadata stored on your server. But if the repairer can't find that metadata and the local version on your user's side is older than the oldest version on your server, then a full repair is triggered.
A full repair just repairs your user's game to the latest available version, without the need of applying patches. It requires your user to fully redownload the latest version of your game, but it is a safe tradeoff when a user does not play for so long periods of time.
Another thing you may want to solve is the following situation: if your user does not play so often, but they still are out of full repair range, they will probably end up applying up to X - 1 patches.
It requires time and it is boring. And you don't want your users to be bored.
Based on previous strategy to store updates, you now only have X builds on your server. You can simply build all shortest paths to the latest version from all previous versions.
For example you have 5 versions: 0.1.0, 0.1.1, 0.1.2, 0.1.3, 0.1.4.
You will generate 4 patches:
-
0.1.0to0.1.4 -
0.1.1to0.1.4 -
0.1.2to0.1.4 -
0.1.3to0.1.4
Now all users will update in just a single step!
Let's say now you add 0.1.5 version.
You delete from your server 0.1.0 build and 0.1.0_0.1.4 patch.
When you delete a build and/or a patch, you must have care to update
builds_index.jsonandpatches_index.jsonto remove deleted build and patch entries.
You will now generate 4 patches again:
-
0.1.1to0.1.5 -
0.1.2to0.1.5 -
0.1.3to0.1.5 -
0.1.4to0.1.5