On this page

Replicating Chaos: Vehicle Replication in Watch Dogs 2

The talk in short

Watch Dogs 2's bounty mode is four players, peer to peer, with authority over every car, cop and pedestrian spread across the peers. The speaker came from character replication and found vehicles harder: they are fast (at 100 ms of lag a car is 2 to 3 m, half to a full car length, from where its owner has it), they collide with each other and with traffic, and players notice a replica's speed wobbling even on a straight road ("the human eye is really, really sensitive to irregular velocities").

What the kit took, and where

Lesson Where How
Extrapolate along a circle from the yaw rate examples/csharp/src/Example.Core/Net/DeadReckoning.cs: DeadReckoning.Extrapolate, MotionState Closed-form constant-turn-rate motion in the ground plane; a straight line when the turn is negligible or for comparison (curved: false)
Snapshot buffer: interpolate inside, extrapolate past the newest SnapshotBuffer.Sample Between snapshots a cubic Hermite through both positions and velocities, so it meets the extrapolation without a kink; late snapshots are put in their place
Projective velocity blending Replica The published formula: Curtiss Murphy, "Believable Dead Reckoning for Networked Games", Game Engine Gems 2 (2011). Two changes, both the kit's: the target path is the buffer's sample at the render time (Murphy's projection from the last snapshot when extrapolating), and the projection from the old position turns at the new yaw rate. Blend time 150 ms, three snapshot intervals at 20 a second. No acceleration term (the snapshot carries none)
The time offset: lag, speed, collision, damped, clamped TimeOffset Target = (0.5 × one-way lag + up to 60 ms for slow bodies) × (1 − 0.5 × collision likelihood), clamped to 0 to 250 ms, eased with a 1 s time constant and moving at most 10% of real time (so the replica plays at 0.9 to 1.1 times real speed while it moves). All defaults are the kit's choices, measured below, not the talk's numbers
Debug trajectories; interpolate pedestrians; the collision hand-over .agents/skills/multiplayer/SKILL.md, section 2, "Fast objects: extrapolate along a curve" As guidance. The Godot mapping (a replica RigidBody3D driven through _IntegrateForces and state.LinearVelocity; the yaw rate as -AngularVelocity.Y for (x, z)) is marked not tested in Godot

The speed term. The talk calls the constant term proportional to the vehicle's speed, then says slow vehicles get a larger offset (more interpolation, since a missed collision matters less there). Read literally, the two disagree (a term growing with speed gives fast vehicles the larger offset). The kit implements the behaviour described: an extra that is largest when the body is still and falls linearly to 0 at FastSpeed.

What it did not take, and why

Measured

examples/csharp/tests/Example.Core.Tests/DeadReckoningTests.cs: a car integrated in small steps (independently of the closed form), sending its state 20 times a second over SimulatedLink (seeded) at 50, 100 and 250 ms round trip with 10% jitter and 2% loss, drawn 60 times a second. Both sides share a clock in the test; a real peer estimates the owner's. The "slalom" varies speed between 16 and 24 m/s and steers left and right (yaw rate up to 0.5 rad/s).

What 50 ms 100 ms 250 ms
Extrapolating to the present, mean error, 20 m/s on a 30 m circle: curved / straight 0.00001 / 0.020 m (1,900×) 0.00002 / 0.040 m (2,100×) 0.00006 / 0.153 m (2,500×)
The same on the slalom: curved / straight 0.0045 / 0.0106 m (2.3×) 0.0092 / 0.0214 m (2.3×) 0.037 / 0.083 m (2.3×)
Largest change of the drawn velocity in one frame, slalom: blended / drawn directly (the car's own: 0.20 m/s) 0.34 / 1.68 m/s 0.40 / 1.82 m/s 0.55 / 2.59 m/s
Largest step beyond the car's own in one frame: blended / drawn directly 3.6 / 19.7 mm 5.2 / 21.0 mm 10.0 / 29.3 mm
Delay behind the owner: hybrid offset / pure interpolation (lag + 100 ms) 20 / 133 ms (1.2 / 8.0 frames) 32 / 156 ms (1.9 / 9.4 frames) 68 / 231 ms (4.1 / 13.8 frames)
Mean distance from the owner's present position: hybrid / interpolation 0.39 / 2.64 m 0.61 / 3.09 m 1.34 / 4.57 m
Mean distance from the true position at the drawn time: hybrid / interpolation 0.021 / 0.012 m 0.024 / 0.017 m 0.038 / 0.023 m

Pure interpolation leaves the car 2.6 to 4.6 m from its owner's position, the size of gap the talk describes (2 to 3 m at 100 ms of lag); the hybrid offset cuts it to 15 to 30% of that, for a drawn path under 2 cm further from the truth.

Each test was run against a naive version before it was kept: straight-line extrapolation fails the curve, buffer and blending tests; drawing the buffer's path directly fails the blending test; a fixed lag + 100 ms offset (pure interpolation) and a fixed half the lag + 60 ms (no speed or collision term) each fail the hybrid-offset, offset-rule and clamp tests (and the blending test, whose scenario then has too few corrections); an offset set to its target with no easing or clamp fails the clamp test.

Not confirmed