Spielerando

Bodies

Learning paths through this topic

An old network packet arrives late and makes a player's body jump back

Packets over the internet can swap places. A message about where someone was a moment ago arrives after the newer one and pulls their body backwards. Counting messages sounds simple until the counter runs out of room. Here is the check that survives that.

Choose how far behind to draw other players when the connection gets worse and better

A fixed delay is either too short for a bad connection, so bodies freeze and jump, or too long for a good one, so everything feels sluggish. Changing it abruptly makes bodies visibly speed up or slow down. Here is a delay that tunes itself and changes without anyone noticing.

Choose the facing picture for units in a tilted-view map from the screen, not the ground

On a map seen from a slanted angle, a unit that walks diagonally on the ground may appear to walk straight down the screen, yet the game shows the picture for another direction. Soldiers then seem to walk sideways. Here is the conversion needed before any direction is turned into a sprite.

Make a worker carrying a heavy load walk slower with matching steps, not just slide slower

Give a porter a speed penalty and he glides at the same step rate as before, only slower, which looks like he is walking on ice. Making the load change look and feel real needs several numbers to change together and not in a straight line. Here is what to change and what must stay put.

Someone joins mid-game and everyone's animations start from the first frame

Sending a body's pose every frame wastes bandwidth, so games only announce changes. Then a newcomer, or a player whose connection hiccuped, sees the wrong frame or the wrong moment of every loop. Here is what to announce so any screen can work out where an animation must be right now.

A player with a bad connection hits people who already ran behind a wall

Making up for lag helps the shooter, and costs the one being shot. If the ride into the past has no end, a very slow connection kills players around corners seconds later. Here is how to choose the moment to look at, how to cap it, and how not to believe the player's own clock.

A dash or lunge ends in a different place on slow and fast computers

If the movement of an attack comes from the animation, then each computer adds up its own little steps and the sum comes out a bit different on every machine. After a few lunges, two screens disagree about where the fighters stand. Here is how to make every machine land on the same spot.

Turn a whole line of soldiers like a door, with the outer ones walking faster

When a formation turns, the units on the inside barely need to move while those on the outside have a long way to go. If everyone walks at the same speed, the line bends, bunches up or leaves stragglers. This entry gives each place in the line its own walking speed and step animation.

Make a building rise faster with more builders, but with fewer gains for each extra one

Five workers on one house should not finish it five times faster, and ten should not all fit around it. Players expect crowding, yet a hard cap feels like a wall. This entry gives a build speed with falling returns, a limit set by free places around the site, and a progress bar that never runs backwards.

Name tags of teammates standing close together pile up into an unreadable smear

In a group the labels above heads land on top of each other. Hiding the farther ones loses information, and nudging them one by one makes them jump around as people move. Here is a stacking rule that stays still when nothing changes and keeps the nearest player's tag where it belongs.

Make a character blink at natural, uneven moments, repeatably

Blinking on a fixed timer looks like a machine, but calling a random number in the middle of the animation makes replays, saves and online play disagree. Here is how to get varied blinks, with now and then a double blink, that come out identical every time for the same character.

A player hit from behind staggers forward, but the animation shows a flinch backwards

A good hit reaction depends on where the blow came from compared to where the character looks. With the wrong test the reaction is mirrored, picks the wrong side exactly at the corners, or restarts at full strength with every hit in a flurry. Here is the choice and a way to let hits pile up gently.