Bodies
Learning paths through this topic
A player riding on a teammate's back wobbles, turns with them or flies off on release
Hanging on a friend is a funny co-op idea and a pile of small problems. The rider's body must follow the other body's turns, but their own head should still look around, within limits, and jumping off should carry on the motion they had. Here is the placing rule.
A player released from a monster's grip falls straight down or snaps away
In co-op, a boss can pick up a teammate with a scripted pose. When the grip ends, control must go back to the physics. If it does so naively, the player stops in mid-air for a moment, drops, or jumps to a different place. Here is a clean handover from animation to physics.
An attack seen on another screen starts late, so the swing looks too slow or too short
Over the network, the news that someone swung a weapon arrives after they started. Playing it from the start makes every hit look delayed; skipping into the middle loses the wind-up. Here is a middle way that hides the lateness, and the point where it is better to give up.
My character swings at once, but the server says no, and the swing vanishes with a pop
To feel instant, a game plays your action before the server has agreed. When the server refuses (stunned a moment ago, out of energy) the swing must disappear. Cutting it off looks like a glitch. Here is how to take it back gently, and what to do when no answer ever comes.
Let rows of archers or musketeers shoot in turns, so the volley rolls along the line
When a block of shooters all release on the same frame, it looks like one big flash every few seconds and there is nothing in between. Rolling fire spreads the shots over the reload time. This entry gives each row its slot, keeps the total rate the same and tells how to deal with rows that have lost their members.
The server fixes my character's position and the whole body jerks
Online, the server sometimes disagrees with where your character thinks it is and moves it. Applied directly, the body twitches and the camera shakes with it. Here is how to hide small corrections completely, and when hiding would be the wrong thing.
A remote character suddenly spins all the way round when it turns past north
Facing directions are circles, not lines. When another player turns just a little past the point where the numbers start over, the smoothing can send the body on a full lap. This also bites when the direction is squeezed into one small number for the network.
A remote character flickers between standing and walking when its speed is almost zero
The speed of other players is computed from slightly uneven updates, so it wobbles. Right at the line between standing and walking, the character twitches between the two looks many times a second. Here is a way to stop the flicker without making the character slow to react.
A player respawns or teleports and their body glides across the whole map
Smoothing between two positions is wrong when the player did not travel between them. After a respawn or a portal, other screens show a ghostly slide through everything. The tempting fix, a distance limit, breaks something else. Here is the reliable one.
Sending every player's position every tick eats the bandwidth of a big match
Most of the time a body just keeps moving the way everyone already expects, or stands still. Telling everybody everything is wasteful, and telling nobody until something happens leaves idle players looking disconnected. Here is a rule for when a body must speak up, and why it has to match what the receivers assume.
Send a joint's turn over the network in four bytes without it flipping or drifting
A full body has many joints and each one's rotation is four numbers. Sending them all as they are is far too heavy, and the obvious shrinking either breaks the rotation or makes arms flip when two screens round differently. Here is a packing that keeps joints stable.
Squeeze the direction a player looks into a tiny message without visible steps
Everyone's aim and look direction is sent many times a second, so every bit counts. But squeezed carelessly, a head turns in visible notches, or a player who looks straight up suddenly looks behind them. Here is a compact format and the one edge where it breaks.