Skip to content

Play-testing with simulation

game.simulate plays a fresh copy of the committed project without a window or renderer. It uses the same object scripts, world scripts, Blueprints, Rapier physics and player controller as Play and the exported player, runs for a fixed number of 1/60-second ticks with scheduled key presses, and returns a report. The project, selection, revision and undo history are never changed.

Use it to check that a mechanic works after an edit: that a door opens, a body falls, a script runs without errors, or the player can reach a platform.

  1. Decide how many frames to run. At 60 ticks per second, 240 frames is four seconds.
  2. Schedule inputs as key transitions. A key stays held until you release it.
  3. Run the command and read the report.
Terminal window
# Hold D for the first second of a four-second run.
feather-cli --workspace ./my-game --project project.feather.json command game.simulate --json '{
"frames": 240,
"inputs": [
{"frame": 0, "key": "D", "pressed": true},
{"frame": 60, "key": "D", "pressed": false}
]
}'

Headless, the command returns {report} directly. In a live editor it starts a background job and returns a job_id; poll job.inspect until status is completed, and read the report from its output.

Field Description
frames Ticks to run, 1 to 600. Default 240
inputs Up to 256 {frame, key, pressed} transitions. frame is zero-based and must be less than frames
blasts Up to 64 explosions {frame, position, radius, damage}; needs destruction enabled
weather Weather events {frame, action, weather, seconds, at} with actions set, strike, tornado and stop_tornado; needs weather enabled
events Up to 256 script events {frame, name, data, target}, sent before that frame as emit would send them. name is 1 to 64 characters, data any JSON up to 16 KiB, and target an object ID to send it to that object’s scripts only
breakpoints Up to 64 script breakpoints {script, line, log, enabled}; see Debugging
Keys Effect
W, A, S, D Move the player
Space Jump
Shift, ShiftLeft, ShiftRight Change movement speed
E, arrow keys (Up, Down, Left, Right or ArrowUp…) Reach script and Blueprint input such as key_down
Q, F, C, G, R, V, Ctrl, ControlLeft Further gameplay actions
Pad:South, Pad:East, … Pad:DPadRight Gamepad buttons
Pad:LeftStickAxis, Pad:RightStickAxis Gamepad sticks; pass axis: [x, y] in −1..1, where y = 1 pushes forward
Look Turns the view like mouse look; pass look: [yaw, pitch] in degrees. Yaw 0 faces −Z; pitch is −89 to 89, negative looks down. E then picks up what the centre of the view is on

The player spawns during the first tick. Schedule jump presses after the player exists and is standing on the ground.

Enabled world scripts run during the simulation, as they do in the player. Before the run starts, each one is checked like it is in the editor; a script with errors stops the command with World script NAME: … and nothing runs.

Use events to drive game rules without a player: world scripts receive them in on_event(name, data) and in on(name, …) listeners, and object scripts and Blueprints in their listeners. The report’s world section then shows the outcome.

Terminal window
feather-cli --workspace ./my-game --project project.feather.json command game.simulate --json '{
"frames": 60,
"events": [{"frame": 10, "name": "coin", "data": {"value": 5}}]
}'

A simulation never pauses. Each breakpoint acts as a logpoint: every hit is reported in the report’s debug section with the script, line, game time, call stack and local variables, and a log text with {name} placeholders becomes the hit’s message. Name world scripts by their name, object scripts object:ID and Blueprints blueprint:ID.

Field Description
success true if the run finished without runtime errors and Stop restored the authored state
frames, timestep_seconds, prewarm_frames The ticks run, the tick length, and the warm-up ticks used to load terrain before the run
objects For each object: initial and final state (position, rotation, scale, velocity, visibility, physics suspension), min_height, max_height and max_upward_velocity
player The player’s initial and final state and its height range
score Collectible score at the end
world When the project has world scripts: scripts (how many ran), state (their get/set values at the end) and signals (game time, active timers, listeners, timers fired, and events emitted, delivered and dropped)
debug When you passed breakpoints: the breakpoints, total_hits and up to 200 hits
wind The wind at the end of the run
logs The most recent runtime messages, up to 128
error_count, errors Total runtime errors, and up to 128 distinct messages
restored Whether Stop restored every authored object
limitations What this run could not verify

Further sections appear when the project uses the matching system: blueprints (per-node execution counts), destruction, boat, vehicle, traversal, weather, feel (stamina, climbing, footsteps and the surface underfoot), fluids, smoke, interaction (doors, switches, pickups, carrying and throwing), ai (agent paths, blackboards, perception and events), abilities (attributes, effects and tags per character), pawn (the possessed pawn, every pawn possessed, and the seconds and distance under control), smart_objects (completed uses and claimed objects), game_mode (the current phase and its history) and streaming (objects loaded, unloaded and pinned, and how many loads and unloads happened).

The interactive water surface (water.interactive in project.environment) is part of the run too.

  • Pending editor edits must be committed or discarded first; see editor.commit.
  • A simulation can run during Play; it uses an isolated copy of the authored project.
  • Only one background simulation can run at a time in an editor session.
Limit Value
Frames per run 1 to 600, at 1/60 second each
Input transitions 256
Script events 256, each with up to 16 KiB of data
Breakpoints 64
Authored objects 2,048
Work budget 1,000,000 object × frame steps

The runner does not render pixels, load model visuals, or play animation or audio. Game UI screens and saves to disk are not exercised either. Imported models use their authored colliders. Dynamic bodies far from the player may stay suspended while their terrain is not loaded; check physics_suspended in the report. Fixed ticks make runs repeatable on one machine, but results are not guaranteed to be bit-identical across platforms.

game.simulate has no renderer. To test movement in the real game, give the player or the editor a file of timed inputs with the FEATHER_INPUT environment variable, together with a verification run:

[
{"at": 0.5, "for": 1.5, "keys": ["W"]},
{"at": 1.0, "for": 0.2, "keys": ["Space"]},
{"at": 2.5, "for": 1.0, "stick": [0, 1]}
]
Terminal window
FEATHER_INPUT=steps.json FEATHER_VERIFY_SECONDS=4 \
feather-player my-game/project.feather.json --verify-run report.json
Field Description
at When the step starts, in seconds after the loading screen ends
for How long the keys are held, in seconds
keys Key names as input bindings use them, such as W, Space, ShiftLeft, ControlLeft or MouseLeft
stick Left stick position [x, y]; y = 1 pushes forward

Steps play only during Play. A key counts as pressed on the first frame it is held, so a Space step jumps once. A file that cannot be read is skipped with a warning.

Use simulation as a regression check after every change. For example, confirm that a cube set to Dynamic falls:

Terminal window
feather-cli --workspace ./my-game --project project.feather.json \
command game.simulate --json '{"frames":120}' \
| python3 -c 'import json,sys; o=json.load(sys.stdin)["data"]["report"]["objects"][0]; print(o["initial"]["position"][1], o["final"]["position"][1])'

The War City example shows a run with scheduled blasts; see Example projects.