There is only one way to take up less space than a cunningly compressed network packet, and that is if you don’t send any data at all.
Obviously, when you send no data, things are unlikely to remain in sync from one machine to another. But you know what? Sometimes that doesn’t matter.
- If it matters to gameplay, you must synchronize it
- Most things do not matter to gameplay
Sounds and animations rarely need to be synchronized. If the network tells you a character is moving rapidly forward, each machine can independently work out that they ought to be playing the run animation and triggering footstep sounds at regular intervals. It doesn’t matter if the footsteps happen at slightly different times on each machine, so there is no need to bother synchronizing this over the network.
Case study: when you overtook another rider in MotoGP, 5% of the time they would play a “shake fist at you” animation. When you crashed, we would choose between many different animations of the rider flying through the air. This was random, and not synchronized over the network. One player might see the fist shaking while another did not, and during crashes each machine would display the rider tumbling in a different direction. We didn’t have enough bandwidth to properly synchronize this stuff, but it didn’t matter because the animations did not affect gameplay, so nobody noticed or cared if they were out of sync.
Similarly, in a shooter there is usually no need to synchronize the exact position of bullet hole decals, or the fact that you shot out a pane of glass, or which direction each spent cartridge particle is flying. Just send a single “I’m in ur game, firing ur gun” boolean, and each machine can figure the rest out for themselves. It doesn’t matter if they each get a slightly different result, as long as the resulting parallel universes are approximately similar.
Once you get in the habit of not bothering to send information, it is amazing how much you can get away with.
Case study: in MotoGP we had advertising billboards and cones positioned around the edges of the track. If a bike collided with one of these, both object and bike would go flying. If a bike repeatedly nudged up against one while moving slowly, they could gradually move the billboard to a new location.
Most players took their racing very seriously, organizing tournaments to see who was fastest, but some griefers wanted to spoil things for everyone else. They would ride backward around the track, competing to see who could cause the biggest pile-up.
The griefers learned that if they were patient they could move several billboards out into the middle of the track, creating a barricade. The serious racers would come flying around the bend, crash into the barricade, and the dust would fly.
Thing is, this didn’t actually work!
We never bothered to synchronize the position of the billboards and cones over the network. We didn’t have enough bandwidth to do that.
Here is what actually happened:
- The griefing player makes many small nudges, moving their bike slowly forward and backward.
- We used a peer-to-peer architecture, so on the griefing machine, these movements are precisely controlled.
- On other machines, prediction algorithms estimated where the griefer was likely to be. This was roughly right, but not exact.
- On the griefing machine, the billboard is gradually nudged out into the middle of the track.
- On another machine, the first nudge is slightly off to the left. This leaves the billboard in a position that is close, but not quite right. Because of that, the next nudge knocks it even further to the left. Now the griefing bike is trying to nudge the billboard, but our local version of the billboard is not where he thinks it is, so subsequent nudges have no effect. Because we do not synchronize the position of the billboard, this situation is never corrected.
- End result: the griefer sees a barricade, but other machines do not.
- Serious players come around the corner, then race straight past, since the barricade was never created on their machines.
- On the griefing machine, there is a barricade. Our prediction algorithms detect a collision, so they trigger the crash animation. Dust. Sparks. Rider goes flying through the air. A moment later, a new network packet arrives. Oops! Apparently there wasn’t really any collision at all. We’d better respawn the bike onto the track and carry on.
Despite millions of players putting more hours into the game than could possibly be healthy, nobody ever noticed this was not consistent.
The griefer saw a spectacular crash, and assumed everyone had been respawned after it.
The serious racers finished their serious race.
And they all lived happily ever after.