Bay 12 Games Forum

Please login or register.

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

Author Topic: The Right Path - Increasing FPS via Traffic Designations  (Read 10156 times)

wuphonsreach

  • Bay Watcher
    • View Profile
Re: The Right Path - Increasing FPS via Traffic Designations
« Reply #30 on: July 31, 2012, 10:02:48 pm »

In the case of the very first picture where you're trying to go around an "L", there are a few possible solutions:

1) Add an opening in the bend of the L, so that the dwarves can easily go through without having to calculate alternate paths.

2) Create a low-traffic or restricted traffic triangle in the inner portion of the L, which discourages them from going into the interior of the L.

Now, questions for science:

a) In the case of stockpile rooms, what happens if you paint all but the edge by the doorway with restricted traffic?  Can dwarves moving stuff to the stockpile still do their jobs correctly?

A test for this would be to have (2) stockpiles.  One chock full of stuff, one that is empty.  Paint all but the nearest corner in restricted traffic and see how the FPS does in moving stuff from one to the other.  Do the dwarves spend a lot of extra CPU cycles trying to path inside of the stockpile?

b) How long of a path before A* gives up and flood-fills in DF2012?
Logged

Xob Ludosmbax

  • Bay Watcher
    • View Profile
Re: The Right Path - Increasing FPS via Traffic Designations
« Reply #31 on: August 01, 2012, 02:59:22 am »

Quote
a) In the case of stockpile rooms, what happens if you paint all but the edge by the doorway with restricted traffic?
 
Any dwarf trying to store or retrieve an item from that stockpile will look elsewhere first.  It probably won't improve FPS, and would probably hurt FPS, but it depends on how often that stockpile is used, and on the fortress layout.  A very rarely used stockpile marked as restricted would probably help FPS.  A very commonly used stockpile marked as restricted would probably hurt FPS. 

Quote
Can dwarves moving stuff to the stockpile still do their jobs correctly?
Yes.  They can still path to the restricted tiles, they will just spend more effort (and thinking time) avoiding them. 

Quote
b) How long of a path before A* gives up and flood-fills in DF2012?
A* doesn't work like that.  A* will function like flood filling in the worst case, which is when it can't reach the destination, or if the destination is physically close to the starting point, but the actual path between the two is very long and you need to go the wrong way for a while. 

Key points are, destination unreachable = bad.  Having to go the wrong way to reach the destination = bad. 

Anyway, A* estimates the distance between the source and target for each tile on the path.  It then compares those estimates to guess which way to go.  The more often it guesses correctly, the quicker it will find the best path. 

Theory:
Spoiler (click to show/hide)

Loud Whispers

  • Bay Watcher
  • They said we have to aim higher, so we dug deeper.
    • View Profile
    • I APPLAUD YOU SIRRAH
Re: The Right Path - Increasing FPS via Traffic Designations
« Reply #32 on: August 01, 2012, 07:18:48 am »

Looking at your outside picture, what are the FPS costs of having to retrieve large numbers of items from outside past the "barrier? I usually have my military sally forth to kill everything, thus leaving all the clothing etc. outside. It's also necessary to dump all the bodies in magma. So, would this actually save FPS in my case, or not?
You'll want to get rid of those one way or another. DF'll still track the items, so release a magma flood or two every now and then to clean up the junk.

wuphonsreach

  • Bay Watcher
    • View Profile
Re: The Right Path - Increasing FPS via Traffic Designations
« Reply #33 on: August 01, 2012, 04:04:02 pm »

Which is why most of my forts end up with doors and stairways everywhere.  I'd rather have a grid of 2-tile wide corridors only 11 tiles apart then a single 5-tile wide hallway with rooms branching off of it.  The downside of all the stairs is space, harder to defend if something does get inside, and possible falling accidents.

If I have a big room next to a corridor, then the doors go towards the corners of the room rather then set in the middle of the walls.  So instead of a double-door set center in a 15-25 tile long room wall, I'll put in two sets of doors towards the ends of the 15-25 tile long wall.
Logged

Five chickens

  • Bay Watcher
    • View Profile
Re: The Right Path - Increasing FPS via Traffic Designations
« Reply #34 on: August 01, 2012, 07:49:06 pm »

Would it make sense to just restrict the entrance to the tunnel leading into the fort?
Logged

Xob Ludosmbax

  • Bay Watcher
    • View Profile
Re: The Right Path - Increasing FPS via Traffic Designations
« Reply #35 on: August 02, 2012, 12:59:43 am »

Restricting something is basically saying, "There's nothing to see here, look everywhere else first."

If the dwarf's target is in the restricted area, you're hurting FPS.  If the dwarf's target is not in the restricted area, you're helping FPS.  Restricting the entrance forces the dwarves to search the fortress for their target before looking to see if it's outside.  In most cases, that's true, so you end up with a net win. 

Quatch

  • Bay Watcher
  • [CURIOUSBEAST_ GRADSTUDENT]
    • View Profile
    • Twitch? Sometimes..
Re: The Right Path - Increasing FPS via Traffic Designations
« Reply #36 on: August 02, 2012, 11:46:31 am »

Does this mean that a diagonal hallway is more efficient to path as well as shorter to walk (compared with two straight hallways at 90deg, assuming you are trying to get from one corner of a square to the other)?
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.

acetech09

  • Bay Watcher
  • Bay Watcher
    • View Profile
Re: The Right Path - Increasing FPS via Traffic Designations
« Reply #37 on: August 02, 2012, 01:01:52 pm »

Does this mean that a diagonal hallway is more efficient to path as well as shorter to walk (compared with two straight hallways at 90deg, assuming you are trying to get from one corner of a square to the other)?

Yes. It does. Straight lines are always best.

I'm thinking about how FPS-efficient a open-square fortress would be. All areas have no walls, so pathfinding is mostly direct-lines.
Logged
I challenge you to a game of 'Hide the Sausage', to the death.

Urist Da Vinci

  • Bay Watcher
  • [NATURAL_SKILL: ENGINEER:4]
    • View Profile
Re: The Right Path - Increasing FPS via Traffic Designations
« Reply #38 on: August 02, 2012, 02:57:25 pm »

...
I'm thinking about how FPS-efficient a open-square fortress would be. All areas have no walls, so pathfinding is mostly direct-lines.

Only if the tile cost is 1 (HIGH, or if you changed NORMAL from 2 to 1). Otherwise, you get some flood-filling and backwards searching as you approach the destination.

GhostDwemer

  • Bay Watcher
    • View Profile
Re: The Right Path - Increasing FPS via Traffic Designations
« Reply #39 on: August 02, 2012, 03:22:57 pm »

My experiences with traffic designation have not been so dramatic. 1-2 FPS gain, at most. Perhaps it is that, knowing the game uses an A* pathing algorithm, I have designed my fortress without blind dead ends and other pathing problems? In any case, I have not seen 15 FPS speed ups. Nothing close, even, for example, physically blocking off caverns or mined out areas won't help me that much. I wish it did!
Logged
Pages: 1 2 [3]