Bay 12 Games Forum

Please login or register.

Login with username, password and session length
Advanced search  
Pages: [1] 2

Author Topic: Dwarves occasionaly ignoring traffic designations.  (Read 1526 times)

Asehujiko

  • Bay Watcher
    • View Profile
Dwarves occasionaly ignoring traffic designations.
« on: January 02, 2008, 04:05:00 pm »

It seems that on apparently random occasions, dwarves ignore a restricted traffic designation and step on it despite both the "no tresspassing" flag and the obvious warning of 10 rapidly retracting/emerging spikes.

My main hallway has the followng layout:

code:

outside
XS...SX
X||||.X
XS...SX
X.||||X
XS...SX
X||||.X
XS...SX
X.||||X
XS...SX
X||||.X
XS...SX
X.||||X
fortress

X wall
S statue
. floor
| 10 x upright spike


All of the empty floor is designated high traffic with the spikes being designated as restricted traffic. Despite those countermeasures, i still had 6 accidents in total, all of them with the row of masterwork steel in the bottom.

Do i have a stealth murderer in my fort or is there something wrong with my dwarves?

Logged
Code: [Select]
Tremble, mortal, and despair! Doom has come to this world!
.....EEEE..E..E.E...EEE.EE.EE.EEE.EE..EE.EE.E.EE.EE.E.EE.
......E..EE.EE.EE.EE..E...EEEE..E..E.E...EEE.EEE...E.EEE.
.☺..EE.E...E.EE.EE...E.EE..E..EE.EE.EE.EE..E...EE.EE..E.E
.....E..E.E.E.E.E.EE.E.E.EE.E...E.EE.EE...E.EE.EE.EEE...E
....E.EE.EEE.EE..EE.EE.E..EEEE..E..E.E...EEE.EEE..E.E..EE

briktal

  • Bay Watcher
    • View Profile
Re: Dwarves occasionaly ignoring traffic designations.
« Reply #1 on: January 02, 2008, 04:26:00 pm »

"Restricted" doesn't actually forbid dwarves from walking on the square.  It just raises the (for the purposes of pathfinding) movement cost.  By default, I think High is 1 and Restricted is 25.
Logged

Teldin

  • Bay Watcher
  • Canadian Bacon
    • View Profile
Re: Dwarves occasionaly ignoring traffic designations.
« Reply #2 on: January 02, 2008, 04:42:00 pm »

You can also edit these values in the .ini I believe, so just set them to something arbitrarily high (like 500) and your dwarves should probably never walk on those tiles again.
Logged

penguinofhonor

  • Bay Watcher
  • Minister of Love
    • View Profile
Re: Dwarves occasionaly ignoring traffic designations.
« Reply #3 on: January 02, 2008, 05:41:00 pm »

His dwarves shouldn't walk a restricted step (25) instead of six normal steps (12). What's up with that?
Logged

Shadowlord

  • Bay Watcher
    • View Profile
Re: Dwarves occasionaly ignoring traffic designations.
« Reply #4 on: January 02, 2008, 06:23:00 pm »

Side note: Animals (appear to) ignore path designations.

[ January 02, 2008: Message edited by: Shadowlord ]

Logged
<Dakkan> There are human laws, and then there are laws of physics. I don't bike in the city because of the second.
Dwarf Fortress Map Archive

Idles

  • Bay Watcher
    • View Profile
Re: Dwarves occasionaly ignoring traffic designations.
« Reply #5 on: January 02, 2008, 06:24:00 pm »

Sounds to me like some part of the pathfinding/movement code is ignoring the heuristics, or sets a very, very high heuristic for a tile blocked by another dwarf.  

Did these accidents happen when the hallway was crowded, so a dwarf might have tried to path around another dwarf, and thus onto the spikes?

Logged

Aquillion

  • Bay Watcher
    • View Profile
Re: Dwarves occasionaly ignoring traffic designations.
« Reply #6 on: January 02, 2008, 07:00:00 pm »

I wouldn't be surprised if there's some randomness built into the pathing, too.  It is actually good, overall (as long as you're not trying to use restrictions as an absolute bar against entering a deadly space, like here); imagine if you have twenty dwarves all deciding to go someplace at about the same time.  Without randomness, they'll all pick the same 'optimal' path...  and, of course, it will become horribly crowded and unoptimal, while a path that was one step longer remains completely empty and unused.  So a bit of randomization prevents this, occasionally having a dwarf choose a slightly unoptimal path to avoid crowding.

[ January 02, 2008: Message edited by: Aquillion ]

Logged
We don't want another cheap fantasy universe, we want a cheap fantasy universe generator. --Toady One

Eagle of Fire

  • Bay Watcher
  • Friendly Fire
    • View Profile
Re: Dwarves occasionaly ignoring traffic designations.
« Reply #7 on: January 02, 2008, 11:27:00 pm »

One of my own post on the wiki:
quote:
       If I understand well what Toady explained in a thread on the forums, all what restricting does is that if the pathing of a dwarf goes thru a restrited tile, the pathing algorith will (try to) recalculate a better route X amount of time. You can see (and change) it in the init file:

  Change these numbers to set the default weights for traffic designations. If you make the last numbers too large, pathfinding might lag.
   The format is (PATH_COST:<high>:<normal>:<low>:<restricted> ).

   [PATH_COST:1:2:5:25]

       This mean that when you restrict a square, if the pathing algorithm happen to plot a way into it, it will recalculate up to 25 times (by default) to try to find a better route. If it fails, it will keep the same route and the dwarf will walk thru the restricted space.

       I think people mix up the terms "restricted" and "forbiden", when in fact it's in no way coded to act like a barrier for dwarves but more as a way to "nudge" dwarves gently in better area(s). --Eagle of Fire 19:42, 27 December 2007 (EST)


Logged
I am on a hot streak... literally.

Torak

  • Bay Watcher
  • God of Gods of Blood.
    • View Profile
Re: Dwarves occasionaly ignoring traffic designations.
« Reply #8 on: January 03, 2008, 01:34:00 am »

Really needs to be a "Forbid area" option.
Logged
As you journey to the center of the world, feel free to read the death announcements of those dwarves that suffer your neglect.

One billion b-balls dribbling simultaneously throughout the galaxy. One trillion b-balls being slam dunked through a hoop throughout the cosmos. I can feel every single b-ball that has ever existed at my fingertips, I can feel their collective knowledge channeling through my veins. Every jumpshot, every rebound and three-pointer, every layup, dunk and free throw.

Draco18s

  • Bay Watcher
    • View Profile
Re: Dwarves occasionaly ignoring traffic designations.
« Reply #9 on: January 03, 2008, 01:48:00 pm »

quote:
Originally posted by Torak:
<STRONG>Really needs to be a "Forbid area" option.</STRONG>

The reason it isn't is due to the "if a dwarf can't walk there at all, and that area is the only path for him to travel he'd never get out."  Hence why restricted: travel here as little as possible.

The pathing values are how many times it searches for a better path, and a forbid is just a restricted with a value of about 500 (search every single path ever, pick best).  And you'd still get dwarves walking through it.  And lag.

Logged

Fedor

  • Bay Watcher
    • View Profile
Re: Dwarves occasionaly ignoring traffic designations.
« Reply #10 on: January 03, 2008, 02:00:00 pm »

quote:
Originally posted by Asehujiko:
<STRONG>My main hallway has the followng layout:
</STRONG>

Consider using bridges that raise to the sides to cover and reveal the spikes.

=================

Eagle of Fire, are you sure the PATH_COST numbers mean recalculations?  That sounds horribly inefficient.

I was under the impression that they simply meant path cost.  So a high-traffic grid would have a path cost of 1, a restricted grid would have one of 25, and pathfinding would seek the lowest cost path.  This hypothesis is not inconsistent with the OP's problem, if we assume a sufficiently high value for a blocked grid.

========================

quote:
Originally posted by Draco18s:
<STRONG>The reason it isn't is due to the "if a dwarf can't walk there at all, and that area is the only path for him to travel he'd never get out."  Hence why restricted: travel here as little as possible.</STRONG>
That's not a good reason.  If a dwarf is trapped, the game should pause, center on the dwarf, and alert the player.  Preferably with custom messages for physical walls/pits, forbidden doors, and forbidden areas.
Logged
Fedor Andreev is a citizen of the Federated Endeavor. He is a member of the Wandering Minds.

Yourself

  • Bay Watcher
    • View Profile
Re: Dwarves occasionaly ignoring traffic designations.
« Reply #11 on: January 03, 2008, 02:02:00 pm »

Dwarves can already get trapped by digging a channel around them.  Why would using a forbid area option be any different?
Logged

Quintin Stone

  • Bay Watcher
  • Dwarven Bureaucrat
    • View Profile
    • RPS
Re: Dwarves occasionaly ignoring traffic designations.
« Reply #12 on: January 03, 2008, 03:36:00 pm »

quote:
Originally posted by Fedor:
<STRONG>Eagle of Fire, are you sure the PATH_COST numbers mean recalculations? That sounds horribly inefficient.

I was under the impression that they simply meant path cost. So a high-traffic grid would have a path cost of 1, a restricted grid would have one of 25, and pathfinding would seek the lowest cost path. This hypothesis is not inconsistent with the OP's problem, if we assume a sufficiently high value for a blocked grid.</STRONG>



I doubt path_cost has anything to do with recalculations per se.  Path cost is simply a standard feature of pathfinding algorithms.  It says "going through this restricted tile should be considered to take as long as going through 25 high-traffic tiles."  Thus the dwarves generally avoid them unless going around is much much much longer.
Logged

0x517A5D

  • Bay Watcher
  • Hex Editor‬‬
    • View Profile
Re: Dwarves occasionaly ignoring traffic designations.
« Reply #13 on: January 03, 2008, 05:06:00 pm »

quote:
Originally posted by Teldin:
<STRONG>You can also edit these values in the .ini I believe, so just set them to something arbitrarily high (like 500)</STRONG>

I would advise against setting it too high.  Add enough numbers, and the distance calculation will wrap around, and the "restricted" path will become the most favored path instead.  The higher the restricted value, the more likely this will happen.

This is in theory, by the way. I have not personally experienced it, as I have not yet even played with pathing.  But I recall seeing a couple of bug reports where this behavior seemed to be blamed.

Logged

0x517A5D

  • Bay Watcher
  • Hex Editor‬‬
    • View Profile
Re: Dwarves occasionaly ignoring traffic designations.
« Reply #14 on: January 03, 2008, 05:11:00 pm »

quote:
Originally posted by Asehujiko:
<STRONG>It seems that on apparently random occasions, dwarves ignore a restricted traffic designation and step on it despite both the "no tresspassing" flag and the obvious warning of 10 rapidly retracting/emerging spikes.</STRONG>

It occurs to me that they may well be stepping out of the way of another mob.  They usually lie down (which I consider to be a bug), but they may dodge on occasion.

Logged
Pages: [1] 2