Bay 12 Games Forum

Please login or register.

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

Author Topic: major FPS improvement, over 2x!  (Read 10581 times)

Savok

  • Bay Watcher
    • View Profile
major FPS improvement, over 2x!
« on: February 15, 2009, 04:59:09 pm »

Whoa.

I was running an 10x12, 47 z-level fort with magma, chasm (undiscovered), underground river, and HFS (undiscovered). As expected, FPS got down to about 25 or 30 once I had 60 dwarves. It is important to note that I had several 1-wide corridors, one of them going from a corner of the map to the middle and spanning several z-levels.

I had heard somewhere on the forums that designating high traffic zones improved FPS because the numbers used to calculate stuff were smaller. Following this advice, I designated high traffic everywhere.

New FPS: 50-65!
« Last Edit: February 15, 2009, 05:02:06 pm by Savok »
Logged
So sayeth the Wiki Loremaster!

Untelligent

  • Bay Watcher
  • I eat flesh!
    • View Profile
Re: major FPS improvement, over 2x!
« Reply #1 on: February 15, 2009, 05:05:43 pm »

Twice as fast makes sense, I guess, seeing as the pathfinding count for a high-traffic square is half that of a normal-traffic square.
Logged
The World Without Knifebear — A much safer world indeed.
regardless, the slime shooter will be completed, come hell or high water, which are both entirely plausible setbacks at this point.

Deathworks

  • Bay Watcher
  • There be no fortress without its feline rulers!
    • View Profile
Re: major FPS improvement, over 2x!
« Reply #2 on: February 15, 2009, 05:27:54 pm »

Hello!

Yep, I am also using high traffic zones in my core fortress (mainly because it is a surface fortress, so I don't want them to trample the young trees, though). My settings for the traffic zones are a bit more extreme than default (I think restricted is about 75). For various reasons, my fortress is growing only slowly, but I recently added high traffic zones and low traffic zones to some new quarters where I was doing quite some building and working, and I was more or less immediately rewarded with about 2 FPS more - an increase from 28 FPS average to 30 FPS average. While this may sound as very little, please note that most of the fortress proper already has such traffic zones, so it was a very minor change.

On the other hand, when the first wave of cats dying of old age occured in the fortress, dropping their number from 82 to 52, there was no notable change in FPS at all. In other words, my personal experience does not confirm the claim that cats eat FPS for breakfast (and neither do donkeys, as I found out in an older fortress suffering from a donkeyplosion).

So, yes, traffic zones are really awesome in many ways, including FPS-wise.

Deathworks
Logged

woose1

  • Bay Watcher
  • Yay for bandwagons!
    • View Profile
Re: major FPS improvement, over 2x!
« Reply #3 on: February 15, 2009, 05:30:17 pm »

Its deppresing that over half the CPU power that goes into this game is used for calculating Dwarves's pathfinding.
Logged

Deathworks

  • Bay Watcher
  • There be no fortress without its feline rulers!
    • View Profile
Re: major FPS improvement, over 2x!
« Reply #4 on: February 15, 2009, 05:55:10 pm »

Hi!

Its deppresing that over half the CPU power that goes into this game is used for calculating Dwarves's pathfinding.

But then again, you should consider how powerful that path-finding is. I mean, we are talking about a complex 3D environment with mutual interference by creatures and also impact on the surroundings by the creatures (killing a young tree probably also costs a little bit of time as well).

And, putting it the other way around, it shows just how well Toady One has implemented all the complex interactions between the dwarves and their environment with all their social interactions, their bodily functions, workshops, prioritizing and many, many details. Those routines are obviously well-crafted if path finding can have so much an impact on things.

Deathworks
Logged

Apegrape

  • Bay Watcher
  • Stop that, it's silly.
    • View Profile
Re: major FPS improvement, over 2x!
« Reply #5 on: February 15, 2009, 05:56:28 pm »

Yeah, but let's not give Toady any more stress.. I think it's scheduled.
If the pathfinding was improved, think of what people could do. Water elementals actually made of water and stuff. Exploding kittens for the masses!
Logged
This is -ing good wood!

Sinergistic

  • Bay Watcher
    • View Profile
Re: major FPS improvement, over 2x!
« Reply #6 on: February 16, 2009, 12:00:14 am »

I wonder what effect you would get from designating to-be-mind areas as high traffic?

The game always slows down a little with lots of mining going on, I always thought it was from the dwarfs constantly pathing to the next stone they want to dig, and running into other miners while doing it.
Logged

ZeroGravitas

  • Bay Watcher
    • View Profile
Re: major FPS improvement, over 2x!
« Reply #7 on: February 16, 2009, 12:11:06 am »

And, putting it the other way around, it shows just how well Toady One has implemented all the complex interactions between the dwarves and their environment with all their social interactions, their bodily functions, workshops, prioritizing and many, many details. Those routines are obviously well-crafted if path finding can have so much an impact on things.

i lol'd
Logged

ZeroGravitas

  • Bay Watcher
    • View Profile
Re: major FPS improvement, over 2x!
« Reply #8 on: February 16, 2009, 12:21:43 am »

Whoa.

I was running an 10x12, 47 z-level fort with magma, chasm (undiscovered), underground river, and HFS (undiscovered). As expected, FPS got down to about 25 or 30 once I had 60 dwarves. It is important to note that I had several 1-wide corridors, one of them going from a corner of the map to the middle and spanning several z-levels.

I had heard somewhere on the forums that designating high traffic zones improved FPS because the numbers used to calculate stuff were smaller. Following this advice, I designated high traffic everywhere.

New FPS: 50-65!

Eh, I tried this with my much smaller map but larger fort and it didn't do anything.

By the way, instead of designating high traffic zones everywhere, you could just lower the cost of normal traffic to 1.
Logged

Sowelu

  • Bay Watcher
  • I am offishially a penguin.
    • View Profile
Re: major FPS improvement, over 2x!
« Reply #9 on: February 16, 2009, 03:32:12 am »

You designated it 'everywhere'?  I have a doubt.  :)  I'm guessing the meaning there is "designated it everywhere that it mattered, like major corridors and gathering places where dwarves want to go"...
Logged
Some things were made for one thing, for me / that one thing is the sea~
His servers are going to be powered by goat blood and moonlight.
Oh, a biomass/24 hour solar facility. How green!

ZeroGravitas

  • Bay Watcher
    • View Profile
Re: major FPS improvement, over 2x!
« Reply #10 on: February 16, 2009, 03:07:06 pm »

You designated it 'everywhere'?  I have a doubt.  :)  I'm guessing the meaning there is "designated it everywhere that it mattered, like major corridors and gathering places where dwarves want to go"...

it's not hard to designate them everywhere. go to the  bottom level. put the cursor in a bottom corner. press enter. hold shift and move to the opposite map corner. press enter.

move up a level. repeat until done.
Logged

Sowelu

  • Bay Watcher
  • I am offishially a penguin.
    • View Profile
Re: major FPS improvement, over 2x!
« Reply #11 on: February 16, 2009, 03:09:42 pm »

I know HOW to designate everywhere, I'm just questioning that it would produce any results at all.  If it does, it would TOTALLY break my mind, and the algorithm Toady is using would be entirely demented.  I'd start looking for proof that it really does work and it's not a fluke.  Because if that has any effect, uh...well, yeah.

I don't think so.
Logged
Some things were made for one thing, for me / that one thing is the sea~
His servers are going to be powered by goat blood and moonlight.
Oh, a biomass/24 hour solar facility. How green!

Savok

  • Bay Watcher
    • View Profile
Re: major FPS improvement, over 2x!
« Reply #12 on: February 16, 2009, 03:45:51 pm »

I agree.

It is rather strange, but it did up the FPS on my fort majorly.

And yes, I did not place high traffic zones in the volcano or other places dwarves never ever go near.
Logged
So sayeth the Wiki Loremaster!

Sowelu

  • Bay Watcher
  • I am offishially a penguin.
    • View Profile
Re: major FPS improvement, over 2x!
« Reply #13 on: February 16, 2009, 04:33:31 pm »

Did you put high traffic zones outside at all?  Assuming your dwarves don't go outside much...  And I'm assuming you didn't put them in those big long tunnels to nowhere?

I want to correct a misconception.  The pathfinding speed has nothing to do with the numbers overall being bigger or smaller.  If you zone the ENTIRE map as low-traffic, and even as restricted, you should expect to see the same things happen as normal or high designation.

The only change is that, to put it really simply:  Dwarves will look for a way to where they are going in high-traffic before medium-traffic, and medium- before low-, low- before restricted.  They'll still search in restricted areas eventually if they NEED to get there, but they'll search them last (in general).  Zoning commonly used areas as high traffic can really help, but zoning infrequently used areas as high traffic is very counterproductive.  Zoning rooms that dwarves never go to as 'restricted' can help, but it can hurt you really bad if you misuse it.

Like, let's say you have a refuse stockpile that you don't want dwarves wandering through, and you mistakenly zone it as 'restricted'.  Now, your dwarves will only go through there as a last resort.  But that includes your refuse haulers, who will search the entire map for your stockpile before they actually look at where it really is.  That can cause a big slowdown.

On the other hand, let's say you have a large bedroom right along your main hallway.  If a hundred dwarves walk past that place every day, you might consider making it restricted.  The bedroom's owner will cause a little slowdown when he tries to get home, because he'll essentially search the whole map before he finds his bed, but probably it will be worth it.

Places that EVERYONE goes are good 'high traffic' candidates...like the booze stockpile, if you have one big one, and maybe the dining room.  Just keep in mind that anyone who needs to walk past the dining room will say "Hmm, maybe my workshop is in here" along the way.

It's actually a lot more subtle than that, but meh...

If you want a real quick test to try this out, one thing to try is to zone your entrance as restricted.  If you only have one entrance to your fort, and most dwarves don't go outside all that often, make like the first ten tiles of your entrance tunnel restricted.  You can sometimes see a huge speedup just from this.

(reasoning: It doesn't really slow down dwarves who need to go outside, on their way out, because they're likely to search the whole fort first anyway.  But it almost guarantees that nobody who doesn't need to go outside will even consider it.)
« Last Edit: February 16, 2009, 04:36:48 pm by Sowelu »
Logged
Some things were made for one thing, for me / that one thing is the sea~
His servers are going to be powered by goat blood and moonlight.
Oh, a biomass/24 hour solar facility. How green!

Deathworks

  • Bay Watcher
  • There be no fortress without its feline rulers!
    • View Profile
Re: major FPS improvement, over 2x!
« Reply #14 on: February 16, 2009, 04:45:21 pm »

Hi!

The improvement I saw was in combination with a slightly smaller application as there are no major zones my dwarves won't visit on the surface. As my fortress consists of surface buildings (lots of free space around them), I designated high traffic zones to mark 2-tile-wide roads leading from one building to the other in a street grid. In between these, I put low traffic zones (effectively restricted if you use the default values). Just adding this for the latest (and rather active) two buildings under construction already had major impact on things.

So, besides cutting off entire zones, reducing roads in width for pathfinding already helps (and since the physical road is still wider, dwarves can and will evade other creatures).

Deathworks
Logged
Pages: [1] 2 3 ... 7