A drop-in fix that keeps big games of Sid Meier's Civilization V from crashing: Huge maps, lots of civilizations, big mods like Vox Populi, and long late games full of units. It also makes late-game AI turns shorter.
You install it by copying one file into the game folder. It doesn't change gameplay, rules, saves or mods, and it works with or without mods.
Version 1.2.1. Tested on a large Vox Populi + EUI game on a Huge map: the crashes went away, and free memory stayed level over a 49-minute session. Also tested on the unmodded game. Please report how it goes, good or bad.
Contents: Why big games crash · What it fixes · Install · Questions · Documentation · Build from source
Civ V is a 32-bit program. However much RAM your PC has, the game can only use about 4 GB of memory, and a big game gets close to that. On top of that, a few bugs in the game waste memory, and two of them corrupt memory when the game gets busy. The result is random crashes, usually in busy turns, right after loading a big save, or late in a long session.
| Problem | What you'd notice without the fix |
|---|---|
| Crashes in busy turns. With many units on the map, the game's graphics code overflows a fixed-size list and damages the memory next to it, often the sound system's. | Random crashes while scrolling or in AI turns, often blamed on the sound (mss32.dll). |
| Crash right after loading a big save. A big save posts more events while loading than the game's event list has room for. | The game crashes as the save finishes loading. |
| Memory running out in long sessions. The game's memory fills up with small gaps it can't reuse. The fix gives it a better memory manager, so free memory stays level. | Crashes after an hour or so of play. |
| Memory spikes from mods. Mods look things up in the game's database a lot, and the leftovers piled up (up to 420 MB when starting a new Huge game). They're now cleaned up as the game goes. | Crashes while setting up a Huge game, or early in it. |
| Memory set aside and never used. The game reserves room for the largest possible map, and keeps its script memory in a heap that never shrinks. The fix gives that room back (about 100 MB on a Huge map). | Less memory to spare late in a game. |
| Crash when you quit. | A crash report on the way out to the desktop. Your saves were never affected. |
| Slow AI turns. Most of a late-game AI turn is the game waiting on itself, not the AI thinking. | Late-game AI turns of a minute or more. In testing they went from about 65-70 s to about 45-50 s (with one Vox Populi option, see tips). |
| Hitches while you pan the map during AI turns. Some screen panels (and mods such as Global Relations) redraw every time the AI changes something. | The map stutters or freezes for a moment while you scroll during AI turns. |
All of them work in every mode the game offers: DirectX 11, DirectX 9 and tablet. Some change exact places in the game, and each checks those places first; with a version of the game other than the final Steam one (1.0.3.279) they switch themselves off and say so in the log.
What it can't do: nothing can raise the 4 GB limit of a 32-bit game, so a very large late game can still get close to it. The fix writes a warning to its log when that happens; see Troubleshooting.
Takes about two minutes.
- Download
CivVCrashPatch-1.2.1.zipfrom the latest release (under Assets). - Unzip it. Right-click the zip, choose Extract All…, then Extract.
- Open the game folder. In Steam, go to Library, right-click
Sid Meier's Civilization V, then choose Manage → Browse local files.
A folder opens that contains
CivilizationV_DX11.exe. - Copy
msimg32.dllfrom the unzipped folder into that game folder. If Windows asks for permission, click Continue. Don't rename the file. - Play. When Steam asks how to launch, choose DirectX 11.
That's it. You don't need the settings file in the zip's optional folder; the fix works
without it.
Using EUI or Vox Populi? If you see black squares on icons or city banners in DirectX 11, open Options → Video Options in the game, turn off GPU Texture Decode and High Detail Strategic View, and restart the game. This is a separate graphics issue that the fix doesn't change for you.
After you start the game, a new folder named civprobe appears in the game folder. Open the
newest events_….log file in it with Notepad. The first line should start with
Civ V Crash Patch 1.2.1.
Close the game, download the new zip, and copy its msimg32.dll over the old one.
Delete msimg32.dll from the game folder. You can delete the civprobe folder too. Nothing else
was changed. (Steam's Verify integrity of game files doesn't remove extra files, so delete the
DLL yourself.)
Is it safe? The full source code is in this repository. The DLL on the Releases page is built from that source by GitHub's servers (see the builds), not on anyone's PC, and each release lists the file's SHA-256 checksum.
My antivirus flagged it. Small unsigned DLLs that load into a game sometimes get flagged by antivirus heuristics. The file isn't digitally signed, because signing costs money. You can compare its checksum with the one on the release page, or build it yourself.
Does it work with Vox Populi, EUI and other mods? Yes. It was developed on a Vox Populi + EUI game.
Multiplayer, achievements, saves? It doesn't touch game rules or save files, and your saves work without it too. Multiplayer hasn't been tested.
Which game version? The final Steam version, 1.0.3.279. If your game is a different version, each fix that depends on it notices and switches itself off (the log says so), and the game runs as it would without that fix.
Steam Deck or Linux (Proton)? Not tested. Proton has to be told to load the DLL: add
WINEDLLOVERRIDES="msimg32=n,b" %command% to the game's launch options.
Mac? No. The Mac version is a different program.
The game still crashed. Please report it: see Reporting a crash for the two files to attach.
Anything else I can do for big games? Yes: Troubleshooting and tips covers slow AI turns with Vox Populi, grey tiles when you scroll far, very long sessions, and settings to avoid.
| If you want to… | Read |
|---|---|
| Fix a problem, get more out of big games, or report a crash | Troubleshooting and tips |
| Change or turn off part of the fix | Settings |
| Understand what was wrong in the game and what the fix changes | How it works |
| Build it, run the tests, or use the diagnostic tools | Developer guide |
| Read the whole investigation, dead ends included | Research notes |
| See what changed between versions | Changelog |
The fix is a proxy msimg32.dll: the exe imports it, so the copy in the game folder loads first
and forwards the real exports to the system DLL. The main crash was a render command stream
(core\CommandStream.cpp) with no capacity checks: on a Huge map with about 1,700 units, busy
frames needed up to ~5,700 of its 4,096 command slots, and the overflow landed in the Miles audio
engine's sample table, so render data was used as sound handles. The fix gives that stream spare
room and bounds every writer, after checking each patch site byte for byte. The other fixes hook
import tables or write game data; none patches the game's main loop. Details:
How it works.
You need LLVM-MinGW
(winget install MartinStorsjo.LLVM-MinGW.UCRT) and a POSIX shell (Git Bash works).
sh probe/build.shThe DLL is probe/build/msimg32.dll. Tests and tools: Developer guide.
Releases are built by .github/workflows/build.yml.
MIT; see LICENSE. Includes mimalloc (MIT); see THIRD-PARTY-NOTICES.md.
Sid Meier's Civilization and Civ are trademarks of Take-Two Interactive Software, Inc. This project is not affiliated with or endorsed by Firaxis Games, 2K or Take-Two Interactive.
