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.

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.

Response: AnimStateView

One animator's restorable playhead.

FieldTypePresentDescription
statestringalwaysCurrent state machine state.
timenumberalwaysPlayhead in seconds.

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

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.