Spielerando

State machines

State machine

Keeps a character, door or game mode in exactly one state, and lets it change only through moves you listed. A move that is not on the list is refused with a plain reason, so your AI can show you the list and the refusal as proof of what can and cannot happen.

Nested state machine

States inside states: a hero who is alive can be on the ground or in the air, and on the ground can be idle or running. A rule like "can die" is written once on the outer state and works everywhere inside it.

Behavior tree

How a computer-controlled character decides what to do: a tree of options in order of importance, checked every frame. Each frame it writes down what it tried and what came of it, so your AI can show you that record as proof of why the guard did what it did.

Quest state machine

Keeps track of every quest: what stage it is at, which facts of the game are true, and which quest depends on which. Because quests are written as plain lists, your AI can show you exactly why a quest will not start, and hand you the list of what depends on what as proof.

The ability is ready on my screen, but the host says it is still cooling down

A well-timed button press gets refused by a few thousandths of a second, so the game feels unfair. Letting everything through invites cheating. This entry shows a small allowance that stays fair and does not add up over time.

Players are removed for being away when they were only watching a cutscene

A game that removes idle players needs more than a stopwatch. Watching a story scene, waiting after death or sitting in a menu is not being away. This entry shows a warning first, the moments that should not count, and how the clock restarts afterwards.

Let the player cancel an attack into a dodge, but only at the right moment

Fighting games and action games feel sloppy if you can cancel any time, and unfair if you can never cancel. This entry builds the short moment where a cancel works, including a button pressed a little too early.

Territory borders that flip back and forth when two cultures are about equal

Many strategy games give each land square to whoever has the most influence there. Where two powers meet, the square changes owner on every tiny shift and the border looks like it is boiling. This entry shows how to keep borders calm without freezing them.

A team burst skips a whole phase of the boss fight

Four players unload everything at once and the boss goes from nearly full to dead, or jumps past a phase with all its scripted moments. This entry shows how to make sure every stage of the fight happens, however hard the team hits.

A computer helper takes over for a dropped player, then fights for the controls

When a teammate drops, the game can keep their character useful. The trouble starts when they come back in the middle of a move, or both the human and the helper act at once. This entry makes the hand-over clean in both directions.

Build times that stay right when the game is paused or sped up

A timer that stores a finishing time looks fine until the player pauses, speeds up or loads a save. Then buildings finish too early, too late or all at once. Here is the way to count a build so that every speed setting gives the same result.

More builders on one site should help, but not twice as much

If every extra builder adds the same speed, the player stacks the whole town onto one wall and the economy turns into a trick. If extra builders add nothing, they feel pointless. Here is how to shape the curve and keep the work when builders come and go.