Home › Engine Lua tables

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.

Engine Lua tables

These Lua tables are not part of GameCore: the engine executable registers them, so GameCore hooks (Community Extension, Frida on the DLL) never see them. They are what UI scripts call: UI.PlaySound(...), Network.HostGame(...), GameConfiguration.GetValue(...), Locale.Lookup(...), and the control methods on Controls.X:SetHide(...).

The exe has no parameter names and no documentation. What this section shows is recovered three ways, always marked inferred:

ForgeUI control methods are different: the exe prints a C++ signature for most of them (void SetHide( bool )), so those types are exact; they are shown as C++ types converted to Lua types.

How to read a signature. Table.Method(a: string, [b: number]) is called with a dot; Type:Method(...) is called on an object with a colon. [...] marks an optional argument. A trailing ... means a helper in the wrapper reads further arguments that were not recovered; the example calls show what the game passes. -> number is the type pushed back to Lua.

How reliable is it. For the 661 static-table and object methods that the game scripts also call, the argument count recovered from code agrees with the scripts for 80% of methods; the code under-counts for 17% (a helper function hides the read) and over-counts for 3% (an extra optional slot). Where they differ the larger number is shown and the other source is in the evidence list.

Static tables and object types

Name Kind Methods Called by game scripts How it was named
UI static table 236 175 registered by exe interface GameCore::App::UI::Lua::IManager; game scripts call 175 of 236 methods
Network static table 94 76 named from how the game scripts call it (76 of 94 methods matched)
GameConfiguration static table 82 51 registered by exe interface GameCore::App::Configuration::Lua::IGame; game scripts call 51 of 82 methods
Modding static table 57 42 named from how the game scripts call it (42 of 57 methods matched)
PlayerConfiguration object type 53 29 game scripts call these methods on pPlayerConfig / playerConfig variables obtained from PlayerConfigurations[playerID]; the exe registers a type called PlayerConfigurations
UserConfiguration static table 52 28 registered by exe interface GameCore::App::Configuration::Lua::IUser; game scripts call 28 of 52 methods
AssetPreview static table 40 27 registered by exe interface GameCore::App::UI::Lua::IGenericObjectContext; game scripts call 27 of 40 methods
Locale static table 30 19 named from how the game scripts call it (19 of 30 methods matched)
UILens static table 28 27 registered by exe interface GameCore::App::UI::Lua::ILenses; game scripts call 27 of 28 methods
Challenges static table 26 24 named from how the game scripts call it (24 of 26 methods matched)
Input static table 25 17 named from how the game scripts call it (17 of 25 methods matched)
Automation static table 24 23 registered by exe interface App::Automation::Lua::IManager; game scripts call 23 of 24 methods
HallofFame static table 23 20 named from how the game scripts call it (20 of 23 methods matched)
FiraxisLive static table 22 19 named from how the game scripts call it (19 of 22 methods matched)
AutoProfiler static table 21 10 named from how the game scripts call it (10 of 21 methods matched)
Options static table 21 21 named from how the game scripts call it (21 of 21 methods matched)
MapConfiguration static table 18 15 registered by exe interface GameCore::App::Configuration::Lua::IMap; game scripts call 15 of 18 methods
Friends (Steam) object type 18 11 game scripts call these on pFriends; Steam overlay methods (ActivateGameOverlay...)
Friends (second platform) object type 17 13 same method style as the Steam Friends object, with different overlay methods (ActivateOverlayToUserGeneratedContent)
UnitSystem static table 15 0 exe interface GameCore::App::UI::Lua::IUnitSystem; no call sites found in the game scripts
Variant container object type 15 6 generic GetValue/SetValue/Add/Get/Remove/GetCount/GetAt object, used on parameter and data variables in game scripts
MapPinConfiguration object type 12 7 game scripts call these on map pin configuration variables; the exe registers a MapPinConfiguration type
Matchmaking static table 11 11 named from how the game scripts call it (11 of 11 methods matched)
Global functions static table 10 0 functions the exe adds to the global Lua environment (print, clamp, fill, count, where, GetLuaMemoryUsage ...)
WorldView static table 9 4 registered by exe interface GameCore::App::WorldView::Lua::IWorldView; game scripts call 4 of 9 methods
Achievements static table 8 0 exe library of achievement getters (AppLuaAchievementsLibrary); no call sites found in the game scripts
Search static table 7 7 named from how the game scripts call it (7 of 7 methods matched)
DirtyComponentsManager object type 6 4 game scripts call these on m_DirtyComponents; the exe interface is GameCore::Utility::Lua::IDirtyComponentsManager
Path static table 6 0 exe library of path helpers (GetDirectoryName, GetExtension, NormalizePath, ...); no call sites found in the game scripts
Benchmark static table 5 5 named from how the game scripts call it (5 of 5 methods matched)
Variant container (read only) object type 5 3 smaller variant of the generic container, used on pParameters in game scripts
Userdata metatable A object type 3 0 __tostring / __eq / __index only
Userdata metatable B object type 3 0 __tostring / __eq / __index only
Global functions (include) static table 2 0 include() and RefreshIncludeFileList registered as globals

ForgeUI control types

46 types with 733 methods (the Controls.Name:Method() API; each type lists the methods registered directly on it; a type may also inherit from ControlBase).

Event objects

The exe creates one event object per Lua event (Events.Name, LuaEvents.Name) and gives each the same seven methods; see Event objects.