Submit a JSON schema, implement the lightweight state sync points, connect to
server.roomielib.com,
and your game has networked multiplayer. No backend to build, no servers to manage. Free.
How It Works
Roomie is a hosted game relay. You describe your game's data, we handle the networking.
Define your game's state and input types.
Paddles, positions, scores, whatever your game needs. PR it to the repo.
Grab the C++, Rust, GML, or C# client.
They default to server.roomielib.com. Connect, create a room, and go.
The server handles rooms, relay, host migration, and reconnects. You write game logic, not networking code.
Features
Everything is handled by server.roomielib.com. You focus on your game.
Game state defined by JSON schemas. Any game plugs in by describing its snapshot and input types.
The server relays opaque blobs. Your data, your rules.
One player is host and owns the game state. Others send inputs, the host merges and broadcasts. Simple, flexible authority model.
When the host disconnects, another player takes over automatically.
Full state resync. Everyone stays in the game.
Room codes, public/hidden listings, passwords, accept/deny, kick/ban, custom settings.
A complete lobby system.
One server hosts many games. Each app_key gets its own room pool. Your game shares the server but is fully isolated.
server.roomielib.com is running 24/7. No infrastructure to provision, no uptime to worry about. Just connect.
Quickstart
Here's how the included Pong example connects to server.roomielib.com and just works.
Your game follows the same pattern.
Clone roomielib to get the client libraries and the Pong example. The Pong schema is already live on the server.
# Clone and build the C++ Pong example git clone https://github.com/codename-B/roomielib cd roomielib/clients/cpp cmake -B build -DROOMIE_BUILD_EXAMPLE=ON cmake --build build
Every game defines its state and input as a JSON schema. Here's Pong's.
Write yours, open a PR. Once merged, your game is live on server.roomielib.com.
{
"app_key": "pong",
"version": 2,
"encoding": "json",
"types": {
"Vec2": { "x": "float", "y": "float" },
"Ball": { "pos": "Vec2", "vel": "Vec2" },
"Paddle": { "y": "float" },
"PongState": {
"ball": "Ball",
"paddles": "array<Paddle>",
"scores": "array<int>"
}
},
"snapshot_type": "PongState",
"input_type": "Paddle"
}
The client libraries connect to server.roomielib.com by default.
Run two instances. One creates a room, the other joins with the code. That's it.
// Connects to server.roomielib.com:8765 by default RoomieClient client; client.connect("server.roomielib.com", "8765"); // Player 1: create a room client.create_room("pong", client_hash, nullptr); // → receives Joined { room_code: "ABC123", side: 0, ... } // Player 2: join with the code client.join_room("pong", "ABC123", client_hash, nullptr); // Host sends state, peers send input - server relays everything client.send_move(state_blob, len); // host client.send_input(input_blob, len); // peer
Client Libraries
All libraries connect to server.roomielib.com out of the box.
Open source and included in the repo.
Full client library with CMake. Includes a networked Pong example built with Raylib.
ReadyClient library with the same protocol types used by the server. First-class support.
ReadyNative TCP with network_connect_raw. Same binary protocol.
No extensions or DLLs required.
Full .NET client. Varint bincode protocol over TCP or WebSocket.
ReadyThe protocol is open and simple enough to implement in any language that speaks TCP.
Coming SoonProtocol
Length-prefixed frames with bincode + varint encoding. Simple enough to implement in any language. Full spec on GitHub.
| Message | Purpose |
|---|---|
Hello | Connect with app_key + room code |
Move | Host sends authoritative state |
Input | Client sends input to host |
RoomControl | Create, settings, kick, ban, leave |
ListRooms | Query public rooms for an app |
Ping | Keepalive / RTT measurement |
| Message | Purpose |
|---|---|
Joined | Room code, peer ID, side, state |
PeerJoined | Another player entered the room |
PeerLeft | A player disconnected |
StateUpdate | Broadcast game state blob |
PeerInput | Forwarded input (to host only) |
RoomEvent | Host transfer, kick, settings change |