One party in memory, streamed to everyone
A room is a single party held in server memory and streamed to every watcher, so everybody sees the same betrayal at the same moment and the model is paid for once per beat however many people are looking.
The alternative, a simulation per visitor, is the default shape for an AI toy and it is wrong for this one twice over. It multiplies the bill by the audience, and it destroys the only thing that makes a simulation worth watching with other people: that it is the same one.
What follows from it
- Cost is flat in the audience. The marginal watcher is a socket. See cost.
- One replica, always. Two replicas is one URL serving two different parties. See one replica.
- No database. State lives in memory and dies with the process, deliberately. What deserves to outlive a process is a file you saved.
- Rooms start on a watcher. Nothing ticks in a room nobody has opened, and a party under way finishes anyway.
The server owns everything
The server never sends positions. It says where each person is, as a zone, and what they are doing, and the browser walks the figure there. Nothing in the rendering layer may feed back into the simulation except a click to select somebody.
That line is not architectural fastidiousness. Positions computed in a browser are per-watcher, and the moment any of them matters to the simulation you have as many parties as tabs.
You can walk away
Close the tab mid-party and the night plays on without you. Come back and you have missed something, exactly as you would have. A simulation that pauses when unobserved is a recording with extra steps.
Read next
Why this app is pinned to one replica
The party lives in server memory and every watcher of a room shares it, so two replicas means one URL serving two different parties. railway.json pins numReplicas to 1 as a correctness constraint, not a cost saving.
Server-sent events for a live simulation
Simulation frames go out over server-sent events, which are one-way, plain HTTP and reconnecting for free, because nothing a watcher does needs a socket and the little that does is an ordinary POST.
The 3D layer never feeds back
The browser receives zones and activities and decides everything about bodies: where they walk, which way they face, what gesture they make. Nothing in the rendering layer may write back to the simulation except a click to select.
Two guard rails on a public LLM toy
Nothing ticks in a room nobody has opened. A party already under way plays to its end and then stops. A rolling hourly cap drops a room to the house brain past a fixed dollar figure.