Bay 12 Games Forum

Please login or register.

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

Author Topic: Does pathway/stair spacing really matter?  (Read 3903 times)

Squirrelloid

  • Bay Watcher
    • View Profile
Re: Does pathway/stair spacing really matter?
« Reply #15 on: April 22, 2010, 04:59:21 pm »

With the many levels of the new version we could technically start making the rooms vertically separated by as much as we usually separate them horizontally. This would make shafts of up/down stairs not that much faster.

But why would you?  I mean, yes, you could design the absolutely least efficient fortress ever.  But that would be user stupidity, not a problem inherent in some particular aspect of what you were doing (like using a vertical artery to reduce transit times).  You *can* space things out vertically, but you *must* space things out horizontally.

If you're going to build a vertical fortress, you want to take advantage of the ability to cluster things more tightly.  Its possible to build a 200+ dwarf fortress where no two points in the fortress are more than 60 tiles from each other.  Actually, you can almost certainly do quite a bit better than that, but it would require quantum stockpiling and the like. And of course you can take advantage of the fact that certain dwarves will only need to visit certain places in the fortress to improve efficiency.
BALDERDASH

You could have a horizontal hallway with every other wall tile being a door to a set of stairs to just the one room. If you had squares jutting off the sides of your vertical column and any kind of horizontal hallway at all it would work out very similar. You could even actually get certain sized rooms closer together with stairs in the middle of the hall and hatches instead of doors.

Seeing as your columns still use horizontal space I don't see why a sideways hall shouldn't get to use vertical space.

A vertical artery will always be more efficient.  Consider that rooms can only be designated in a horizontal area.  So whenever you have a layer in a vertical fortress, your workshops or whatever stay on that layer and interfere with nothing.  If you rotate this structure on its side, you'll see that to maintain the same space efficiency you'd need to turn all the layers vertical.  As you cannot do that (can't have a vertical workshop, for example), then you can't get the same efficiency from a horizontal artery.  Ie, if you put a stairway up to access a workshop, you must wait another 3 tiles before you can put another stairway up or it'll run through the workshop.
Logged

Shoku

  • Bay Watcher
    • View Profile
Re: Does pathway/stair spacing really matter?
« Reply #16 on: April 22, 2010, 05:18:03 pm »

This is why you alternate up and down. Then it is just 1 tile away to the next room. Or you could do the three tile wait and have both up and down come from the door for doubles.

The real factor that stopped me from doing the space filling model you're advocating was that it makes the pathfinding bloom expand in 3d and I prefer a fort with a lot of FPS over one with fewer frames between tasks.
Logged
Please get involved with my making worlds thread.

Squirrelloid

  • Bay Watcher
    • View Profile
Re: Does pathway/stair spacing really matter?
« Reply #17 on: April 22, 2010, 05:21:19 pm »

This is why you alternate up and down. Then it is just 1 tile away to the next room. Or you could do the three tile wait and have both up and down come from the door for doubles.

The real factor that stopped me from doing the space filling model you're advocating was that it makes the pathfinding bloom expand in 3d and I prefer a fort with a lot of FPS over one with fewer frames between tasks.

I haven't noticed any FPS slowdown because of using many vertical levels, and DF does not run noticeably fast on my computer.  As long as there is just a single vertical artery, there aren't a large number of ways to get places, just a very efficient central route, so there's only so many paths it can try.
Logged

Shoku

  • Bay Watcher
    • View Profile
Re: Does pathway/stair spacing really matter?
« Reply #18 on: April 23, 2010, 07:58:09 am »

The problem is how many it has to look at at the same time. If you have just a corridor of any type it spirals forward basically just marching a wall along. With side rooms you get a little off shoot that scans along all of the floorspace in the room and then terminates. Normally the biggest this would get would be at the outside where it can just expand in the four compass directions until it runs out of map.

But with a vertical shaft every time it goes forward to the next step there is another door to look at. It ends up looking at maybe ten times the floor space before it can really reach the ends of rooms and stop looking at the earlier levels, and that is if you only do the compact cube layout.

Pathfinding is one of the biggest drains on FPS as it stands so unless you have some ridiculous bottleneck of not having enough memory for the traits of your dwarves it makes a big difference. The vertical layout is probably not as big a slow down as leaving animals out of cages but it's there and it has definitely had an impact on my computer. Maybe yours does run it different but how would you even check if you hadn't asked before?
Logged
Please get involved with my making worlds thread.

Squirrelloid

  • Bay Watcher
    • View Profile
Re: Does pathway/stair spacing really matter?
« Reply #19 on: April 23, 2010, 08:04:38 am »

The problem is how many it has to look at at the same time. If you have just a corridor of any type it spirals forward basically just marching a wall along. With side rooms you get a little off shoot that scans along all of the floorspace in the room and then terminates. Normally the biggest this would get would be at the outside where it can just expand in the four compass directions until it runs out of map.

But with a vertical shaft every time it goes forward to the next step there is another door to look at. It ends up looking at maybe ten times the floor space before it can really reach the ends of rooms and stop looking at the earlier levels, and that is if you only do the compact cube layout.

Pathfinding is one of the biggest drains on FPS as it stands so unless you have some ridiculous bottleneck of not having enough memory for the traits of your dwarves it makes a big difference. The vertical layout is probably not as big a slow down as leaving animals out of cages but it's there and it has definitely had an impact on my computer. Maybe yours does run it different but how would you even check if you hadn't asked before?

Why is pathfinding in X-Y any more efficient than in Z? Its not like my fortress layout occupies more space than yours - if anything it occupies less because i drastically reduce hallway volume.

Its not like you can ignore the z-levels entirely.  You do mine down there, yes?  Doesn't it also have to stop at every stair and check for routes when moving across an x-y plane fortress?

I've found the more total stone i mine, the slower my FPS gets.  Which z-level that stone was mined from is seemingly irrelevant.
Logged

Quatch

  • Bay Watcher
  • [CURIOUSBEAST_ GRADSTUDENT]
    • View Profile
    • Twitch? Sometimes..
Re: Does pathway/stair spacing really matter?
« Reply #20 on: April 23, 2010, 12:19:27 pm »

On the subject, edit your path costs in the init file to 1:1 rather than 1:2. Some arcane bit of the pathing algorithm actually makes having the default value not the lowest be wasteful. You get significant FPS boost.

I prefer 3 wide for <50 dwarves, and about +1 wide per every 50 beyond. The narrowest I go is 2 wide, excepting exploration. I mark the outside edges of my routes with high path cost tiles, which also stops unnecessary path checks into rooms.

I use the same metric for stairway blocks.

I also designate a layer every 5 or so that has no rooms, only diagonal connections between all stairway blocks. This lets people take shortcuts when traveling long distances.
Logged
SAVE THE PHILOSOPHER!
>>KillerClowns: It's faster to write "!!science!!" than any of the synonyms: "mad science", "dwarven science", or "crimes against the laws of god and man".
>>Orius: I plan my forts with some degree of paranoia.  It's kept me somewhat safe.

VerdantSF

  • Bay Watcher
    • View Profile
Re: Does pathway/stair spacing really matter?
« Reply #21 on: April 23, 2010, 01:39:05 pm »

high path cost tiles
Wait, there are ways to actually make "difficult" terrain?

***
 
Ah! Reading the wiki on traffic now!
« Last Edit: April 23, 2010, 01:51:10 pm by VerdantSF »
Logged

BurnedToast

  • Bay Watcher
  • Personal Text
    • View Profile
Re: Does pathway/stair spacing really matter?
« Reply #22 on: April 23, 2010, 04:56:58 pm »

On the subject, edit your path costs in the init file to 1:1 rather than 1:2. Some arcane bit of the pathing algorithm actually makes having the default value not the lowest be wasteful. You get significant FPS boost.

You don't need to edit the init file, you can change the path costs right from the ingame menu.

Also, I tried it and got perhaps a 2 or 3 fps average boost in my 40 dwarf fort. Not really anything to get excited about.

Logged
An ambush! curse all friends of nature!

Shoku

  • Bay Watcher
    • View Profile
Re: Does pathway/stair spacing really matter?
« Reply #23 on: April 23, 2010, 08:52:29 pm »

The problem is how many it has to look at at the same time. If you have just a corridor of any type it spirals forward basically just marching a wall along. With side rooms you get a little off shoot that scans along all of the floorspace in the room and then terminates. Normally the biggest this would get would be at the outside where it can just expand in the four compass directions until it runs out of map.

But with a vertical shaft every time it goes forward to the next step there is another door to look at. It ends up looking at maybe ten times the floor space before it can really reach the ends of rooms and stop looking at the earlier levels, and that is if you only do the compact cube layout.

Pathfinding is one of the biggest drains on FPS as it stands so unless you have some ridiculous bottleneck of not having enough memory for the traits of your dwarves it makes a big difference. The vertical layout is probably not as big a slow down as leaving animals out of cages but it's there and it has definitely had an impact on my computer. Maybe yours does run it different but how would you even check if you hadn't asked before?

Why is pathfinding in X-Y any more efficient than in Z? Its not like my fortress layout occupies more space than yours - if anything it occupies less because i drastically reduce hallway volume.

Its not like you can ignore the z-levels entirely.  You do mine down there, yes?  Doesn't it also have to stop at every stair and check for routes when moving across an x-y plane fortress?

I've found the more total stone i mine, the slower my FPS gets.  Which z-level that stone was mined from is seemingly irrelevant.
Because of how pathfinding works. It looks at the tiles next to your dwarf (or maybe the destination.) Then it looks at the tiles next to those. Then the tiles next to those. Then the tiles next to those and so on. When going along a flat corridor with only rooms on the sides it needs only the number length of the room before that side branch fizzles- it becomes a dead end and stops looking there. In such a hall this is also the number of tiles to the next door. As such you have only the cost of working out 3 or 5 tiles (width of the hall) per step plus the width of up to two rooms. If you look at a column it goes up one step and into available rooms one step. It goes up another step, further into available rooms, and one step into new rooms. Now instead of going into just two rooms it goes into however many rooms as the depth you have carved them all at once.

If we assume that you just use 4x5 rooms for everything a step along a flat 3 wide hall is 3 + 4 + 4 = 11 except at doors or the walls between rooms. Mostly it takes 11 tiles to move on to the next step. In 2x2 column it is 4 up, 4 down, and typically 16 into the rooms per floor. It takes five floors before you get to the back of any room (6 if you count the door) so that means once it has extended five floors in both directions you are now looking at calculations for 204 tiles per step. Most of the time you probably have fewer floors but larger room and this means that you have to check tiles in every room of the fort to travel virtually anywhere outside of the current room.

Again, maybe your computer handles that kind of calculation differently than mine but the central shaft has been murder on the machines I've had access to.
Logged
Please get involved with my making worlds thread.

Squirrelloid

  • Bay Watcher
    • View Profile
Re: Does pathway/stair spacing really matter?
« Reply #24 on: April 23, 2010, 10:58:53 pm »

The problem is how many it has to look at at the same time. If you have just a corridor of any type it spirals forward basically just marching a wall along. With side rooms you get a little off shoot that scans along all of the floorspace in the room and then terminates. Normally the biggest this would get would be at the outside where it can just expand in the four compass directions until it runs out of map.

But with a vertical shaft every time it goes forward to the next step there is another door to look at. It ends up looking at maybe ten times the floor space before it can really reach the ends of rooms and stop looking at the earlier levels, and that is if you only do the compact cube layout.

Pathfinding is one of the biggest drains on FPS as it stands so unless you have some ridiculous bottleneck of not having enough memory for the traits of your dwarves it makes a big difference. The vertical layout is probably not as big a slow down as leaving animals out of cages but it's there and it has definitely had an impact on my computer. Maybe yours does run it different but how would you even check if you hadn't asked before?

Why is pathfinding in X-Y any more efficient than in Z? Its not like my fortress layout occupies more space than yours - if anything it occupies less because i drastically reduce hallway volume.

Its not like you can ignore the z-levels entirely.  You do mine down there, yes?  Doesn't it also have to stop at every stair and check for routes when moving across an x-y plane fortress?

I've found the more total stone i mine, the slower my FPS gets.  Which z-level that stone was mined from is seemingly irrelevant.
Because of how pathfinding works. It looks at the tiles next to your dwarf (or maybe the destination.) Then it looks at the tiles next to those. Then the tiles next to those. Then the tiles next to those and so on. When going along a flat corridor with only rooms on the sides it needs only the number length of the room before that side branch fizzles- it becomes a dead end and stops looking there. In such a hall this is also the number of tiles to the next door. As such you have only the cost of working out 3 or 5 tiles (width of the hall) per step plus the width of up to two rooms. If you look at a column it goes up one step and into available rooms one step. It goes up another step, further into available rooms, and one step into new rooms. Now instead of going into just two rooms it goes into however many rooms as the depth you have carved them all at once.

If we assume that you just use 4x5 rooms for everything a step along a flat 3 wide hall is 3 + 4 + 4 = 11 except at doors or the walls between rooms. Mostly it takes 11 tiles to move on to the next step. In 2x2 column it is 4 up, 4 down, and typically 16 into the rooms per floor. It takes five floors before you get to the back of any room (6 if you count the door) so that means once it has extended five floors in both directions you are now looking at calculations for 204 tiles per step. Most of the time you probably have fewer floors but larger room and this means that you have to check tiles in every room of the fort to travel virtually anywhere outside of the current room.

Again, maybe your computer handles that kind of calculation differently than mine but the central shaft has been murder on the machines I've had access to.

You can set all the tiles just off the main shaft to 'restricted' so it goes up 25 levels before it goes into rooms.  Not that i've done this, but it would bias pathfinding in the right way.
Logged

Shoku

  • Bay Watcher
    • View Profile
Re: Does pathway/stair spacing really matter?
« Reply #25 on: April 24, 2010, 12:00:56 am »

Not really. It would make it go through the whole column (unless you have stuff more than 25 floors away) so you would just get rid of the 8 tiles that deals with. The rooms still all end up starting one turn after the last and that's where all the space really is.

There is another way of making an essentially horizontal hallway that is space filling though. A spiral ramp shape. You can't have everything in the fort within 60 steps but you can definitely fill all the space.
Logged
Please get involved with my making worlds thread.

Hydra

  • Bay Watcher
    • View Profile
Re: Does pathway/stair spacing really matter?
« Reply #26 on: April 26, 2010, 04:40:58 am »

I tend to use the same setup for all my current fortresses. The core is a 11x11 (convenient shift-spacing) central room. In the middle I have a single up/down staircase. It's surrounded with 8 more 11x11 rooms that are used as stockpiles. Around the perimeter of those 9 large rooms I have a lot of 5x5 rooms that have space for a workshop, a small workshop-source-stockpile, and a door to seal them off in case of a fey mood I can't fill.

Looks like this:


Lightblue are stockpiles, darkblue is the central 'shaft' and the workshops.

Bedrooms are a bit different but the 'floor' is the same size:


Gives about 76 bedrooms of varying sizes. Even for a very large fort you only need 2 of these.

I tend to stack about 5 'normal' layers on top of each other and below that I make bedrooms. In one (40d) fort I actually build part aboveground and then channeled around the tower so I would have a big tower extending out of the ground.
Logged

Shades

  • Bay Watcher
    • View Profile
Re: Does pathway/stair spacing really matter?
« Reply #27 on: April 26, 2010, 09:16:45 am »

On the subject, edit your path costs in the init file to 1:1 rather than 1:2. Some arcane bit of the pathing algorithm actually makes having the default value not the lowest be wasteful. You get significant FPS boost.

The down side of this is that you can no longer have high traffic zones, but it depends if your fps or your zoning is more important.

I prefer 3 wide for <50 dwarves, and about +1 wide per every 50 beyond. The narrowest I go is 2 wide, excepting exploration. I mark the outside edges of my routes with high path cost tiles, which also stops unnecessary path checks into rooms.

I tend to use 3 wide corridors, I've yet to have a problem with traffic down them but that might be a bi-product of the way I connect things. For pure FPS reasons 1 wide corridors are the most efficient, but I don't recommend it.
Logged
Its like playing god with sentient legos. - They Got Leader
[Dwarf Fortress] plays like a dizzyingly complex hybrid of Dungeon Keeper and The Sims, if all your little people were manic-depressive alcoholics. - tv tropes
You don't use science to show that you're right, you use science to become right. - xkcd

tps12

  • Bay Watcher
    • View Profile
Re: Does pathway/stair spacing really matter?
« Reply #28 on: April 26, 2010, 01:28:00 pm »

Quote
Ramps can sort of get them moving around twice as fast though. Diagonal movement doesn't take any longer than straight so diagonally down can get them going a significant portion of a horizontal hallway before they are even on its level.

I was thinking about a double helix type design to cut down on sprawl, and using ramps for this reason.

In general, I think I need to be using way more z-levels. My current fort (pop. ~100, I'm a newb) takes up around 7000 tiles, which if you distribute it evenly would be like a 20x20x20 cube, whereas I have everything jammed into five or six levels. (Actually, even better than a cube would be a sphere of radius 12 with bedrooms in the outer shell and communal areas in the center, but I don't think I have the patience for that.)
Logged

Shoku

  • Bay Watcher
    • View Profile
Re: Does pathway/stair spacing really matter?
« Reply #29 on: April 26, 2010, 09:19:33 pm »

I did that a little in my final 40d forts. I had planned to also build a tower of the double helix up into the sky but never got far with it.

I gave up on actually sinking down into the caverns like that.
Logged
Please get involved with my making worlds thread.
Pages: 1 [2] 3