Mazes are confusing for a specific reason, and it is not complexity. It is that most people try to remember the shape of the passages, which is a large amount of information that changes as you move. Remember something else instead and a maze becomes straightforward.
What a perfect maze guarantees
Dungeon Tunnel carves a fresh maze every run with an iterative depth-first search, and the result is always perfect: exactly one route exists between any two cells.
Three things follow from that, and all three are useful while playing.
A dead end is always genuinely a dead end. There is no hidden passage, no secret wall and nothing to search for, so the correct response to a dead end is to turn around immediately rather than to look around.
Backtracking is never a mistake. In a looping maze, retracing your steps can mean you missed something; here it simply means this branch did not contain what you wanted.
And there is exactly one route to anything. Once you have found a cell, you have found the only way to it, so there is no better path to look for later.
Track junctions, not corridors
This is the whole technique and it is worth stating plainly.
A corridor is a lot of information - its length, its turns, where it started. A junction is one fact: at this place, I went that way and did not go those ways.
A maze of 13 by 9 cells has perhaps twenty junctions, and remembering twenty facts is easy. Remembering the shape of a hundred and seventeen cells is not.
In practice this means noticing every branch as you pass it and keeping a rough list of the ones you have not taken. When a branch runs out, you return to the nearest unexplored junction rather than wandering, and the maze collapses into a short sequence of decisions.
Ad space reserved. See README.md to connect an ad unit.
Wall-following, and when it fails
The classic maze technique - keep one hand on the wall and walk - does solve any perfect maze, eventually. It is also almost always the wrong choice here.
Wall-following guarantees a solution and guarantees nothing about length. It routinely walks the entire perimeter of every dead end in the maze, and in a game with a burning lantern the length is the whole problem.
Where it is genuinely useful is when you are completely lost with a resource running low. Wall-following will get you somewhere, reliably, which is better than wandering - and in Dungeon Tunnel getting to the exit at all is worth 400 points a level.
Where the game puts what you need
Nothing in Dungeon Tunnel is placed casually, and knowing the rules removes most of the searching.
The three keys are on the three cells furthest off the shortest route from entrance to exit, computed by breadth-first search. That means they are spread apart and deep, so a circuit beats three sorties.
Oil flasks are placed a little way off the route - close enough that relighting is possible, far enough that it always costs a detour.
Ordinary treasure is laid along the route itself, so the direct path is never empty. And the chest is on the single furthest cell in the maze, which is usually not worth it.
Between them, those rules mean you can predict roughly where things are before you find them: shallow means treasure, deep means keys, and the deepest point means an expensive decision.
Managing the light
The lantern shrinks the visible radius as it burns, from about 250 pixels at full to 120 at the end, and it burns faster at greater depth.
That produces a real change in how the maze plays. At full light you can see junctions before you reach them and plan two moves ahead; at low light you can see the junction you are standing in and nothing else, which is when junction memory becomes essential rather than merely useful.
The practical consequence is to explore while the light is good and execute when it is not. Finding the third key at ten seconds of lantern is much harder than finding it at thirty, so the order of operations matters more than the speed.
Bats are terrain
The only creature in the maze cannot be fought, and it costs four seconds of lantern on contact - the same currency as a wrong turn.
That equivalence is the useful part. A bat is not a threat to be avoided at any cost; it is a four-second toll, and taking the toll to keep a good route is frequently correct.
Players who treat bats as enemies spend more time dodging them than the contact would have cost, which is a common and expensive error in every game where a hazard is priced in the same unit as a detour.
Descending, and why leaving early compounds
Reaching the exit with three keys banks 400 points a level plus twenty-five per second of lantern remaining, and carries eighteen seconds of that lantern into the next maze.
So remaining lantern is paid twice: once as score and once as a head start. A player who consistently leaves with twenty seconds will reach level five comfortably; one who consistently scrapes out at two will not reach level three.
The maze also grows with depth, up to 13 by 9 cells, and stops there. Past that size a lantern run stops being navigation and becomes endurance, which is a different and worse game.
Key takeaways
- A perfect maze has exactly one route between any two cells, so a dead end is never hiding anything.
- Track junctions, not corridors - twenty facts instead of a hundred and seventeen.
- Wall-following always solves a maze and is almost always too long; keep it for when you are lost with a low resource.
- Keys are on the deepest off-route cells, oil is just off the route, and the chest is on the single furthest cell.
- Explore while the light is good and execute when it is not.
- Bats cost four seconds - the same as a wrong turn - so taking the hit to keep a route is often right.
Frequently asked questions
Are the mazes the same every time?
No, a fresh one is carved every run. It is always a perfect maze, so exactly one route exists between any two cells.
Should I use the wall-following trick?
Only when you are lost with a low lantern. It always finds a solution and routinely walks the perimeter of every dead end, which is far too slow when time is the constraint.
Where are the keys?
On the three cells furthest off the shortest route from entrance to exit. That is computed rather than random, so they are always spread apart and deep.
Is the chest worth getting?
Usually not. It is on the single furthest cell in the maze, so the detour is the largest possible one, and 250 points rarely covers it at depth.
How should I handle the bats?
As terrain. A bat costs four seconds of lantern, the same as a wrong turn, so taking the contact to keep a good route is frequently the cheaper option.