Spelunky is © 2008, 2009 Derek Yu and Mossmouth, LLC, and is used under the [Spelunky User License v1.1b](https://spelunky.ai/LICENSE.txt). spelunky.ai is an unofficial fan project, not affiliated with or endorsed by Mossmouth. The game and its assets may not be sold.

Music by George Buzinkai and Jonathan Perry; sound effects made in SFXR. From Spelunky Classic 1.1, © 2008, 2009 Derek Yu and Mossmouth, LLC.

# The Tunnel Man skips his first visit

From the spelunky.ai wiki: <https://spelunky.ai/wiki/tunnel-man-skips-first-visit>. Verified against the spelunky.ai port [v0.1.13](https://github.com/851-labs/spelunky/releases/tag/v0.1.13) on 28 October 2026.

The Tunnel Man skips his first visit is a quirk of Spelunky Classic in which he isn't in his screen the first time it's reached.

| Quirk     |                                                                                                                                                                                                         |
| --------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| Status    | GML + Oracle                                                                                                                                                                                            |
| Where     | [`objects/oTransition/create.gml:47-60`](https://spelunky.ai/wiki/source/objects/oTransition/create#L47-L60)                                                                                            |
| Pinned by | `fidelity/replays/tunnelman-seed-2-mines-over-max.txt`                                                                                                                                                  |
| Row       | [docs/quirks.md §1, Bugs and leftovers in the 1.1 source](https://github.com/851-labs/spelunky/blob/main/docs/quirks.md#1-bugs-and-leftovers-in-the-11-source): “The Tunnel Man skips his first visit.” |

The [Tunnel Man](https://spelunky.ai/wiki/tunnel-man) digs the [shortcuts](https://spelunky.ai/wiki/tunnel-man-shortcuts), and waits for the player's money in the
screen at the end of an area: after level 4 for the first. On a fresh install, the first player to get there
finds the screen empty. Each shortcut is owed $1 more than its price at first, and the screen only takes that $1
off instead of showing him.

## What happens

On a fresh install, the player takes the exit of level 4, the last of [the Mines](https://spelunky.ai/wiki/mines). The screen between
levels tallies the loot, and nobody is there; X skips it, and the Jungle's first level loads[^1].

**Clip: The Tunnel Man misses his first visit.** On a fresh install, the player leaves the Mines' last level. The transition to the Jungle shows the tally and no Tunnel Man, though no shortcut has been paid for yet; he only comes on the next visit. ([video](https://spelunky.ai/wiki/media/clips/quirks/tunnel-man-first-visit/clip.mp4))

## Why

What's owed on the shortcuts is kept in the high scores table, and a fresh table stores the first two $1 above
their prices[^2]. Paying off the level 9 shortcut does the same to
the level 13 one[^3]. The screen between levels makes the Tunnel Man only
if what's owed is down to the price, and otherwise takes 1 off it:

```gml objects/oTransition/create.gml:47-51
if (global.tunnel1 > 0 and global.tunnel2 > 0 and isRoom("rTransition1x"))
{
    if (global.tunnel1 > global.tunnel1Max) global.tunnel1 -= 1;
    else instance_create(96+8, 176+8, oTunnelMan);
}
```

[`objects/oTransition/create.gml:47-51`](https://spelunky.ai/wiki/source/objects/oTransition/create#L47-L51), from `spelunky.gmk`, Spelunky Classic 1.1's source, © 2008, 2009 Derek Yu and Mossmouth, LLC ([Spelunky User License v1.1b](https://spelunky.ai/LICENSE.txt)).

So the first visit to each of his three screens takes the $1 off and shows no one, and he first shows up on the
next[^4][^5]. What's owed goes back into the table
when the game ends in a death or a win[^6].

## Reproducing it

Start with a fresh high scores table (a new install) and reach the end of the Mines. It happens to every new
player, once for each shortcut. The replay of the clip starts from a fresh table: the screen after level 4 loads
on frame 4231, takes what the level 5 shortcut is owed from $100,001 to $100,000, and makes no Tunnel Man; level 5
loads on 4264[^7]. The screen after level 8
does the same for the level 9 shortcut[^8], and
the screen after level 12 for the level 13 one, once the level 9 one is paid off[^9].

## In the port

The spelunky.ai port reproduces it exactly: it's in docs/quirks.md's list of the 1.1 source's bugs[^5], and the oracle's fingerprints of the replays pin each empty screen. No option turns it off.

## FAQ

### Why isn't the Tunnel Man after level 4 in Spelunky Classic?

The first time a game reaches the screen after level 4, he isn't there: the game only takes $1 off what the level 5 shortcut is owed. He's there from the next game on, once this one has ended in a death or a win.

### Does the Tunnel Man skip his first visit for every shortcut?

Yes. The level 5 and level 9 shortcuts each start $1 above their price, and paying off the level 9 one sets the level 13 one $1 above its price too, so each of his three screens is empty the first time.

### Is the missed visit lost for good?

No, as long as the game ends in a death or a win, which saves what's owed in the high scores table. Then the next time the player reaches that screen, the Tunnel Man is there and asks for the full price. Quitting the game before that loses the $1, and the screen is empty again next time.

## See also

- **Related:** [Tunnel Man](https://spelunky.ai/wiki/tunnel-man), [Tunnel Man shortcuts](https://spelunky.ai/wiki/tunnel-man-shortcuts), [The Mines](https://spelunky.ai/wiki/mines)

## References

[^1]: Clip quirks/tunnel-man-first-visit

[^2]: [`scripts/scrResetHighscores.gml:32-33`](https://spelunky.ai/wiki/source/scripts/scrResetHighscores#L32-L33)

[^3]: [`objects/oTunnelMan/step.gml:24`](https://spelunky.ai/wiki/source/objects/oTunnelMan/step#L24)

[^4]: [`objects/oTransition/create.gml:52-60`](https://spelunky.ai/wiki/source/objects/oTransition/create#L52-L60)

[^5]: Quirk 1 (docs/quirks.md)

[^6]: [`scripts/scrUpdateHighscores.gml:97-99`](https://spelunky.ai/wiki/source/scripts/scrUpdateHighscores#L97-L99)

[^7]: Replay `fidelity/replays/tunnelman-seed-2-mines-over-max.txt`

[^8]: Replay `fidelity/replays/tunnelman-seed-9-jungle-over-max.txt`

[^9]: Replay `fidelity/replays/tunnelman-seed-9-jungle-paid-ice-over-max.txt`

### Source code

- [`scripts/scrResetHighscores.gml`](https://spelunky.ai/wiki/source/scripts/scrResetHighscores)
- [`objects/oTunnelMan/step.gml`](https://spelunky.ai/wiki/source/objects/oTunnelMan/step)
- [`objects/oTransition/create.gml`](https://spelunky.ai/wiki/source/objects/oTransition/create)
