Not translated yet — showing English.
Writing a Brain
A brain is ordinary code that answers one question: what does this bot do next. It runs wherever you want it to — a cloud function, your own service, a headless client — and it talks to the room through the same surface a human player's client uses. This page specifies the socket it plugs into: what a brain receives, what it may send back, and when. Bots covers getting a bot into a room.
What is settled, and what you can build against today
The platform ships no game AI. No behaviour trees, no utility system, no navigation brain. That is the boundary: the decisions are yours, and the module's job is to make your decisions indistinguishable from a player's.
A brain is not a hook. A hook wraps a step of ours. A brain is not a step of ours at all: it runs outside the room, on its own schedule, and the platform does not care which direction the connection was opened from. That is why a brain can be a cloud function, a service you host, or a headless client, and why none of those is more native than the others.
The socket is perception in, commands out, and both sides are the player's:
| What it is | |
|---|---|
| perception | exactly what a player in that seat would receive — the same deltas, through the same visibility rules. A bot cannot wallhack any more than a player can. |
| commands | exactly what a player in that seat would send. No privileged input channel exists. |
A bot that sees more — a debug mode, a training mode — is a declared widening, not a side effect of being a bot.
The thinking tick is declared, and it is not the simulation tick. Brains are outside, so they think on their own cadence.
Between two thoughts, the last command stands
A brain that thinks slowly doesn't produce a bot that stands still; it produces a bot that keeps doing the last thing it decided. Design the brain around that.
Brains going away has declared behaviour, and there is no default. You say what happens when the brain stops answering, per room type. "Brains unavailable" is a retained event, so a late subscriber learns the current situation rather than only future changes.
What a bot deliberately cannot be
These are refusals rather than omissions.
- A bot is not a player, and it does not own entitlements, purchases or leaderboard records. A bot that could hold them would be a way to manufacture them.
- The bot flag always exists and is always observable to the platform. Whether your game shows it to players is your decision; whether it exists is not.
- The module keeps no history of what a bot decided or why. That is your business, in your telemetry — the platform is not the place your AI's reasoning is stored.