Dwarf Fortress

Dwarf Fortress

edmek55555 Jul 5, 2021 @ 1:20pm
Will there be a fix for FPS death?
I love dwarf fortress and played it many times until FPS death. I’m very excited to see it get updated with a graphical overhaul and most importantly, a better UI. However I was wondering if they were also doing any bug fixing/coding overhauls or if the changes for the steam release are just cosmetic?

P.S anyone have any good tips for avoiding fps death that have personally worked well fo them? I’m sure my obsession with hording animals is a killer but my army of giant Cardinals is worth the eventual sadness lol
Originally posted by The Trashman:
There's a page on the DF wiki with plenty of tips for improving framerate:
https://dwarffortresswiki.org/index.php/DF2014:Maximizing_framerate

The steam release almost certainly won't include any changes to improve framerate.

In terms of things that've worked well for me, I've found that focussing on minimising pathing helps the most with increasing framerate. In a late fort with 200 dwarves (and as many animals), with all caverns open and a complicated layout, there's a huge amount of pathfinding that needs to be done. The smaller the area to path through, the closer everything is, the more you designate traffic areas, the better your framerate will be.

Framerate Improvements
  • Embarking on a smaller site means a smaller area for pathing. Using (uppercase) UHKM when selecting an emark site to shrink the size to 3x4 (75% of the size), 3x3 (~55% of the size) or even smaller can help limit the amount of pathfinding that needs to be done.

  • Designate high, low and restricted traffic areas ([d]esignations -> [o] to selected traffic area painting, then select [l]ow, [n]ormal, [h]igh or [r]estricted before painting) to aid in pathfinding. Painting main corridors, stairways, and routes through your fort as [h]igh traffic areas will help the pathfinding algorithm find the fastest routes through. Additionally, you can paint dead-end rooms as [l]ow or [r]estricted areas to help it skip over these.

  • Caverns are large and complicated. Blocking access to them with a locked door, raised drawbridge or even walling them off entirely will reduce the amount of pathfinding dwarves need to do through them.

  • Animals need to pathfind, too. Locking them in a cage will completely stop them from doing this, though I believe they will no longer breed. Using a pasture behind a locked/pet impassible door or drawbridge can also minimise the pathfinding they do. In the case of your war cardinals, locking them in a cage that's linked to a lever could allow you to release them all at once when needed.

  • Plan your fort for efficiency. Minimising distance between things means less pathfinding. For example, putting small stockpiles of prepared food, drinks and mugs/goblets near your dining hall means dwarves don't have to go between your farm/food stockpiles and your dining hall as much. Spreading out vertically rather than horizontally can keep things closer.

  • Using warrens can help keep your dwarves contained to a smaller area. I'm not completely clear on how this interacts with pathfinding, but I have found this helpful for framerate previously.

  • If you find the game unplayable at lower framerates, consider limiting your population cap to a smaller size.

  • Outside of pathfinding, the game tracks items you create. The more things you make, the more junk there is for the game to track. Trading or gifting junk items to caravans or crushing things under a drawbridge can help get rid of old items. Additionally, turning off temperature calculations can speed things up, though I think things will stop burning/freezing in that case.
< >
Showing 1-15 of 15 comments
carlospaul Jul 5, 2021 @ 3:36pm 
think of it kind of like other games, TOtally Accurate Battle Simulator for example. You can place down a ton of units (i.e. peasants) to try and beat the level but the more you place down the more you make your game laggy because more 3D models for the game to process. If you make lots of stuff in Dwarf Fortress the same thing happens. But no one complains that in TABS you have bad FPS when you put down a lot of units. There is the fact that you get migrants forever, and migrants can't be controlled. So maybe Toady should put some type of adjustable setting for the max size of your fortress. But everything else, making endless clothing or something in your textile industry is in your control, just like how placing down more units in TABS is in your control.
XANi Jul 5, 2021 @ 4:13pm 
There are people running 200+ year forts without FPS problems, you can't really "fix" FPS if player is hoarding every piece of crap on the map.

Dwarf fortress wiki have good guide on reducing framerate problems
clinodev  [developer] Jul 6, 2021 @ 12:16am 
Originally posted by carlospaul:
There is the fact that you get migrants forever, and migrants can't be controlled. So maybe Toady should put some type of adjustable setting for the max size of your fortress. But everything else, making endless clothing or something in your textile industry is in your control, just like how placing down more units in TABS is in your control.

I'm happy to tell you he added immigration caps! My play style develops a lot of fortress wealth fast, so I pretty regularly set the cap to 50 at the start of the fort, and use them to build a fort for 100 or so dwarves, then set the cap to 100 and so on.

http://dwarffortresswiki.org/index.php/DF2014:Immigration#Limiting.2Fpreventing_immigration
John Jul 7, 2021 @ 4:30am 
Originally posted by XANi:
There are people running 200+ year forts without FPS problems, you can't really "fix" FPS if player is hoarding every piece of crap on the map.

Dwarf fortress wiki have good guide on reducing framerate problems
Of course you can, if you make a game that uses more than a single cpu thread that is. The bad hardware optimization that is not up to date with modern technology is the reason for those early fps deaths.
Jerma Rat Jul 7, 2021 @ 5:53am 
Originally posted by John:
Originally posted by XANi:
There are people running 200+ year forts without FPS problems, you can't really "fix" FPS if player is hoarding every piece of crap on the map.

Dwarf fortress wiki have good guide on reducing framerate problems
Of course you can, if you make a game that uses more than a single cpu thread that is. The bad hardware optimization that is not up to date with modern technology is the reason for those early fps deaths.
There's already been a 300+ comment thread on this, it seems like a pretty divisive topic in the community.
Voryn Dagoth Ur Jul 8, 2021 @ 9:18pm 
Originally posted by John:
Originally posted by XANi:
There are people running 200+ year forts without FPS problems, you can't really "fix" FPS if player is hoarding every piece of crap on the map.

Dwarf fortress wiki have good guide on reducing framerate problems
Of course you can, if you make a game that uses more than a single cpu thread that is. The bad hardware optimization that is not up to date with modern technology is the reason for those early fps deaths.
think its mostly the spaghetti codes fault, not the multi threading, if you add multithreading, which would pretty much take redoing the entire game, you'd still have the spaghetti code situation.
The author of this thread has indicated that this post answers the original topic.
The Trashman Jul 12, 2021 @ 3:39am 
There's a page on the DF wiki with plenty of tips for improving framerate:
https://dwarffortresswiki.org/index.php/DF2014:Maximizing_framerate

The steam release almost certainly won't include any changes to improve framerate.

In terms of things that've worked well for me, I've found that focussing on minimising pathing helps the most with increasing framerate. In a late fort with 200 dwarves (and as many animals), with all caverns open and a complicated layout, there's a huge amount of pathfinding that needs to be done. The smaller the area to path through, the closer everything is, the more you designate traffic areas, the better your framerate will be.

Framerate Improvements
  • Embarking on a smaller site means a smaller area for pathing. Using (uppercase) UHKM when selecting an emark site to shrink the size to 3x4 (75% of the size), 3x3 (~55% of the size) or even smaller can help limit the amount of pathfinding that needs to be done.

  • Designate high, low and restricted traffic areas ([d]esignations -> [o] to selected traffic area painting, then select [l]ow, [n]ormal, [h]igh or [r]estricted before painting) to aid in pathfinding. Painting main corridors, stairways, and routes through your fort as [h]igh traffic areas will help the pathfinding algorithm find the fastest routes through. Additionally, you can paint dead-end rooms as [l]ow or [r]estricted areas to help it skip over these.

  • Caverns are large and complicated. Blocking access to them with a locked door, raised drawbridge or even walling them off entirely will reduce the amount of pathfinding dwarves need to do through them.

  • Animals need to pathfind, too. Locking them in a cage will completely stop them from doing this, though I believe they will no longer breed. Using a pasture behind a locked/pet impassible door or drawbridge can also minimise the pathfinding they do. In the case of your war cardinals, locking them in a cage that's linked to a lever could allow you to release them all at once when needed.

  • Plan your fort for efficiency. Minimising distance between things means less pathfinding. For example, putting small stockpiles of prepared food, drinks and mugs/goblets near your dining hall means dwarves don't have to go between your farm/food stockpiles and your dining hall as much. Spreading out vertically rather than horizontally can keep things closer.

  • Using warrens can help keep your dwarves contained to a smaller area. I'm not completely clear on how this interacts with pathfinding, but I have found this helpful for framerate previously.

  • If you find the game unplayable at lower framerates, consider limiting your population cap to a smaller size.

  • Outside of pathfinding, the game tracks items you create. The more things you make, the more junk there is for the game to track. Trading or gifting junk items to caravans or crushing things under a drawbridge can help get rid of old items. Additionally, turning off temperature calculations can speed things up, though I think things will stop burning/freezing in that case.
em312s0n Jul 17, 2021 @ 8:19am 
The only fix for fps death at this point is for AMD or Intel to make faster CPUs with a large cache
Hobo Misanthropus Jul 17, 2021 @ 10:41pm 
Originally posted by John:
Originally posted by XANi:
There are people running 200+ year forts without FPS problems, you can't really "fix" FPS if player is hoarding every piece of crap on the map.

Dwarf fortress wiki have good guide on reducing framerate problems
Of course you can, if you make a game that uses more than a single cpu thread that is. The bad hardware optimization that is not up to date with modern technology is the reason for those early fps deaths.


Multithreading isn't as simple as "Make it use more CPU core"

Some elements of programming can't be parallelized.

I've heard Dwarf Fortress is also a really cache hungry game (it's functionally a database), and that Server CPUs, Workstation CPUs and now Zen 3 CPUs perform a lot better clock for clock.

Comparing a 10900k vs a 5900X or 5950X would let us know, they're more or less equal in terms of FLOP/IOP with the big difference being Ryzen's massive cache.
Last edited by Hobo Misanthropus; Jul 17, 2021 @ 10:42pm
Teemo Jul 19, 2021 @ 9:55pm 
Most if not all the framerate improvement suggestions can be developed for better player enjoyment without multithreading. There is just a huge to-do list going already, so FPS improvements don't always make it.

For example:
Pathfinding: If the game realizes that certain paths are used often, starts incorporating them into the pathfinding so pathfinding doesn't have to cover the entire map, essentially for most long range pathing calculations the unit would just walk to the nearest entry point for a known route, and then look for the much shorter path once they get to the end of the route. Only in new areas before the pathing memory sets in would be high cycle calculations

Caverns: Turn off essentially all pathfinding through them unless a job is sending the dwarf there.

Animals: Change the pathfinding behavior to be much much simplier (since animal minds are simplier). When you do an animal pathfinding calculation, have it determine the next X decisions rather than just the next 1 decision, but have exceptions that would trigger an early rethink. This would mean most animals would reduce cycle time by ~(X-1)/X %.

Items: Get more generic with most items. I know that DF loves it's detail, but I'm sure 99.999% of players would be willing to sacrifice detail on mundane uninteresting items if it gives us back FPS

Temperature Calculation: Again, we don't want to turn them off completely because it affects freezing/fire, but it can be coded that temperature calculations are ignored most of the time unless certain temperatures are hit. In other words, keep track of just overall generic zone temperatures only, and then check for things like magma being out of place, or dwarves being out of place with respect to magma, then only run temperature calculations when anomalies occur rather than always. If it is 30 degrees C outside and nothing is in the magma sea or currently on fire for example, just skip the temperature calculations.

The Trashman Jul 20, 2021 @ 2:45am 
Originally posted by Teemo:
Most if not all the framerate improvement suggestions can be developed for better player enjoyment without multithreading. There is just a huge to-do list going already, so FPS improvements don't always make it.
I would be annoyed if they took time away from developing new features to implement the things you've suggested, or any FPS improvements in general, given that there are ways to mitigate it.

An even easier solution would be to set the default pop cap. to <= 100, and the default map size to 3x3 or less. That way the players who can't/won't deal with traffic zones, blocking off caverns, etc. don't have to worry about it. The players who can/will can just increase the pop. cap. Maybe when you start a game, you get an options menu (exposing options from the d_init.txt file) with a 'Max Pop.' slider, defaulting to, say, 60. If the player starts pushing it up to over 100, a warning pops up that there may be framerate issues in the lategame, but that the wiki has solutions for this.

I play on a laptop from 2013 and the only time I've experienced drops in FPS that makes the game borderline unplayable is when I visit a 1000+ pop. site as an adventurer. Or when I spoiler the spoilers.

Originally posted by Teemo:
I know that DF loves it's detail, but I'm sure 99.999% of players would be willing to sacrifice detail on mundane uninteresting items if it gives us back FPS
I very much doubt this. I think the insane attention to detail is one of the big attractions of DF, and the game's creators are very good at keeping mundane information out. I also don't believe it's the details on items that causes the problem, but the number of items themselves. I don't think there's a difference between the game tracking 100 plain earrings vs 100 earrings that are studded with metal and encrusted with gems when it comes to framerate.
edmek55555 Jul 20, 2021 @ 10:00am 
Originally posted by The Trashman:
Originally posted by Teemo:
Most if not all the framerate improvement suggestions can be developed for better player enjoyment without multithreading. There is just a huge to-do list going already, so FPS improvements don't always make it.
I would be annoyed if they took time away from developing new features to implement the things you've suggested, or any FPS improvements in general, given that there are ways to mitigate it.

An even easier solution would be to set the default pop cap. to <= 100, and the default map size to 3x3 or less. That way the players who can't/won't deal with traffic zones, blocking off caverns, etc. don't have to worry about it. The players who can/will can just increase the pop. cap. Maybe when you start a game, you get an options menu (exposing options from the d_init.txt file) with a 'Max Pop.' slider, defaulting to, say, 60. If the player starts pushing it up to over 100, a warning pops up that there may be framerate issues in the lategame, but that the wiki has solutions for this.

I play on a laptop from 2013 and the only time I've experienced drops in FPS that makes the game borderline unplayable is when I visit a 1000+ pop. site as an adventurer. Or when I spoiler the spoilers.

Originally posted by Teemo:
I know that DF loves it's detail, but I'm sure 99.999% of players would be willing to sacrifice detail on mundane uninteresting items if it gives us back FPS
I very much doubt this. I think the insane attention to detail is one of the big attractions of DF, and the game's creators are very good at keeping mundane information out. I also don't believe it's the details on items that causes the problem, but the number of items themselves. I don't think there's a difference between the game tracking 100 plain earrings vs 100 earrings that are studded with metal and encrusted with gems when it comes to framerate.
I respect what you’re saying but it sounds like you may just not have played enough. FPS is not solely a cap or item issue. FPS death is absolutely guaranteed to happen if you know how to play the game and that is a known fact. You can manage your population all you want. You can destroy all the items you want. Because, as most people do, you forgot the game also tracks its own history as well. As long as you are playing that history is being written. Nothing you can do will stop that if you play long enough.

It’s no surprise to anyone that FPS death is due to poor foresight in coding. I’m pretty sure they have even admitted that before. People need to stop with this “oh you’re just playing wrong” mindset. You should be able to play however you want. What other game do you have to limit population, turn off temperature, destroy a bunch of items, cage up all of your pets, and block off rooms just so the framerate won’t go nuts? It’s a legitimate coding issue. Let’s stop pretending like people are just playing the game wrong and causing massive bugs
Last edited by edmek55555; Jul 20, 2021 @ 10:00am
Mouse Jul 25, 2021 @ 7:41pm 
Originally posted by edmek55555:
It’s no surprise to anyone that FPS death is due to poor foresight in coding. I’m pretty sure they have even admitted that before. People need to stop with this “oh you’re just playing wrong” mindset. You should be able to play however you want. What other game do you have to limit population, turn off temperature, destroy a bunch of items, cage up all of your pets, and block off rooms just so the framerate won’t go nuts? It’s a legitimate coding issue. Let’s stop pretending like people are just playing the game wrong and causing massive bugs

This is a bit of a misnomer, it's not poor foresight, it's a lack of any formal programming education. I recall when we tried explaining using SSE to Toady and he pretty much was like "is that a compiler setting? Well, I upgraded my compiler so it might be using it." Toady is a brilliant mathematician and is brilliant at writing the algorithms for the game... but he isn't the person you want implementing those algorithms.

If you honestly think about the complexity of math going on in a modern 3D game just to render the entire environment, you should see that it isn't the amount of data that is the issue with dwarf fortress... it's the way it's structured in memory and how it is all processed. People throw out parallelization like a fix all, but it actually requires large rewrites of how things are structured in memory and processed to get good parallelization.

Also note that you don't want to be arbitrarily spawning new threads and calling that parallelization, you're more likely to slow things down with that mindset, especially if both processes need to join up at some point.

Like most game designers, Toady is interested more in his algorithms than the implementation. That is why we see new features being added and increasingly complexity while the minor issues of FPS death are ignored. Toady is the director, he sees the whole picture as it works perfectly together and his head is up in the clouds, that is why he needs code writers to put his ideas into form and focus on the minutia he isn't interested in himself.
Why can't this CPU issue be moved to the GPU? Old School RuneScape has a plugin to make the game run off the GPU rather than the CPU. This can't be done for this game too?
CyberianK Nov 13, 2022 @ 10:37pm 
Originally posted by megumeat:
Why can't this CPU issue be moved to the GPU? Old School RuneScape has a plugin to make the game run off the GPU rather than the CPU. This can't be done for this game too?
There is no need, modern CPUs have more than enough processing power after the DF software architecture would allow moving some of the processing to be handled by multithreading. Since all of what could be put into multithreading can be handled by the last 5+ years of CPU gens already there is no need to push some of that into GPU parallel processing which would mainly add additional problems for no gain.
< >
Showing 1-15 of 15 comments
Per page: 1530 50

Date Posted: Jul 5, 2021 @ 1:20pm
Posts: 15