Dwarf Fortress: Best init.txt for FPS Stability in Massive Embarks

The most effective way to save a dying fortress is to disable the secondary physics simulations that do not directly impact your dwarves’ survival.

File Path & Setup

  1. Navigate to: [DF Install Folder]/data/init/
  2. Locate: init.txt (Display & Engine) and d_init.txt (Simulation Logic).
  3. Pro Tip: After editing, ensure you have DFHack installed. Commands like fix/stable-temp and cleanall are essential companions to these .txt tweaks for maintaining long-term stability.

Optimized “Urist-Approved” Configuration Table

ParameterRecommended ValueTechnical Purpose
[FPS:YES]YESEnables the in-game counter to monitor real-time performance.
[G_FPS:20]20Reduces the visual refresh rate, freeing up CPU cycles for game logic.
[TEMPERATURE:NO]NOThe Master Fix. Disables the massive heat-transfer calculation engine.
[WEATHER:NO]NOStops the calculation of rain, snow, and wind effects across the embark.
[PRIORITY:REALTIME]REALTIMEForces Windows to prioritize DF’s single-thread logic over background apps.

init.txt Optimization

[FPS:YES]
[G_FPS:20]
[PRINT_MODE:2D]  // For Steam Edition, standard is optimized, but 2D/VBO can help on older IGPs.
[PRIORITY:REALTIME]
[TEXTURE_PARAM:NEAREST] // Disables linear filtering for minor GPU-side relief.

d_init.txt Optimization

[TEMPERATURE:NO]
[WEATHER:NO]
[CAVERN_LAYER_NUMBER:1] // Recommended for new worlds; fewer layers = fewer pathing nodes.
[PATH_COST:1:2:5:25] // Tweaks pathfinding weights to favor designated high-traffic halls.
[AUTOSAVE:SEASONAL]

HowTo: Engineering the Anti-FPS Death Strategy

Follow these GameEngineer.net technical steps to maintain a 100+ FPS simulation:

  1. The G_FPS Hack: In init.txt, setting G_FPS to 20 instead of the default 50 is a pro secret. It doesn’t slow down the game’s logic, but it means the engine draws the screen fewer times per second, giving the CPU more “breathing room” to calculate pathfinding ($P_{path}$).
  2. The Temperature Nuclear Option: Setting [TEMPERATURE:NO] is the single most effective change. Dwarf Fortress calculates the temperature of every single item, wall, and unit. Disabling this can double your FPS instantly. Warning: Magma will no longer burn things and ice won’t melt.
  3. Traffic Designations: Use the in-game “Traffic” tool. Set your main 3-tile wide hallways to High and your deep mining shafts to Low. This guides the A* pathfinding algorithm to check the most efficient routes first, reducing the $T_{search}$ time per dwarf.
  4. Atom Smashing: Items are FPS killers. Build a Dwarven Atom Smasher (a bridge that lowers onto a pile of trash). Deleting 5,000 sets of tattered goblin clothing will significantly reduce the “Item Loop” overhead.+1
  5. Multi-Threading (Experimental): In 2026, ensure the “Experimental Multi-threading” is enabled in the Steam settings menu. While DF is mostly single-threaded, this offloads the “Line of Sight” and “Rendering” to secondary cores ($C_{sub}$).

Technical Explanation: Pathfinding and Entity Count ($N^2$)

Dwarf Fortress performance scales poorly because many calculations are $O(N^2)$. If you have 100 dwarves and 101st walks in, you aren’t just adding one unit; you are adding 100 new potential social interactions and pathfinding conflicts.

By using [PATH_COST], you modify the Heuristic ($h(n)$) of the pathfinder. When costs are optimized, the dwarf “knows” that the main hall is faster, causing the algorithm to discard thousands of potential branch paths through your old mineshafts. This prevents the “Calculation Spike” that occurs every time a dwarf decides to go grab a drink from the tavern.

Leave a Comment