← All templates

Small ordered systems, components as plain data, deterministic tests.

Constitution — Bevy game

Version 1.0.0 · Ratified 2026-11-10

These principles hold for every spec, plan and task of the game. A spec may add rules; it never weakens these.

  1. Small systems. Each system does one job and reads only the components it needs. A system with more than about five queries or parameters is split before it is merged.

  2. Explicit system ordering. Systems that depend on each other are ordered with SystemSets and .before(), .after() or .chain(). Nothing relies on the scheduler's incidental order, and ambiguity detection reports no conflicts.

  3. Components are plain data. Components and resources hold data only, with no behaviour beyond small helpers. Logic lives in systems, so any component can be inspected and serialized.

  4. Features are plugins. Each feature is a Plugin that registers its systems, events and resources. main.rs only adds plugins, and a feature can be removed by removing one line.

  5. Deterministic tests. Gameplay rules are tested by building a minimal App, inserting entities, calling update() and asserting on the World. Time and random numbers come from resources the test controls, so a test gives the same result on every run.

  6. Fixed timestep for simulation. Physics and gameplay rules run in FixedUpdate; rendering and input run in Update. Simulation never depends on the frame rate.

  7. States drive flow. Menus, loading and play are States, with systems gated by run_if(in_state(...)) and setup in OnEnter. No system checks a global flag to know which screen is active.