Play SpecRel 4D online
Two players, two computers, one causal relativistic billiards table. The game connects the two browsers directly, peer to peer. No server or account is needed: you just swap two codes by chat.
The easy way: a lobby link
If this game is served next to a rendezvous server, press Create online lobby under the game. A panel shows a link: copy it and send it to the other player. When they open it you are both in, and the game starts. Until then the game stays paused. If no direct path exists between your two networks, the server also relays the game traffic, so this works on almost any network.
Without a server: swapping codes
- Host: open Host a match. After a few seconds an
invite code (starting with
SR4W) appears. Press Copy and send it to the other player over any chat. - Joiner: open Join a match, paste the invite code into the box and press Connect. A reply code appears. Copy it and send it back.
- Host: paste the reply code into the second box and press Connect.
- The panel disappears on both screens and the HUD's top line names the other player. You're in.
Each pair of codes works once. If something goes wrong, reload both pages and start over with fresh codes. Keep both tabs in front: browsers pause background tabs, so a hidden tab stops playing (and holds up the other player).
Playing
- Fly with WASD, Space and C (or the on-screen buttons), and drag the view to look around. Fire your laser at the reticle with Enter: hit the other ship's hull to score. X brakes. Your ship is rigid, so it only obeys a command once news of it has crossed the hull: by default the controls lag 0.8 s. Press ; before the match starts to fly a lag-free control pod inside the hull instead; the hull follows it.
- You see the other ship as an open cage with the pilot's clock inside it, showing their proper time. You see it, like everything else, where it was when the light reaching you left it.
- WAITING FOR THE OTHER PLAYER is physics, not lag. Fly off fast and come back, and you'll have aged less but moved further into the lab's future than the player who stayed put (the twin paradox). Your view needs everything the other player could still change to be settled, so the game holds you until they catch up. You can still look around while you wait.
- Both players see exactly the same collisions: each browser runs an identical copy of the world.
If it won't connect
- Make sure both of you opened the same build (this page's links) in an up-to-date Chrome, Edge, Firefox or Safari.
- With codes, the connection needs a direct path between the two networks. Most home Wi-Fi works. Some mobile networks and corporate or university networks block direct connections; if the panel says Could not connect, use a lobby on a server with a relay, or try another network (a phone hotspot often helps).
- Mixed up the codes? The host pastes the reply code and the joiner pastes the invite code. The game tells you if you pasted the wrong one.
Other ways to play together
- With a room name of your choice: open the game with
?p2p=host&room=NAMEand?p2p=join&room=NAME. The browsers then swap the codes through the rendezvous server and nobody has to paste anything. If the game page is not served next to a rendezvous server, add&signal=https://your-server. - On one computer: player 1 and player 2 in two tabs (or the Start 2-player match button in the game). The tabs talk to each other directly, with no codes.
- Desktop app: if you build SpecRel from source with Rust, both players run the command below,
then paste each other's
SR4D-code:cargo run --release -- --p2p
To skip the pasting, anyone with a public IP can run a rendezvous server (--rendezvous, UDP port 7778), and both players join the same room:cargo run --release -- --p2p myroom@server.example.com
Desktop and browser players can't play each other.