Bay 12 Games Forum

Please login or register.

Login with username, password and session length
Advanced search  

Author Topic: New pathfinding  (Read 477 times)

Dorten

  • Bay Watcher
  • [CAFFEINE_DEPENDENT ]
    • View Profile
New pathfinding
« on: April 15, 2008, 10:31:00 pm »

Yeah, it's cool, that dwarves learned to get round other dwarves, and it looks really cool when a horde of dwarves run in the open field... but! I've witnessed this:

code:

++++++++++++++++++++++++++++
+                          +
+                          +
x+                          +
+                          +
+                          +
++++++++++++++++z+y++++++++++++ -> Exit

That's the catwalk I was building for my marksdwarvwes. Pluses are floors, and everything else is either open space or walls. So. The mason is coming from the Exit, to build a wall at spot 'x'. At the spot 'y' he meets another mason, who goes back to the exit. So the first mason goes ALL THE WAY AROUND to spot 'z', actually PASSING his destination, then turns around and proceeds to x.

Think, a check whether the round-way will take less time than simple ducking or not needs to be implemented. Its ridiculous without one.

Logged
Cacodemon 2nd Leutenant
medals: 8/40
specials: 30/44
badges: 13:8:3:0:0

MaxVance

  • Bay Watcher
  • Legendary Internet User
    • View Profile
Re: New pathfinding
« Reply #1 on: April 15, 2008, 10:47:00 pm »

I agree. Dwarven pathfinding is still not optimal in many situations; for example, my masons will often go way out of their way to get to the mines, than go all the way down to get a rock which was exactly five Z-levels under their shop, then all the way back up, passing the rock stockpile that was six squares away.
Logged

Anjey aka PM

  • Bay Watcher
    • View Profile
Re: New pathfinding
« Reply #2 on: April 15, 2008, 11:34:00 pm »

quote:
Originally posted by MaxVance:
<STRONG>I agree. Dwarven pathfinding is still not optimal in many situations; for example, my masons will often go way out of their way to get to the mines, than go all the way down to get a rock which was exactly five Z-levels under their shop, then all the way back up, passing the rock stockpile that was six squares away.</STRONG>
not related to reported bug
Logged
he greatest programming project of all took six days; on the seventh day the programmer rested. We''ve been trying to debug the *&^%$#@ thing ever since. Moral: design before you implement.

Tayrin

  • Bay Watcher
    • View Profile
Re: New pathfinding
« Reply #3 on: April 16, 2008, 09:33:00 am »

There was a report of something quite similar here, where dwarves would keep bumping into each other and switching to the alternate path, though the passing-the-destination part was not mentioned.

The report is listed under bug 812, anyway:

quote:
000812 □ [pathfinding] (Report) dwarves can get stuck in a looping pattern trying to avoid each other
Logged

Draco18s

  • Bay Watcher
    • View Profile
Re: New pathfinding
« Reply #4 on: April 16, 2008, 09:01:00 pm »

That must be what happened when I built a grate underground and watch a dwarf take a looping path above ground (through a LOT of restricted area) to get to the grate nearly directly below him (rather than taking the stairs to his left) and passing the work area.  The gate had been dropped by the previous peasant walking towards the untaken stairs prior to dropping the grate for a drink.
Logged