Petits systèmes ordonnés, composants en données simples, tests déterministes.
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.
-
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.
-
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. -
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.
-
Features are plugins. Each feature is a
Pluginthat registers its systems, events and resources.main.rsonly adds plugins, and a feature can be removed by removing one line. -
Deterministic tests. Gameplay rules are tested by building a minimal
App, inserting entities, callingupdate()and asserting on theWorld. Time and random numbers come from resources the test controls, so a test gives the same result on every run. -
Fixed timestep for simulation. Physics and gameplay rules run in
FixedUpdate; rendering and input run inUpdate. Simulation never depends on the frame rate. -
States drive flow. Menus, loading and play are
States, with systems gated byrun_if(in_state(...))and setup inOnEnter. No system checks a global flag to know which screen is active.