Spielerando

Bodies

Learning paths through this topic

Squash and stretch a bouncing character so it never looks like it gains or loses material

Stretching a jumping blob along its movement and flattening it on landing gives weight and life, but scaling one side alone makes it look like it inflates or shrivels, and it lifts off the floor when squashed. Here is how to keep the size right and the feet on the ground.

Give every villager a fixed walk offset so hundreds of them do not step in unison

Spawn two hundred workers on the same frame and they all lift the same foot at the same instant, which looks like a parade. Choosing a random offset when they spawn seems to fix it, until the numbers change from one match to the next. This entry shows what to derive the offset from, and why it must not depend on the list order.

Let a walking unit finish its current step when it stops, instead of freezing mid-stride

When a march order is cancelled the legs stop wherever they happen to be, and a whole army stands there with one foot in the air. The obvious cure, playing the walk backwards or snapping to the idle pose, looks worse. This entry says where the feet should come to rest and what to do when the speed has already dropped to zero.

Switching held items quickly makes the hands snap or wait for senseless animations

A player taps through three items in half a second. Every raise-and-lower animation then plays from the start, so the hands jump, or the game queues them up and ignores what was pressed last. Here is how to let the hands change their mind in the middle of a motion.

Let a fighter step forward into a blow without ever standing inside the enemy

A swing with a forward step feels powerful, but if the step is a fixed length, a fighter who is already close walks through his target, and one who is far still hits from too far away. This entry shows how long the step may be, what the step looks like in time, and what must not move.

Move a many-jointed tentacle, neck or crane arm to a target without stretching

When a creature has more than two joints, the limb formula no longer applies, and moving each joint by hand makes the chain stretch, shrink or tie in knots. Here is a way that keeps every piece the same length, keeps the base in place and handles targets that are too far.

Throwing a friend goes off with the wrong speed after a pause or a flick

A throw should leave the hand with the speed the hand had at that moment. Taking the average of the whole carrying time throws a friend slowly after a quick flick, and a sudden stop after a long swing still launches them. Here is how to measure just the right moment.

Many defeated players pile up as physics bodies and the game slows to a crawl

In a big team battle every defeat leaves a floppy body behind, and each one costs time every frame. Deleting the oldest looks like a vanishing trick right in front of the player. Here is how to choose which bodies to freeze, and who must never be chosen.

Make archers and towers aim where a moving enemy will be, not where it is

Arrows aimed at the place where a runner stands now always land behind him, so he looks invincible, while a perfect aim at everything looks unfair. This entry shows how to find the aim point for a moving target, what to do when the target is too fast, and how the body should turn towards that point and not towards the enemy.

Turn the body only after the head has turned far enough, then stop near centre

If the body copies every tiny head movement it twitches; if it waits too long the neck looks broken. Characters that aim or look around need a delay before the feet turn and a rule for when to stop, or they jitter at the threshold. Here is the pattern with its two limits.

Keep a turret aimed at the enemy while the vehicle under it turns

A tank or ship with a turret on top looks fake if the gun swings round with the hull and then catches up late. Here is how to let the base and the gun turn at their own speeds, and why the gun must correct for the base before it does anything else.

Two players carry a heavy crate together and it behaves wrongly when they walk apart

Carrying together is a favourite co-op moment, until one player runs left and the other right. The crate tears in two directions, the bodies drift away from their grips, or one player drags the other along. Here is a rule for who decides the movement and what happens when someone lets go.