Demo
A computer player.
This is the same code in two jobs. aim is the bot the balance test drives to decide
whether the game is winnable; imperfect is that bot with its hands shaking, which is
what plays behind the title screen. Having one implementation means the demo can never
drift away from the thing the tests measure.
Everything here is pure. The imperfection is threaded through an Rng the caller owns
-- never the world's own generator -- so watching the demo cannot perturb the determinism
the replay tests depend on.
Definitions
A competent player: perfect aim, and it dodges.
Used by the balance test, where the point is to measure the game rather than the player. Its results are an optimistic bound -- a human misses.
The tuning the game ships with.
Every value here was measured, not chosen. See docs/ARCHITECTURE.md and bin/bench.
A fallible player: the same aim, blurred, and occasionally not paying attention.
Perfect play makes a dull demo -- the formation evaporates in a straight line and nothing ever threatens the cannon. A little jitter and the odd idle tick make the attract screen look like somebody playing.
Returns the advanced generator, so the caller keeps the demo's randomness entirely separate from the world's.