Is there any way I can avoid death by FPS in Dwarf Fortress?

Most of this advice comes from the wiki page on improving framerate. Some of it unfortunately requires pre-action, before your current point.

A number of things can impact framerate. Flowing water for example takes a lot of CPU power. Item count can affect it, though number of squares with items in them affects it more. Pathfinding can cause trouble.

I find that creature count is my biggest offender, but I don't generally have large amounts of flowing liquid in my forts.

However changing the structure of your fort with framerates that low is going to be a pain and a half. There are some things you can turn off in configuration files that may help. The important file here is df/data/init/d_init.txt. In this file you can adjust things like the population cap which would let you avoid having too many dwarves in the first place. You can also turn off temperature calculations which can speed up the game some.

Not knowing a huge amount about your setup, I would recommend turning off temperature, at least temporarily, to get enough speed to work with. Be sure to also reduce your population cap. Otherwise your population will just keep growing and slow you back down again.

I would also confine all your animals to walled off pastures or cages and close off unneeded areas to reduce pathfinding slowdowns. If you have any waterfalls or pumped areas, turning them off could also help.

Some people don't like to use what feels like a bug, but quantum stockpiles can help. Geting all the random junk consolidated is supposed to help framerate.

If some of the random items are things you will never want, like XXPig tail sockXX, You can use a Dwarven Atom Smasher to remove them from the game and no longer spend any CPU cycles at all tracking them. This however is going to be a minor improvement at best, unless you have tens of thousands of worn out socks.

Look at the framerate wiki page and see if any of its other ideas apply in your situation.


Some things can be done:

  • Shut off that dwarven reactor and any sources of moving water
  • Only female animals are useful. Slaughter everything but the females and maybe 1-2 males for breeding
  • For chicks, build a grid of 1x1-rooms with a nest in it, seal each of them with a door
  • For anything grazing, build similar structures, albeit a bit larger. Size depends on creature type unfortunately. Of course, these animals need food and cannot graze inside.
  • Build a dwarven atom smasher and get rid of the junk lying around
  • Make sure that you only dig small corridors, 1 - max 3 spaces wide (and 3 only where there is loads of traffic). Wall off large, unused parts, for example where you mined out for resources. Use the traffic designators, use forbidden for parts that need no maintenance. Use burrows. If your miners only need access to lower levels, restrict them to that. Make burrows as small as possible.

In my experience, the last point has the most significant effect, since the pathfinding needs a lot of CPU time and it will not consider spaces not reachable or outside of the burrows. The key point here is to restrict creatures as much as possible.

And never, ever, embark in a coastal biome. The waves are nice and stuff but you will have died the FPS death even before you arrived.


The core of the problem is pathfinding. Dwarf fortress uses A* pathfinding with some crude hacks to improve performance. It does not use any fancy tricks like Hierarchical Pathfinding which would reduce the CPU usage by more then 95 percent on long distances. The best thing to do is learn a bit about the A* alghorithm so you know it's pitfalls and keep this in mind when building your fort. But without any coding experience I can imagine this being hard. The wiki has some do's and dont's about ways to design your fortress to help the pathfinder out. The fact remains that the game would get a > 95% performance boost if toady would implement a good indexed hierarchical pathfinder, flocking and perhaps run this on a separate thread (which would probably be really hard to do given the current design choices).

Your issue at hand is very likely that most of your little dwarfs want to go to a far away position or at least a position where the pathfinder needs to check a lot of tiles as candidates for a path. So the first thing you could do is play on smaller maps in both X,Y,Z. Tile size grow exponentially 10x10x10 is just 1000 tiles but 20x20x20 is already 8000 tiles. So playing on a 2x2 area would be a lot faster then a 4x4 area later on in the game.

What you can do right now is assign burrows. Just let a view dwarfs gather those materials outside your fortress. Burrows has the nice side effect that dwarfs assigned to it would never get a task that is outside the burrow. It also narrows down the tiles the pathfinder will check since it should not consider a tile outside the burrow since the dwarf cannot go there.