Skip to content

Gameplay data

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.

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.

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
An event's contracts as data files: the list names each contract, each contract the reward it pays, and the reward its currency. (The contracts are illustrative.)

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.

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.

Scripts in the world: when data isn’t enough.