Talos docs

GET /snapshot

Since 0.6
Plain text

Response

Response: WorldStateView

Everything needed to restore the world to this frame.

FieldTypePresentDescription
frameintegeralwaysThe frame this state was captured at.
timenumberalwaysSimulated seconds since the scene loaded. frame multiplied by the fixed timestep; carried so a snapshot lines up with the time on an event without the client doing arithmetic.
rng_seedintegeralwaysThe deterministic RNG seed in effect.
entitiesEntityStateView[]alwaysEvery entity's restorable state.
hudPropsalwaysHUD fields the scene's hud components are showing. Values are strings or numbers; a field with no value is omitted rather than set to null.
goalsGoalStateView[]alwaysGoal progress, in declaration order.
opaqueOpaqueStatesometimesSolver state the physics backend cannot rebuild from transforms and velocities alone — contact islands, sleeping flags, warm-start impulses.
session_pausedbooleansometimesWhether ctx.session.pause() was holding the world. Absent when it was not. A held world counts frames without advancing time, so a capture taken after a pause has time behind frame × the timestep, and a restore keeps that time rather than recomputing it.
instancesInstancesStateView[]sometimesWhat the run changed in each instanced mesh since load: instances a behaviour added, moved or removed, by stable id. Absent when nothing was changed, so a world without instanced meshes, or one whose instances stood still, snapshots exactly as before they existed.
nav_liveNavLiveStateViewsometimesA meta.nav.live navmesh rebuild that was waiting for its install tick, so a restore installs the same navmeshes on the same ticks as the run it was taken from (multiplayer resync, a lockstep rewind).
spawnedSpawnedDefView[]sometimesThe definition of every entity a behaviour spawned at run time and that is alive, ascending by id. Absent when nothing was spawned, so a world that never spawned snapshots exactly as before this existed.
spawn_counts{ string: integer }sometimesPer source id, how many ids ctx.world.spawn({ like }) has derived from it (like#N), so a copy spawned after a restore, in this world or a fresh one (a late joiner), gets the id it got in the run that never restored. Present whenever anything was spawned or counted.
npcNpcWorldStateViewsometimesThe NPC types' simulations: per type an opaque runtime that resumes it exactly and what each NPC is doing, plus what scripts asked of the NPCs that their next tick applies. Absent in a world without NPC types; a snapshot without it restores its NPCs as a fresh load starts them.
crowdCrowdWorldStateViewsometimesThe world's crowd: what each navagent is doing and, for the Rust crowd, an opaque runtime that resumes it exactly. Absent without navagents; a snapshot without it puts each agent back where its entity stands and plans its target again.
road_progressRoadTrackView[]sometimesEvery entity ctx.world.road(id).progress(entity) is tracking: road by road in id order, each road's in the order its tracking started. Absent when nothing is tracked; a snapshot without it restores with nothing tracked, and tracking starts again at the next progress.

Response: CrowdWorldStateView

A world's crowd (WorldStateView::crowd).

FieldTypePresentDescription
agentsCrowdAgentView[]sometimesEach navagent, by its scene id, ascending.
runtimeOpaqueStatesometimesargus-nav's runtime of the Rust crowd; missing or of another version, the agents are put back from their summaries.

Response: CrowdAgentView

One navagent as a reader sees it.

FieldTypePresentDescription
idstringalwaysThe agent's scene id.
positionnumber[3]alwaysWhere it stands.
velocitynumber[3]alwaysHow it is moving, m/s.
targetnumber[3]sometimesWhere ctx.nav.goTo last sent it, on the navmesh.
arrivedbooleansometimesIt reached its target.
stuckbooleansometimesIt has not closed on its target for three seconds, or cannot reach it.

Response: OpaqueState

Backend state a snapshot carries but nothing outside the backend interprets.

FieldTypePresentDescription
backendstringalwaysWhich backend wrote this, e.g. rapier3d. A snapshot is only restorable into the same one.
versionintegeralwaysThe backend's format version. A mismatch means the blob cannot be restored.
datastringalwaysThe blob, base64.

Response: EntityStateView

One entity's restorable state.

FieldTypePresentDescription
idstringalwaysThe entity's stable scene id.
namestringalwaysHuman-readable label, so a snapshot reads without a second call to /entities.
tagsTagssometimesScene tags. Omitted when the entity has none.
positionnumber[3]alwaysWorld-space position.
rotationnumber[4]alwaysWorld-space rotation, [x, y, z, w].
scalenumber[3]alwaysLocal scale.
velocityVelocitysometimesLinear and angular velocity. Absent for an entity with no rigid body, which is not the same thing as a rigid body at rest.
scriptScriptStateViewsometimesThe behavior's ctx.state, if it has one.
animAnimStateViewsometimesAnimator playhead, if it has one.
overrides{ string: Props }sometimesWhat a behavior has written over this entity's components with entity.set, by component type. Omitted for an entity nothing has written to, which is almost all of them.
reparentReparentViewsometimesWhere a behaviour moved this entity with entity.setParent, when that is not the parent the scene gave it. Omitted for every entity still where the scene put it; a restore that omits it puts the entity back under the scene's parent.
controllerControllerStateViewsometimesThe character controller's state between ticks, for an entity with a controller. A restore that omits it (a snapshot from an older build) puts a character that was resting back on its floor and leaves one rising or falling in the air.

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: ControllerStateView

A character controller's state between ticks, past its position and heading: what lets a restored character step exactly as the one saved. Entities are named by scene id.

FieldTypePresentDescription
velocitynumber[3]alwaysThe character's own velocity, without the speed it carries from ground it left.
carrynumber[3]alwaysHorizontal speed kept from moving ground the character jumped or walked off.
pitchnumberalwaysLook pitch, radians.
groundedbooleanalwaysStanding on walkable ground.
crouchingbooleanalwaysCrouched (the shorter capsule).
groundNormalnumber[3]alwaysThe ground's normal under the character.
groundstringsometimesThe entity the character stands on.
underFootnumber[3]sometimesWhere the ground check met the ground.
touchingstringsometimesThe entity the character last touched sideways.
movingbooleanalwaysMoving faster than the idle speed.
jumpHeldbooleanalwaysThe jump input on the last tick: a press is its rising edge.
leaveGroundbooleanalwaysAn upward velocity write waiting to lift the character off the ground on the next tick.
nextJumpHeightnumbersometimesA jump height asked for the next jump only.
anchorControllerAnchorViewsometimesThe ground the character rides and where on it.
teleportedstringsometimesGround reported teleported, not to carry the character across.
groundVelocitynumber[3]alwaysHow fast the ground carried the character on the last tick.
groundTurnnumberalwaysHow far moving ground turned the character on the last tick, radians.
walkSpeednumberalwaysThe walking speed a script or a steer last set, m/s.
gravityScalenumberalwaysctx.controller.gravityScale.
moveWithGroundbooleanalwaysctx.controller.moveWithGround.
crouchInputbooleanalwaysThe crouch ctx.controller.crouch(on) latched, held until the script says otherwise.
pendingPendingInputViewsometimesInput a behaviour gave an engine-driven character after its pass this tick, which its pass on the next tick takes. Absent when there is none.
yawnumbersometimesThe controller's heading, radians about +Y, which look turns. Always written; a state without it (from an older engine) restores the heading from the entity's rotation, as before.
squeezedBystringsometimesThe moving body that was closing on the character on this tick, by scene id: the next tick's character-squeezed event is an edge against it. Absent when there was none.

Response: ReparentView

A behaviour's reparent, as a snapshot carries it: the new parent's scene id, or null for the top of the scene.

FieldTypePresentDescription
parentstringsometimesThe parent's scene id; null when the entity was moved to the top of the scene.

Response: ScriptStateView

One behavior's restorable ctx.state.

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

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: GoalStateView

One goal's progress.

FieldTypePresentDescription
idstringalwaysThe goal's authored id, from its goal component.
labelKeystringalwaysThe string-table key for the goal's display text.
orderintegersometimesDeclaration order, when the goal component gives one.
reachedbooleanalwaysWhether the goal has been reached.
at_frameintegersometimesThe frame it was reached on. Absent while it has not been.

Response: InstancesStateView

One instanced mesh's run-time changes (WorldStateView::instances).

FieldTypePresentDescription
idstringalwaysThe instanced mesh entity's stable scene id.
next_idintegeralwaysThe id the next added instance would get.
changesInstanceChangeView[]alwaysAscending by instance id.

Response: InstanceChangeView

One instance a behaviour added or moved (with its value), or removed (no value).

FieldTypePresentDescription
idintegeralwaysThe instance's stable id.
valueInstanceValueViewsometimesWhere it is now, in its instanced mesh's frame; absent when it was removed.

Response: NavLiveStateView

A pending meta.nav.live rebuild (WorldStateView::nav_live).

FieldTypePresentDescription
install_atintegeralwaysThe tick the pending navmesh goes in on.
gathered_atintegeralwaysThe tick its geometry was gathered on.
againbooleansometimesAnother static changed while it waited: the next rebuild starts on install_at.
includedintegersometimesHow many leading entries of since the pending rebuild was gathered with.
sinceNavChangeView[]sometimesEvery static collider change since the navmesh in force was gathered, in tick order.

Response: NavChangeView

One static collider change: exactly one of moved, spawned, despawned, by the entity's stable id, with its local pose (relative to its parent) before the change.

FieldTypePresentDescription
idstringalwaysThe entity's stable scene id (or the id a behaviour spawned it with).
atintegeralwaysThe tick of the change.
movedNavPoseViewsometimesIt moved; its local pose before the move.
spawnedbooleansometimesIt was spawned (it is not in the geometry gathered before).
despawnedNavPoseViewsometimesIt was despawned; its local pose before it went.

Response: NpcWorldStateView

The NPC types of a world (WorldStateView::npc).

FieldTypePresentDescription
typesNpcTypeStateView[]sometimesEach NPC type, in module order.
commandsany[]sometimesScript commands raised since the NPCs' last tick, in order (as GET /npc/pending lists them).
stimuliany[]sometimesScript stimuli raised since the NPCs' last tick, in order.
clock[number, integer]sometimesThe world clock a script last set: hour of the day, day length in ticks.

Response: NpcTypeStateView

One NPC type's simulation.

FieldTypePresentDescription
modulestringalwaysThe type's script module.
tickintegeralwaysIts tick count.
npcsNpcSummaryView[]sometimesWhat each of its NPCs is doing.
runtimeOpaqueStatesometimesargus-npc's runtime of the type; missing or of another version, the type starts over.

Response: RoadTrackView

One entity's progress along one road (WorldStateView::road_progress): the engine's whole track, so a restore counts the lap and orders the standings exactly as the world it came from.

FieldTypePresentDescription
roadstringalwaysThe road entity's scene id.
entitystringalwaysThe tracked entity's scene id.
positionnumber[3]alwaysWhere it was at its last step, in the road's own frame.
snumberalwaysIts distance along the centre line there.
offsetnumberalwaysHow far right of the centre line it was (negative is left).
from_linenumberalwaysHow far from the centre line it was.
alongnumberalwaysIts distance past the start line, laps unwrapped (s on an open road).
checkpointintegeralwaysThe last checkpoint it crossed in order, counted across laps (-1 on the grid behind the line).
backwardnumberalwaysMetres gone backward, net of forward since.
reachedintegeralwaysThe tick its race distance last reached a new best (a tie in the standings goes to the earlier).
bestnumberalwaysThat best race distance.

Response: SpawnedDefView

A runtime-spawned entity as a scene file would hold it (WorldStateView::spawned).

FieldTypePresentDescription
idstringalwaysThe entity's id, the same as the matching entry of entities.
defPropsalwaysThe scene-contract entity object, exactly as a scene file's entities array holds one.

Example

curl "http://127.0.0.1:7700/snapshot"

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.