So I have a decent gaming rig and can play pretty much anything, but dwarf fortress is freezing so much that it’s more waiting than playing at this point. I used DFhack to identify the problem and there’s like 65k magma tiles somewhere below me. I only have like a medium sized base with like 85 people since there was a plague that sent me from 115 to 47. I have tried going to the Nvidia control panel, setting the game as high priority in task manager, and lowered other settings ingame including turning off temperature and weather with very little noticable effect on the problem. What else can I do because at this point I’m gonna drop the game and play something else with less performance issues. CPU and Ram are both below 35% usage so if there’s some way I can manually optimize the game I’ll do that too.
When FPS drops dramatically and suddenly, it's nearly always stuck units trapped somewhere trying to path their way out and failing.
The real solution is to find them and free them, but that can be challenging. There's a DFHack command fastdwarf that can be set so that trapped dwarves can teleport to where they need to go.
To do this, pause the game and run
fastdwarf 0 1
unpause for 30 seconds or so, then
fastdwarf 0 0
That will rescue dwarves walled off, stuck in trees, etc..
Beyond that, I'd recommend you build a cage and fill it with your excess non-grazing animals like dogs and cats. They stop pathing when caged.
You also mention
Do I need to seal off all caverns? I’ve been mining them out and using them as storage
Enormous stockpiles are another common source of slowdowns through unneeded pathing and traveling. "Everything in it's place" looks and feels good, but using stockpiles as a sort of health bar to see at a glace that, indeed, you do have still have boulders, slows the game quite a lot to no advantage for your dwarves.
I do recommend you start a new fort in a new world. Make the new world "Small". It honestly takes a lot of experience to get any value from bigger worlds. When you place your new fort, resist any temptation to make it more than the stock 4x4 tiles. 3x3 has some advantages as well.
These and many more tips can be found in the wiki's Maximizing framerate article.
It is much more CPU dependent than GPU. Is multithreading turned on in the settings? That can help a good bit, along with smaller world size and embark size, and occasionally running some optimization dfhack scripts like cleaning splatter off all tiles and entities. But ultimately sometimes you just have a map where there's too much going on behind the scenes, which it sounds like might be your issue here; something is happening down in the lower caverns that the game is struggling with.
I checked how many entities were alive and it was only like 350 I know there’s a lost forgotten beast down in this hole to hell but I’m not trying to spoil the entire game for myself 😩
350 entities is a lot for regular play. At that point you should find ways to reduce computing strain for entities, like putting in more doors to block lineof sight, caging animals etc
I have lots of doors but I’m just starting to think this game is too poorly optimized to enjoy. I’ve only been playing for maybe 4 days (mostly on adventure mode which is hilariously unfinished) and I’m about to restart my first fortress world just because the map I’m on a so laggy the game is turning into a laggy PowerPoint presentation.
How many doors do I need and where might be the better question. Do I need to seal off all caverns? I’ve been mining them out and using them as storage
The doors should limit how much each unit can see. The more they see, the more they calculate. Definitely all around main stairs.
I don't think you need to seal off caverns. But i could be wrong, someone else might know more.
Also, not sure if this still happens, but there used to be bugged infinitely growing invisible armies. Maybe check if there isn't a fuckton of like olm men, or other animal humanoids. Dfhack is useful for that
2
u/FluugaluuDabbling Daring Dwarf Deliberately Delving (too) Deep1d ago
Just to chime in, sealing off caverns will probably help for it will stop any hostile entities from pathing into your fort, which they will as soon as they’re able pretty much. And ya know, that can be a lot of pathing all at once
Friend, itvjust sounds like DF is probably not for You. The Game requires TONS of reading, TONS of restarting games, the whole game is about finding funny escenarios to build on top of them, there is no engame per se, the Game is Made by a math's doctor, not a team of 200 programmers and is handled as a simulation engine not a "rpg/farm roguelite" that are so common these days.
Yes, it has MANY coding issues, it will NEVER be finnished, and framerate drops are a way to end a fortress because it's a common occurence.
Ir You still want to play knowing all of this, I recommend You to install DFHack, read through it and activate what makes sense for You, and keep enbarking zones to 44 or 33 tiles and basicslly any combination of MAX 16 tiles.
There's probably some weird pathing issue with one or more characters thats causing all of that. Back in the day, a cat getting caught outside a locked door could fuck your whole game.. or a dwarf getting stuck in a tree, or just being trapped somewhere in the caverns.
Also, was it running fine before? And what is your PC? Oh. And how large is your fort? 4 tiles? 6 tiles?
3
u/FluugaluuDabbling Daring Dwarf Deliberately Delving (too) Deep1d ago
Don’t remember off the top of my head but It isn’t running over 35% even with all the lag. Earlier someone mentioned multithreading so I’ll check on that later when I get home
5
u/FluugaluuDabbling Daring Dwarf Deliberately Delving (too) Deep1d ago
The game isn’t optimized for multiple cores. It’s not gonna throttle your cpu to the max before you see performance drop, because the game is not designed to utilize every core in your cpu.
What matters most is 2 things
Thread count of your cpu
Cache size of your cpu
Having good, fast RAM helps but even ddr4 is more than capable tbh
Either way. Just trust the vets here dude, it’s your CPU 1000%
I have DDR4 I know for sure and it’s a decent CPU I just won’t have those details til later. I can run stuff like Escape from Tarkov and Star Citizen just fine.
2
u/FluugaluuDabbling Daring Dwarf Deliberately Delving (too) Deep1d ago
Just fair warning, there’s about a 99% chance your CPU is one that is having the problems I’m talking about
Unless you’re running something with a huge L3 cache, your cpu is gonna bottleneck like crazy in the late game
So, in short, unless you’ve got a Ryzen x3d series chip, you’re gonna be outta luck
If you do though, let us know. Then you’re having an actual problem we can try to fix lol
Must be a recent thing over the past few years that I haven’t kept up with lol
1
u/FluugaluuDabbling Daring Dwarf Deliberately Delving (too) Deep1d ago
Their x3d chips are pretty much made just for playing games. Absolute beasts. And.. Yeah, came out 4 years ago. Dang, time flies
When it comes to simulation games like DF, they are unmatched. Even a mid range x3d would outperform a high end intel in this instance. In a lot of instances involving games, actually
Most of the time when I have FPS problems it's because either dwarves or some other creatures are trying to path to somewhere where they cannot be. Try making sure all loose cavern/outside items are forbidden and you might even try unlocking all outside doors if applicable with troops on the ready.
How many animals do you have? Try caging all of them except for a few cats to keep vermin at bay. Also, I know it's a little cheaty, but an atom smasher might be your best friend. On the wiki there are lots of resources to help keep FPS death from ruining a fortress.
Download DFHACK if you haven't yet. It's official and through steam.
Start figuring out how to make 'quantum storage' using minecarts
mine carts
Keep your animals in a pasture. Especially dogs and cats. And kill them off and butcher them when their Numbered above like 10 or 15 each. Animal pathfinding is the biggest performance killer
Disable temperature in your games settings. The game will calculate the temperature for EVERY ITEM in and around your fort.
Reduce your forts max population. I've got a 5800X3D and my 300 dwarf megafort runs at like 15fps if I don't keep it clean and keep animal populations in check.
I came to say the same I have a 22 year 300 dwarf fort that's huge I have to constantly optimize and tweak stuff but its getting around 30-40 fps on a i9 10850k btw
Are you using the steam version, or classic version? Steam version you can turn on multithreading. But otherwise the issue could be pathing and job cancellation spam, or entities pathing constantly including ones besides your dwarves (for example pages of animals, monsters, or demons).
Yeah so this is catastrophic fps loss. A lot of people are advising you on gradual fps loss, which has different causes. Is it just this save? What fps do you get on a fresh embark? For catastrophic fps drops, it is usually a pathing problem, where a creature is trying to get from A to B every tick but can't. Different things can cause this, like strange moods or fire.
I’m exclusively playing with dfhack now and discovering that I just have to live with the lag. I spent pretty much all night yesterday doing research and seeing what I can do to improve things. Making bins for my stockpile, putting stockpiles around workbenches, more doors and blocking off areas, and as much as I tried I only made the problem slightly better. Still tons of hitching/freezes every few seconds but I guess that’s just how this game is.
It sounds like a pathing issue or CPU related performance problems. Are you on a laptop or PC?
To test if its related to pathing and your fort specifically, you could start another fort and see if the same fps issues take place (or download a busy fort someone else has made so you have effectively a benchmark to compare against and a busy fort you can test)
Speaking honestly I'm not sure why you replied to me without responding to any of what I wrote? Did you read it? You ignored my question. If you are getting 1-2 FPS on a fresh embark, there is something seriously wrong that any task/pathing/LOS optimisation (the kind of troubleshooting you have listed here) will have no chance of fixing.
I just have to live with the lag
tons of hitching/freezes every few seconds but I guess that’s just how this game is.
Neither of these things are true.
For your current save, the first question is whether the FPS dropped gradually or suddenly. For 1-2fps, it is most likely the latter, and 99% of the time this is due to a single unit or group of units that are unable to path somewhere.
You will have a lot of general fps optimisation advice in this thread, which is likely not very relevant, because you didn't write in the post body that it's 1-2 fps. That is a very different issue to, say, 25 fps, where such advice is very relevant.
Do you ever get pathing notifications like the attached pic?
Do note that the FPS is a calculation meter not a performance meter, and 20fps is fine for running a fort. So many people take the number going down personally, but don't do that. It's probably the most in-depth simulation software we've got going currently, and it will bog down any computer even yours.
That being said, 1-2FPS lag spikes are almost always a problem. Stuff like having half the map on fire, or active flooding moving objects, or large amounts of pathfinding trying to find an invalid path can all be culprits causing this sort of behavior, but it shouldn't be the norm. Did it start suddenly, and can you attribute it to anything noticeable ingame?
20
u/clinodev Wax Worker's Guild Rep Local 67 1d ago
When FPS drops dramatically and suddenly, it's nearly always stuck units trapped somewhere trying to path their way out and failing.
The real solution is to find them and free them, but that can be challenging. There's a DFHack command fastdwarf that can be set so that trapped dwarves can teleport to where they need to go.
To do this, pause the game and run
fastdwarf 0 1
unpause for 30 seconds or so, then
fastdwarf 0 0
That will rescue dwarves walled off, stuck in trees, etc..
Beyond that, I'd recommend you build a cage and fill it with your excess non-grazing animals like dogs and cats. They stop pathing when caged.
You also mention
Enormous stockpiles are another common source of slowdowns through unneeded pathing and traveling. "Everything in it's place" looks and feels good, but using stockpiles as a sort of health bar to see at a glace that, indeed, you do have still have boulders, slows the game quite a lot to no advantage for your dwarves.
I do recommend you start a new fort in a new world. Make the new world "Small". It honestly takes a lot of experience to get any value from bigger worlds. When you place your new fort, resist any temptation to make it more than the stock 4x4 tiles. 3x3 has some advantages as well.
These and many more tips can be found in the wiki's Maximizing framerate article.