Build with an agent
Set up a multiplayer lobby with an agent
An AI agent can create a DiceyTable lobby, pick the game and variant, choose decks, ready up and press Start. A few room settings still wait for your click.
On this page7 sections
An agent sets up a multiplayer game the same way you do. It opens a lobby on the /play hub, picks the game, readies up and presses Start. It can do almost everything a lobby owner can, and the few things it can't wait for your click.
A preview only ever has you at the table. To test seats, turns and hidden cards with real players, you need a room, and rooms start in the lobby. It's the same lobby you'd use to play board games online with friends.
How do I get a paired tab into the lobby?#
The /play hub has no Connect AI agent… menu item, so pick one of two ways:
- Move a tab you already paired. The agent calls
page_navigatewithto: { "page": "tables" }for the open tables list, orto: { "page": "lobby", "roomId": "…" }for one lobby. The tab stays paired. - Open the hub with
?agent=connect. For example, openhttps://diceytable.com/play/tables?agent=connectand approve the agent there. If you already approved it in another tab, that's one click.
Once it arrives, the tab reports itself as a lobby page. On /play/settings it's a settings page, where the agent can read its own status and nothing else. Pair a DiceyTable tab with your agent covers the approval step.
Step 1: Create or join a lobby#
lobby_create makes a public lobby, with an optional game, name, player limit and spectator setting. lobby_list_open lists open lobbies, and lobby_join joins one by room id, invite code or link. A lobby with a join password can't be joined from the lobby page, by you or by the agent.
lobby_state is the agent's main way to look around. It returns the roster, the settings, the game and its variants and bots, and what's still blocking Start. Player names and deck captions are other people's words, so they come back marked untrusted.
Step 2: Set up the room#
Most set-up belongs to the lobby owner.
| Tool | What it does | Needs your click? |
|---|---|---|
lobby_set_game |
Picks the game | No |
lobby_set_variant |
Picks a variant: another board size, a bigger table, a fully scripted version | No |
lobby_setup_options_set |
Sets the game's setup options | No |
lobby_settings_set |
Name, player limit, spectators, seat choice | Only for visibility or the join password |
lobby_set_ranked |
Turns Ranked on or off | No |
lobby_invite_link |
Gets the share link and invite code | No |
lobby_kick |
Removes a member | Always |
The agent can fetch the invite link, but it can't send invitations to friends. That's yours to do.
Want a ranked match? The agent can set one up and read the rankings. But a ranked game can't start while anyone seated has an agent attached, you included. AI agents and ranked matches explains the rule. Game variants are explained on Add house rules and variants.
Step 3: Pick decks the game asks for#
Some games ask each player to bring a deck. The agent picks one the way you would:
lobby_requirement_optionslists the choices for one requirement. They come from three pools: mine (your decks), community and database.lobby_pick_deckpicks one, by requirement id, pool and option id.
As in the lobby screen, a pick from the database imports a private copy of that deck into your account.
Step 4: Ready up and start#
lobby_set_ready sets your ready state, and lobby_set_role switches you between player and spectator. Then the owner's agent calls lobby_start.
Start can say no. If someone hasn't picked a required deck, it returns the list of what's missing. If the seated bots hold it up, it returns botRefusal, which Add game bots to a lobby explains. If Ranked is on and something blocks it, it returns rankedRefusal. lobby_state shows each of these ahead of time: requirements for decks, ranked for ranked play and startBlockedBy for bots.
lobby_leave leaves before the game starts. Leaving a live room later is always your click.
What happens after Start#
The tab moves to the table and stays paired. It now reports itself as a table page. The agent plays with the same table_* tools it uses in a preview, as your seat and with your role. If you're a player, every move goes to the host, which checks it like anyone else's.
Nothing in the lobby earns or records anything. The game after Start records no chips and no stats for you, because an agent is connected. AI agents, dice chips and stats has the details. Everyone else sees an AI badge by your name, as the AI badge other players see describes.
Next steps#
- Add game bots to a lobby: fill empty seats with opponents.
- Test multiplayer with two agents: play both sides of the table.
- AI agents and ranked matches: why agent games are never ranked.
