Bay 12 Games Forum

Please login or register.

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

Author Topic: Big rooms or multiples small rooms what is better for pathfinding performance?  (Read 3406 times)

CyberianK

  • Bay Watcher
    • View Profile

Hello Everyone,

going back to the game after giving up due to FPS death and pathfinding error issues in the past.
I want to start again with a fort design that does not create many FPS issues and pathfinding problems.

I am getting a bit of conflicting info. One guy http://www.bay12forums.com/smf/index.php?topic=172501.msg7893530#msg7893530 says he does a design with big open rooms without any walls or doors. One other guy says big open rooms are bad for pathfinding and I should do small rooms instead https://old.reddit.com/r/dwarffortress/comments/alvxt9/biweekly_df_questions_thread/efig3i4/.

I get that walling off Caverns and mined areas and such is good I am mainly talking about my main fortress area.
Logged

Bumber

  • Bay Watcher
  • REMOVE KOBOLD
    • View Profile

The post says "the more space they have to search". For going from one side of a big room to the other, the space searched is just a straight line. The post advises to seal off dead-ends.

Spoiler: Small rooms are bad: (click to show/hide)
« Last Edit: February 01, 2019, 01:22:51 pm by Bumber »
Logged
Reading his name would trigger it. Thinking of him would trigger it. No other circumstances would trigger it- it was strictly related to the concept of Bill Clinton entering the conscious mind.

THE xTROLL FUR SOCKx RUSE WAS A........... DISTACTION        the carp HAVE the wagon

A wizard has turned you into a wagon. This was inevitable (Y/y)?

baldamundo

  • Bay Watcher
    • View Profile

I've found the advice on this very confusing and seemingly contradictory as well. I suspect the answer isn't straightforward - especially when you consider the impact on pathfinding from collisions and dodging. So a narrow corridor might be easier pathfinding for one dwarf, but if there are ten going in opposite directions, the calculation is very different.
Logged

Bumber

  • Bay Watcher
  • REMOVE KOBOLD
    • View Profile

I think the issue with 2x2 vs 3x3 stairs might have something to do with dwarves pathing around each other. If it's 2x2 and one of the z-levels is filled with 4 dwarves, everyone has to suck it up and just pass through each other by lying down in the same tile. If it's 3x3, there's a lower probability of having a z-level filled with 9 dwarves, so everyone will keep recalculating their paths to find one that avoids passing through another dwarf.

On the other hand, I think having a bunch of 1x1 stairs throughout the fort may be more disastrous. If a 1x1 stair has a dwarf in it, the other dwarves may attempt to re-path to the one of the other staircases.
Logged
Reading his name would trigger it. Thinking of him would trigger it. No other circumstances would trigger it- it was strictly related to the concept of Bill Clinton entering the conscious mind.

THE xTROLL FUR SOCKx RUSE WAS A........... DISTACTION        the carp HAVE the wagon

A wizard has turned you into a wagon. This was inevitable (Y/y)?

feelotraveller

  • Bay Watcher
  • (y-sqrt{|x|})^2+x^2=1
    • View Profile

I agree with that.  However there is also another side to it.  When travelling up or down a 2x2 stair there are immediately 11 tiles checked for pathing for the next step, whereas on a 3x3 there can be up to 26.

Nice gif btw.  :)
Logged

Sarmatian123

  • Bay Watcher
    • View Profile

_no_ _walls_

Never ever walls. Unless you have to have them to enclose pastures (so animals do not need to be lead back to them) or around refuse for dead bodies not to be seen constantly on. Just dig/construct huge 56x56 hall like I do. Put 4 3x11 radiating up/down stairs from central 3x3 passage in central corridors. Enjoy your fps improving by 100% the least :)

_automatic_ _quantum_ _stockpiles_

Mining cart. Construct railstop with auto directional dumping. Learn to use h-hauling routes menu.

_sell_ or _atom smash_

too huge stone stockpiles. Don't let it loiter around.

_z-stockpile_ _mark_ _dump_ _cloths_

All tunics, caps, shoes and mittens. Destroy or sell. Less warn-checks on those. They also conflict with military outfit, so double gain. It will work on owned too. Go every year and dump all cloths from cabinets too, then unmark so these can be used again.

_smooth_ _walls_ _&_ _floors_ _then_ _wall_ _underground_ _digs_ _off_

Smoothing will prevent for vermin generation and walling off will keep animals like cats but not only from pathing into those. Growth & vermin are not your fps friends.

_use_  _pathing_ _value_

Mark low traffic there you don't want your dwarves to go. Mark main roads (like entrance to fortress) with high traffic.

_in_ _init_ _stop_ _filth_ _spread_

_don't_ _keep_ _too_ _many_ _animals_

220 dwarves? 100 animals or less! You won't get enough to leather clothing, but fps will go lighter on you for that. Buy leather for cloths from caravans, if you can.

_don't_ _dig_ _3x3_ _shaft_ _for_ _lava_

Dig 1x1 shaft. When you are done fetching lava, it is easier to wall it off. Mining goes faster. Less stones produced as by products. Easier and faster to wall off any cavern breaches (corners always first. corners will get you!).

_also_

Atom smash non-master quality by products from your legendary skilling. Though sell master quality (if you are not using it), as smashing it is not advised.

_keep_ _stocks_ _small_

if you can. Don't construct when you can dig, as 14k-20k blocks are huge drag on fps, despite existing in constructions. On surface instead of flooring an area you can carve downstairs. Instead of walling, channel a hole and remove ramps from it.
Logged

baldamundo

  • Bay Watcher
    • View Profile

_no_ _walls_

Never ever walls. Unless you have to have them to enclose pastures (so animals do not need to be lead back to them) or around refuse for dead bodies not to be seen constantly on. Just dig/construct huge 56x56 hall like I do. Put 4 3x11 radiating up/down stairs from central 3x3 passage in central corridors. Enjoy your fps improving by 100% the least :)
Are you serious about this??? And does it mean demolishing all the walls in the caverns would improve FPS as well??
Logged

Dragonborn

  • Bay Watcher
    • View Profile

Can you clarify what pathfinding problems you are having?

I remember your previous threads here, and your "pathfinding" problem with trade depots was not a pathfinding problem at all, you couldn't see your items on the trade depot menu because one of your nobles made bins forbidden for export, and you had your trade stuff in bins.

If you are dealing with issues of workshops not "seeing" items, that could be caused by a lot of different things, and I don't think "pathfinding" is behind it.

Now if you're dealing with FPS issues, sure, some layouts are going to be more efficient than others.  Stuff like that is low hanging fruit you can deal with, but I find it hard to believe that using 2x2 versus 3x3 stairs, or ramps instead of stairs, is going to give you a massive boost of FPS that you are looking for.  You're likely dealing some other problem.

Off the top of my head, sudden and massive drops in FPS are one of two things:
- You've got a door that's marked 'keep tightly closed' and there's an animal trying to repeatedly path through it.  This is a known bug.
- You've got an animal of some kind stuck and it's constantly trying to path out.  I once had a case where my FPS dropped to 5 for no apparent reason.  It turns out a unicorn somehow got stuck in a tree.  Chopping down the tree freed the unicorn and FPS returned to normal.
Logged

anewaname

  • Bay Watcher
  • The mattock... My choice for problem solving.
    • View Profile

If you experience sudden FPS drops in a fort, it usually can be traced back to one event or change (including the bugs Dragonborn posted), but Bumber's, baldamundo's, and feelotraveller's posts... that is the important stuff for fortress designs.

I try to create a tree-like path system in my fort, full of dead-end rooms (each dead-end has only one entrance, 1 to 5 tiles wide). The room size is less important to me than the single entrance.

Logged
Quote from: dragdeler
There is something to be said about, if the stakes are as high, maybe reconsider your certitudes. One has to be aggressively allistic to feel entitled to be able to trust. But it won't happen to me, my bit doesn't count etc etc... Just saying, after my recent experiences I couldn't trust the public if I wanted to. People got their risk assessment neurons rotten and replaced with game theory. Folks walk around like fat turkeys taunting the world to slaughter them.

Loci

  • Bay Watcher
    • View Profile

I am getting a bit of conflicting info. One guy http://www.bay12forums.com/smf/index.php?topic=172501.msg7893530#msg7893530 says he does a design with big open rooms without any walls or doors. One other guy says big open rooms are bad for pathfinding and I should do small rooms instead https://old.reddit.com/r/dwarffortress/comments/alvxt9/biweekly_df_questions_thread/efig3i4/.

I don't see any conflict there. The first link says that wide open areas are better for pathfinding, and they are--they optimize direct pathing from A to B into a straight line. The second link says that large areas are worse for pathfinding, and they are--they increase the cost of "degenerate" pathing (from A to B when B is unreachable), and tend to increase the cost of direct pathing because players put A and B further apart. So the unconflicting conclusion is that small, open rooms (ideally, 1) are better for pathfinding.

Additionally, layout optimization can have a significant impact on pathing performance. If you expect dwarves to path from A to B frequently, A and B should be kept as close together as possible to "make the common paths fast".

Although there are unsubstantiated claims regarding stairs vs. ramps floating around, I doubt there is any significant impact on pathing performance.
Logged

Bumber

  • Bay Watcher
  • REMOVE KOBOLD
    • View Profile

The second link says that large areas are worse for pathfinding, and they are--they increase the cost of "degenerate" pathing (from A to B when B is unreachable)
If by "unreachable" you mean no path exists, DF keeps track of which areas are connected. This is only reevaluated when tiles are modified.

If you meant backtracking is required, just make sure you have doorways (or ramps/stairs) near the corners.
Logged
Reading his name would trigger it. Thinking of him would trigger it. No other circumstances would trigger it- it was strictly related to the concept of Bill Clinton entering the conscious mind.

THE xTROLL FUR SOCKx RUSE WAS A........... DISTACTION        the carp HAVE the wagon

A wizard has turned you into a wagon. This was inevitable (Y/y)?

Loci

  • Bay Watcher
    • View Profile

The second link says that large areas are worse for pathfinding, and they are--they increase the cost of "degenerate" pathing (from A to B when B is unreachable)
If by "unreachable" you mean no path exists, DF keeps track of which areas are connected. This is only reevaluated when tiles are modified.

That's not quite the same thing. If two dwarves meet in a narrow hallway, one (or both?) will try to repath around the other dwarf. The destination remains 'connected', but not necessarily 'reachable' when excluding one (or more) tiles from the search. Similar things may occur with liquids, temperatures, smoke, etc. Basically, worst-case pathing performance is to check every single accessible tile, and that makes having extra accessible tiles costly.
Logged

CyberianK

  • Bay Watcher
    • View Profile

Can you clarify what pathfinding problems you are having?

I remember your previous threads here, and your "pathfinding" problem with trade depots was not a pathfinding problem at all, you couldn't see your items on the trade depot menu because one of your nobles made bins forbidden for export, and you had your trade stuff in bins.

If you are dealing with issues of workshops not "seeing" items, that could be caused by a lot of different things, and I don't think "pathfinding" is behind it.

Yes that was me :)

Got the bin thing under control but what made me quit DF after was Dwarfs, Trade depot and Workshops not seeing some items and that breaking my whole fort. And now it happens again.

Like this for examples:


The helm is also not picked up by peoples with missing helm. Its not forbidden or anything as you can see.
Logged

Dragonborn

  • Bay Watcher
    • View Profile

Is that the workflow plugin from DFHack?  I honestly didn't think anyone still used that since we got the revamped manager work orders.  What happens if you setup a work order with some item constraints using the manager, i.e. make a leather helm if the total amount of available helms is less that 20.  You get to the manager window by press 'm' on the unit menu.  Does it respect the item count when you queue up a work order that way?
« Last Edit: February 03, 2019, 03:23:19 pm by Dragonborn »
Logged

CyberianK

  • Bay Watcher
    • View Profile

Is that the workflow plugin from DFHack?
Yes I used that for years never used the manager orders. Maybe I should change that :)

So what seems to happen is that my whole fortress is in some kind of continous pickup equipment loop

They pickup and drop and pickup again. No other work is done even the mining jobs and chop down tree jobs aren't done. This has been going on for about a year I got 100+ armor parts and they are still partly naked (also nothing else preventing them from layering some are even fully naked). I now changed the squads to be inactive and use civilian clothing hope that solves it then I start again.

edit: google found this age old bug that kind of looks what I got http://www.bay12games.com/dwarves/mantisbt/view.php?id=2687

edit2:

after I removed helms from all uniforms its now validated true and workflow shows

Only got dress, boots and leggins in Uniform but the same issue is with leggins still and pickup equip loop still going.
Now switching to no uniform.

edit3: I removed all uniforms now the fortress is no longer frozen and the dorfs are working again. Before there were even some naked dwarfs picking up equipment for 6 months and still being naked after.
I will now slowly enable uniforms one by one again starting with very simple ones. edit4 I can't if I put any uniform on loop of death starts again.
« Last Edit: February 03, 2019, 04:46:52 pm by CyberianK »
Logged
Pages: [1] 2