Civilization VI Modding
Use this skill only for Civilization VI. Keep Civilization VII separate even when a request mentions both games.
First Pass
- Identify whether the user is creating a new mod, editing an existing mod, or debugging a load/runtime problem.
- Inspect the mod folder before editing. Look for
.modinfo,Data/,Text/,Lua/,UI/,Art/, and any existing naming conventions. - Preserve the mod's current style: XML vs SQL, folder layout, id prefixes, file names, and load-order strategy.
- If the request affects database tables, inspect existing schema usage in the project and nearby game/mod examples instead of inventing table names.
- If the user reports a game error, ask for or inspect
Database.log,Modding.log, and Lua logs before changing broad areas.
Common Files
.modinfo: declares actions, files, dependencies, properties, and compatibility.- XML/SQL: inserts or updates gameplay database rows.
- Text XML/SQL: updates localized strings.
- Lua: gameplay events, UI panels, scripts, and hooks.
- Logs: usually under the user's
Documents\My Games\Sid Meier's Civilization VI\Logs. - Local mods: usually under
Documents\My Games\Sid Meier's Civilization VI\Mods.
Safe Workflow
For a new mod:
- Create a clear mod id/name and a stable internal prefix, for example
TAN_. - Create a
.modinfowithUpdateDatabaseactions for gameplay data,UpdateTextactions for localization, and Lua/UI actions only when needed. - Add one feature at a time. Prefer a minimal loading mod before adding complex modifiers or Lua.
- Use stable identifiers everywhere:
LOC_...keys for text, uppercase IDs for database types, and consistent prefixes for custom rows. - Document any required DLC/ruleset dependency in
.modinfo.
For an existing mod:
- Read the
.modinfofirst to understand what files actually load. - Trace the requested feature from loaded file to database table or Lua entry point.
- Make the smallest change that fits the existing structure.
- Avoid rewriting working XML/SQL into another format unless the user asks.
For debugging:
- Check whether the file is included in
.modinfo. - Check load order and action type: gameplay data should be
UpdateDatabase; text should beUpdateText. - Check SQL/XML syntax first, then missing references, then duplicate IDs.
- Use logs to identify the exact failing file/line where possible.
Implementation Guidance
- Prefer SQL for concise bulk changes and XML for mods already organized around XML.
- Avoid changing base-game rows destructively unless the user explicitly wants an overhaul. Add new rows or narrowly update existing rows.
- Keep localization separate from gameplay data when the mod already does that.
- For modifiers, verify every chain: owner table -> modifier id -> modifier type -> arguments -> requirement sets.
- For Lua/UI work, identify whether the script runs in gameplay context, UI context, or as a replacement/addition to an existing UI file.
- Treat DLC differences carefully. Gathering Storm and Rise and Fall add systems and tables; don't assume all players have every expansion unless the mod requires it.
Mod Structure and Review Checklist
Civilization VI Modding Checklist
New Mod Structure
Use a simple, inspectable layout unless the existing project already uses something else:
MyCiv6Mod/
MyCiv6Mod.modinfo
Data/
MyCiv6Mod_Gameplay.sql
Text/
MyCiv6Mod_Text.sql
Lua/
UI/
Art/
.modinfo Checks
- The mod id is stable and unique.
- Every gameplay SQL/XML file is listed in an
UpdateDatabaseaction. - Every localization file is listed in an
UpdateTextaction. - Lua/UI files are declared using the action type expected by the existing mod pattern.
- Required DLC, expansion, or ruleset dependencies are explicit when the content relies on them.
- File paths use the actual casing and relative paths present on disk.
Database Checks
- Custom IDs use a consistent prefix.
LOC_keys referenced by gameplay rows exist in text files.- Referenced types exist before use.
- Modifier IDs, modifier types, arguments, requirement sets, and subjects line up.
- Updates are narrow and include a
WHEREclause unless intentionally broad. - SQL statements end with semicolons.
Lua/UI Checks
- Confirm whether the file runs in UI or gameplay context.
- Search for existing events/hooks before adding a parallel system.
- Keep replacement UI files minimal; full UI replacement can break compatibility.
- Add defensive nil checks for game objects and context lookups.
Debugging Logs
Ask the user for relevant log excerpts if they are not in the workspace:
Database.logfor SQL/XML schema and constraint failures.Modding.logfor action loading and file inclusion problems.- Lua logs for runtime script errors.
When logs identify a failing file, fix that file first before broad refactors.
<!-- OB-S:Wae__6ss0J2Vw4K0ckAh4Q -->
Scan to join WeChat group