Docs Reference

Contents

Templates

Every game pins one template: a genre's kits, controls, camera, rules, starting documents, tuning knobs and acceptance checks. The template makes a new game playable from its first step; the game then replaces its defaults one by one. These are the templates in the library, as the Director's template_catalog tool reads them.

Action survival tpl.action_survival

One place seen from above through a day and a night: gather, make, carry a light, and beat what hunts you by reading it. The first game on it is examples/tideline.

Version 1.0.0 · library/templates/action_survival/ · Games on it: Nightcoast, Tideline

Use it when

  • The player survives in one place, seen from above, against what hunts them there.
  • Days and nights matter: the player gathers and makes things by day and holds out by night.
  • Danger is real-time and physical: sneaking, running, dodging and melee, not turns or menus.
  • A light the player carries is both safety and a beacon to what watches.

Not for

  • Puzzles on a grid, where each move is a decision: use tpl.puzzle_grid.
  • Stories told mostly through choices and dialogue, with little danger.
  • Games about many units at once (strategy, city building, card battles).
  • Platformers and anything that needs jumping or climbing: the ground here is terraces a body steps up one level at a time.

What the Director asks first

  • What hunts the player, and what does it want? Picks the enemy archetypes and their brains.
  • What changes when night falls? Sets how dark the night is and what the lamp is for.
  • What does the player make first, and from what? Shapes the first recipes and what the place yields by hand.

What every game on it must show

  • 600 idle ticks give the same state hash twice.
  • The monkey (test.fuzz) presses every action at random for a minute on 4 seeds, and no run logs an error or breaks an engine invariant.
  • A bot gathers and makes its first thing within the first minutes: the template's test.first_minute makes the first thing a recipe lets it make by hand within 3 minutes on one of its 4 seeds at least.
  • A newcomer is not lost in its first minute: in test.first_minute the seek bot gathers, makes and then stands its ground, and most of its 4 runs are not downed, killed or lose the game before a minute of play.
  • Tactics, not stats: a bot that dodges the tell and strikes the working part wins at least 80% of 20 seeded fights; a bot that stands and trades blows loses at least 80%.
  • Notice distance orders lamp-lit night >= standing day > standing night > crouched in cover at night.
  • The night is dark enough that a carried lamp raises a frame's mean luma by at least 40%.

Knobs a game may turn

  • walk_mps (2 to 5): Walking pace in tiles per second; sets how far a day's work reaches.
  • run_mps (4 to 8): Running pace; keep it above the fastest hunter's so running away works.
  • minutes_per_sec (0.5 to 10): World minutes per real second; 1.4 makes a day about 17 real minutes.
  • player_health (3 to 12): The player's health, shown as cells; about three blows from a hunter keeps a fight short and readable.
  • blow_damage (1 to 5): What one of the player's blows takes off a working part; low, so fights are won by reading the hunter, not by stats.

Kits

kit.actors kit.audio kit.brain_fsm kit.clock kit.core kit.crafting kit.harvest kit.inventory kit.light_carried kit.melee kit.mesh kit.move kit.perception kit.ui kit.vfx kit.world_tiles

Top-down adventure tpl.adventure

A small world seen from above: a village with people to talk to, a quest given in words, a wild place with things that hunt you, items to find and use, and the way back to finish it. The first game on it is examples/thornwick.

Version 1.0.0 · library/templates/adventure/ · Games on it: Larkmead, Thornwick

Use it when

  • The player walks a small world seen from above, talks to the people in it and does what they ask.
  • There is a quest given in words: go somewhere, find or beat something, bring it back.
  • Danger is real-time and physical, but the heart of it is the errand and the people.
  • Items matter: a weapon in hand, food to eat, the thing the quest is for.

Not for

  • Surviving a place through days and nights, making things from what it yields: use tpl.action_survival.
  • Stories told only in words and choices, with no place to walk: use tpl.visual_novel.
  • Puzzles on a grid, where each move is a decision: use tpl.puzzle_grid.
  • Platformers and anything that jumps: use tpl.platformer_2d.
  • Dungeons with rooms and doors: the world is one outdoor map.

What the Director asks first

  • Who asks the player for help, what for, and what do they give back? Becomes the giver (an Archetype with a usable naming its Dialogue), the steps of var.quest the Dialogue's lines read and set, the item the quest is for, the reward, and test.quest's goals.
  • Where does the player start, and where is the wild place they are sent to? Becomes the WorldGen: each place a disc (atFrac, withinTiles) with its own grounds and props, and its named places for the cast, the item and where a downed hero wakes.
  • What lives in the wild place, and how is it beaten? Becomes the foe's Archetype and brain: what it sees and hears, how far it chases, its blow's tell, and its hard and soft sides.
  • Who else lives there, and what do they know or give? Each becomes a usable with a Dialogue of its own: a hint, a gift (give in a line's do), a sign to read.

What every game on it must show

  • 600 idle ticks give the same state hash twice.
  • The monkey (test.fuzz) presses every action, talks and mashes the talk's keys for a minute on 4 seeds, and no run logs an error or breaks an engine invariant.
  • A newcomer is told what to do: in test.first_talk the seek bot finds someone with something to say, reads the talk to its end, and most of its 4 runs are not lost in the minute after.
  • The quest can be played start to finish as a person would: in test.quest the seek bot talks to the giver, goes out, comes back with what was asked and wins, on most of its 4 runs.
  • L3 shoots the title, a talk, a choice and the win, and every text on them is whole and big enough to read.

Knobs a game may turn

  • walk_mps (2.5 to 5): Walking pace in tiles per second; sets how long the walk to the wild place takes.
  • run_mps (4 to 8): Running pace; above the beasts' run, so running away works.
  • player_health (3 to 12): The hero's health, shown as cells; three bites from a beast takes half.
  • staff_damage (1 to 5): What one blow of the starting staff takes off a beast.
  • beast_health (1 to 10): Blows a beast takes; low, so a fight is won by reading the tell, not by stats.
  • bite_damage (1 to 4): What one bite takes off the hero.
  • berry_heal (1 to 6): Health a handful of berries gives back.

Kits

kit.actors kit.audio kit.brain_fsm kit.clock kit.core kit.harvest kit.inventory kit.melee kit.mesh kit.move kit.perception kit.ui kit.vfx kit.world_tiles

2D platformer tpl.platformer_2d

Run and jump through side-view levels to the exit, over gaps, ledges, ladders, spikes and the things that patrol them, with every level proven finishable.

Version 1.0.0 · library/templates/platformer_2d/ · Games on it: Acorn Rooftops, Burrow Run

Use it when

  • The player runs and jumps through side-view levels to reach an exit: gaps, ledges, ladders, spikes and enemies in the way.
  • Levels are short courses the player finishes, collecting things on the way, with checkpoints to come back to.
  • Timing and movement are the challenge, not stats, menus or turns.

Not for

  • Puzzles where each move is a decision on a grid: use the grid puzzle template.
  • Survival and crafting in one open place seen from above: use the action survival template.
  • Fights where aiming and projectiles matter more than jumping.

What the Director asks first

  • Who is the player, and how do they move: quick and floaty, or heavy and precise? Sets the hero's model and sprite, and the run, jump and gravity knobs every level is proven against.
  • What gets in the way: pits, spikes, patrolling enemies? Picks the hazard tiles and the enemy archetypes, and how much a hit costs.
  • Hand-made levels, or generated ones laid from room templates? Decides between Rooms placed by hand and a rooms.chain generator with start, path, exit and filler rooms.

What every game on it must show

  • Every level has a witness: bake proves it completable from start to exit with the player's own movement numbers.
  • A playtest replays every level's witness in the engine, tick for tick, and reaches each exit until the game is won.
  • A bot that plays like a casual person (kit.platformer's playthrough: reaction time, presses a little off, fumbles, back to the checkpoint when hurt) plays every level on 8 seeds, and most runs finish every level without giving one up. Per level, the report says how long it took and how often and where the player was hurt.
  • 600 idle ticks give the same state hash twice.

Knobs a game may turn

  • run_speed (4 to 14): The hero's top running speed in tiles per second; with the jump it sets how wide a gap can be. Every level is proven against it again when it changes.
  • jump_speed (12 to 30): Upward speed a jump starts with, tiles per second; the apex is about its square over twice the gravity (19 and 70 give 2.6 tiles).
  • gravity (30 to 140): Gravity in tiles per second squared; higher is snappier and lower is floatier.
  • hearts (1 to 10): Hits the hero takes before a life is lost.

Kits

kit.audio kit.core kit.mesh kit.platformer kit.sprite kit.ui kit.vfx

Grid puzzle tpl.puzzle_grid

Push things around a grid until each level is solved: every move a decision, every level proven solvable, undo and restart one key away.

Version 1.0.0 · library/templates/puzzle_grid/ · Games on it: Lamplighter, Pier Pressure

What the Director asks first

  • What does the player move around, and what makes a move impossible? Picks the object kinds, their layers and tags, and the push rules.
  • When is a level solved? Sets the win conditions (all crates on targets, no gems left, a key on a door).

What every game on it must show

  • Every level has a witness: the solver proves it solvable at bake.
  • A playtest replays every level's witness in the engine and wins each one.

Kits

kit.audio kit.core kit.grid kit.grid_rules kit.ui kit.vfx

Twin-stick arena shooter tpl.twin_stick

A top-down arena shooter: one stick moves, the other aims and shoots. Waves of foes come through the gates at the player, who scores as they survive, and a short run ends in a win (the last wave beaten) or a loss. The first game on it is examples/saltwell.

Version 1.0.0 · library/templates/twin_stick/ · Games on it: Saltwell

Use it when

  • The player moves with one stick and aims and shoots with the other, seen from above.
  • Foes come in waves at the player, who holds out, scores as they survive, and wins by beating the last wave.
  • A run is short and replayable: a few minutes, won or lost, then again.

Not for

  • A quest given in words, people to talk to: use tpl.adventure.
  • Surviving a place through days and nights, making things: use tpl.action_survival.
  • Melee fights read and dodged one at a time: use tpl.adventure or tpl.action_survival.
  • Platformers and anything that jumps: use tpl.platformer_2d.
  • Puzzles on a grid: use tpl.puzzle_grid.

What the Director asks first

  • Where is the fight, and where do the foes come in? Becomes the WorldGen: the floor of the arena (a disc with atFrac, withinTiles), its cover (blocking props), what stands round it, and the named gates the wave rules spawn at.
  • What comes at the player, and how is each kind beaten? Each kind becomes an Archetype (speed, health, a bite with a tell, or a shooter with a tell and a projectile of its own) and its points in the rules.
  • What does the player shoot, and how fast? Becomes the hero's shooter (cooldown, a volley's count and spread, damage) and the projectile Archetype (speed, range, its look).
  • How long is a run, and what makes it a win? Becomes the waves: how many, how big, how fast they come, which foes in which, and the win and lose rules.

What every game on it must show

  • 600 idle ticks give the same state hash twice.
  • The monkey (test.fuzz) walks, shoots and dashes for a minute on 4 seeds, and no run logs an error or breaks an engine invariant.
  • A newcomer survives the first wave: in test.first_wave the skirmish bot shoots and puts foes down, and most of its 4 runs do not fall.
  • The run can be won: in test.run the skirmish bot holds out through the last wave on at least one of 4 seeds, and most runs do not fall.
  • L3 shoots the title, a wave, a hit and the end, and every text on them is whole and big enough to read.

Knobs a game may turn

  • player_health (3 to 12): Bites the player can take, shown as cells.
  • bolt_damage (1 to 5): Health one bolt takes.
  • crawler_health (1 to 6): Bolts a crawler takes: two, so a stream of them reads as a stream of hits.
  • brute_health (3 to 20): Bolts a brute takes: it has to be kited.
  • bite_damage (1 to 3): Health one bite takes.
  • waves (1 to 20): Waves to hold out through to win; five is a run of about three minutes.
  • first_wave (1 to 40): Crawlers in the first wave.
  • wave_growth (0 to 20): Crawlers each wave adds.
  • brutes_from (1 to 20): The first wave with a brute; each later wave has one more.
  • on_field (1 to 24): Most foes up at once: past it the gates wait.
  • spawn_secs (0.2 to 10): Seconds between foes through the gates.
  • rest_secs (0 to 30): The breather between waves.

Kits

kit.actors kit.audio kit.brain_fsm kit.clock kit.core kit.melee kit.mesh kit.move kit.perception kit.ranged kit.ui kit.vfx kit.world_tiles

Visual novel tpl.visual_novel

A story read a line at a time over painted scenes, with choices that branch it, flags that change what comes later, and more than one ending. The first game on it is examples/fog_signal.

Version 1.0.0 · library/templates/visual_novel/ · Games on it: Fog Signal

Use it when

  • The player reads a story and steers it with choices: who to trust, where to go, what to say.
  • What matters is what was chosen earlier: a flag set in the first scene changes a line or an ending later.
  • The game is talk and scenes, with few or no moving bodies: people stand on a painted backdrop and speak.

Not for

  • Anything where the player moves a body through a place in real time: use the action survival template or the 2D platformer.
  • Puzzles where each move is a decision on a grid: use the grid puzzle template.
  • Long stories with inventories, stats and fights between the talking: that needs a world as well as words.

What the Director asks first

  • What happens, to whom, and how long should one reading take? Becomes the Dialogue: its speakers, its scenes in order and its length (about a dozen lines a minute), written top to bottom as lines.
  • Which choices does the player make, and what does each one change later? Each choice becomes links with choice text on the line that asks it; what it changes becomes a flag (set_var) that a later line's or link's when reads, so the branches meet again but remember.
  • How can it end, and which choices lead to each ending? Each ending is a last line that sets var.ending and calls end_game; its when reads the flags. A playtest plays every branch to every ending.
  • Who do we see, and where does it happen? Picks the people (figure.person Models baked to Sprites), and each scene's sky, ground and props, painted by the story screen when var.scene names it, in the Style's palette.

What every game on it must show

  • Playtests play every branch of every choice to every ending, each asserting the flags its choices leave and the ending it reaches.
  • Bake finds every line reachable, every line and speaker a link names in the dialogue, and no branch running on into another branch's first line.
  • L3 shoots a line, a choice and an ending, and every text on them is whole and big enough to read.
  • 600 idle ticks give the same state hash twice.

Kits

kit.audio kit.core kit.mesh kit.sprite kit.ui

Generated from library/templates/*/template.json, read as the Director's template catalog.