A utility for running repeated iterations of civ 5 games
Install python3+ (tested with 3.9), and the following packages:
pywinauto
pandas
numpy
VP is ran with a modpack so that the Civ 5 CLI automation can be used to enter a game directly without having to automate going through menus.
The autoplay mod included in the base of this repo (./autoplay
) MUST be included in the modpack used for automation. Game options may be first configured in autoplay (v 1)/game_options.sql
if desired.
Instructions for creating a modpack can be found at https://civ-5-cbp.fandom.com/wiki/Creating_a_Modpack . After creation, the modpack folder should be placed in C:\Program Files (x86)\Steam\steamapps\common\Sid Meier's Civilization V\Assets\DLC
(or your DLC location)
Copy RunAutoplayGame.lua
from the root of this repo to C:\Program Files (x86)\Steam\steamapps\common\Sid Meier's Civilization V\Assets\Automation
Copy Community_79a.lua
to C:\Program Files (x86)\Steam\steamapps\common\Sid Meier's Civilization V\Assets\Maps
Properties -> General -> Launch Options must be set to
"C:\Program Files (x86)\Steam\steamapps\common\Sid Meier's Civilization V\CivilizationV.exe" %command% -Automation RunAutoplayGame.lua
(or your executable location)
The following options must be set in-game:
Game Options:
- Skip Intro Video Enabled
- Optional: Turns Between Autosaves:1 and max autosaves kept:999
C:\Program Files (x86)\Steam\steamapps\common\Sid Meier's Civilization V\config.ini
:
EnableTuner = 1
...
MessageLog = 1
AILog = 1
AIPerfLog = 1
BuilderAILog = 1
PlayerAndCityAILogSplit = 1
LoggingEnabled = 1
...
[GAME]
...
; Force quick combat animations
QuickCombat = 1
...
; Worldsize options are WORLDSIZE_DUEL/WORLDSIZE_TINY/WORLDSIZE_SMALL/WORLDSIZE_STANDARD/WORLDSIZE_LARGE/WORLDSIZE_HUGE
WorldSize = WORLDSIZE_STANDARD
...
; Map Script file name
Map = Assets\Maps\Communitu_79a.lua
...
; Handicap for quick play
QuickHandicap = HANDICAP_EMPEROR
Fill out config.py
downloaded from this repo with your install and local files locations
python3 main.py
from the root of the repo.
Will save completed games to the complete
directory in the civ 5 documents location (adjacent to MODS
)