Bay 12 Games Forum

Please login or register.

Login with username, password and session length
Advanced search  

Author Topic: Building my fortress in a labyrinth  (Read 1000 times)

Jox

  • Escaped Lunatic
    • View Profile
Building my fortress in a labyrinth
« on: May 29, 2011, 04:58:39 pm »

Ok so, I have decided to build my fortress in a nice big labyrinth, and I was wondering if my dwarfs will take random paths through the twisting halls or will they just find the shortest route and just wander that path? On the same note will invaders do the same thing?
Logged

EmperorJon

  • Bay Watcher
  • Still waiting...
    • View Profile
Re: Building my fortress in a labyrinth
« Reply #1 on: May 29, 2011, 05:02:19 pm »

All units take the shortest route to their destination. (Well, your dwarves will also take into account the traffic designations)
Logged
I think it's the way towns develop now. In the beginning, people move into a town. Then they start producing tables, which results in more and more tables. Soon tables represent a significant portion of the population, they start lobbying for new laws and regulations, putting people to greater and greater disadvantage...
Link for full quote. 'tis mighty funny.

Jox

  • Escaped Lunatic
    • View Profile
Re: Building my fortress in a labyrinth
« Reply #2 on: May 29, 2011, 05:05:44 pm »

Dang, guess ill throw in some bridges on the floor and use a dog and pressure plates to randomly change the paths through the labyrinth, although that does sound rather epic.
Logged

Saiko Kila

  • Bay Watcher
  • Dwarven alchemist
    • View Profile
Re: Building my fortress in a labyrinth
« Reply #3 on: May 29, 2011, 05:37:49 pm »

If there are optional routes, dwarves will reroute if they encounter other dwarves, even if the new path is longer. Even if it's like 10x times longer. They don't crawl if they don't need too, which is sometimes stupid. Therefore in a labyrinth consisting of 1-tile wide corridors your dwarves will behave almost like laboratory rats, and they would be choosing different paths. This behavior is easy to spot (and loathe) when navigating caverns with narrow corridors. They can be hauling that FB's body or black-cap logs and be two tiles from the exit, when they encounter they colleagues and they reroute taking 40-tiles long path. And then again, and again... Rats.
Logged

Jox

  • Escaped Lunatic
    • View Profile
Re: Building my fortress in a labyrinth
« Reply #4 on: May 29, 2011, 05:58:05 pm »

Ahahaha that sounds delightful, in that case i cant wait to see how those ridiculous goblins react when they enter my red and black glass serrated disc lined corridors. This may turn out very dwarfy indeed.
Logged

Saiko Kila

  • Bay Watcher
  • Dwarven alchemist
    • View Profile
Re: Building my fortress in a labyrinth
« Reply #5 on: May 30, 2011, 01:18:55 am »

Ahahaha that sounds delightful, in that case i cant wait to see how those ridiculous goblins react when they enter my red and black glass serrated disc lined corridors. This may turn out very dwarfy indeed.

My most convoluted working solution contains only two corridors, which are converging at entry point and exit point. Gobbos normally will try the shortest path (with deadly weapons trap in my case) and choose the longer (with cages) when the shortest is closed. But if both of them are open and there are many gobbos and trolls (say one squad of each species) then they will try both. I don't know how would they behave if the paths are more complicated. I suppose they would be reluctant to take the longest ones. But be careful, gobbos evading traps will jump, which means a small-range instant teleport. They may jump closer to the exit, over these traps, up to 4 tiles I believe.
Logged

Niseg

  • Bay Watcher
    • View Profile
Re: Building my fortress in a labyrinth
« Reply #6 on: May 30, 2011, 03:18:27 am »

In my opinion a labyrinth would be counter productive   It would take you more and more cpu resources  to find a path. In order for it to work you'll have to trap someone in it somehow (probably a presure plate) and tell your dwarves to avoid it using traffic zones.


If there are optional routes, dwarves will reroute if they encounter other dwarves, even if the new path is longer. Even if it's like 10x times longer. They don't crawl if they don't need too, which is sometimes stupid.

This explains a few things in terms of path finding and FPS behavior. 

For a while I tried to figure it out if pathfinding is the real FPS killer. Devek has made a valid claim that pathfinding  can't be it,  because it doesn't happen that often. Still if things are as you claim it explains the fps gradually dropping rather than fluctuating .

If the dwarves are in an enclosed space they would each find a path for themselves and the chances they''ll collide with someone grows . At many intervals  a group of dwarves  may find they can't step into a path because another creature is there. If they recalculate the path they may get a failure due to the blocking creature. a path failiure means A* will go through all the accessible nodes. This may cause heavy backtracking inwards .

This is a major trouble if a few dwarves are trapped between  two groups . They may oscillate back and forth. This can also be worsened if a dwarf is searching for an accessible item. if it gives up as soon as the item is inaccessible it looks for another one. If he's trapped he may try to find a path to each and every valid item in the port (I'm sure there is some sanity check). if he's not traped he can be fooled by the heuristic to try and reach items bellow or above him that may look closer but are really far away. What you get is an 8 way intersection where everyone has a green light and right of way.

« Last Edit: May 30, 2011, 10:42:19 am by Niseg »
Logged
Projects:Path finding simulator(thread) -A*,weighted A*(traffic zones), user set waypoints (path caching), automatic waypoint room navigation,no-cache room navigation.

FGK dwarf

  • Bay Watcher
    • View Profile
Re: Building my fortress in a labyrinth
« Reply #7 on: May 30, 2011, 03:32:18 am »

This is a major trouble if a few dwarves are trapped between  two groups . They may osculate back and forth.

I really think you meant "oscillate" there  :o
Logged

hitto

  • Bay Watcher
    • View Profile
Re: Building my fortress in a labyrinth
« Reply #8 on: May 30, 2011, 08:36:35 am »

You could just make the "solution" to your labyrinth a high traffic zone, and the rest to low.

Unfortunately, invaders will always know the default best path to your first destructible construction/unprotected entrance, so labyrinths are really a challenge for YOU.
Logged

Niseg

  • Bay Watcher
    • View Profile
Re: Building my fortress in a labyrinth
« Reply #9 on: May 30, 2011, 10:45:57 am »

This is a major trouble if a few dwarves are trapped between  two groups . They may osculate back and forth.

I really think you meant "oscillate" there  :o

:lol: fixed.
firefox spell check can't be trusted .
Logged
Projects:Path finding simulator(thread) -A*,weighted A*(traffic zones), user set waypoints (path caching), automatic waypoint room navigation,no-cache room navigation.

Jox

  • Escaped Lunatic
    • View Profile
Re: Building my fortress in a labyrinth
« Reply #10 on: May 30, 2011, 03:52:41 pm »

You could just make the "solution" to your labyrinth a high traffic zone, and the rest to low.

Unfortunately, invaders will always know the default best path to your first destructible construction/unprotected entrance, so labyrinths are really a challenge for YOU.
Ah so you have stumbled on the whole point of this endeavor, I have gotten sick with the basic fortress layout and want to try a nice megaproject so I'm combining them, two cats with one stone as the saying goes.
Logged

Azated

  • Bay Watcher
  • ohai der
    • View Profile
Re: Building my fortress in a labyrinth
« Reply #11 on: May 30, 2011, 09:00:18 pm »

I always thought that creatures chose the closest route, no necessarily the fastest. I've noticed this happen when there is stone 10 squares away, but on the next Z is the exact same stone. In this case, they'd go for the one below, even if it means walking around my map to the back door to get to it.
Logged
Then it happened. Then I cringed. Then I picked it up and beat him to death with it, and then his buddies, too.
You beat a man to death with his dick?

"I don't feel like myself. Maybe I should have Doc take a look at me" ~ Dreamy
 "You're gonna trust a dwarf that got his medical degree from a pickaxe?" ~ Bossy