Contracts
A contract is a short list of questions about one game mechanic, such as a stamina bar or a backpack. Answer the questions, and the mechanic is defined well enough to build and test. Contracts are optional: a package is complete without one.
Contract and adoption
An adoption is one set of answers to the questions of a contract. One set of answers defines one behavior. With one set of answers, Ranged value is an XP bar that fills into the next level. With another set of answers, it is a stamina bar that blocks an attack when the player has too little stamina. Health, Stamina and Oxygen are three adoptions of the same contract.
Contract
The questions about one mechanic. The Ranged value contract has 15 questions.
Adoption
One set of answers. If you change one answer, you have a different adoption.
The Ranged value contract asks, among its 15 questions:
| The contract asks | The Stamina adoption answers |
|---|---|
| You have 10 stamina. An attack costs 20. Can you attack? | No. You need the full cost. |
| A hit would take stamina below zero. What happens? | It stops at zero and the extra is lost. |
The numbers stay yours: how much stamina there is, how fast it recovers, how long the wait is. Every contract also comes with acceptance tests, the checks a finished game must pass.
Your first adoption
- Find the contract for your mechanic in the catalog. Search with the word you already use: health bar, backpack, coyote time, autosave.
- Pick the adoption closest to your game. If none fits, start from the contract itself and answer the questions yourself.
- Open it in the authoring tool with the button on its page, change the answers and numbers that do not fit, and save it into your package.
These three steps are the complete process. They add ordinary package files to your package. The Contracts chapter of the Handbook shows these files.