Home › Engine executable › Game summary and statistics data model
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.
Game summary and statistics data model
The game summary (the Hall of Fame screens, the end-of-game graphs and reports, the per-leader and per-victory progress) is driven by data. Two parts: configuration tables in the game's Configuration database, created by Configuration/Data/Schema/HallofFame.sql and filled by HallofFame.xml (what statistics, graphs, reports and aggregates exist), and recorded tables in HallofFame.sqlite, where the exe stores every finished or running game (Application::GameSummary writes them, the Lua table HallofFame and the summary library read them; see the HallofFame page and the database statements). Verified: table and column names, shipped row counts, SQL statements (read from the files and the exe). Inferred: what a table is for beyond its name.
What the shipped data defines (28 statistics in 8 categories, 38 graphs, 5 reports with 21 columns, 83 aggregate rules: Sum 46, Max 8, First 4, MaxSum 9, Count 2, Last 14 over the scopes MajorPlayers 23, Games 23, Rulesets 23, MajorCityObjects 11, ReligionObjects 3). A modder adds a statistic by adding rows: a DataPointAggregateUpdates rule that sums, maximises or counts a recorded data point, a Statistics row (name key, category, icon) and, for a report, a ReportColumns row. The recorded data point values are rows of ObjectDataPointValues / GameDataPointValues; the game transfer of the exe (Application::GameSummary::BeginGameTransfer) creates the game, its players and objects, datasets and data point values (CreateGame, CreateObject, CreateGameDataset, CreateObjectDataset, UpdateAggregateDataPoints).
Configuration tables (17)
| Table |
Columns |
Shipped rows |
Exe operations |
Functions that use it |
StatisticCategories |
Category, Name, IsHidden, SortOrder |
8 |
SELECT 1 |
lGetStatisticsCategories |
StatisticCategoryRulesetOverrides |
RulesetType, Category, Name, IsHidden, SortOrder |
0 |
SELECT 1 |
lGetStatisticsCategories |
Statistics |
DataPoint, Name, Icon, ValueIconDefault, ValueIconOverride, Annotation, Direction, Category, Importance, Visible |
28 |
SELECT 1 |
lGetStatistics |
StatisticRulesetOverrides |
RulesetType, DataPoint, Name, Icon, ValueIconDefault, ValueIconOverride, Annotation, Direction, Category, Importance, Visible |
0 |
SELECT 1 |
lGetStatistics |
Highlights |
DataPoint, Name, Caption, Icon, MinValue, MaxValue, Importance |
0 |
— |
— |
DataPointAggregateScopeQueries |
Query, SQL |
11 |
— |
— |
DataPointAggregateScopes |
Scope, Query, ExtraData, SortIndex |
8 |
— |
— |
DataPointAggregateQueries |
Query, SQL |
16 |
SELECT 1 |
UpdateAggregateDataPoints |
DataPointAggregateUpdates |
AggregateDataPoint, Scope, Operation, Query, DataPoint, ExtraData, SortIndex |
83 |
SELECT 2 |
DeleteAggregateDataPoints, UpdateAggregateDataPoints |
GraphQueries |
Query, SQL |
6 |
SELECT 2 |
lGetGraphs |
Graphs |
Graph, Scope, Name, Description, Direction, XLabel, YLabel, XUnit, YUnit, Query, DataSet, ExtraData, UxHint, Importance, Visible |
38 |
SELECT 2 |
lGetGraphs |
GraphRulesetOverrides |
RulesetType, Graph, Scope, Name, Description, Direction, XLabel, YLabel, XUnit, YUnit, Query, DataSet, ExtraData, UxHint, Importance, Visible |
0 |
SELECT 1 |
lGetGraphs |
ReportQueries |
Query, SQL |
5 |
SELECT 2 |
lGetReports |
Reports |
Report, Scope, Name, Description, InitialColumnName, InitialColumnDescription, InitialColumnUxHint, InitialColumnValueIconDefault, InitialColumnValueIconOverride, ShowEmptyRows, Query, ExtraData, Importance, Visible |
5 |
SELECT 2 |
lGetReports |
ReportRulesetOverrides |
RulesetType, Report, Scope, Name, Description, InitialColumnName, InitialColumnDescription, InitialColumnUxHint, InitialColumnValueIconDefault, InitialColumnValueIconOverride, ShowEmptyRows, Query, ExtraData, Importance, Visible |
0 |
SELECT 1 |
lGetReports |
ReportColumns |
Report, Name, Description, SortOrder, DataPoint, UxHint, Minor, AlwaysShow, EmptyValue, DefaultValue, ValueIconDefault, ValueIconOverride, Visible |
21 |
SELECT 2 |
lGetReports |
ReportColumnRulesetOverrides |
RulesetType, Report, Name, Description, SortOrder, DataPoint, UxHint, Minor, AlwaysShow, EmptyValue, DefaultValue, ValueIconDefault, ValueIconOverride, Visible |
0 |
SELECT 1 |
lGetReports |
Recorded and queried tables (15)
Tables the exe writes or reads that are not part of the configuration schema. Columns are the ones named in statements that mention the table, so a statement that joins several tables can list a column under more than one of them. "summary database" tables live in HallofFame.sqlite; "game" tables belong to the game databases (queried for names and icons).
| Table |
Database |
Columns named in statements |
Exe operations |
Functions |
Games |
summary database |
GameMode, GameSpeedType, LastPlayed, LeaderType, Map, MapSizeType, Ruleset, StartEraType, StartTurn, TurnCount, VictorTeamId, VictoryType |
DELETE 1, INSERT 1, SELECT 3 |
0xb4bd0, 0xb5e10, lGetVictoryProgress |
GameObjects |
summary database |
ExtraData, GameId, Icon, LeaderName, LeaderType, Name, PlayerObjectId, PlotIndex, Type, VictoryType |
INSERT 1, SELECT 6 |
0xb4800, 0xb4bd0, 0xb55b0 |
GamePlayers |
summary database |
CivilizationName, CivilizationType, DifficultyType, IsAI, IsLocal, IsMajor, LeaderName, LeaderType, PlayerId, PlayerObjectId, Score, TeamId, VictoryType |
INSERT 1, SELECT 6 |
0xb4800, 0xb4bd0, 0xb55b0 |
ObjectDataPointValues |
summary database |
DataPoint, ObjectId, ValueNumeric, ValueObjectId, ValueString, ValueType |
INSERT 1, SELECT 1 |
BeginGameTransfer, UpdateAggregateDataPoints |
GameDataPointValues |
summary database |
DataPoint, GameId, ValueNumeric, ValueObjectId, ValueString, ValueType |
INSERT 1, SELECT 1 |
BeginGameTransfer, UpdateAggregateDataPoints |
DataSets |
summary database |
DataSet, GameId, ObjectId, Type |
INSERT 2 |
BeginGameTransfer |
DataSetValues |
summary database |
DataSetId, X, Y |
INSERT 1, SELECT 2 |
lGetGraphs, BeginGameTransfer |
ChallengeGames |
summary database |
ChallengeId, GameId, LeaderName, LeaderType, PlayerObjectId, VictoryType |
INSERT 1, SELECT 6 |
0xb4800, 0xb4bd0, 0xb55b0 |
RulesetDataPointValues |
summary database |
— |
DELETE 1 |
DeleteAggregateDataPoints |
Rulesets |
game |
Description, IsScenario, Name, RulesetType, SortIndex |
SELECT 1 |
lGetAvailableRulesets |
RulesetDomainOverrides |
game |
Domain |
SELECT 1 |
lGetLeaderProgress, lGetRulesetPlayableLeaders |
Players |
game |
CivilizationIcon, CivilizationName, CivilizationType, LeaderIcon, LeaderName, LeaderType |
SELECT 1 |
lGetLeaderProgress, lGetRulesetPlayableLeaders |
RulesetUnSupportedValues |
game |
CivilizationIcon, CivilizationName, CivilizationType, LeaderIcon, LeaderName, LeaderType |
SELECT 1 |
lGetLeaderProgress, lGetRulesetPlayableLeaders |
Victories |
game |
Icon, Name, VictoryType |
SELECT 1 |
lGetVictoryProgress |
RulesetTypes |
game |
Icon, Kind, Name, Type |
SELECT 1 |
lGetRulesetTypes |
Statistic categories
| Category |
Text key |
Sort |
CATEGORY_GENERAL |
LOC_GAMESUMMARY_CATEGORY_GENERAL |
100 |
CATEGORY_DIPLOMACY |
LOC_GAMESUMMARY_CATEGORY_DIPLOMACY |
200 |
CATEGORY_DISCOVERY |
LOC_GAMESUMMARY_CATEGORY_DISCOVERY |
200 |
CATEGORY_COMBAT |
LOC_GAMESUMMARY_CATEGORY_COMBAT |
200 |
CATEGORY_PROSPERITY |
LOC_GAMESUMMARY_CATEGORY_PROSPERITY |
200 |
CATEGORY_RELIGION |
LOC_GAMESUMMARY_CATEGORY_RELIGION |
200 |
CATEGORY_EXTRA |
LOC_GAMESUMMARY_CATEGORY_EXTRA |
300 |
CATEGORY_HIDDEN |
None |
100 |
Data points (48)
Names of the recorded values and the statistics built from them: Statistic = has a Statistics row (with a category); aggregates are the DataPointAggregateUpdates rules that produce the value (operation of a data point over a scope).
48 data points
| Data point |
Statistic category |
Aggregates |
Reports |
BarbarianCampsCleared |
CATEGORY_DISCOVERY |
First of BarbarianCampsCleared over MajorPlayers; Sum of BarbarianCampsCleared over Games; Sum of BarbarianCampsCleared over Rulesets |
— |
BarbariansKilled |
CATEGORY_COMBAT |
First of BarbariansKilled over MajorPlayers; Sum of BarbariansKilled over Games; Sum of BarbariansKilled over Rulesets |
— |
Beliefs |
|
Last of Beliefs over ReligionObjects |
Religions |
BuildingsConstructed |
|
Last of BuildingsConstructed over MajorCityObjects |
PlayerCityStatus |
Cities |
|
Last of Cities over ReligionObjects |
Religions |
CitiesConquered |
CATEGORY_PROSPERITY |
Sum of CitiesConquered over MajorPlayers; Sum of CitiesConquered over Games; Sum of CitiesConquered over Rulesets |
— |
CitiesFounded |
CATEGORY_PROSPERITY |
Sum of CitiesFounded over MajorPlayers; Sum of CitiesFounded over Games; Sum of CitiesFounded over Rulesets |
— |
CitiesLost |
CATEGORY_PROSPERITY |
Sum of CitiesLost over MajorPlayers; Sum of CitiesLost over Games; Sum of CitiesLost over Rulesets |
— |
CityWithHighestPopulation |
CATEGORY_PROSPERITY |
Max of Population over MajorPlayers; Max of Population over Games; MaxSum of Population over Rulesets |
— |
CivicsAcquired |
CATEGORY_DISCOVERY |
First of CivicsAcquired over MajorPlayers |
— |
CivicsBoosted |
CATEGORY_DISCOVERY |
— |
— |
Combats |
CATEGORY_COMBAT |
Sum of Combats over MajorPlayers; Sum of Combats over Games; Sum of Combats over Rulesets |
— |
Culture |
|
Last of Culture over MajorCityObjects |
PlayerCityYields |
CurrentGovernment |
CATEGORY_PROSPERITY |
— |
— |
DistrictsConstructed |
|
Last of DistrictsConstructed over MajorCityObjects |
PlayerCityStatus |
Faith |
|
Last of Faith over MajorCityObjects |
PlayerCityYields |
FavoriteGovernment |
CATEGORY_PROSPERITY |
Max of GovernmentInUseByType over MajorPlayers; MaxSum of GovernmentInUseByType over Games; MaxSum of GovernmentInUseByType over Rulesets |
— |
FavoriteUnit |
CATEGORY_COMBAT |
Max of UnitsTrainedByType over MajorPlayers; MaxSum of UnitsTrainedByType over Games; MaxSum of UnitsTrainedByType over Rulesets |
— |
Followers |
|
Last of Followers over ReligionObjects |
Religions |
Food |
|
Last of Food over MajorCityObjects |
PlayerCityYields |
Founder |
|
— |
Religions |
Gold |
|
Last of Gold over MajorCityObjects |
PlayerCityYields |
GoodyHutsPopped |
CATEGORY_DISCOVERY |
Sum of GoodyHutsPopped over MajorPlayers; Sum of GoodyHutsPopped over Games; Sum of GoodyHutsPopped over Rulesets |
— |
GovernmentInUseByType |
|
— |
PlayerGovernments |
GreatPeopleEarned |
CATEGORY_PROSPERITY |
Sum of GreatPeopleEarned over MajorPlayers; Sum of GreatPeopleEarned over Games; Sum of GreatPeopleEarned over Rulesets |
— |
HolyCity |
|
— |
Religions |
MostFollowedReligion |
CATEGORY_RELIGION |
Max of Followers over Games; Max of Followers over Rulesets |
— |
NaturalWondersDiscovered |
CATEGORY_DISCOVERY |
Sum of NaturalWondersDiscovered over MajorPlayers; Sum of NaturalWondersDiscovered over Games; Sum of NaturalWondersDiscovered over Rulesets |
— |
NukesLaunched |
CATEGORY_COMBAT |
Sum of NukesLaunched over MajorPlayers; Sum of NukesLaunched over Games; Sum of NukesLaunched over Rulesets |
— |
Population |
|
Last of Population over MajorCityObjects |
PlayerCityStatus |
Production |
|
Last of Production over MajorCityObjects |
PlayerCityYields |
ReligionsFounded |
CATEGORY_RELIGION |
Count of Followers over Games; Count of Followers over Rulesets |
— |
Science |
|
Last of Science over MajorCityObjects |
PlayerCityYields |
StrongestUnit |
CATEGORY_COMBAT |
Max of UnitsKilledByType over MajorPlayers; MaxSum of UnitsKilledByType over Games; MaxSum of UnitsKilledByType over Rulesets |
— |
TechsAcquired |
CATEGORY_DISCOVERY |
First of TechsAcquired over MajorPlayers |
— |
TechsBoosted |
CATEGORY_DISCOVERY |
— |
— |
Tourism |
|
Last of Tourism over MajorCityObjects |
PlayerCityStatus |
TurnFounded |
|
— |
Religions |
UnitsKilled |
CATEGORY_COMBAT |
Sum of UnitsKilledByType over MajorPlayers; Sum of UnitsKilledByType over Games; Sum of UnitsKilledByType over Rulesets |
— |
UnitsKilledByType |
|
— |
PlayerUnits |
UnitsLost |
CATEGORY_COMBAT |
Sum of UnitsLostByType over MajorPlayers; Sum of UnitsLostByType over Games; Sum of UnitsLostByType over Rulesets |
— |
UnitsLostByType |
|
— |
PlayerUnits |
UnitsTrained |
CATEGORY_COMBAT |
Sum of UnitsTrainedByType over MajorPlayers; Sum of UnitsTrainedByType over Games; Sum of UnitsTrainedByType over Rulesets |
— |
UnitsTrainedByType |
|
— |
PlayerUnits |
WarsDeclared |
CATEGORY_DIPLOMACY |
Sum of WarsDeclared over MajorPlayers; Sum of WarsDeclared over Games; Sum of WarsDeclared over Rulesets |
— |
WarsReceived |
CATEGORY_DIPLOMACY |
Sum of WarsReceived over MajorPlayers; Sum of WarsReceived over Games; Sum of WarsReceived over Rulesets |
— |
WeakestUnit |
CATEGORY_COMBAT |
Max of UnitsLostByType over MajorPlayers; MaxSum of UnitsLostByType over Games; MaxSum of UnitsLostByType over Rulesets |
— |
WondersConstructed |
CATEGORY_PROSPERITY |
Sum of WondersConstructed over MajorPlayers; Sum of WondersConstructed over Games; Sum of WondersConstructed over Rulesets (+1) |
PlayerCityStatus |
Graphs (38)
38 graphs
| Graph |
Scope |
Query |
Text key |
ReligiousBeliefs |
Game |
GameDataSetsByType |
LOC_HOF_GRAPH_RELIGION_BELIEFS |
ReligiousCities |
Game |
GameDataSetsByType |
LOC_HOF_GRAPH_RELIGION_CITIES |
ReligiousFollowers |
Game |
GameDataSetsByType |
LOC_HOF_GRAPH_RELIGION_FOLLOWERS |
PlayerGold |
Game |
GameDataSetsByType |
LOC_HOF_GRAPH_PLAYER_GOLD |
PlayerCulture |
Game |
GameDataSetsByType |
LOC_HOF_GRAPH_PLAYER_CULTURE |
PlayerFaith |
Game |
GameDataSetsByType |
LOC_HOF_GRAPH_PLAYER_FAITH |
PlayerScience |
Game |
GameDataSetsByType |
LOC_HOF_GRAPH_PLAYER_SCIENCE |
PlayerScore |
Game |
GameDataSetsByType |
LOC_HOF_GRAPH_PLAYER_SCORE |
PlayerBuildingsConstructed |
Game |
GameDeltaDataSetsByType |
LOC_HOF_GRAPH_PLAYER_BUILDINGS |
PlayerDistrictsConstructed |
Game |
GameDeltaDataSetsByType |
LOC_HOF_GRAPH_PLAYER_DISTRICTS |
PlayerCitiesConquered |
Game |
GameDeltaDataSetsByType |
LOC_HOF_GRAPH_PLAYER_CITIES_CAPTURED |
PlayerCitiesFounded |
Game |
GameDeltaDataSetsByType |
LOC_HOF_GRAPH_PLAYER_CITIES_FOUNDED |
PlayerCitiesLost |
Game |
GameDeltaDataSetsByType |
LOC_HOF_GRAPH_PLAYER_CITIES_LOST |
PlayerGreatPeopleEarned |
Game |
GameDeltaDataSetsByType |
LOC_HOF_GRAPH_PLAYER_GREAT_PEOPLE |
PlayerCombats |
Game |
GameDeltaDataSetsByType |
LOC_HOF_GRAPH_PLAYER_COMBATS |
PlayerUnitsKilled |
Game |
GameDeltaDataSetsByType |
LOC_HOF_GRAPH_PLAYER_UNITS_KILLED |
PlayerUnitsLost |
Game |
GameDeltaDataSetsByType |
LOC_HOF_GRAPH_PLAYER_UNITS_LOST |
PlayerWarsReceived |
Game |
GameDeltaDataSetsByType |
LOC_HOF_GRAPH_PLAYER_WARS_RECEIVED |
PlayerWarsDeclared |
Game |
GameDeltaDataSetsByType |
LOC_HOF_GRAPH_PLAYER_WARS_DECLARED |
PlayerWondersConstructed |
Game |
GameDeltaDataSetsByType |
LOC_HOF_GRAPH_PLAYER_WONDERS |
PlayerTechsAcquired |
Game |
GameDataSetsByType |
LOC_HOF_GRAPH_PLAYER_TECHS |
PlayerCivicsAcquired |
Game |
GameDataSetsByType |
LOC_HOF_GRAPH_PLAYER_CIVICS |
PlayerBarbariansKilled |
Game |
GameDataSetsByType |
LOC_HOF_GRAPH_PLAYER_BARBARIAN_KILLS |
PlayerBarbarianCampsCleared |
Game |
GameDataSetsByType |
LOC_HOF_GRAPH_PLAYER_BARBARIAN_CAMPS |
PlayerNukesLaunched |
Game |
GameDeltaDataSetsByType |
LOC_HOF_GRAPH_PLAYER_NUKES |
PlayerGoodyHutsPopped |
Game |
GameDeltaDataSetsByType |
LOC_HOF_GRAPH_PLAYER_GOODY_HUTS |
PlayerNaturalWondersDiscovered |
Game |
GameDeltaDataSetsByType |
LOC_HOF_GRAPH_PLAYER_NATURAL_WONDERS |
CityProduction |
Player |
PlayerDataSetsByType |
LOC_HOF_GRAPH_CITY_PRODUCTION |
CityCulture |
Player |
PlayerDataSetsByType |
LOC_HOF_GRAPH_CITY_CULTURE |
CityFaith |
Player |
PlayerDataSetsByType |
LOC_HOF_GRAPH_CITY_FAITH |
CityGold |
Player |
PlayerDataSetsByType |
LOC_HOF_GRAPH_CITY_GOLD |
CityFood |
Player |
PlayerDataSetsByType |
LOC_HOF_GRAPH_CITY_FOOD |
CityScience |
Player |
PlayerDataSetsByType |
LOC_HOF_GRAPH_CITY_SCIENCE |
CityTourism |
Player |
PlayerDataSetsByType |
LOC_HOF_GRAPH_CITY_TOURISM |
CityPopulation |
Player |
PlayerDataSetsByType |
LOC_HOF_GRAPH_CITY_POPULATION |
CityBuildings |
Player |
PlayerDataSetsByType |
LOC_HOF_GRAPH_CITY_BUILDINGS |
CityDistricts |
Player |
PlayerDataSetsByType |
LOC_HOF_GRAPH_CITY_DISTRICTS |
CityWonders |
Player |
PlayerDataSetsByType |
LOC_HOF_GRAPH_CITY_WONDERS |
Reports (5)
| Report |
Scope |
Columns (data point) |
PlayerUnits |
Player |
UnitsTrainedByType, UnitsKilledByType, UnitsLostByType |
PlayerGovernments |
Player |
GovernmentInUseByType |
PlayerCityYields |
Player |
Production, Food, Gold, Faith, Science, Culture |
PlayerCityStatus |
Player |
Population, Tourism, BuildingsConstructed, DistrictsConstructed, WondersConstructed |
Religions |
Game |
Founder, HolyCity, TurnFounded, Followers, Cities, Beliefs |
Game fields handed to the scripts (PushGameData)
PushGameData (0x4c4220) builds the table of one recorded game that the Lua functions GetGames / GetGameData return. Field names: CivilizationName, CivilizationType, DefeatType, DifficultyType, GameId, GameMode, GameSpeedType, IsHuman, IsLocal, IsMajor, LastPlayed, LeaderName, LeaderType, MapSizeType, PlayerId, PlayerObjectId, Players, Ruleset, Score, StartEraType, StartTurn, TeamId, TurnCount, VictorTeamId, VictoryType.