How a game is built
A game is a stack of layers. The first is the root, and each layer after it is built on the one before.
When someone plays Sky Islands at Night, the runtime loads Starter World, then Sky Islands, then Sky Islands at Night. Each layer's script runs once, in that order, and says what it sets, adds and replaces. Then the root builds the world from what every layer said.
| Word | What it means |
|---|---|
| Layer | A folder with a variation.json and an entry script. One layer is one developer's contribution |
| Root | A layer with no parent. It builds the world and decides what the layers above it may change |
| Child | A layer whose parent names another layer. It can have children of its own |
| Game | A root plus the chain of children up to the one being played |
| Library | Shared helper code that games with different roots can use. Not ready yet, see below |
The manifest
variation.json is where a layer says who it is and what it allows.
{
"name": "Sky Islands",
"version": "1.2.1",
"summary": "Floating islands above the meadow, and gliding between them.",
"added": "floating islands, gliding",
"creator": "Ana",
"parent": "starter-world",
"entry": "layer.gd",
"seal": ["rules.player.glide*"]
}
| Key | Who sets it | What it does |
|---|---|---|
name, version, summary, added, creator | Every layer | What the catalogue and the credits show |
cover, genre, perspective, players, session, difficulty, controls | Every layer | How the game looks and is described in the catalogue |
parent | Every layer | The slug of the layer you build on, or null for a root |
entry | Every layer | Your script that runs when the layer loads. layer.gd if left out |
open | The root only | The points children may change, such as rules.*, zones, items, slots.*. A child's open is ignored |
seal | Any layer | Points no layer above you may change, such as rules.world.gravity |
Your slug is your layer's short name, such as sky-islands. It's the name
of your layer's folder, and your files live under res://layers/<slug>/.