Presentation and state
A presentation setting changes only pixels. It never changes the game’s state, the random numbers, the input log, a save, the script trace or the sounds the game asks for (plan 42, decision 312).
The owner’s words for it: desktop and DS “may look different, never play differently” (plan 16; decision 310: “im fine with different graphical detail settings for desktop and ds”). A player on a powerful desktop with every effect on and a player in melonDS play the same game. A recorded session plays the same on both.
Presentation and state
Section titled “Presentation and state”| Presentation: may differ | Game: may not differ |
|---|---|
| Particle counts, draw distance, frame rate of the 3D field | Where the player is, what is in view of the logic, which people and scripts are active |
| Resolution, anti-aliasing, upscalers, bloom, shadows, water | The random numbers drawn, the battle, the rules |
| The screen’s layout: two screens or one wide canvas | Maps, scripts, text, data |
| Colour-vision filters, less motion, less flashing | Saves, the input log |
The line is drawn by one question: does it change what happens when the game reads input? Battle animation speed, how fast health bars drain and auto-run all change how many ticks pass before the game reads the next button press, so they change the game. They are therefore game options, saved with the game and identical on every platform, never presentation rows (decision 332). The desktop’s speed-up runs the same ticks faster; it does not skip any.
DS behaviour
Section titled “DS behaviour”Every presentation row declares its DS class:
| Class | Meaning | Example |
|---|---|---|
native |
The DS draws the same idea with its own hardware | Anti-aliasing, fog, edge marking |
approx |
A cheaper version that fits the DS | Reflections of characters only |
off |
Not drawn on DS; the DS’s options screen hides the row | Bloom, resolution, shadow maps |
Rows are named by what they do (bloom, reflections, particles), never by a game
or a renderer’s internals. A game may set the preset a new player starts at, and cap
what a player may choose, in [graphics]:
[graphics]default = "classic" # the DS's picturecap = { bloom = "low", shadows = "map" } # the most a player may chooseA creator’s caps keep a game’s art direction. Accessibility rows can never be capped
or forbidden (decision 315). Presets are classic (the DS’s picture), high and
ultra; auto picks one for the machine.
Settings
Section titled “Settings”Presentation settings are in no save and no pack. On desktop they are lines of the
user’s configuration file; on DS, a small device file beside the save slots. A save
written at ultra is byte for byte the save written at classic.
The game never asks which platform it runs on. A device file with an auto line is a
desktop; one without is a fixed device, which starts at the DS’s values (decision
327).
Enforcement: structure
Section titled “Enforcement: structure”The settings live in their own crate, pl-present. It is a dependency of exactly the
crates that draw: pl-game’s view builders, the desktop and DS backends, and the
planned GPU renderer. The logic crates (pl-core, pl-data, pl-battle,
pl-script, pl-world, pl-ui, pl-systems) never depend on it.
A test reads every Cargo.toml of the workspace and fails if any of those seven
crates reaches pl-present, directly or through another crate. A setting then has no
way into the game’s state: the code that decides the game cannot even name it.
Inside pl-game, which does both, the settings are passed only to the functions that
build a frame, never to the ones that update the game. That is a convention, and a
convention needs a proof.
The renderer receives the finished frame and has no path back into the game (see One description of a frame). Weather particles use a hash of their own index, never the game’s random number generator, so their count can change freely.
Enforcement: replay
Section titled “Enforcement: replay”One recorded session is replayed headless at two settings, and everything the game decided is compared tick by tick:
| Compared | What it covers |
|---|---|
| The world’s digest | Positions, facing, movement, flags, variables, the people and their scripts, the generator, the clock, every player in co-op |
| The scripts’ digest | Their flags and variables, the machine, the game’s generators |
| The battle’s digest | The whole battle state |
| The log | The script trace |
| The sounds | Every sound and piece of music the game asked for |
| Every save | Byte for byte |
| The input log, recorded again | Byte for byte |
The sessions: the demo game’s opening into the rain, across two areas and the stairs between floors, saved from the menu; and the opening through its first battle. They are played at:
classic, the DS’s picture;ultra, with the view rows at their maximum: particles ×4, draw distance ×3, a 21:9 screen, the display’s frame rate;- a fixed device with the DS’s own rows changed (60 frames a second, reflections off, an afterimage);
- the accessibility rows on: a colour-vision filter, less motion, less flashing.
All must be equal. Any difference fails the test and names the first tick and the digest that differ. The proof is itself tested: a setting deliberately read where the game updates (a planted leak) must make it fail.
On DS, the present session of cargo xtask test-nds plays the same replay with the
DS’s rows changed, on desktop and in melonDS, and its digests must equal the
classic run’s.
Rationale
Section titled “Rationale”- Fairness and trust. No graphics setting can make a battle easier, a roll luckier or a walk faster.
- One game to test. Every test, replay and comparison with the real games runs at
classic; the result holds at every other setting because the proof says so. - Co-op and link play. Players at different settings, on different platforms, stay in lockstep, because only inputs cross the network and the same inputs give the same game.
- Freedom to add effects. Ray tracing on desktop costs the DS nothing and risks nothing; the proof catches a mistake the day it is made.
Further reading
Section titled “Further reading”- Presentation settings for the rows and presets.
- Accessibility and quality of life.
- Determinism and the seeded RNG.