Networking
For the team, networking decides three things: whether a player's own car feels instant, whether a ram or a net catch looks the same on every screen, and whether a session can be hosted at all from a university lab. This chapter covers the model chosen, the settings that make it work, exactly what is sent, and what real online tests found.
Choosing the network model
Shady Shipping is a physics-driven car chase for up to five players. Contact between cars decides the match, so every screen must agree on it. Four established models were compared.
| Model | Strength | Weakness | Verdict |
|---|---|---|---|
| Deterministic lockstep | Only inputs sent; tiny bandwidth | Needs identical physics on every PC; Chaos is not | Rejected |
| Server authority with snapshot interpolation | Smooth, consistent remote cars | Remote cars shown slightly in the past, so rams miss | Kept for traffic only |
| Server authority with prediction and resimulation | Own car instant; server decides outcomes | Corrections can show as a small hop | Chosen |
| Client-authoritative movement | Simple and responsive | Cheating; each side believes its own crash | Rejected |
The chosen model works like this. Each player's game runs the car physics slightly ahead of the server, so their own car reacts the moment they press a key. Other players' cars are moved forward from the last input received for them, easing off towards no input. When the server's version of a car disagrees with the client's, the client rewinds to that physics frame and replays every frame since with the corrected data. That replay is called resimulation. Chaos, Unreal's physics engine, supports this natively in UE 5.8.
Because remote cars are predicted forward instead of shown in the past, a cop and the van meet at roughly the same moment on every screen. That suits the net and the arrest ring. The cost is that a sudden brake or swerve by a remote player makes the prediction briefly wrong, and the correction can show as a small hop that grows with latency (the delay for a message to reach the server). Server-side rewind, as used for instant-hit shots in shooters, was rejected because it is far more complex for vehicle physics.
Engine settings
These settings are part of the architecture, not preferences. Each one is in the project's config files and fixed a real failure.
| Setting | Value | Why |
|---|---|---|
| Physics prediction | On, with history capture, up to 1,000 ms | Turns on resimulation; covers the worst latency tested |
| Async physics | On, fixed step 0.016667 s (60 Hz), no substepping | Resimulation needs a fixed step |
| Player car replication mode | Resimulation | Own and remote cars predicted |
p.Vehicle.DisableConstraintSuspension | 1 | Constraint suspension crashed online in the prototype |
Net.IsPushModelEnabled | 1 | Only values marked as changed are sent |
NetServerMaxTickRate | 60 | Server sends at the physics rate |
| Client rate and connection speeds | 60,000 bytes a second | Room for the per-player budget plus headroom |
| Connection timeouts while joining | 600 s | Players wait while the server loads the city |
LocalPlayerClassName | USSLocalPlayer | Every join carries the player's profile id |
| Player car update rate | 30 a second, always relevant | Cars must never pop in at chase speed |
The fixed physics step matters beyond networking. Anything that pushes a car (nitro, the net's rope, burst tyres, a garage driving the van) runs inside FSSArcadeVehicleSimulation on the physics thread. A force added from ordinary game code would not be replayed during resimulation, so the car would fight its own corrections.
Replication rules
Every replicated value follows these rules.
| Rule | How it is applied |
|---|---|
| The server owns outcomes | Pickups, cash, damage, wrecks, catches, arrests and strikes are decided only on the server |
| Clients predict their own car | Input is applied at once, recorded and replayed if the server disagrees |
| Send state, not ticks | Clocks and timers are sent once as a server end time; every PC counts down itself |
| Send a plan, not a stream | Drives, the name wheel and cutscenes send a start time and a seed; each PC plays them |
| Reliable for rules, unreliable for flavour | Game-changing messages are reliable; cash pops and pedal effects are not |
| Private data goes to its owner only | The courier's job and each player's ability picks are owner-only |
Effect windows
Police tools change how a car drives, so they must land on the same physics frame everywhere. The server stores each effect on the car as an effect window: which effect, its strength and the server physics frames it covers. Every machine applies it on those frames, and a machine that receives it late rewinds to its first frame.
| Effect | Caused by |
|---|---|
| Snare and Rope | The bumper net |
| Tyres | A spike strip |
| Slow | Lights Out |
| Wreck | The van or a cop reaching 0 HP |
| Drive | A repair garage or the round's drive-in |
| Drag | Testing |
Engine physics actions were tried first. At 150 ms latency only 1 of 7, then 8 of 13, applied, because an action arriving after its frame was stored was never used. Effect windows started on the server's frame on every machine at 0 to 200 ms with up to 5% packet loss, with the largest correction 15 cm. Nitro rides inside the car's own recorded input, in its unused yaw channel, so it replays with everything else.
What is replicated
| What | How it travels | Who receives it |
|---|---|---|
| Match phase, strikes, stars | Properties on ASSGameState, push model | Everyone |
| Round cash and wallet | Properties on ASSPlayerState | Everyone |
| Courier's job | Property on USSParcelComponent | Courier only |
| Cargo shown on the van | Loaded and doors-open flags only, never the tier | Everyone |
| Heat (pings, sightings, last seen) | Properties on USSHeatComponent | Everyone; drawn only on police radars |
| Arrest progress | Start value, time and rate on USSArrestComponent | Everyone |
| Drop-in stage and zones | Properties on USSDropInComponent | Everyone |
| Ability picks | Owner-only property on USSAbilityComponent | That player |
| Ability timers (cloak, smoke, drone, EMP) | End times on each ability's component | Everyone |
| Car hit points and recent hits | Property on USSHealthComponent | Everyone |
| Fitted garage items | Property on USSVehicleLookComponent | Everyone |
| Tuning tables | CSV text on ASSTuningReplicator | Everyone |
Not replicated at all
Car sounds, skid marks, smoke, damage looks, cameras, the radar, route arrows, ability shakes and rumble, and the drive-in film are all worked out on each PC. The driver sends throttle, brake and boost state at most 15 times a second so other PCs can draw lights and flames; everything else comes from replicated movement.
RPCs
An RPC (remote procedure call) is a one-off message asking another machine to do something (Epic Games, n.d.d). Every server RPC is checked before the server acts on it.
| RPC | Direction | Reliable | Server checks |
|---|---|---|---|
ServerPutNetOut and other ability presses | Client to server | Yes | Right side; caller picked that ability; it is ready |
ServerSetDitchHeld | Courier to server | Yes | Only counts while a parcel is on board |
ServerPick (drop zone) | Courier to server | Yes | Choosing stage, and a real zone |
ServerLoadedIn | Client to server | Yes | Sent once the PC runs smoothly after loading |
ServerSetReady, ServerBuyOrFit, ServerSetAbilities | Client to server | Yes | Lobby phase, side, ownership and wallet |
ServerSetHorn, ServerSetLamps | Client to server | Yes | Cosmetic state for that car only |
ServerSetDriverFX | Client to server | No | Pedal state for effects only |
ClientLoaded, ClientDelivered, ClientDitched, ClientMadeHot | Server to courier | Yes | Feedback; state already replicated |
ClientRoundResults | Server to each player | Yes | Sent once at round end |
ClientCashPopup | Server to one player | No | Cosmetic |
ClientRefused, ClientRepairRefused | Server to one player | Yes | Feedback only |
Round start and loading
The round start follows the same rule as everything else: the server decides, each screen shows it. Two problems found in testing shaped it.
| Problem | Fix |
|---|---|
| A slow PC stalls for seconds after loading and missed the drive-in | Each PC sends ServerLoadedIn after 15 smooth frames; the server waits for all, up to 90 s |
| A late phase update left a screen stuck on the countdown | Each screen ends the countdown from its own synced clock; measured within 0.25 s of the server |
Information the police must not have
The design hides the van from the police except through their radar. In the code, the courier's job and cargo tier never reach a police PC, and the police radar only draws what USSHeatComponent sends. However, every player car is always relevant (sent to every player whatever the distance; Epic Games, n.d.e), so the van's exact position does reach police PCs, and a modified client could read it. The original design limited the van to cops within 150 m. That was dropped because cars past the engine's 150 m cut-off vanished from other players' screens, and with at most five cars the cost of sending all of them is small. The team accepts the cheating risk for a university prototype.