Dwarf Fortress

Dwarf Fortress

Ronin Cross Dec 30, 2022 @ 9:00am
FPS Death
I'm at year 11 with 140 population and after a noticeable slowdown I toggled on the in-game FPS tracker; I'm getting 10-15 fps.

I just got my fortress to a point where I'd say the real fun starts; is it just downhill from here or are there way to fix this?

I'm new to DF, if I had to guess one thing that could help would be getting rid of *trash* that spawns from fighting and ect that then clutters the map/trash piles forever. Can you toss things into magma to remove them? I have a steel pick floating in magma from an *accident* so I know those won't disappear, but what about body parts/teeth/trash?
Originally posted by Xcorps:
Originally posted by Generic Hyena #2:
Holy f*ck that DFHack reccommendation worked great.
Apparently there were 529 amphibian men in my caverns. Is there no cap on these?
Went from 19FPS to 99.

Thank you very much!

Yes, you can limit them. Setting>Difficulty>Custom...down the list to caverns. Change the numbers that are there to less than 25% of what they currently are, or turn them off completely. Those are not actual counts, 50 does not mean "50 crittters".

Source is Putnam in a video with Blind or a post, I don't remember. Try watching this, starting around 11. https://www.youtube.com/watch?v=79J3X8ulER0&ab_channel=Blind
< >
Showing 1-15 of 21 comments
Destroi Dec 30, 2022 @ 9:06am 
yeah 10-15 is pretty low for 140 pop

year 11 makes me think you have a ton of items all over

maybe look at clearing clutter from the map

yes you can use magma, or just make a simple atom smasher from a bridge/lever.

Or, take what you've learned and start a new map and see if the updates help. I've noticed all my newer forts have better performance lately
zeeb Dec 30, 2022 @ 9:07am 
Atom smash everything/everyone you don't need and don't produce items just for the sake of it, everything should have a purpose.

For example, I limit my forts to only produce a maximum of 100 drinks. I also stop at 10 of the animals I want to use with the offspring being slaughtered for food etc.

Children gets to ride a rollercoaster to the core, looks kinda FUN.
Last edited by zeeb; Dec 30, 2022 @ 9:14am
malthenielsen Dec 30, 2022 @ 9:11am 
I think you can save it. You should look up some of the standard moves.

Crush all the junk items on the map under a drawbridge or donate it to a caravan. It's easier with bridges because you can build temporary ones next to the junk.

Cut all the trees down, trees gobble FPS.

Cut down on animals and visitors.
Boomshanka Dec 30, 2022 @ 9:29am 
dont engrave your fort to much, and try not to have massive stockpiles
MSA75 Dec 30, 2022 @ 9:38am 
Turn off temperature and weather from the settings.
Ronin Cross Dec 30, 2022 @ 10:44am 
Trying all these now, thank you guys.

Found out while looking through my stocks to sort things as trash, I have 70k honeybees.... only 5 hives but I never figured out how to harvest them so they've just been accumulating XD I don't know if that contributed but I wouldn't be surprised lol
Zaelus Dec 30, 2022 @ 10:51am 
You guys should take a read through this thread which was started by the new programmer that will be working on the game, Putnam, as a result of their profiling the performance of the game: http://www.bay12forums.com/smf/index.php?PHPSESSID=bfb95c64d68a140d72b52d448161f2dc&topic=180561.0

In summary, FPS death is inevitable. The primary reason it occurs is due to the system of checking lines of sight amongst ALL creatures in the entire game instance. They have to do this to be able to know exactly when things see each other, so even creatures down in the caves nowhere near your dwarves are still checking to see if your dwarves can see them, and vice versa.

Pathfinding happens so rarely that my profiling has shown it contributes to about 6% of an individual tick's processing time. This is compared to the largest cause, one whose contribution to total CPU usage actually grows faster than pathfinding and one that is still the slowest thing in early game: units checking other units for line-of-sight/proximity checks (running away from hostiles etc), which is more like 20%. The truth is that FPS death is not a matter of multithreading pathfinding or anything like that, it's a combination of just about everything in there.

20% of total CPU usage is massive for one single algorithm in a whole executable. So I would guess that you have opened a ton of cavern area or have a lot of creatures present on the map all the time in general, and that's the cause. Hopefully we will be seeing some optimization to this portion of the code in the near future.
Last edited by Zaelus; Dec 30, 2022 @ 10:52am
malthenielsen Dec 30, 2022 @ 10:53am 
Originally posted by Ronin Cross:
Trying all these now, thank you guys.

Found out while looking through my stocks to sort things as trash, I have 70k honeybees.... only 5 hives but I never figured out how to harvest them so they've just been accumulating XD I don't know if that contributed but I wouldn't be surprised lol

Check out your seeds. I once had 6K useless avodado pits in a fort.

Also shells, remains can pile up.
Morkonan Dec 30, 2022 @ 12:22pm 
Originally posted by Zaelus:
...
In summary, FPS death is inevitable. The primary reason it occurs is due to the system of checking lines of sight amongst ALL creatures in the entire game instance. They have to do this to be able to know exactly when things see each other, so even creatures down in the caves nowhere near your dwarves are still checking to see if your dwarves can see them, and vice versa.
..

"Inevitable"

I have a Mountainhome, 221 citizens, at least a hundred visitors and animals, plus whatever else is wild and currently active. I have multiple taverns/dining halls, temples, guilds, etc, a large production floor, bedrooms, farms, stockpiles full of clothing/items/armor... IOW - All the stuffs.

I haven't encountered FPS Death.

But, what have I not done?

I have yet to open the Caverns.

Why?

Because, as soon as I saw people talking about issues, two mechanics came to mind that I've seen in other games that cause "problems." One is that there are real temperature mechanics, but I haven't had any wildfires, and another is tile-by-tile checks for things spreading in a game, like.. fungus/moss spreading once caverns are opened.

I have seen <1 fps results in streams where the player has three active, obvious, things going on:

Siege or FB
Spreading Fire
Caverns open and fungus spreading

In fact, in all cases where I've seen gameplay hit with FPS death occurs, those variables are present. I've probably watched... uh... far, far, too many hours of gameplay streams. Why? I have no life and I'll put one up while eating dinner, because TV is mindless garbage. (And streams of DF isn't? No, of course not! :))

I run the game on a first-gen i7 (but a nice one), 8 gig RAM, a SCSI SSD (yeah, old), some relatively new'isher NVidia GPU that doesn't matter, and Win7Pro (old old).

I can't recall, atm, but I may have also started in a 3x3 embark for the reasons noted - I tried to research a bit before starting a real playthrough. But, I may have just used 4x4 since I try to use default values for benchmarking purposes.

My only performance issues are mouse-click detection at times where there's a good bit going on, visually, and the game is unpaused. I've had raids with not much in terms of appreciable performance hits, but it was noticeable. (I currently have them off because I goofed in interpreting some mechanics and am correcting for that, but I don't expect terrible results unless I get 100s of besiegers, which... could be possible.)

So... "inevitable?" No, not in my admittedly unschooled opinion. It's not a problem of the gradual accumulation of actions/events building up, it's the problem of, IMO and being a non-coder/non-programmer, one of slapping a lot of overhead on top of all those things that will not go away. It's additional forever-checks getting put on top of already existing forever-checks that appears to be the issue and it reads as if those checks are not well-optimized as well.

The sight checks, which won't ever stop, surely need to be optimized/whatever'ed. Fire/temperature and, in my opinion only, the fungus spread may need to be looked at. (I do not know how either of these propagate.)
Ronin Cross Dec 30, 2022 @ 6:14pm 
Still working on building my magma dumpster fire area; I do have 3 caverns discovered and a large magma pool. I didn't notice the FPS slowing down until roughly after the third cavern now that you mention it, so maybe that is one of the larger factors.

If I can get this trash destroyed and it helps any, might just flood the caverns with magma.
MSA75 Dec 30, 2022 @ 11:44pm 
Turn off temperature and weather from the settings, set stricter population caps, embark on a smaller world and use 2x2 or 4x4 embarks, wall off caverns, make sure dwarves don't get stuck into some doorway etc.
mauerzahn Feb 5, 2023 @ 11:47am 
Same with me:

I'm a total newb, so I might miss a lot of things and have a bad fortress design and all. But I'm down to 7-10 fps on an i7 processor after only 8 years and a population of 114 with my second fort - and I don't even have visitors.

Even with atom smashers running, DF Hacks temperature equilibrium and strict old clothes management fps don't change... or at least not in the direction I'd like them to change. :-)

For some reason things seem to run good - even a year or two after entering the third cavern - but then all of a sudden fps drop rapidly and nothing seems to get them up again.

I feel like I might be missing something.. sigh... kind of sad for this is such a great game, just not on 7fps. :-)
kheftel Feb 5, 2023 @ 11:58am 
Originally posted by mauerzahn:
Same with me:

I'm a total newb, so I might miss a lot of things and have a bad fortress design and all. But I'm down to 7-10 fps on an i7 processor after only 8 years and a population of 114 with my second fort - and I don't even have visitors.

Even with atom smashers running, DF Hacks temperature equilibrium and strict old clothes management fps don't change... or at least not in the direction I'd like them to change. :-)

For some reason things seem to run good - even a year or two after entering the third cavern - but then all of a sudden fps drop rapidly and nothing seems to get them up again.

I feel like I might be missing something.. sigh... kind of sad for this is such a great game, just not on 7fps. :-)
Try using DF back exterminate to see if you have a bunch of cavern invaders clogging up your fps. For me, I had a few hundred units, amphibian men/women, giant olms etc and once I cleared them my fps went back to normal.
Tanker Feb 5, 2023 @ 4:52pm 
Originally posted by Ronin Cross:
I'm at year 11 with 140 population and after a noticeable slowdown I toggled on the in-game FPS tracker; I'm getting 10-15 fps.

If the slowing down was not gradual, but mostly came within a short period of time and you did not build something special withinn the time, then probably it is because of cavern invaders mentioned above. I would also check it there is a creature (dwarf/enemy/merchant/guest/animal) stuck somewhere (Putnam (new dev.) mentioned that it also can significantly slow the game down).
< >
Showing 1-15 of 21 comments
Per page: 1530 50

Date Posted: Dec 30, 2022 @ 9:00am
Posts: 21