Readable beats clever

The instinct with chase behaviour is to make it intelligent - pathfinding, flanking, adapting to the player. For an arcade game that is usually a mistake, because intelligent behaviour is unpredictable behaviour, and unpredictable pursuit cannot be exploited.

The pleasure in a chase game is not evading something unknowable. It is understanding a rule and using it: leading a pursuer into an obstacle, sidestepping a commitment it cannot cancel, breaking a prediction with a sharp turn. All of those require the behaviour to be simple enough to model.

So Candy Monster Escape uses three rules, each expressible in one sentence, and prints all three on the game page.

Direct pursuit

The simplest rule: move straight toward the player's current position at a constant speed.

The implementation

Compute the angle from the creature to the player, then move along it. That is the entire behaviour - three lines of code with no state.

Its exploit is obvious once stated: a creature that always heads directly at you will run straight into anything between you and it. Leading a gumdrop into a cover block is the first technique most players discover, and it works because the rule has no exception for obstacles.

Direct pursuers should be slower than the player. If they are faster, the rule has no counter and the encounter becomes attrition.

Advertising keeps Candy Arcade free. Ads never cover gameplay or controls.

Predictive pursuit

Aim at where the player will be rather than where they are, estimating lead time from distance and speed.

This produces behaviour that feels smarter and is exploited differently. A predictive pursuer is very hard to escape in a straight line, because it is cutting the corner - and very easy to escape with a sharp direction change, because its prediction is now wrong and it has committed to the wrong point.

So the two rules demand opposite responses: run straight from a direct pursuer, turn sharply from a predictive one. Having both in the same arena means the player must identify which is which, which is a much more interesting demand than outrunning either.

Predictive pursuers can be faster than the player, because the sharp-turn counter does not depend on speed. Ours are.

Charging pursuit

Patrol a fixed route, ignore the player entirely, and when they cross your sight line commit to a straight charge that cannot be steered.

This is the most interesting of the three because it has two distinct phases with different counters. During patrol it is not a threat at all and can be positioned around. During a charge it is fast and lethal and completely predictable, because it cannot turn.

The counter is therefore a sidestep at the last moment, which feels dramatic and is mechanically trivial. That gap between how it feels and how hard it is makes charging pursuers the most satisfying to beat.

Fairness requires the sight line to be drawn. Ours renders a translucent band ahead of a patrolling creature, so crossing it is a choice rather than an accident.

Why stating the rules improves the game

Every one of these behaviours is documented on the game page. That might look like giving away the solution, and in practice it raises the skill ceiling rather than lowering it.

A player who does not know the rules plays reactively: something is chasing, so run. A player who knows them plays deliberately: lead the gumdrop into the crate, turn sharply to break the jelly's prediction, cross the liquorice sight line on purpose so the charge commits away from where you want to go.

That third one is the giveaway. Deliberately triggering a charge to control where a hazard goes is only possible if you know the rule, and it is a considerably more interesting play than avoidance.

Speed relationships matter more than the rules

The behaviours only work if the speed relationships are right, and getting them wrong breaks a correct rule.

PursuerSpeed relative to playerWhy
DirectSlowerIt must be escapable by running, so the exploit is a choice not a necessity
PredictiveSlightly fasterThe counter is turning, not speed, so it can afford to be quick
Charging (patrol)Much slowerIt should be positionable around while not charging
Charging (charge)Much fasterThe drama is the commitment, and the counter is the sidestep

If the direct pursuer were faster than the player, leading it into an obstacle would stop being an option and start being the only option, which converts a technique into a requirement.

Escalate count, not intelligence

Once the behaviours are right, difficulty comes from how many are active rather than from making any of them smarter.

Candy Monster Escape adds one creature every twenty-two seconds, cycling through the three types. Two creatures is manageable; five with mixed behaviours requires real spatial management, because the counter to one is often the wrong move against another.

That interaction is where the difficulty lives, and it arrives for free once the individual rules are simple and distinct. Making any one of them cleverer would reduce it, because a less predictable pursuer cannot be planned around in combination with others.

Common mistakes

  • Making pursuit intelligentUnpredictable behaviour cannot be exploited, which removes the pleasure of a chase game.
  • Hiding the behavioural rulesStated rules raise the skill ceiling. Players who know them play deliberately rather than reactively.
  • Getting speed relationships wrongA direct pursuer faster than the player converts a technique into a requirement.
  • Undrawn sight lines for chargersCrossing a sight line must be a choice. Without a drawn line it is an accident.
  • Escalating by making pursuers smarterDifficulty should come from count and interaction, which requires each rule to remain simple.

Practical tips

  • Lead direct pursuers into obstacles; they will not avoid them.
  • Escape predictive pursuers with sharp turns, never straight lines.
  • Sidestep a charge at the last moment - it cannot be steered once committed.
  • Cross a sight line deliberately to send a charge away from where you want to go.
  • With several creatures active, identify each type before choosing a route.

Key takeaways

  • Arcade pursuit should be readable rather than clever, because readable behaviour can be exploited.
  • Direct pursuit runs into obstacles; predictive pursuit is broken by sharp turns; charges cannot be steered.
  • Stating the rules raises the skill ceiling rather than lowering it.
  • Speed relationships determine whether an exploit is a choice or a necessity.
  • Escalate by count and interaction, not by intelligence.

Frequently Asked Questions

Should enemy AI in an arcade game be clever?

Usually not. Unpredictable behaviour cannot be exploited, and exploiting a known rule is where the pleasure in a chase game comes from.

How do I escape a creature that chases me directly?

Lead it into an obstacle. Direct pursuit heads at your current position with no exception for anything in the way.

Why can I not outrun the jellies?

They aim at where you will be rather than where you are, so straight-line running plays into it. Sharp direction changes break the prediction.

How do I avoid a charging creature?

Sidestep at the last moment. A charge cannot be steered once committed, which makes it dramatic and mechanically simple to beat.

Does knowing the rules make the game easier?

It makes it deeper. Knowing the rules lets you trigger a charge deliberately to control where a hazard goes, which is a much more interesting play than avoidance.