Action
Learning paths through this topic
Show the messages of who defeated whom in order, even when they arrive mixed up
The list of defeats on the side of the screen sometimes shows the revenge before the first defeat. This entry shows how to keep the order with a short wait for a missing message, and what to do when a message never comes.
Push enemies away from the hit and let the push fade out
A knockback that always goes to the right looks silly when you hit from the right, and one that never stops slides enemies through walls and off the map. Heavy enemies should barely move. This entry covers direction, weight and the fade-out.
Hit what the shooter saw on screen, even with a slow connection
A player aims right at an enemy, clicks, and the game says miss because the enemy had already moved on the server. This entry shows how to judge the shot against the world the shooter really saw, and where to stop so fast connections are not punished.
Make fights against much stronger or weaker enemies feel right
A low-level hero who meets a mighty monster should feel doomed but not helpless, and a veteran should not get rich from rats. The two directions need different curves. This entry gives both, with limits that keep the numbers sane.
Heal from damage that was really dealt, not from overkill
A vampire-style weapon that heals by a share of damage sounds easy, until a huge blow on a nearly dead rat fully heals the hero, or small hits heal nothing at all. This entry shows what counts as dealt damage and what to do with the leftovers.
Keep a crowd of enemies from attacking all at once
Ten enemies surrounding the hero all swing together and the player dies without ever seeing what hit them. Good action games make a crowd feel dangerous but readable. This entry hands out turns to attack and makes sure no enemy waits forever.
Choose the enemy the player means when locking on
Lock-on picks the nearest enemy, but the player is looking at another one, or it flips back and forth between two enemies at the same distance. This entry weighs where the player points against how far away something is, and keeps the choice calm.
Decide who gets a reward from a shared enemy, so that a single last hit is not enough
If only the player who lands the last hit is rewarded, people wait and steal. If everyone who touched the enemy is rewarded, anyone can tag it and leave. This entry shows a fair share rule and a counting mistake that makes the numbers lie.
Make a monster give up a chase, run home and heal, without being exploitable
Players love to pull a monster far from its camp and hit it from a spot it cannot reach. A monster that never gives up is a cheat for the player; one that gives up too easily is a cheat for the monster. This entry covers the walk home and the fresh start.
Tell each player only about enemies nearby, without them flickering at the edge
Sending every enemy to every player does not scale, and sending only the near ones makes enemies blink in and out when someone walks along the edge. This entry shows a rule with two distances that stops the blinking, and who must always be known.
Make a sword swing hit each enemy once, not every frame
The sword touches an enemy for a few frames and the enemy loses all its health in one swing, or the hit never lands because it was checked at the wrong moment. Here is how to tell the game which frames count and who has already been hit.
Decide miss, dodge, block, crit or hit with a single dice roll
Rolling separately for miss, dodge, block and crit gives odds nobody can state, and a high crit chance quietly steals from the others. One roll along an ordered strip makes every outcome add up cleanly and shows what really happens when the numbers get too big.