Logs / Route 008
The car runs on the driver's computer
In multiplayer, a car's physics runs on the machine of whoever is behind the wheel. What that means when two players swap seats, what the cars going past are actually doing, and the six weeks when nobody could hear them.
A driving sim gives multiplayer a specific headache. The physics in this game is detailed and fairly expensive, and it has to feel instant to whoever is driving. If every car ran on a central server, the internet round trip would sit between the driver’s hands and the front wheels, and it would show in every corner.
So the rule is: whoever sits in the driver’s seat runs that car. Their computer does the full tyre, drivetrain and suspension simulation and tells everyone else what happened. An empty car belongs to the host.
Getting in is a negotiation
That makes the driver’s seat the single source of truth, and getting into a car becomes a small conversation. A player asks to get in. If the car is already theirs, they just sit down. If someone else owns it, the request goes to that player, and the host double-checks: is the car locked, and is the new driver really within 15 m of it? Once that’s approved, the car changes hands, and so does the job of simulating it.
A driver who gets out keeps running the car for 20 seconds. Hop out to open a gate, hop back in, and nothing has changed hands. After 20 seconds, or on a disconnect, the car goes back to the host.
The host has to be the one signing off, because the networking library underneath will accept an ownership change from anyone who asks for one. So the host keeps a ledger of who legitimately owns what, approves the changes it has checked, and treats anything else as an attempted hijack.
The cars going past
Another player’s car isn’t simulated locally at all. Its body is frozen and moved by the network. Updates arrive 60 times a second for cars driven by players and 20 for AI traffic, with only the changed values sent and a full refresh about once a second. Between updates the car is carried forward along its last velocity for up to 0.3 s, then eased onto where it really is, so it glides rather than stutters.
The wheels still turn and the suspension still moves, because anyone would notice straight away if they didn’t. A small bundle of tyre data comes along with each update (wheel speeds, slip, temperature, wear, punctures), and that’s what lets a car that’s only being watched still squeal, smoke and leave skid marks.
Six weeks of silence
That bundle is where the best multiplayer bug so far lived.
At the start of August the tyre squeal, smoke and skid marks switched to a more accurate measure of slip. On the driver’s own car everything sounded better. But remote cars don’t run tyre physics, so they only know what comes over the network, and the new slip values weren’t being sent. From 3 August to 13 September, every other player’s car was completely silent. No squeal, no smoke, no skid marks, however hard it slid.
There was a test guarding the network format, and it passed the whole time. It checked that the old slip value arrived intact, which it did. Nothing was reading it anymore.
The fix was to send the two new values, plus a new test that checks the fields remote cars actually use rather than the ones that happen to be on the list. The lesson went into the project notes: changing what a feature reads is a multiplayer change, even when it looks like a local tidy-up.
What else travels
The host sends the weather every 5 seconds, so everyone gets rained on together. The economy lives on the host and goes out to everyone whenever something changes, and money only ever moves there. Liveries travel with the car, get checked on arrival and are capped at 32 layers, so nobody can send a 4,000-layer masterpiece. Seats, fuel pumps, rentals and repairs are all decided by the host.
The host also watches for cheating: going past 1.6 times a vehicle’s top speed, jumping 60 m in one go, hovering for three seconds. By default it only logs. Enforcement is a server setting.
Talking
Voice chat is proximity-based. Anyone within about 35 m hears a player in 3D, from where that player is standing. For anything further there’s a CB radio in vehicles, with 40 channels, push-to-talk, squelch and a suitably crackly band-limited sound, and handheld walkie-talkies with 8 channels.
Servers
A game can be hosted from the menu, with friends joining over a local network, directly, or through a relay server for the cases where a direct connection won’t work. There’s also a dedicated server, which is the same game started without graphics: 60 ticks a second, up to 16 players. Every server keeps its own saves (money, cars and bills per player, plus a separate world save for each map), and a player who drops out has their slot kept for 60 seconds.
All of that works. It’s just switched off on Hachijō right now, because the island is changing so fast that single-player boots are much quicker to test with. It comes back when there’s somewhere worth sharing.
Filed under multiplayer, deep-dive