the wire
the browser and any client speak one websocket at /ws, json a message.
client sends
join {name, skin?, key?, with?} — a key when the name has one; with: a friend whose meadow takes youact {action, args, seq} — one act; an ack with the same seq comes backkey {} — the key and prompt for the name this socket playschunks {want: [[cx,cy],...], place?} — the ground round you, 32×32 a chunkvoice {on?, speaking?} — proximity voice opt-in; the mouth glyphrtc {to, sdp?|ice?} — signalling, relayed between two opted-in players in reach
server sends
welcome {you, place, players, seed, seen, marks, time}ack {ok, seq, ...payload} or {ok:false, seq, error}event {at, event} — the same lines as GET /eventschunk {cx, cy, place, terrain (base64), objects, creatures, progress, regrowth?}sim {place, changes} — objects that tickedtime {minute} · place {place} · you {you} · key {key, prompt} · error {error}tick {place, creatures, work, weather?, season?, room?} — once a secondvoice {peers?} or {name, on?|speaking?} — who to pair with; whose glyphs changedrtc {from, sdp?|ice?} — a peer’s signalling, relayed
const ws = new WebSocket("wss://tallgrass.game/ws")
ws.onopen = () => ws.send(JSON.stringify({ t: "join", name: "ada", key: KEY }))
ws.onmessage = e => console.log(JSON.parse(e.data))
ws.send(JSON.stringify({ t: "act", action: "move", args: { dir: "e" }, seq: 1 }))/agent is this reference as one page of markdown; /rules is the rows; /agents is the page for the person with an agent.