Fighting monsters without getting hit
Why monsters get stuck: NPC pathing and safespots, explained on a grid
Why many safespots work in OSRS: monsters pursue directly and stop when their available steps are blocked, while you plan a route. Tick by tick, on a grid you can test.
Practise this: Flinching 3: The Gate
Many safespots work because a pursuing monster in Old School RuneScape moves directly towards you rather than planning a detour around an obstacle. When all of the steps it may try are blocked by a fence, a rock or a corner, it stays where it is. You, on the other hand, can path around obstacles. Microgrind's Brutes use this direct pursuit rule.
This page shows the rule on a grid, step by step, using Microgrind's own pathfinder. Every trail drawn here was produced by the same code the Flinching drill runs, and there is a grid at the end where you can place a monster yourself and watch where it snags.
Two kinds of walking
There are two movement rules at work, and safespots live in the gap between them. The OSRS Wiki describes the player's pathfinding as a breadth-first search, and an NPC's movement as naive: diagonally towards the target, then straight once there is no diagonal left (Pathfinding, OSRS Wiki). Microgrind uses the same split:
- You plan. Click a tile and a breadth-first search finds the shortest route over the terrain, around walls and through gaps. You walk one tile per tick, or two while running.
- Monsters don't. Each tick a chasing monster looks at where you stand right now and tries a single step towards you. It never looks ahead, never backs up and never goes the long way round.
When several routes are equally short, the order in which the search checks a tile's neighbours decides which one you get. Microgrind checks west, east, south and north, then the four diagonals, the order the Wiki gives, so on open ground you tend to walk straight first and take the diagonal at the end.
Both rules move on the game tick, 600 ms at a time, and both are part of the same tick order: inputs, then every monster, then you.
The monster step rule
Every tick, a monster that is chasing you and is not yet in melee range does this:
- If you are off to one side and also above or below it, it tries the diagonal step towards you.
- If that is blocked (or you are straight east or west), it tries the east or west step towards you.
- If that is blocked too (or you are straight north or south), it tries the north or south step.
- If none of them works, it stands still this tick and tries again next tick.
A step is blocked by a wall tile, by another creature standing there, or, for a diagonal, by a wall on either of the two tiles it would brush past. Nothing cuts a corner, for monsters or for you.
On open ground (left) the monster closes the distance with diagonals until it lines up with you, then walks straight in. Put a wall on that straight line (right) and it walks up to the wall and stops. There is a gap at the top, and the dotted line shows you would take it without a second thought. The monster never will, because the gap is not in the direction of any step it is allowed to try.
Off the line (left) the fallback steps make it slide: blocked diagonally, it takes the straight step instead, tick after tick, until it clears the end of the wall. Note the corner: even when the diagonal tile itself is open, it will not squeeze past a wall corner to reach it.
Why diagonal tiles are safe from melee
Melee needs a tile directly north, south, east or west of its target. A monster standing diagonally next to you cannot hit you with melee, so it keeps trying to step onto one of the two side tiles. If both are blocked (right-hand grid above), it is stuck one diagonal away for good. The same rule works in your favour when you attack: you cannot melee diagonally either, so the drills always walk you to a side tile first.
The OSRS Wiki gives the same restriction for almost all melee weapons in the game, with exceptions such as halberds, which reach two tiles (Attack range, OSRS Wiki).
Can it reach me from this tile?
| Your tile | Can it hit you? | Why |
|---|---|---|
| (1, 1), between the two stones | Safespot | After 2 ticks it is diagonally next to you, where melee can’t reach, and both its side steps are stone. |
| (4, 0), behind the pillar | Safespot | It stops after 1 tick, because its only step towards you (south) is blocked. |
| (3, 0), beside the pillar | Can hit you | Nothing blocks its straight line, so it is beside you in 3 ticks. |
| (0, 0), far corner | Safespot | It stops after 2 ticks, because every step it may try (south-west, then west, then south) is blocked. |
| (1, 4), open ground | Can hit you | Nothing blocks its straight line, so it is beside you in 2 ticks. |
A fence safespot, tick by tick
Flinching 3: The Gate is built around this. A fence runs across the arena on row 5, with a single gap at (5, 5). The Brute has no territory, so the only way to get away from it is the fence. Below is the run its briefing describes, played by the sim with the Brute's real numbers: walk through the gap, hit it once, then run back out and stand beside the gate at (4, 4).
| Tick | You | Brute | What happens |
|---|---|---|---|
| 1 | (5, 4) | (5, 7) | You run north. |
| 2 | (5, 6) | (5, 7) | You reach a tile next to it and swing. |
| 3 | (5, 4) | (5, 7) | Your hit lands. The Brute is angry now, but its first swing is 2 ticks away. You run back south through the gate. |
| 4 | (4, 4) | (5, 6) | The Brute steps south. You step west. |
| 5 | (4, 4) | (4, 6) | The Brute steps west. |
| 6–12 | (4, 4) | (4, 6) | Its only step towards you (south) is a fence tile, so it stands still. |
| 13 | (4, 4) | (5, 7) | It calms down and steps back towards where it started. |
The important rows are the ones where the Brute stops moving. You are 2 tiles away, directly across the fence. Its only legal step towards you runs into a fence tile, and it has no rule that says "go back to the gap", so it stands there until its temper runs out on tick 13, 10 ticks after your hit landed (its retaliation delay of 2 plus the 8-tick combat timer, both explained in the flinching guide). Damage taken: 0.
That is the whole trick behind most safespots: pick a tile where the straight line from the monster to you is blocked, and where sliding along the obstacle does not lead it round the end.
What Microgrind models, and what it doesn't
Microgrind recreates the movement rules that make safespots work. It does not try to be a full copy of the game's world, and some things that matter for real safespots are deliberately left out.
| Rule | Microgrind |
|---|---|
| Monsters step diagonal first, then east/west, then north/south, and stand still when all are blocked | Modelled, tested |
| No corner cutting, for monsters or players | Modelled, tested |
| A monster cannot step onto your tile or another creature's | Modelled, tested |
| Player route: breadth-first search; walk 1 tile per tick, run 2 | Modelled, tested |
| An unreachable destination sends you to the closest reachable tile instead | Modelled, tested |
| Melee only from a tile directly north, south, east or west | Modelled, tested |
| A calmed monster walks back towards where it started | Modelled, tested |
| Monsters bigger than one tile | Not modelled |
| Ranged and magic attackers, line of sight, longer melee reach | Not modelled |
| The game's route search area and path length limits | Not modelled |
Try it on a grid
Place yourself and a monster, draw some walls, then step it forward a tick at a time. The faint trail shows where the monster will go if you stand still, and marks the tile where it would snag. Switch to "Walk" and click a tile to see your own route, which the monster then chases.
How to practise it
- Flinching 3: The Gate: hit the Brute through the gate, slip out to the side and wait. The level shows its anger timer, so you can see the snag and the calm-down happen.
- Flinching 4: Count to Eight: two gaps and no timers. Pick a side tile where the fence is between you, and count the ticks yourself.
In both, the move that matters is the same: once your hit is on its way, get to a tile the Brute cannot reach in a straight line, and do not come back until it has calmed down.
Quick answers
What is a safespot in OSRS?
A tile where a monster cannot reach you to attack, usually because an obstacle sits on the straight line between you and its simple movement rule will not take it around.
Why do NPCs get stuck behind things?
Many monsters use direct pursuit instead of planning a detour. Each tick they try a step towards you (diagonal first, then straight), and if every step they may try is blocked, they wait. NPCs with routefinding can go around obstacles instead.
Can monsters attack diagonally with melee?
Almost never: the OSRS Wiki lists diagonal attacks as off limits for nearly all melee, and Microgrind's melee always needs a tile directly north, south, east or west of the target. A monster stuck on a diagonal tile with both side tiles blocked cannot hit you.
Practise this
Free in the browser, no sign-up. Slowed ticks and other practice aids are in each level's settings.
Sources
Not affiliated with or endorsed by Jagex Ltd. Old School RuneScape is a trademark of Jagex Ltd.