Should a worker dig straight through the rock or walk around the mountain
In a game where stone can be mined, the shortest way is often through a wall. Digging takes time, the tool may be too weak, and some rock cannot be dug at all. Here is how a route weighs digging against walking, and what to return.
Why this works
Rock is not a wall, it is a price: the time to dig it out. Put that price next to the cost of walking and a single route search settles whether to dig or to detour, and a tool too weak for the rock simply removes it from the map.
When not to use it
Don't let workers dig freely when digging changes the world in ways you want to control, such as breaking the roof of a cave, undermining a base or opening a way for monsters. Then protect those cells and send the worker around.
In the full entry
- What to build, step by step
- Starting values and the reason for each
- 3 common mistakes and the fix
- A diagram of every state
- 41 lines of example code with 5 checks that pass
- How your AI shows you that it works
Say this to your AI
Use the Spielerando entry "Should a worker dig straight through the rock or walk around the mountain" (read_entry survival-dig-or-detour-route) in my game. Build it step by step, and show me how you checked that it works.Or skip this and connect the MCP: your AI then finds all of this by itself.Connect the MCP