๐ก See my other Civ projects here
Patches to Sid Meier's Civilization V or Sid Meier's Civilization: Beyond Earth that enable achievements while playing with mods.
-
Install the patch following the instructions below
-
Start the game in Steam
โ If playing Civ 5 in Proton or Windows, choose the patched version of DirectX as indicated below
-
Open the Mods menu and play the game with mods as desired
Open a terminal and run this command:
sed -i 's/SELECT ModID from Mods where Activated = 1/SELECT ModID from Mods where Activated = 2/' "/home/$USER/.steam/steam/steamapps/common/Sid Meier's Civilization V/Civ5XP"
For DirectX 11, open a terminal and run this command:
sed -i 's/SELECT ModID from Mods where Activated = 1/SELECT ModID from Mods where Activated = 2/' "/home/$USER/.steam/steam/steamapps/common/Sid Meier's Civilization V/CivilizationV_DX11.exe"
For DirectX 9, run the patch script:
./scripts/apply-patch.sh "/home/$USER/.steam/steam/steamapps/common/Sid Meier's Civilization V/CivilizationV.exe"
Open a terminal and run this command:
sed -i 's/SELECT ModID from Mods where Activated = 1/SELECT ModID from Mods where Activated = 2/' "/Users/$USER/Library/Application Support/Steam/steamapps/common/Sid Meier's Civilization V/Civilization V.app/Contents/MacOS/Civilization V"
-
Download the patch tool from Releases
-
Run the patch tool, e.g.
patchciv.exe 'C:\Program Files (x86)\Steam\steamapps\common\Sid Meier''s Civilization V\CivilizationV.exe'
-
When playing the game, choose DirectX 9 (unfortunately the patch doesn't work for DirectX 11)
Install the patch to fix the crash when playing with mods here: https://github.com/bmaupin/civ-be-linux-fixes. It will also enable achievements with mods.
Open a terminal and run these commands:
sed -i 's/SELECT ModID from Mods where Activated = 1/SELECT ModID from Mods where Activated = 2/' "/home/$USER/.steam/steam/steamapps/common/Sid Meier's Civilization Beyond Earth/CivilizationBE_DX11.exe"
sed -i 's/SELECT ModID from Mods where Activated = 1/SELECT ModID from Mods where Activated = 2/' "/home/$USER/.steam/steam/steamapps/common/Sid Meier's Civilization Beyond Earth/CivilizationBE_Mantle.exe"
Paste these commands in PowerShell and then press Enter (source):
โ It will take a minute or so to run; wait until it says "Patch complete."
function Replace-ContentInFile {
param (
[string]$FilePath
)
$data = Get-Content -Encoding Byte -ReadCount 0 $FilePath
$dataAsHexString = [BitConverter]::ToString($data)
$search = 'SELECT ModID from Mods where Activated = 1'
$replacement = 'SELECT ModID from Mods where Activated = 2'
$searchAsHexString = [BitConverter]::ToString([Text.Encoding]::UTF8.GetBytes($search))
$replaceAsHexString = [BitConverter]::ToString([Text.Encoding]::UTF8.GetBytes($replacement))
$dataAsHexString = $dataAsHexString.Replace($searchAsHexString, $replaceAsHexString)
$modifiedData = [byte[]] ($dataAsHexString -split '-' -replace '^', '0x')
Set-Content -Encoding Byte $FilePath -Value $modifiedData
Write-Host "Patch complete"
}
Replace-ContentInFile -FilePath 'C:\Program Files (x86)\Steam\steamapps\common\Sid Meier''s Civilization Beyond Earth\CivilizationBE_DX11.exe'
Replace-ContentInFile -FilePath 'C:\Program Files (x86)\Steam\steamapps\common\Sid Meier''s Civilization Beyond Earth\CivilizationBE_Mantle.exe'
To uninstall this patch:
-
Open Steam and go to the game in your library
-
Right-click on the name of the game on the left > Properties
-
Installed Files > Verify integrity of game files
See docs/details.md