- agent observations and input for automation
- spectator observations for browser rendering
Agent observations
Agent observations include the current tick,game_status, the observing
player, other visible players, nearby dynamic world entities, and recent
replicated events.
The observation radius comes from world.toml:
ObservationRadius attribute on that Player. The effective value is clamped
between 0 and the configured world radius.
Nearby dynamic entities are included in the player observation. Parts tagged
Static are omitted from the local player observation’s dynamic world list;
describe static geometry in API.md or expose the parts an agent must reason
about through world-specific attributes/actions.
API.md
API.md should describe:
- observation fields
- action names
- action arguments
- examples
- success and failure conditions
- any world-specific conventions
API.md is configured by scripts.skill in world.toml.
Agent input in Luau
UseAgentInputService for structured inputs:
AgentInputService:GetInputs(player) returns and clears queued inputs for that
player.
AgentInputService:HasPendingInputs(player) checks whether queued input exists.
Input data is JSON converted into Lua values.
Renderer input
Custom renderers can usectx.runtime.input to join locally, send input, send
remote events, and bind keyboard actions.
The renderer input bridge is for browser controls. World scripts should still
translate raw input into clear domain actions.
GUI click input
Input typeGuiClick with data.element_id is handled specially. The engine
finds the matching element under the player’s PlayerGui and fires
MouseButton1Click when available. This path does not synthesize
MouseButton1Down, MouseButton1Up, MouseEnter, or MouseLeave; those
signals exist for script compatibility but need an explicit engine/browser
bridge before a renderer can drive them.
Local HTTP flow
The local engine server exposes the agent session API:POST /join?name=AgentNamePOST /inputGET /observe
POST /join returns:
X-Session on /input and /observe.
POST /input queues the input, waits for the next input-processing tick, and
returns a fresh player observation.
Built-in input validation currently covers:
MoveTo,Pickup, andPlace:data.positionmust be a finite[x, y, z]vectorThrow:data.directionmust be a finite[x, y, z]vector; optionaldata.speedmust be a finite numberStopandJump: no required dataReset: handled specially and only allowed whenagent_api.allow_resetis enabled
AgentInputService unchanged.
Use those for world-specific domain actions such as OpenGate, CraftItem, or
InspectPanel.
Observation shape
Player observations are JSON objects with the current tick,game_status,
observing player, nearby players, nearby world entities, recent events, and
world metadata. Exact world-specific action semantics belong in API.md.
The top-level player observation fields are:
tickgame_statusplayerother_playersworld.entitieseventsrecent_events
OpenDoor, Pickup, Place, UseWorkbench, Answer, Speak. Keep argument
objects small, typed, and stable so coding agents can infer them from examples.