Dwarf Fortress: Best init.txt for FPS Stability

The primary goal for Dwarf Fortress stability is Simulation Throughput. The game tracks two types of FPS: Graphical FPS (G_FPS) and Calculation FPS. If your dwarves move in slow motion, your Calculation FPS is low. By modifying the initialization files, we can implement a “Clean Simulation” profile: disabling complex fluid/temperature checks and capping the refresh rate to prevent the GPU from stealing CPU cycles.

Hardware Compatibility & Expectations

  • CPU Single-Core Speed: This is the only stat that truly matters for Dwarf Fortress. A high boost clock (5.0GHz+) will always outperform a high core count.
  • RAM Latency: Since the game constantly accesses massive arrays of unit data, low-latency RAM (DDR5 with tight timings) provides a measurable UPS boost.
  • Steam vs. Classic: In the Steam version, most “init” settings are now in the in-game menus, but the .txt files still offer deeper control for “hard-coding” performance.

Backup and Preparation

Dwarf Fortress is sensitive to syntax errors in its init files.

  1. Completely exit Dwarf Fortress.
  2. Navigate to your game folder (path below).
  3. Copy init.txt and d_init.txt, saving backups as .bak files.
  4. Open the originals with Notepad++.

File Location

The configuration files are located in the data/init/ subfolder: C:\Program Files (x86)\Steam\steamapps\common\Dwarf Fortress\data\init\init.txt C:\Program Files (x86)\Steam\steamapps\common\Dwarf Fortress\data\init\d_init.txt

Best init.txt & d_init.txt Settings for FPS

Search for these specific tags. These settings are designed to prioritize the simulation over visual flair:

In init.txt:

[FPS:YES]              -- Shows the FPS counter so you can monitor drops.
[FPS_CAP:100]          -- Caps game speed; 100 is standard, 0 is uncapped.
[G_FPS_CAP:20]         -- Lowering this from 50 to 20 saves significant CPU.
[PRIORITY:HIGH]        -- Forces Windows to prioritize DF over background apps.
[PRINT_MODE:2D]        -- The most stable rendering mode for low-end GPUs.

In d_init.txt (The “Heavy Lifters”):

[TEMPERATURE:NO]       -- Boosts FPS by up to 50% by disabling heat math.
[WEATHER:NO]           -- Stops rain/snow calculations (prevents mud/litter).
[CAVERN_LAYER_COUNT:1] -- Fewer caverns mean significantly less pathfinding AI.
[POPULATION_CAP:80]    -- Keeping pop under 100 is the best way to avoid lag.
[PATH_COST:1:1:1:1]    -- Simplifies pathfinding math (experimental).

Pro Tip: Disabling TEMPERATURE is the single largest FPS boost available, but it has side effects: fire becomes permanent and ice will never melt. Only use this if your fortress is truly dying of lag.

Key Parameters Explained

ParameterRecommended ValueImpact
G_FPS_CAP20Reduces how often the screen redraws, freeing the CPU for logic.
TEMPERATURENORemoves the most intensive “per-tile” calculation in the game.
WEATHERNOPrevents “Contaminant” build-up (blood/mud) which bogs down memory.
POPULATION_CAP80 – 120Limits the number of “Thinking” entities on the map.
PRIORITYHIGHReduces micro-stutters caused by other background processes.

In-Game Optimization (Beyond the Config)

Even with a perfect config, “Fortress Design” is the ultimate FPS saver:

  • The Atom Smasher: Build a bridge that retracts onto a 1×1 pile of junk. Activating it deletes the items from existence, clearing them from the memory.
  • Traffic Zones: Use the Traffic tool to mark main hallways as “High” and unused corners as “Restricted.” This guides the pathfinding algorithm to find routes faster.
  • Animal Caging: Every wandering cat or stray dog is an AI pathfinding check. Cage your livestock to freeze their AI and save UPS.
  • Quantum Stockpiles: Use minecarts to dump thousands of items onto a single tile. This prevents the game from checking thousands of separate inventory slots.

Troubleshooting & Common Fixes

  • Unresponsive Menus: If you set G_FPS_CAP too low (below 15), your mouse clicks might not register. Keep it at 20 for a balance of speed and usability.
  • Obsidian Farming Stops: If you turn off Temperature, magma won’t cool into obsidian. Re-enable it temporarily when doing heavy engineering.
  • Save Corruption: Ensure COMPRESSED_SAVES is set to YES in init.txt unless you have massive amounts of free storage, as late-game save files can become enormous.

Frequently Asked Questions (FAQ)

Does the Steam version need these tweaks?

Yes. While the Steam version is “cleaner,” it still runs the same legacy simulation code. The G_FPS_CAP tweak is especially effective on the Steam version’s high-res tilesets.

Why does water movement kill FPS?

Every tile of “flowing” water (level 1-6) triggers a “Flow Calculation.” To save FPS, build “Dwarven Atom Smashers” at the end of your waterfall projects to delete excess water rather than letting it flow off-map.

Is DFHack necessary for FPS?

Highly recommended. The fix/stable-temp and clean all commands in DFHack can fix common “Lag Spikes” caused by temperature bugs and blood splatter without needing to disable features in the config.

Conclusion and Expected Results

By manually refining your init.txt and d_init.txt, you are surgically removing the secondary systems that compete for your CPU’s attention. You can expect a 20-40% increase in Calculation FPS, fewer “hitch” events during sieges, and a significantly longer lifespan for your colony before simulation lag makes it unplayable.

Leave a Comment