Skip to main content

Module run

Module run 

Source
Expand description

run and scene: the game started headless as the game’s options say, a script of keys, controller buttons, actions by name and waits played, and some frames more. run answers with the top screen, the frame as text, the scene, what happened, the sounds asked for, the game’s log and its modules; scene with the scene and the log. With --perf, run also measures each frame and answers a summary of the times, and with --perf-out writes every kept frame as a JSON line (super::perf); where the heap is counted by memory tag, it takes a heap snapshot before the script and one after the last frame, and answers what held the heap and what grew. With --session, the game starts from a session record instead (shuyi_platform::session), played to its end or to the first frame this build plays differently, and the script goes on from there.

Structs§

RunInput
What run and scene play.
RunOutput
What run saw.
SceneAsk
What scene is asked for beyond the scene: one value of its data, by pointer, and its data’s shape.
SceneOutput
What scene saw.

Constants§

MAX_IDLE_FRAMES
The most frames frames may ask for: about 28 simulated minutes.
NO_SHAPE
The limit of scene --shape on a scene whose data has no shape.

Functions§

ask_scene
output answering ask in place of its scene: the value at its path, and its data’s shape, with what the shape’s absence adds to limits; or the problem code and why, a path that names nothing. With no scene, or nothing asked, it is left as it is.
check_actions
Whether session’s game can press every action script names: one with a key or a button (Session::actions). An error names the step and the game’s actions, before anything plays (run, scene and MCP’s step call it).
keys
A script of keys, for tests and callers that only press keys.
limits_of
What a run of frames frames couldn’t show: the frames after the game asked to quit (on frame quit), the frame if no screen is open, and the scene, if there is none because of no_scene.
parse_args
Reads run’s and scene’s arguments (not --json), the game’s start options among them.
perf_out_path
Where --perf-out <path> writes: path from the project’s folder root, as the operating system takes it.
run
run: plays input in game; a trace file (perf_out) is written from the working folder (run_at says from where).
run_at
run: plays input in game; a trace file (perf_out) is written from the project’s folder root, as the CLI and the MCP server run it.
run_output
What session shows after its run, as run answers it, with its limits.
scene
scene: plays input in game, and answers with the scene; a record is read from the working folder (scene_at says from where).
scene_answer
The answer op gives with session’s scene, asked ask, and how far its record played, record: it passes if there is a scene and the record played no differently (differs).
scene_at
scene: plays input in game, a record read from the project’s folder root, and answers with the scene. It passes if there is one and a record played no differently.
scene_output
The scene session shows, as scene answers it, with its limits.
scene_output_text
What scene saw, for people.
text
What run saw, for people.
usage
The usage of run (and scene, if op says so), with the game’s start options.