Bay 12 Games Forum

Please login or register.

Login with username, password and session length
Advanced search  

Author Topic: Slightly odd miner diagonal pathfinding  (Read 512 times)

Teldin

  • Bay Watcher
  • Canadian Bacon
    • View Profile
Slightly odd miner diagonal pathfinding
« on: November 07, 2007, 09:10:00 pm »

I had a tunnel that looked like this:

code:
Top view:

X......XX
X.XXX..XX
X.XXX-=XX
X.XXX.-XX
X.XXX@.XX
X......XX
XXXXX..XX
XXXXX..XX


Where X is walls, - are walls marked to be mined, = is the wall that is flashing, and @ is the miner.

Rather than go up and mine diagonally, the miner will always take the long route around and go mine it from above rather than below. Just thought it was a little weird.

Logged

Dame de la Licorne

  • Bay Watcher
  • Cats? Check. FPS? Uh-oh...
    • View Profile
Re: Slightly odd miner diagonal pathfinding
« Reply #1 on: November 07, 2007, 09:20:00 pm »

This is due to the pathfinding algorithm and mining preferences.  They prefer W over E, then N, then S, and diagonals the same so, NW, NE, SW, SE, in that order.
Logged
If software was real world, then it'd be something equivalent of hitting a nail with a hammer and having a building collapse on the other side of town.

Don't worry people, sometimes -moments occur

Draco18s

  • Bay Watcher
    • View Profile
Re: Slightly odd miner diagonal pathfinding
« Reply #2 on: November 07, 2007, 09:33:00 pm »

quote:
Originally posted by Dame de la Licorne:
<STRONG>and diagonals the same so, NW, NE, SW, SE, in that order.</STRONG>

*Cough* NW, SW, NE, SE.  West over east, so SW over NE.

Logged

God of Toast

  • Bay Watcher
    • View Profile
Re: Slightly odd miner diagonal pathfinding
« Reply #3 on: November 07, 2007, 10:48:00 pm »

It's not that they prefer anything, it's just a old dwarven tradition.
Logged

Seryntas

  • Bay Watcher
  • has created a masterpiece!
    • View Profile
    • RPGWW Forums
Re: Slightly odd miner diagonal pathfinding
« Reply #4 on: November 07, 2007, 11:25:00 pm »

Yeah, it annoys the crap out of me, too.  I sometimes have to wait for a whole project to finish before I can use the first part of it.
Logged
"Nectar and ambrosia are all the gods are allowed to eat in Greek mythology. In that way they're kind of like pandas. You know, in diet. From there the similarities break down." -my Greek Lit TA