The parameter configuration requirements are identified and agreed between the gameâs designers and the Spil Games Account Manager. Once finalized, they are communicated to the gameâs developers. A default JSON is provided as part of the Spil Games SDK. After publication, the configuration file is maintained by Spil Games LiveOps.
We recommend the following:
- Balancing issues are best left until you have a good set of game core mechanics.
- Pricing should not be managed using the game configuration file. Generally, this is better managed through the shop features. For more information, see âSupporting Wallet, Shop and Inventory Controlâ.
Understanding How It Work
Your game should start by it requesting the latest version of the configuration file. The Spil Games SDK will try to retrieve this from the Spil Games back-end server. If there is no network connection, the Spil Games SDK will fall back to its last known version. The configuration file and all its parameter values can be managed using SLOT (Spil Games Live Operations Tool). The procedure and requirements for this are described in the rest of this chapter.
Requesting a Configuration File
The Spil Games SDK provides two methods for retrieving a gameâs configuration file from the Spil Games server. You can retrieve the entire file using the following code:
Parsing the JSON Configuration File
You can use the following methods for working with the Game Config:
The Spil Games Unity SDK also includes methods for converting JSON strings to objects via the SpilGames.Unity.JSON.JSONHelper method.
The configuration service should always return a value. However, if, for any reason, it does not, ensure that you check and handle a possible null return.
Listening for Updates to the Configuration File
By default, game configuration calls will always return the last saved value. However, it is also possible to listen for configuration updates, which often happen in a background process, using the OnConfigUpdated event. After receiving the update, you can refresh the user interface and game state. Use the following code.
Implementing a Default Configuration File
If there is no network connection, the Spil Games SDK will use a default configuration file. In addition, users might open the app for the first time and not have an Internet connection. For those situations, a default configuration file called “defaultGameConfig.json” needs to be added to your projectâs root folder. The following is an example of a simple configuration file for the game Pixel Wizard.
Using Firebase Remote Config
The Spil SDK offers the possibility to work with the Firebase Remote Config. For Android, you need to make sure that the Firebase module is included. For more information on how to set up the values in Firebase, check the following link:
In order to work with the Firebase Remote Config directly through the Spil SDK, use the following methods and callbacks: