https://metaplay.io logo
Config Versioning
# questions-and-feedback
t
Hi everyone! We have recently stumble upon an issue in our game and I'm wondering how other people and teams handle it. tl;dr: How do you tackle config version across multiple client versions? In our case, we a few different areas that the players need to fix before progressing to the next one, each of these fixes cost an certain amount of Coins to purchase. Let's say on
Config v1
we have
table: 100 coins
, but we've done some changes and improvements and want to change
Config v2
to
table: 200 coins
. The issue is, we can't guarantee when players will update the client to get those changes. And, at the same time, we want to publish the config so the player that do update get the new values. Is there a way to make sure that older clients are served
Config v1
while they are on that client, and are only provided with
Config v2
after they update the client?
j
When you publish the new game config on the server, all clients will download it when they start the game next time. This guarantees all clients will get the values on their next session.
Just to clarify, is the issue that the old client does not support the newer game config? For example, new game config having some Reference to some UI element for example, causing old client to misbehave on new config, hence the need for separate configs.
If this is the latter case, generally what can be done is to try to structure the game to be more forward compatible, or be more try to be more backwards compatible with the new data. As an hypothetical example: * Forward compatible: Let's say we have offers with that require UI elements in the game itself. Forward compatible client would check that the UI elements are available before showing such an offer. * Backwards compatible: Let's say we have again offers with that require UI elements in the game itself. The new config would put the new offers in a new library or new MetaMember ids, making it so the old client doesn't read these. (And then cleaning this mess up later).
So maybe the summary is: * You cannot have multiple different game configs. * But you can have a single game config, and have different client logic interpret the data differently. If there are changes to the game logic, i.e. the example had different costs, you can use https://docs.metaplay.io/feature-cookbooks/game-updates-and-versioning/logic-versions Logic Versions to alter the logic. The Game Configs themselves cannot be versioned, but logic can, so things are possible:
Copy code
int cost;
 if (playerModel.LogicVersion >= 6) { cost = playerModel.GameConfig.Foo.Cost; }
 else { cost =  playerModel.GameConfig.Foo.LegacyCost; }
2 Views