Skip to content

A utility for running repeated iterations of civ 5 games and harvesting logs

Notifications You must be signed in to change notification settings

artemigkh/civ5-automation

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Civ 5 Automation + Log Harvesting

A utility for running repeated iterations of civ 5 games

Prerequisites

Python and Packages

Install python3+ (tested with 3.9), and the following packages:

pywinauto
pandas
numpy

Modpack

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)

Automation Entrypoint

Copy RunAutoplayGame.lua from the root of this repo to C:\Program Files (x86)\Steam\steamapps\common\Sid Meier's Civilization V\Assets\Automation

Maps

Copy Community_79a.lua to C:\Program Files (x86)\Steam\steamapps\common\Sid Meier's Civilization V\Assets\Maps

Steam Options

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)

Game Options

The following options must be set in-game:

Game Options:

  • Skip Intro Video Enabled
  • Optional: Turns Between Autosaves:1 and max autosaves kept:999

Game Config Options

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

Script Options

Fill out config.py downloaded from this repo with your install and local files locations

Running the Script

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)

About

A utility for running repeated iterations of civ 5 games and harvesting logs

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published