Multiplayer rooms for the web

A web-native multiplayer layer, built from the ground up so rooms sleep whenever they're idle, even with players still connected, and wake in milliseconds. Board and card games sleep between turns, and action games stop costing anything 30 seconds after a match ends.

Request an invite

npx @irtio/cli init my-game

Server and client in lockstep

State syncs seamlessly between the room and every client, and client-side prediction and lag compensation keep it looking right no matter the network conditions. Input reaches your server code as calls that read like ordinary functions, and ownership rules let the client change the fields it's allowed to directly.

Client
Server

1The client calls a functionClient

const roll = await room.calls.roll({ sides: 20 });

2The room runs your handlerServer

roll({ sides }) {
  return 1 + Math.floor(Math.random() * sides);
},

3The client carries on with the resultClient

die.textContent = `You rolled ${roll}`;

Declare a call once; its args are checked on both sides and its reply comes back typed. Calls

Rooms that sleep, and wake anywhere

IRT rooms are built from the ground up to be portable. While a room runs, its state changes stream to the state store, so it can be restarted at any time, on any server, from exactly where it left off. Connections are held outside the room, so a restart doesn't drop a single player.

What that gets you

Rooms sleep when nobody needs them

An empty room hibernates 30 seconds after its last player leaves, and an idle one, like a board game between turns, can sleep with its players still connected. A sleeping room costs nothing.

Scale without sizing servers

Each room is placed when it wakes, so a spike gets room after room and a lull holds nothing.

Crashes and deploys that don't kick players

A room that breaks is replaced from its saved state with its players' connections held. Running rooms stay on their build until they next hibernate, then wake on the new one.

Replays and state you can inspect

Because a room's state streams out of it, you get replays and shareable clips out of the box, and state you can inspect to debug problems.

How rooms hibernate and wake

Try it: a party quiz

One person writes the quiz, a TV shows the questions and a code to join with, and everyone answers on their phone. The room keeps every deadline in its alarm, so the game runs itself to the podium, and between games it sleeps with every phone still connected. The answer stays in room code until the reveal, so no phone can read it early.

The quiz on a TV, revealing the right answer to a question, beside a phone showing its answer was right

Play Trivia NightAlarmsSleeping rooms

Handled out of the box

Client trust based on game needs

A project can mix room types that make different choices.

  1. 1

    Relay

    A native room runs no code of yours. It passes messages on and keeps presence and a leader.

  2. 2

    Shared entities

    Players spawn, own and write entities under rules each kind declares, still with no server code.

  3. 3

    Ownership

    Players write the entities they control with no round trip, and the room checks every write.

  4. 4

    Fully authoritative

    The room runs the rules, clients predict their own movement, and hits are checked by rewinding.

Room types

An example game: Breach

Breach is a 5v5 bomb-defusal shooter for the browser: buy rounds, rifles and a sniper, grenades, a kill cam. Its room is fully authoritative and runs at 60 ticks a second.

Breach in first person: a pistol in hand, an opponent figure standing in front of a crate at the end of a lane, and the score and round clock at the top of the screen.

Movement with no wait

Players are physics characters the client predicts, with the same controller as the room. At 150 ms round trip, 1,200 ticks of running, jumping and climbing stairs needed no correction.

Hits where you saw them

A shot travels in the player's input, and the room checks it against where the target was on the shooter's screen, with a hitbox for each bone of its pose.

Ten players from one button

Finding a 5v5 waits in a lobby until ten have joined, then hands them all to a new match. Quick play fills public matches between rounds.

Crashes don't end the round

The round clock, the bomb and the economy are room state, so a room that crashes picks up where it was, and players reconnect to it.

A full room of ten sends each player about 20 KB a second and takes 0.3 ms a tick.

Multiplayer you can test

Multiplayer bugs hide between players: a write lost in a reconnect, an entity one team shouldn't see, an avatar duplicated by a crash. IRT's test tools run your room and the real client in process, on a clock that moves only when the test moves it, so those bugs show up in a test instead of in a playtest. They need no network or account, and run the same in CI.

avatars.test.ts
test("a crash keeps one avatar per player", async () => {
  const t = testRoom(room);
  const alice = await t.connect({ player: "alice" });
  await t.host.crash();
  await alice.reconnected();
  expect(alice.view(Avatar)).toHaveLength(1);
  expect(alice.reconnects).toBe(1);
});

Crashes and reconnects on demand

@irtio/testing crashes the room, hibernates it or drops a client the way production does, so you can check what each player sees afterwards.

Dozens of scripted players

irt simulate runs bots with real client connections and checks every tick that nobody sees what they shouldn't and no write is silently lost.

npx irt simulate --players 20
20 players, 600 ticks (30.0 s at 20 Hz), seed 1, in 2.1 s
  pass  visibility    11980 client views checked against the room's interest
  pass  prediction    0 mispredictions, at most 0 for one bot (allowed 10)
  pass  room-errors   0 errors logged by the room
  pass  limits        room state peaked at 1840 bytes (allowed 33554432), 20 entities
  pass  script        0 errors thrown by the script and behaviours
trace: .irt/simulate/trace.jsonl

Why it matters for coding agents

A coding agent can't open two browsers and play against itself, so multiplayer code is the code it can least check. With these tools it can: it runs the tests and the simulation, reads the result, and fixes what failed before it calls the work done.

Failures it can reproduce

A run is deterministic for its seed, so a bug the agent finds is one it can run again after its fix.

Output written to be read

The simulation's trace is JSON lines. The last gives the verdict and the first failure, and each failure has its tick and the entity's values in the room and on the client.

Docs that match your version

irt mcp gives the agent the docs for the SDK you installed, andllms.txt has them for any agent.

Testing rooms

Hosting on irt.io

You pay for room-hours, the time a room is awake, at the size you pick. The number of players in a room doesn't change it, and a hibernated or sleeping room costs nothing.

Prepaid credit, no subscriptions

irt.io runs on prepaid credit. You won't be surprised by a bill, or have a monthly subscription to manage.

Each project also caps the rooms awake at once and the room-hours used in a day. You get an alert at 80%, and at a cap players already in rooms keep playing.

An open source room host

The room host is open source and runs a build on your own machine. The client SDKs work against it unchanged, so moving off irt.io is a change of project URL. SeeSelf-hosting.

MeterWhat it countsPrice
Room-hoursAn hour of one room awake, however many players are in it.From $0.005 an hour, by room size
TrafficThe bytes your rooms send to players and receive from them.Free
Voice-minutesPer participant, per minute in a call. Only if you turn voice on.$0.001 a participant-hour
StorageThe room state your hibernated rooms keep, and your replays and clips.Free

irt.io is currently invite-only

We're inviting game developers in small groups, and every invite comes with $10 of credit to try out the platform. Tell us what you're building for access. We want to hear about it.

Pricing

From the blog

  1. Delayed project updates and a brief reconnectOn 25 November, project changes took up to 9 minutes to reach players in the eu region, and fixing it reconnected every player once.

All posts

Build rooms that sleep

Tell us what you're building, and we'll email you an invite with $10 of credit to start.