Shows its work

Every claim, with the check that holds it.

Every feature in Ductane was pulled out of a working game, and every claim on this site is a number you can reproduce on your own Mac. This page shows two of them, and how every change is checked before it is called done.

Behaving the same at any step rate

The same jump, however often the game steps.

Apex of a 6.3 m/s jump, in meters. The height it should reach is 0.992.

A fixed step takes the frame rate out of a game, but not the step rate: a body moved a step at a time falls short by more the coarser the step. Ductane's character controller follows the exact curve for constant gravity, y + v·dt − ½g·dt², so the step rate stops mattering. Landing speed, slide distance and the eye's settling were fixed the same way.

Steps a secondStepped simplyDuctane
300.8900.992
600.9400.992
1200.9660.992
2400.9790.992

The check is one course: walk, jump, climb three steps, sprint, slide, go off a ledge, land. The sample walks it at all four rates, and the walk check requires the same report at each, to the centimeter.

Fixed timestep
The sample's ruins from above at dusk, lit by braziers, casting long shadows.

Found by drawing one frame

Every shadow was a frame stale.

The scene read shadow maps that the same command buffer was still writing. In play it looked right, because last frame's maps were there, and nothing said otherwise.

Drawing a single frame into a file showed it: the first frame came out different every run. Two barriers later, four runs of that frame are the same bytes, and the frame is a check.

Recorded frames

How it's checked

On every change, before it is called done. The numbers are counted when the site is built, never typed.

1,326

Tests

Each new one shown to fail with its feature switched off.

swift test
45

Scripted walk runs

17 walks of the sample, played by script and invisibly — seven of them at four step rates, and one again under the splash.

DUCTANE_SAMPLE_WALK="w:1" swift run DuctaneSample
6

Recorded frames

Drawn with no window and compared pixel by pixel against the last good one.

DUCTANE_SAMPLE_FRAME=frame.png swift run DuctaneSample

What each check covers

Tests

Everything that needs no window: the step maths, the controller's moves, loaders, bindings, settings, the weather schedule, the world file. A new test is first shown to fail with its feature switched off, so it is known to test something.

The tests on GitHub

Scripted walks

The sample played from a line of keys and seconds, with no window, no keyboard and no sound, logging where the feet were. A walk fails when a change moves where it ends, however right the change feels.

Scripted walks

Recorded frames

Viewpoints drawn into a texture with no window and compared pixel by pixel against the last good frame. Shadows, the tone map and the lights become something a check can fail on.

Recorded frames

Run them yourself

From a clone of the repository, on a Mac that meets the requirements.

# every test
swift test

# the sample, played by script: hold W for a second
DUCTANE_SAMPLE_WALK="w:1" swift run DuctaneSample

# the same, as a check: no window, no keyboard, no sound
# it reports where the feet ended and keeps running; stop it with ⌃C
DUCTANE_SAMPLE_CHECK=1 DUCTANE_SAMPLE_WALK="w:1" swift run DuctaneSample

# one frame, drawn with no window, into a file
DUCTANE_SAMPLE_FRAME=frame.png swift run DuctaneSample

How something gets into the engine

Pulled from a working game

A piece enters when working, tested code in a game shows where the engine's part ends and the game's begins. Nothing is designed in the abstract first.

Kept the same at every rate

Anything that moves is checked at more than one step rate, because a fixed step removes the frame rate from a result, not the step size.

Followed into what uses it

A change is not finished until the sample, and everything else built on the engine, has been built, tested and run with it.

Versioned honestly

Semantic versions. A change that breaks existing code waits for the next major version, and every release is in the changelog.