Gameplay data
A lot of the game is numbers
Section titled “A lot of the game is numbers”Much of Knockout City is data: small files, each one thing described by its values. A match’s rules, which balls a mode uses, what a contract asks for and what it pays, the price of an offer, the colours a character’s hair comes in. Change the values and you change the game, without writing a line of script.
There are dozens of kinds. A few you’ll meet:
| Kind | Describes |
|---|---|
| Match and Match rules | A mode: teams, rounds, timers, which balls, what’s allowed. |
| Ball loadout | Which special balls can appear. |
| Contract and Contract list | A challenge, what it counts, and what completing it pays. |
| Reward | What a player gets: currency, XP, an item. |
| Accessory | A cosmetic item and what it’s made of. |
| Offer, Currency | Something the store sells, and what it’s paid with. |
The full list is in Asset kinds.
Every field, even the ones not stored
Section titled “Every field, even the ones not stored”A data file only stores the values someone set. Everything else is left at the kind’s default and isn’t in the file at all. The game knows each kind in full, fields and defaults, and so does Studio: its Inspector shows every field of the kind, filled in with defaults where the file is silent.
That has a nice side effect: changing one value adds exactly one value to your copy. And setting a field back to its default takes it out again.
Data points at data
Section titled “Data points at data”Like everything else, data files reference each other. A contract list names its contracts; each contract names the reward it pays; the reward names a currency.
Each one uses the ones to its right.
- Contract listan event's contracts
- Contractwin 3 matches
- Reward75 event currency
- Currencythe event currency
- Contractthe next challenge
- Rewardits payout
Some data only counts if something central points at it. A new contract list, currency or offer does nothing until it’s registered with the part of the game that gathers them. The store and seasonal events pages say where for each.
Server data and game data
Section titled “Server data and game data”Some data only the server reads: prices, contracts, rewards, what the store sells. Some only the game needs: what things look like. Studio shows both in one tree, marks server-only files with a server badge, and when you test it installs each of your files wherever it’s needed. You never choose. See Server and client.
For programmers
Each kind is a type declared in the game’s own type library, with every field and its default. Files are sparse: they store only non-default values under the type’s declaration. Studio reads the declarations, so the Inspector shows the full type. Registration (the economy’s offer list, the progression level’s contract lists) is what makes the backend pick up new data.
Where to go next
Section titled “Where to go next”Scripts in the world: when data isn’t enough.