Skip to main content

Directory layout

All games follow a standard directory structure. The recommended starting point is to copy games/template/ and rename it to your game ID.
The library/ subdirectories are created automatically when simulations are run if they do not already exist. readme.txt is for developer notes about game mechanics and any miscellaneous information relevant to that game.

File reference


src/ vs games/

The repository is split into two top-level areas:
  • src/ — reusable engine code shared across all games. This includes win calculators, the wallet manager, the state machine, event helpers, config base classes, and output writers. You should not need to modify files in src/ for normal game development.
  • games/<game_id>/ — all game-specific logic. Every file in the directory layout above lives here. Python’s Method Resolution Order (MRO) allows game files to selectively override engine behaviour without copying shared code.
When writing a new mechanic, ask: will this be reused by other games? If yes, it belongs in src/. If it is specific to one title, it belongs in games/<game_id>/.

Run-file parameters

The run.py file controls how simulations are executed. The following parameters are passed to create_books():

Config output files

After simulations complete, generate_configs(gamestate) writes three JSON files to library/configs/:

Library folders