Purpose
To give game designers some idea of what dynamic variables are and how they work.
Applicability
This article is applicable to Game Designers using the D5.1+ code.
Written Explanation
It takes a lot of time and effort to tweak a game when you have to download the project, make changes, have it tested, and upload a new build. Even worse, some companies, such as Apple, delay a build for testing and critical changes may not be able to get out to customers as quickly as we’d like.
We have created a system called ‘Dynamic Variables’ to work around this. In its current form, it allows us to change:
- which enemies appear in the game and how powerful they are
- which weapon pickups appear in the game
You don’t need to have a deep understanding of this process, but it is useful to know how it works at a high level (especially for if there are problems).
There are three components to the Dynamic Variables system.
- An online google spreadsheet. Each game has one; this is where all the values are stored.
- An intermediate webserver that holds all the values.
- The Unity editor, or one of our games.
The normal flow of information is like this:
- you make some changes to the spreadsheet
- you tell the spreadsheet to upload settings for debug/testing
- a script runs on the server that takes all the values and packages it up as JSON (which lets us easily communicate the data between different systems)
- the spreadsheet uploads those values to the intermediate webserver
- the Unity editor (and debug builds of the game on the device) download the latest data when you press play (or start the game)
- using these new values, the difficulty of the game is easily adjusted
When you are satisfied with the new values, you can tell the spreadsheet to upload the values for release, and then people with the released version of the game will get the new settings.
Our system also operates, in a limited fashion, in the reverse direction.
- you create a new spawn point in the game by pressing a button
- the game saves the spawn point information in JSON format
- the game uploads the file to the webserver
- you refresh the spreadsheet, and it gets the latest values from the webserver
- the spreadsheet adds new entries for the new spawn points, which you can then edit.
This process also works when you delete a spawn point.
