DayZ 1.29 prioritises the global variable g_Game over the GetGame() function call. Mods using GetGame() will still compile and work, but they won't benefit from the server performance improvements that come with using g_Game directly.
This tool scans your mod source code and replaces all GetGame() calls with g_Game so your mods are fully optimised for 1.29+.
Grab the latest .exe from Releases. No install needed, just run it.
- Run the exe and point it at your mod folder (or pass the path as an argument)
- It scans all
.cfiles recursively and shows you a summary of what it found - If it finds non-
.cfiles withGetGame()calls (some modders use odd extensions), it'll ask if you want to include those too - Pick
[V]to view the exact changes for any file before committing to anything - Pick
[A]to apply — it backs up every file it's about to modify, then applies the changes - After applying, it rescans to verify everything was replaced
It won't touch GetGame() inside string literals or block comments (/* */). It will replace calls inside inline comments (//) but flags them so you can check.
GetGame().IsServer() -> g_Game.IsServer()
GetGame().GetPlayer() -> g_Game.GetPlayer()
CGame game = GetGame(); -> CGame game = g_Game;
if (GetGame() != null) -> if (g_Game != null)
Literally just swaps GetGame() for g_Game everywhere it appears in code. The methods, parameters, and return types are all unchanged — it's the same CGame object, just accessed differently.
Double-click the exe or run from a terminal:
dayz-script-patcher.exe "C:\Path\To\Your\Mod"
Works in PowerShell, CMD, Windows Terminal, and VS Code terminal. Colors are disabled automatically when piped to a file.
The tool automatically backs up every file it modifies before making changes. Backups are saved in a timestamped folder (e.g. _getgame_backup_20260408_153000/) inside your target directory, preserving the original folder structure. If any file fails to back up, the tool aborts without modifying anything.
You should still consider using git or making a manual copy for extra safety.
Requires Bun.
bun install
bun run buildOutput goes to dist/dayz-script-patcher.exe.
Bohemia prioritised g_Game over GetGame() in 1.29 as a performance optimisation — direct variable access is faster than a function call, and GetGame() gets called thousands of times per frame across all scripts. According to the DayZ developers, these optimisations contributed to up to a 400% server performance improvement. GetGame() still works, but any mod still using it misses out on those gains.
The fix is a straightforward find-and-replace, but doing it by hand across a large mod is tedious and error-prone. This tool does it safely with previews, edge case handling, and verification.