Bay 12 Games Forum

Please login or register.

Login with username, password and session length
Advanced search  

Author Topic: Reason for framerate decrease over time, besides population?  (Read 2679 times)

rucksackjack

  • Bay Watcher
    • View Profile
Reason for framerate decrease over time, besides population?
« on: April 25, 2010, 10:09:17 am »

Up until now I'd assumed that my gradually-decreasing framerate over the course of an average fort was due directly to the increasing population -- more dwarves pathing, etc. I'm sure that's a significant part of it, but today I had what seemed like a strange experience:

I started out with the FPS capped at 400, as is my wont. As usual, my framerate started in the 300s and then gradually decreased over the course of the game, until at around 70 population it was well below 100. At this point, I allowed my entire fort to be murdered by an angry goblin. When I was down to less than 10 population again, I realized that the framerate hadn't gone back up, and was still around 50!

Can anyone explain the real reason for the drop? Is it because of all the items lying around in the fort? I admit that my fortress was not exactly tidy; a lot of workshops were cluttered, and stockpiles were massive and constantly overflowing. Or is there some other reason? I kept animal population to an absolute minimum, and all of them were dead by the end anyway, so I don't think it's that. But what exactly is changing over the course of the fort, if not population, that causes this permanent drop in framerate?

This is driving me nuts, so any reply would be appreciated. I'd really like to get to the heart of this issue so I can figure out how best to optimize framerate in future forts.
Logged

bmaczero

  • Bay Watcher
  • Smokie, Tame Parakeet (On Head)
    • View Profile
    • I make games
Re: Reason for framerate decrease over time, besides population?
« Reply #1 on: April 25, 2010, 10:13:55 am »

It's because of items.  If you lost that many dwarves there must be hundreds of articles of clothing lying around that the game has to keep track of.
Logged
The Forgotten Beast Art Archive.  Nightmares 100% guaranteed!

rucksackjack

  • Bay Watcher
    • View Profile
Re: Reason for framerate decrease over time, besides population?
« Reply #2 on: April 25, 2010, 10:19:26 am »

Thank you. It sounds like items have an extremely profound effect on framerate, far moreso than units (except in unusual circumstances such as all of the dwarves simultaneously rushing to pick stuff up from a murdered elf caravan). If this is the case, it sounds like one could keep the framerate relatively high simply by constantly giving away goods to the caravans, keeping everything properly stockpiled, etc. Has anyone verified this experimentally?
Logged

riznar

  • Bay Watcher
    • View Profile
Re: Reason for framerate decrease over time, besides population?
« Reply #3 on: April 25, 2010, 10:34:09 am »

People destroy loose items in various ways, melting them in magma, crushing under bridges, giving away to caravans, etc. I think it's been shown to work.
Logged

Danjen

  • Bay Watcher
    • View Profile
Re: Reason for framerate decrease over time, besides population?
« Reply #4 on: April 25, 2010, 10:43:37 am »

An atomsmasher is a very good investment for any fort.
Logged
Quote from: mrbobbyg
Hey, I'm cool with you tying a dog up and shooting it with a ballista if you're short on elves, but there's not need to lie about it to us.

Tycho

  • Bay Watcher
    • View Profile
Re: Reason for framerate decrease over time, besides population?
« Reply #5 on: April 25, 2010, 11:07:48 am »

Do we know if bins/barrels have any effect on this? Does putting things in bins reduce
the framerate load from all the items to just the bin?
Logged
Tycho canceles Starting Fist Fight: Went Insane.

Squirrelloid

  • Bay Watcher
    • View Profile
Re: Reason for framerate decrease over time, besides population?
« Reply #6 on: April 25, 2010, 11:31:11 am »

Number of mined tiles have a profound impact on FPS as it makes pathfinding harder.  Clever use of traffic designations can mitigate this somewhat
Logged

PopeRichardCorey

  • Bay Watcher
    • View Profile
Re: Reason for framerate decrease over time, besides population?
« Reply #7 on: April 25, 2010, 02:17:09 pm »

Number of mined tiles have a profound impact on FPS as it makes pathfinding harder.  Clever use of traffic designations can mitigate this somewhat

Does walling off no-longer-used regions also mitigate?
Logged
And when you build your fortress walls from the bones of skeletal elephants, slain my weapons forged from melted goblin plunder, fed on cattle that graze on grass that blinks.  Then, you will know dwarfdom.

Paul

  • Bay Watcher
  • Polite discourse with a dash of insanity.
    • View Profile
    • Need an affordable website? I can help.
Re: Reason for framerate decrease over time, besides population?
« Reply #8 on: April 25, 2010, 02:29:11 pm »

The presence of hidden units also negatively impacts performance (goblin ambushes, thieves, etc) even if they have no path to the dwarves. Larger forts usually attract more ambushes and such, so that's one thing that slows you down.

In a past version I modified goblins to only be active during winter, and noticed that I could often find goblin ambushes in the spring, summer, and fall as well - they had apparently been wandering around since winter. Keeping a patrol moving around the map spotting them I confirmed they only came during the winter, but without anything on the surface to spot them they would wander around on the surface until they eventually ran into something (usually a caravan). I think they even built up over time if not spotted by something.

I'm not sure if that all still holds true for the new version, though. I haven't tried modding the goblins this version yet.
Logged
Do you like Science Fiction? I'm writing the Weaveborn Saga over on Royal Road and my website. Link

Gertack

  • Bay Watcher
    • View Profile
Re: Reason for framerate decrease over time, besides population?
« Reply #9 on: April 25, 2010, 05:23:32 pm »

Worst framerate hit isn't pathing so much as the number of jobs pending (which is increased by having loose rock around).

I've noticed smoothing/engraving/mining cause a FPS hit too while they're in progress.
Logged

Narmio

  • Bay Watcher
    • View Profile
Re: Reason for framerate decrease over time, besides population?
« Reply #10 on: April 25, 2010, 10:23:30 pm »

Walling off unused mine sections definitely helps.  It takes a while, it seems, for the cached map segments to be cleared when you change connectivities, so don't expect things to jump straight back up.  It also might be worthwhile to forbid any loose stone left in walled off areas.

I've also got a theory that the interconnectedness of standard grid mining is really, really, really bad for pathfinding.  And that separating mines into large "blocks" that only have a few entrances and exits might help.  But that's just a theory.  It's based on the fact that mining out quite a large fortress - entrance, many levels of stockpiles, workshops, forges, bedrooms, etc doesn't cause anywhere near as much slowdown for me as opening up a few levels of mine.

I had thought that designating a "fortress" burrow and a "mines" burrow and only assigning haulers and miners to the latter would prevent other dwarves attempting to path into the mines, but burrows and pathfinding dont' seem to interact like that yet. 

Something else I've done is make sure every mine level has only one entrance and to put ten tiles of Restricted traffic designation in that entrance area.  That means that destinations inside the fortress will usually be checked first.  Assuming the majority of your dwarves are not going into the mines (which can be untrue when extracting large amounts of ore!), this can have some small gain.  But not as much, it seems, as strip-mining a level and then walling it off.
Logged

AncientEnemy

  • Bay Watcher
  • The Answer is always POUR MAGMA ON IT
    • View Profile
Re: Reason for framerate decrease over time, besides population?
« Reply #11 on: April 25, 2010, 10:39:53 pm »

pathfinding aside, it does seem like in the new version that having lots of items does have a much more profound impact on FPS than it did in 40d. in 40d it was the common wisdom (and something i tended to observe myself) that items didn't affect your FPS all that much. generally to see a noticeable increase you'd have to atomsmash/chasm/otherwise eliminate thousands of items.

in 2010 however it seems like items take up a much bigger chunk of your FPS. take the bugged elven caravans that bring thousands of items. in 40d the addition of a few thousand items would have been a minor fps hit, something you wouldn't really notice in the scheme of things. but in 2010 it can halve your fps.

simplifying pathfinding as much as possible is/probably ever-shall-be the biggest player in determining the kind of FPS you can get. but it seems like eliminating unnecessary items may now be a significant factor as well.

Max White

  • Bay Watcher
  • Still not hollowed!
    • View Profile
Re: Reason for framerate decrease over time, besides population?
« Reply #12 on: April 25, 2010, 10:40:56 pm »

If you happen to get blood everywhere (And who hasn't by the first summer) then that do will REALLY bad things to FPS...

Lord Dakoth

  • Bay Watcher
  • That's a hammerin'.
    • View Profile
Re: Reason for framerate decrease over time, besides population?
« Reply #13 on: April 26, 2010, 12:10:50 am »

Yes. To make matters worse, I don't believe that outside refuse is cleared away at the turn of the year anymore... and my cleaner-dwarves never seem to clean properly.

Main thing that kills fps is items, normally stone. Atomsmasher the crap, just be careful not to atomsmash any (important) dwarves in the process.
Logged
Avatar by legendary engraver /u/Redicno of reddit.

Lightning4

  • Bay Watcher
    • View Profile
Re: Reason for framerate decrease over time, besides population?
« Reply #14 on: April 26, 2010, 12:35:01 am »

Blood is a severe FPS crippler, especially if you're on a map where it never rains. My second fort was crippled to about 6 fps by the time I finally abandoned due to the sheer layers of blood outside from the rather... messy ambushes. I can only imagine how many layers my dwarves and creatures had on them, further reducing the FPS.

Fortunately, you can kill it with constructed walls or floors, or avoid it by settling somewhere it rains very often. Or you can avoid having your dwarves fight outside, that works too. :P

Logged