Home › Engine executable › Event data fields

Engine executable. Settings and tools of the game program (CivilizationVI.exe), usable without a mod. Mostly undocumented debug and configuration functionality; descriptions come from analysis of the executable and have not all been tried in the running game.

Event data fields (as read by the exe)

Each GameCore bus event carries a small data object. This page lists, for 109 events, the fields the exe's own handlers read from it: the byte offset, the width in bytes, how many analysed handlers read it, and constants a handler compares a field with. It was recovered by tracing how the decompiled handlers use the event data parameter (138 handlers of the renderer, audio, telemetry, UI and network systems).

Offsets are from the start of the event data object. A plot is typically two 4-byte fields (x, y) that some handlers read as one 8-byte value, so only the wider read is shown. The Lua parameter column is the parameter list of the matching Lua event from the GameCore reference; where the number of fields equals the number of Lua parameters (9 events) the order is probably the same, otherwise the two lists are only shown side by side. Fields that no analysed handler reads are not listed, and the field names are not in the exe.

Reliability. Inferred: handler addresses for the 3D renderer were matched to the Linux build by registration order, a wrong match would show another event's fields; handlers that take the event as a second parameter were assumed to do so; reads through an unresolved indirect call are missed. The method was checked on TERRAIN_STATE_CHANGED (the plot at 4 and 8, shown as one field, the state hash at 0xc, the set-or-clear flag at 0x10), which matches a hand disassembly.

Event Id Fields read (offset: width in bytes) Handlers analysed Lua parameters
TURN_END 5 0x4:4 1 (Listener) —
LOCAL_PLAYER_TURN_BEGIN 8 0x60:4, 0x70:8, 0x78:4 1 (AmbientAudio) —
REMOTE_PLAYER_TURN_END 12 0x0:8, 0x8:8, 0x10:4, 0x14:1 1 (WorldView) —
PLAYER_TURN_DEACTIVATED 16 0x0:8, 0x8:4 1 (WorldView) playerID
PLAYER_TURN_COMPLETE_IGNORED 17 0x0:8, 0x8:8, 0x10:8 1 (WorldView) —
TEAM_VICTORY 18 0x0:8, 0x8:4/8, 0x10:8 3 (Listener, Manager, WorldView) —
UNIT_ADDED_TO_MAP 28 0x0:4, 0x8:8, 0x10:4/8, 0x20:4, 0x24:4, 0x28:4, 0x2c:4, 0x30:4, 0x34:4, 0x38:4, 0x3c:4, 0x40:1, 0x41:1 2 (WorldView) playerID, unitID
UNIT_REMOVED_FROM_MAP 29 0x0:4, 0x8:8 2 (WorldView) playerID, unitID (order probably matches)
UNIT_KILLED_IN_COMBAT 30 0x0:4, 0x8:2, 0xc:4, 0x10:2, 0x14:4 2 (StrategicAudio, WorldView) killedPlayerID, killedUnitID, playerID, unitID
UNIT_KILLED_BY_FALLOUT 31 0x0:4, 0x4:8 1 (WorldView) —
UNIT_KILLED_LIFESPAN_EXPIRED 32 0x0:4 1 (WorldView) —
UNIT_DAMAGE_CHANGED 33 0x8:8, 0x10:4, 0x18:4 1 (WorldView) playerID, unitID, newDamage, prevDamage
UNIT_ACTIVITY_CHANGED 35 0x4:4, 0x8:2, 0xa:2, 0xc:4, 0x10:4, 0x14:4 2 (Manager, WorldView) playerID, unitID, ActivityTypes activityType
UNIT_VISIBILITY_CHANGED 36 0x4:4, 0x8:8, 0x10:4 2 (WorldView) playerID, unitID
UNIT_CAPTURED 37 0x0:4, 0x8:4, 0xc:4, 0x10:4 1 (WorldView) currentUnitPlayerID, unitID, owningPlayerID, capturingPlayerID (order probably matches)
UNIT_ENTER_FORMATION 38 0x8:2/8, 0x10:2/8 2 (Listener, WorldView) firstUnitPlayerID, firstUnitID, secondUnitPlayerID, secondUnitID
UNIT_EXIT_FORMATION / UNIT_FORMATION_CHANGED 39 0x8:8, 0x10:8 1 (WorldView) firstUnitPlayerID, firstUnitID, secondUnitPlayerID, secondUnitID
event 40 40 0x0:4, 0x4:8 1 (WorldView) —
UNIT_FORM_CORPS 41 0x0:4/8 1 (WorldView) playerID, unitID
UNIT_EMBARK_CHANGED 44 0x8:2, 0xc:4, 0x10:1 1 (StrategicAudio) —
UNIT_PROMOTED 45 0x0:8, 0x8:2/8, 0x10:4, 0x18:8, 0x20:8 3 (Listener, WorldView) playerID, unitID
UNIT_CHARGES_CHANGED 46 0x0:8, 0x8:8, 0x10:4/8, 0x18:8, 0x20:8 2 (WorldView) playerID, unitID, newCharges, oldCharges
UNIT_UPGRADED 47 0x0:8, 0x8:8 1 (WorldView) playerID, unitID (order probably matches)
UNIT_AIRLIFTED 48 0x8:2, 0xc:4 1 (StrategicAudio) —
UNIT_PARADROPPED 49 0x8:8, 0x18:4, 0x1c:4 1 (WorldView) —
UNIT_SACRIFICED 50 0x10:4/8 1 (WorldView) —
UNIT_HERO_ACTIVATED 51 0x8:8, 0x10:4, 0x14:4 1 (WorldView) —
UNIT_RESOURCE_INSPIRE 53 0x4:4/8 1 (WorldView) —
UNIT_KILL_WEAKER_UNIT 54 0x4:4/8 1 (WorldView) —
UNIT_DESTROY_DEVELOPMENT 55 0x8:8, 0x10:4, 0x14:4 1 (WorldView) —
UNIT_FORCE_LEVY_MILITARY 56 0x8:8, 0x10:4, 0x14:4 1 (WorldView) —
UNIT_GRANT_ENVOY 57 0x4:4/8 1 (WorldView) —
UNIT_NAVAL_GOLD_RAID 58 0x8:8, 0x10:4/8 1 (WorldView) —
UNIT_RESTORE_UNIT_MOVES 59 0x10:4/8 1 (WorldView) —
UNIT_AREA_DAMAGE 60 0x10:4/8 1 (WorldView) —
UNIT_AREA_HEAL 61 0x10:4/8 1 (WorldView) —
POST_TOURISM_BOMB 63 0x8:2, 0xc:4, 0x10:4, 0x14:4, 0x18:4 1 (StrategicAudio) —
UNIT_ABILITY_GAINED 65 0x0:8, 0x8:4/8, 0x10:4, 0x40:4 3 (StrategicAudio, WorldView) playerID, unitID, unitAbilityIndex
UNIT_ABILITY_LOST 66 0x0:8, 0x8:4/8, 0x10:4, 0x40:4 3 (StrategicAudio, WorldView) playerID, unitID, unitAbilityIndex
UNIT_OPERATION_STARTED 68 0x8:2, 0xc:4, 0x10:4 1 (StrategicAudio) ownerID, unitID, operationID (order probably matches)
UNIT_COMMAND_STARTED 72 0x8:2, 0xa:2, 0xc:4, 0x10:4, 0x14:4, 0x18:4 1 (StrategicAudio) playerID, unitID, UnitCommandTypes commandType, data1
UNIT_ACTIVATE 73 0x8:8, 0x18:4, 0x1c:1 2 (StrategicAudio, WorldView) —
UNIT_GREATPERSON_ACTIVATED 77 0x8:8 1 (WorldView) unitPlayerID, unitOwner, unitID, unitID, greatPersonClassID, greatPersonClassID, greatPersonIndividualID, greatPersonIndividualID
CITY_ADDED_TO_MAP 87 0x8:8, 0x10:8, 0x18:4 1 (WorldView) playerID, cityID, x, y
CITY_PROPERTY_CHANGED 90 0x8:2, 0xc:4 1 (WorldView) —
CITY_REMOVED_FROM_MAP 93 0x8:2/8 1 (WorldView) playerID, cityID
CITY_PRODUCTION_COMPLETED 99 0x10:4 1 (Listener) playerID, cityID, constructionType, unitID, wasCancelled
CITY_PRODUCTION_COMPLETED 100 0x0:4, 0x8:2/8, 0x14:4, 0x18:8 1 (WorldView) playerID, cityID, constructionType, unitID, wasCancelled
CITY_POPULATION_CHANGED 102 0x8:8, 0x10:4 1 (WorldView) playerID, cityID, cityPopulation
CITY_TILE_OWNERSHIP_CHANGED 107 0x10:8 1 (WorldView) playerID, cityID, x, y
FEATURE_ADDED_TO_MAP 116 0x4:4/8, 0xc:4, 0x14:1 2 (AudioMiner, WorldView) x, y
FEATURE_VISIBILITY_CHANGED 118 0x8:8, 0x10:4, 0x14:4, 0x18:4 1 (WorldView) —
FEATURE_REMOVED_FROM_MAP 119 0x4:8 1 (WorldView) x, y
DIPLOMACY 132 0x8:4, 0xc:4, 0x14:1 2 (AmbientAudio, StrategicAudio) —
RESOURCE_ADDED_TO_MAP 138 0x4:8, 0xc:4 1 (WorldView) x, y, resourceIndex
RESOURCE_VISIBILITY_CHANGED 140 0x8:8, 0x10:4, 0x14:4, 0x18:4 1 (WorldView) x, y, resourceIndex, visibilityType (order probably matches)
RESOURCE_REMOVED_FROM_MAP 141 0x4:8 1 (WorldView) iX, iY, resourceIndex
IMPROVEMENT_ADDED_TO_MAP 143 0x8:4/8, 0x18:4, 0x1c:4, 0x24:4, 0x28:4, 0x2c:4, 0x30:4, 0x34:1, 0x35:1, 0x36:1, 0x37:1 3 (AudioMiner, StrategicAudio, WorldView) x, y, improvementIndex, playerID
IMPROVEMENT_CHANGED 144 0x8:4/8, 0x1c:4, 0x24:4, 0x28:4, 0x2c:4, 0x30:4, 0x34:1, 0x35:1, 0x37:1 1 (WorldView) x, y, improvementIndex, improvementPlayerID, resourceIndex, isPillaged, isWorked
IMPROVEMENT_VISIBILITY_CHANGED 145 0x8:4/8, 0x38:4, 0x3c:4, 0x40:4, 0x44:4 1 (WorldView) x, y, improvementIndex, eVisibility
IMPROVEMENT_REMOVED_FROM_MAP 146 0x4:4/8 1 (WorldView) x, y, owningPlayerID
TERRAIN_STATE_CHANGED 151 0x4:4/8, 0xc:4, 0x10:1 1 (WorldView) —
ROUTE_ADDED_TO_MAP 152 0x8:8, 0x10:4, 0x18:8, 0x28:1, 0x2a:1, 0x2b:1 1 (WorldView) —
ROUTE_CHANGED 153 0x8:8, 0x10:4, 0x18:8, 0x28:1, 0x2a:1, 0x2b:1 1 (WorldView) x, y
ROUTE_VISIBILITY_CHANGED 154 0x8:8, 0x10:4, 0x14:4, 0x18:4, 0x1c:4 1 (WorldView) —
ROUTE_REMOVED_FROM_MAP 155 0x4:8 1 (WorldView) —
DISTRICT_ADDED_TO_MAP 156 0x10:4/8, 0x18:4, 0x20:8, 0x28:4, 0x2c:4, 0x30:4, 0x34:4, 0x38:1, 0x40:4, 0x44:4 1 (WorldView) playerID, districtID, cityID, x, y, districtIndex, percentComplete
DISTRICT_CHANGED 157 0x8:2, 0xa:2, 0xc:4, 0x10:8, 0x18:4, 0x20:2/8, 0x30:4, 0x38:1 1 (WorldView) —
DISTRICT_DAMAGE_CHANGED 159 0x10:8, 0x20:8, 0x28:4, 0x2c:4, 0x34:4 1 (WorldView) playerID, districtID, DefenseTypes defenseType, newDamage, oldDamage (order probably matches)
DISTRICT_REMOVED_FROM_MAP 160 0x10:4/8, 0x18:4, 0x20:8 1 (WorldView) playerID, districtID, cityID, x, y, districtIndex
DISTRICT_BUILDING_RESTORE 162 0x8:8, 0x10:4/8, 0x18:4, 0x20:2/8, 0x2c:4 1 (WorldView) —
BUILDING_ADDED_TO_MAP 165 0x8:4/8, 0x10:8, 0x24:4, 0x2c:4, 0x30:1 1 (WorldView) x, y, buildingIndex, playerID, cityID, percentComplete, isPillaged
BUILDING_CHANGED 166 0x8:8, 0x10:8, 0x24:4, 0x2c:4, 0x30:1 1 (WorldView) x, y, buildingID, playerID, percentComplete, unknown
BUILDING_VISIBILITY_CHANGED 167 0x8:8, 0x10:8, 0x24:4, 0x28:4, 0x2c:4, 0x30:4, 0x34:4 1 (WorldView) —
BUILDING_REMOVED_FROM_MAP 168 0x8:4/8, 0x10:8, 0x24:4 1 (WorldView) x, y
BUILDING_CHANGED 169 0x8:4/8, 0x10:2/8, 0x24:4, 0x28:4 2 (Listener, WorldView) x, y, buildingID, playerID, percentComplete, unknown
BUILDING_CHANGED 170 0x8:8, 0x10:8, 0x24:4, 0x28:1 1 (WorldView) x, y, buildingID, playerID, percentComplete, unknown
BUILDING_CHANGED 174 0x0:4, 0x8:8, 0x10:8, 0x24:4, 0x28:4, 0x2c:4 1 (WorldView) x, y, buildingID, playerID, percentComplete, unknown (order probably matches)
TECH_BOOST_TRIGGERED 178 0x4:4, 0x8:4 1 (Listener) playerID, techBoosted, unknownA, unknownB
CIVIC_BOOST_TRIGGERED 179 0x4:4, 0x8:4 1 (Listener) playerID, civicIndex, unknownA, unknownB
PLOT_OWNERSHIP_CHANGED 180 0x4:8, 0xc:4 1 (WorldView) —
PLOT_VISIBILITY_CHANGED 181 0x8:8, 0x10:4, 0x14:4, 0x18:4, 0x1c:4 1 (WorldView) x, y, visibilityType
APPEAL_CHANGED_NEAR 183 0x4:8, 0xc:4 1 (WorldView) —
PLOT_PROPERTY_CHANGED 184 0x4:8 1 (WorldView) x, y
RESEARCH_COMPLETED 188 0x4:4, 0x8:4 1 (WorldView) playerID, technologyIndex (order probably matches)
CIVIC_COMPLETED 192 0x4:4, 0x8:4 1 (WorldView) playerID, civicIndex, isCancelled
NATIONAL_PARK_ADDED_TO_MAP 244 0x10:4 1 (WorldView) —
NationalParkRemoved 245 0x10:4, 0x14:8, 0x1c:8, 0x24:8, 0x2c:8, 0x34:8, 0x3c:8, 0x44:8, 0x4c:8, 0x54:8, 0x5c:8, 0x64:8, 0x6c:8, 0x74:8, 0x7c:8, 0x84:8, 0x8c:8, 0x94:8, 0x9c:8, 0xa4:8, 0xac:8, 0xb4:8, 0xbc:8, 0xc4:8, 0xcc:8, 0xd4:8, 0xdc:8, 0xe4:8, 0xec:8, 0xf4:8, 0xfc:8 1 (WorldView) —
NATIONAL_PARK_VISIBILITY_CHANGED 246 0x8:4, 0xc:4, 0x10:4, 0x14:4, 0x28:8 1 (WorldView) —
COMBAT 248 0x8:2, 0xa:2, 0xc:4, 0x10:2, 0x12:2, 0x14:4, 0x28:4 1 (StrategicAudio) combatResult
Events::NullEventClass 249 0x48:8 1 (GameCoreController) —
GOODY_HUT_REWARD 259 0x8:2, 0xc:4, 0x10:4 1 (StrategicAudio) playerID, unitID, unknown1, unknown2
PLAYER_ERA_CHANGED 265 0x4:4, 0x8:4 2 (Listener, WorldView) playerID, eraIndex (order probably matches)
PLAYER_ALIVE_CHANGED 272 0x4:4 1 (Manager) —
LOCAL_PLAYER_CHANGED 274 0x4:4 1 (AmbientAudio) localPlayerID, prevLocalPlayerID
BARBARIAN_CLAN_DISPERSED 279 0x8:8, 0x10:4 2 (StrategicAudio, WorldView) —
BARBARIAN_CLAN_RAIDED 280 0x8:8, 0x10:4 2 (StrategicAudio, WorldView) —
BARBARIAN_CLAN_HIRED 281 0x8:8, 0x10:4 2 (StrategicAudio, WorldView) —
BARBARIAN_CLAN_BRIBED 282 0x8:8, 0x10:4 2 (StrategicAudio, WorldView) —
BARBARIAN_CLAN_RANSOMED 283 0x8:8, 0x10:4 2 (StrategicAudio, WorldView) —
BARBARIAN_CLAN_INCITED 284 0x8:8, 0x10:4 1 (StrategicAudio) —
PLOT_YIELD_CHANGED 287 0x4:4/8 1 (WorldView) x, y
STORM_ADDED_TO_MAP 312 0x8:2/8, 0x14:4, 0x18:4, 0x1c:4, 0x20:8 2 (AudioMiner, WorldView) —
STORM_REMOVED_FROM_MAP 313 0x8:8, 0x20:8 1 (WorldView) —
STORM_CHANGED 314 0x0:2, 0x4:4, 0x8:8, 0x14:4, 0x1c:4, 0x20:8, 0x28:4, 0x30:8 2 (AudioMiner, WorldView) —
DROUGHT_REMOVED_FROM_MAP 316 0x14:4, 0x18:8 1 (WorldView) —
FAVOR_CHANGED 322 0x4:4, 0x8:4, 0xc:4 1 (Listener) —
CLIMATE_CHANGE_EVENT 325 0x4:4 1 (Listener) —
UNIT_JUMPED 326 0x8:2, 0xc:4 1 (StrategicAudio) —