A scene in Euca is just a set of entities with components — there
is no scene file format to learn first. You build a scene by spawning entities, and you read
it back with observe.
Start a local server first — see the Quickstart. All commands target
http://localhost:3917; every POST sends Content-Type: application/json.
1. Spawn the entities
Each /spawn adds a row to the world table. Give it a position and whatever components the
entity needs — physics, health, team, a collider, and so on.
# A Kinematic mover on team 1, drifting along +x.
curl -s -X POST http://localhost:3917/spawn \
-H 'Content-Type: application/json' \
-d '{"position":[0,1,0],"velocity":{"linear":[1,0,0]},"physics_body":"Kinematic","health":100,"team":1}'
# A static target on team 2.
curl -s -X POST http://localhost:3917/spawn \
-H 'Content-Type: application/json' \
-d '{"position":[5,1,0],"physics_body":"Static","health":60,"team":2}'
The full set of spawnable components — colliders, AI, roles, inventory, and more — is in the
POST /spawn reference.
Step before you read. A spawn sets an entity’s local transform, but world-space
positions only propagate when the simulation advances. Always POST /step {"ticks":1}
before observe or scene/save, or every position reads back as the origin [0,0,0].
2. Read the assembled scene
curl -s -X POST http://localhost:3917/step \
-H 'Content-Type: application/json' -d '{"ticks":1}'
curl -s -X POST http://localhost:3917/observe
observe returns the whole scene as a flat table — one row per
entity, with its components.
3. Point a camera (render / editor hosts)
A render- or editor-hosted server owns a camera you can drive:
# Place the camera.
curl -s -X POST http://localhost:3917/camera \
-H 'Content-Type: application/json' -d '{"eye":[10,10,10],"target":[0,0,0]}'
# Or snap to a preset view: top, front, back, right, left, perspective.
curl -s -X POST http://localhost:3917/camera/view \
-H 'Content-Type: application/json' -d '{"view":"top"}'
# Or frame a specific entity.
curl -s -X POST http://localhost:3917/camera/focus \
-H 'Content-Type: application/json' -d '{"entity_id":1}'
The camera lives in the rendering layer, so these endpoints take effect on a render- or
editor-hosted world. The headless example server has no camera and will report No camera —
use it to build and inspect scene data, and a render host to view it.
4. Persist the scene
The durable, rebuildable form of a scene is a scenario — a declarative document of the
whole world that you export and re-apply:
curl -s http://localhost:3917/scenario > scene.json
See Deterministic replay for the round-trip. There is also a
quick POST /scene/save {"path":"scene.json"} that dumps the world to a JSON file, but note
its loader is lossy — scene/load restores position, scale, and physics body only, and
drops health, team, velocity, and rotation. For a faithful rebuild, prefer the scenario.