Talos docs

POST /step

Since 0.6

: inputs, ticks and an entity read in one call.

Plain text

Request

Request body: StepRequest

POST /step request: inputs, then whole ticks, then a read, as one atomic call.

FieldTypeRequiredDescription
inputInputEvent[]noInputs to place before the ticks, applied in order. May be empty (just step and read).
stepintegernoWhole fixed ticks to run, at most 3600. One by default.
entitiesstring[]noEntity ids to read after the ticks, answered as GET /entity/{id} would.

Request body: InputEvent

One synthetic input, tagged by type.

ValueMeaning
actionA named action, as ctx.input.pressed("jump") reads it.
axisA two-axis input, as ctx.input.axis("move") reads it.
steerWorld-frame steering for a harness walking a route.
mouseMouse motion, as a person's mouse gives it: delta pixels every tick, for frames ticks.
pointerWhere the mouse points: pixel (x, y) of view view's cell, the space ctx.camera.pick takes and ctx.input.pointer reports. A level like a key: it holds until another pointer moves it or one with off: true takes it away, and a replay records it.
keyOne key going down or up, as the window's keyboard sends it.

Response

Response: StepResponse

POST /step response: what POST /time says, what POST /input said, and the entities read.

FieldTypePresentDescription
frameintegeralwaysThe frame counter after the ticks ran.
pausedbooleanalwaysWhether the sim is paused.
steppedintegeralwaysHow many ticks ran.
inputInputResponsesometimesPOST /input's answer for the inputs placed; absent when there were none.
entitiesEntitySnapshot[]sometimesThe entities asked for, as of frame, in the order asked.

Response: EntitySnapshot

Everything the agent can see about one entity at one frame.

FieldTypePresentDescription
idstringalwaysStable scene id, unique within the scene. The key for GET /entity/:id.
namestringalwaysHuman-readable label from the scene file. Not unique.
tagsTagsalwaysScene tags, in declaration order. The ?tag= filter matches one of these exactly.
positionnumber[3]alwaysWorld-space position, [x, y, z], metres.
rotationnumber[4]alwaysWorld-space rotation as a quaternion, [x, y, z, w].
scalenumber[3]alwaysLocal scale, [x, y, z].
parentstringsometimesParent entity id, absent at the root.
staticbooleanalwaysTrue when the entity is marked static (never moves; excluded from trace deltas).
velocityVelocitysometimesLinear and angular velocity. Absent for entities with no rigid body.
componentsComponentsalwaysScene components on this entity, in declaration order.
overrides{ string: Props }sometimesWhat a behavior has written over this entity's components with entity.set, by component type — and only what it has written, so an entity nothing has touched has none.
scriptScriptStateViewsometimesThe behavior's ctx.state, if it has a script component.
animAnimStateViewsometimesAnimator state, if it has an animator component.
vehicleVehicleViewsometimesWhat its vehicle is doing, if it is a running vehicle. Everything a tester driving it through its input actions needs to steer by; ?fields=vehicle keeps just this.
spriteSpriteViewsometimesWhat its sprite shows, if it has one: the animation, the frame, the view the last frame drew and the picture's world bounds. ?fields=sprite keeps just this.
tilemapTilemapViewsometimesIts tilemap, if it has one: each layer's size and filled cells, the chunks the last frame drew, the collision rectangles and the world bounds. ?fields=tilemap keeps just this.
frameintegeralwaysThe frame this snapshot was taken at. Correlates with /capture, /events and /trace.

Response: AnimStateView

One animator's restorable playhead, what gates gameplay, and its exact runtime (lane rule 35).

FieldTypePresentDescription
statestringalwaysCurrent state machine state.
timenumberalwaysPlayhead in seconds.
oncestringsometimesThe one-shot playing (ctx.animator.play). Absent when none is.
layersAnimLayerStateView[]sometimesEach declared layer: its name, state and one-shot. Absent with no layers.
speednumbersometimesThe animator-wide playback rate when it is not 1 (0 is a hit-stop).
windowsstring[]sometimesThe animation event windows open now (an attack's hit window).
runtimeOpaqueStatesometimesThe animator's exact runtime (backend argus-animator); hand it back as it is. Missing or of another version, a restore uses state and time only.

Response: ScriptStateView

One behavior's restorable ctx.state.

FieldTypePresentDescription
modulestringalwaysThe module specifier.
statePropsalwaysctx.state. Always an object.

Response: SpriteView

A sprite component as it plays and was last drawn.

FieldTypePresentDescription
animationstringsometimesThe animation playing (or stopped on); absent while a still frame shows.
framestringalwaysThe frame showing.
frameIndexintegeralwaysIts entry in the animation's frame list, 0 up.
playingbooleanalwaysFalse once stopped or a non-looping animation reached its end.
speednumberalwaysPlayback multiplier (ctx.sprite.speed).
viewintegeralwaysThe view the last drawn frame showed: 0 the front, counting counter-clockwise seen from above.
viewsintegeralwaysHow many views the frame has (1: the same from every side).
visiblebooleanalwaysWhether it is drawn (ctx.sprite.visible).
opacitynumberalways0..1; below 1 it is drawn see-through.
boundsnumber[3][2]alwaysWorld-space box of the picture showing, [min, max]: for a sprite that turns to the camera, the box it sweeps as it turns, so it does not depend on where the camera is.

Response: TilemapView

A tilemap component as it stands and was last drawn.

FieldTypePresentDescription
layersTilemapLayerView[]alwaysEvery layer, in the component's order.
chunksDrawnintegeralwaysChunks (16 × 16 cells, one draw each) the last frame drew.
collisionRectsintegeralwaysBoxes in the collision body (merged rectangles of solid cells); 0 with none.
boundsnumber[3][2]alwaysWorld-space box of every layer, [min, max].

Response: VehicleView

A running vehicle, as GET /entities reports it: how it is driven, and where it is going.

FieldTypePresentDescription
inputstringalwaysWho owns its movement. "auto": the engine, from the actions, every tick; a behaviour's ctx.vehicle.drive is ignored. "script": a behaviour, through ctx.vehicle.drive; holds on the actions move nothing.
actionsVehicleActionsalwaysThe actions it reads, by role, each with its kind — only those the scene's gameplay context binds (an unbound role reads 0 and is left out).
speednumberalwaysm/s along its forward; negative while reversing.
forwardnumber[3]alwaysIts nose: the entity's -Z in world axes, unit length.
steerAnglenumberalwaysThe front wheels' angle now, radians, positive right — the sign the steer action has.
maxSteernumberalwaysThe wheels' angle at full lock, radians, at a standstill (it shrinks with speed).
wheelbasenumberalwaysFront axle to rear axle, metres.
minTurnRadiusnumberalwaysThe tightest circle it can turn at its speed now, metres: wheelbase / tan(lock), with the lock the steering's speed reduction leaves.
brakeDecelnumberalwaysThe deceleration full brake gives on the level, m/s²: what stopping at a mark takes.
topSpeednumberalwaysThe fastest it goes flat out on the level, m/s (before drag).
throttlenumberalwaysThe throttle and brake in force this tick, 0..1, after the reverse rule.
brakenumberalwaysSee throttle.
gearintegeralways1 forward, -1 reverse.
wheelsOnGroundintegeralwaysHow many of its wheels touch the ground.
driftVehicleDriftViewsometimesThe drift, only on a vehicle that has a drift block.

Response: Velocity

Linear and angular velocity in world space.

FieldTypePresentDescription
linearnumber[3]alwaysMetres per second, [x, y, z].
angularnumber[3]alwaysRadians per second about each world axis, [x, y, z].

Response: InputResponse

POST /input response.

FieldTypePresentDescription
acceptedintegeralwaysHow many of the submitted inputs were applied.
frameintegeralwaysThe frame they take effect on: the next tick the sim runs.
unboundstring[]sometimesNames that no entity in the scene consumes, so the caller learns about a typo instead of watching nothing happen.

Example

curl -X POST "http://127.0.0.1:7700/step" --json @body.json

Start a server with argus run --serve; the port is --port (7700 by default). The request and response fields are in the query API guide.