Spielerando

Punch and impact

Learning paths through this topic

A friend's connection drops and their character stands in the way

When someone loses connection in a co-op game, their character either vanishes at once, which is harsh if they come back in a second, or stays solid and blocks everyone. A staged fade-out handles both. Here is how long each stage lasts, what the others can do meanwhile, and how the returning player is treated.

My moves arrive too late or too early at the host and I feel it

If your inputs reach the host just after it needed them, it has to guess, and if they arrive far too early they sit around adding delay. The best fix is not a fixed delay but a gentle change in how fast your own clock ticks. Here is the control rule and why a small range is enough.

A hit knocks me back later than it should and I end up somewhere else

News of a push reaches you after you have already walked on, and applying it now gives a different ending place than the host has. Pushes have to happen at the moment they were meant to, then the moves since replayed. Here is how to do that, and how to make sure a push is never counted twice.

A player who joins mid-game appears right on top of someone

Picking a start spot at random puts the newcomer inside a friend or next to an enemy about as often as you would fear. Choosing the spot that is farthest from everything else is better, but two people joining in the same moment still collide. Here is the choice, the tie rule, and a protective pause scaled to how crowded it is.

A player who respawns glides across the whole map on my screen

Smooth drawing of other players has one blind spot: when someone is moved instantly, such as a respawn, a portal or a checkpoint, the smoothing happily draws them flying there. A tiny marker in the news tells your drawing code when it must not blend. Here is the rule and what to show in the gap.

A crate that two players push jitters or teleports between them

A shared object cannot be calculated by two computers at once, or each shows it somewhere else. One of them has to be in charge at any moment, and handing the job over too eagerly makes the crate twitch. Here is how to choose who is in charge and how long they keep that role.

Old network messages move players backwards after a while

Messages can arrive in the wrong order or twice, and the numbers used to put them in order eventually run out and start again from zero. A naive comparison then treats brand new news as ancient, and players start moving backwards after an hour of play. Here is the comparison that survives the restart.

How much input delay should a two-player game add for a given ping

Adding a deliberate small delay to your own button presses lets the friend's presses arrive in time and reduces how often the game has to redo moments. Too much feels like mud, too little means constant corrections. Here is how to compute the right amount for the connection and how to change it without anyone noticing.

My character lags behind my keys in an online game

When every step has to wait for the host to answer, your own character feels like it walks through mud. The cure is to move right away and quietly fix things when the answer arrives, but the fixing step has a classic mistake that makes you jump forward twice.

A two-player game without a host feels delayed or keeps correcting itself

When two players run the same game directly against each other, waiting for the friend's key press makes everything sluggish, while guessing and being wrong makes things jump. The way out is to guess, keep going, and quietly redo the last moments when the truth arrives. Here is what to keep and how to find where the guess went wrong.

Other players' jumps look like triangles, not arcs

If news about a jumping player only arrives a couple of times per second, drawing a straight line between the points cuts off the top of every jump. Sending a little extra about how fast they are moving lets you draw the true curve. Here is the blend and the one unit mix-up that ruins it.

One lost network message makes my character stutter on the host

Messages with your key presses sometimes simply vanish, and the host has to guess what you did during the hole. Guessing nothing makes you stop, guessing the same again makes you overshoot. Sending a few recent moves along each time almost removes the problem, and the rest has a good default.