NPC chase & escape (demo)
A tiny reference for hostile NPCs that still let weak players escape: aggro radius, leash from home, distance-based de-aggro timer, and a faster player so kiting works. Use WASD / arrows (desktop) or drag on the arena (touch).
Ready.
100% · caught in melee = drain · R restart
What you’re seeing
- Orange ring — aggro around the NPC: enter it and it pursues.
- Cyan dashed ring — stay outside this from the NPC ~2.3s to force de-aggro.
- Grey dashed ring — leash from its home: pulled past this and it resets.
- Or drag it so far from home that leash breaks — it resets immediately.
Pattern to port into your engine
- Aggro radius — acquire target.
- Chase — move toward player at NPC speed.
- Attack only in melee — damage while in short range.
- Leash anchor — abandon if pulled too far from spawn.
- Evade / forgive timer — if target stays beyond “lost” distance long enough, clear aggro.
- Speed curve — player slightly faster than NPC so escape is skill-based, not hopeless.
Note: This tool is for general information only, not professional advice. Full disclaimer
Related tools
- Tic-tac-toe — Play 3×3 noughts and crosses vs the computer in your browser.
- Battleship — 10×10 sea battle vs the computer or a friend online with a room code. Place ships, then hunt and sink.
- Hangman — Guess the word with SVG gallows and a large common-English word list.