Expand description
Session records: everything the platform gave a game in one run, frame
by frame, and its playback (ADR-0072). A record is taken where the
platform hands things to App (App::record), so no game code
records anything: the clock, the system’s events, the input, the system
keyboard’s answers, the music’s position, the display, the platform’s
facts and the store as it was handed over. Each frame also holds a hash
of what happened in it, never of its picture.
Playback plays a record on the HeadlessPlatform, from the game’s
real Start, and says at which frame the game first did something
else. Frames count App::frame calls from 1, as
App::frame_number does.
A game’s rules records (a seed and commands, a hash per step) are one level up, and stay the game’s: playing a session runs the same rules, so a tick game’s steps and a turn game’s commands come out of it.
A record’s text is RON, one frame per line, so two records diff frame by
frame (SessionRecord::to_ron). The suggested file name is
*.session.ron. A record is a run’s log, not an asset, so it has no
Format, and it is never migrated: a field added later is optional and
leaves FORMAT_VERSION alone, and a change to what a field means
raises it.
Structs§
- Frame
Difference - The first frame that played differently from its record.
- Frame
Record - One frame of a run, in the order
Appreads the platform: empty lists and unchanged values are left out, so an idle frame is itsdtalone, or itsdtandmusicwhile music sounds. - Keyboard
Frame - The system keyboard’s part in one frame.
- Playback
- A record playing, one frame at a time: on an
Appmade from the game’sStart(prepare), on a platform fromHeadlessPlatform::from_session. It needs no Harness, so a running build can replay a record too. - Played
- How far the test Harness has played its record (
Harness::play_to). - Session
Record - One run of a game, as the platform gave it (module docs).
Appfills one in (App::session);from_ronreads one back.
Enums§
- Session
Error - Why a record can’t be played.
- Stamps
- Whether a playback checks that the record’s build is this one.
Constants§
- FORMAT_
VERSION - The version of a record’s text this engine reads and writes.
- MAX_
SESSION_ FRAMES - The most frames one record holds: an hour at 60 frames a second.
Recording stops there (
SessionRecord::truncated).
Functions§
- prepare
startmade ready to playrecord: a record of another version refused, the record’s stamp checked against the start’s asstampssays, and the record’s voice manifest put in its setup. Beside it, what the playback can’t promise, one line each.