Core Architecture Overview
Civilization VII uses a highly modular architecture organized around “modules” - self-contained packages of content that can be loaded independently. This represents a significant evolution from previous Civilization titles, with content now strictly compartmentalized by era (Ages) and type. The game’s core structure consists of:- Base Modules - Fundamental game systems shared across all content
- Age Modules - Era-specific content packages (Antiquity, Exploration, Modern)
- Standard Modules - Core gameplay definitions and shared resources
.modinfo definition file, making the base game itself a collection of interconnected mods. This architecture makes Civilization VII inherently more moddable than its predecessors.
The Ages System
Civilization VII’s defining feature is its Ages system, which directly impacts how modding works. For detailed information on the Ages system, see the Age Architecture document.Module Relationships
The base game content is distributed across multiple modules that work together:- base-standard: Core gameplay definitions, rules, and systems
- age-antiquity, age-exploration, age-modern: Age-specific content (details in Age Architecture)
Module File Structure
Examining the actual game files, each module follows a consistent structure:- Base-Standard: Contains the
definitionsfolder with.civdbschema files that define game structures - Age Modules: Focus on content specific to that historical period, but lack definition files
- DLC Modules: Similar structure but typically focus on specific civilizations or leaders
Core Modding Concepts
Mod Structure
A basic Civilization VII mod consists of:.modinfofile - XML definition that identifies the mod and specifies how it loads- Data files - XML/SQL content that adds or modifies game elements
- Text files - Localization entries for in-game text
- UI files - JavaScript (JS) files for interface modifications (Civ VII uses JS instead of Lua)
- Map scripts - JS files for procedural map generation (if applicable)
<GAME_DATA>/Mods/your-mod-name/.
Mod Loading Process
When Civilization VII loads a mod:- The game reads the mod’s
.modinfofile to identify dependencies and actions - Action groups define what files to load and when they should load
- Conditionally loaded content may depend on game state (e.g., current Age)
- Database updates are applied to game tables
- Text updates are merged with existing localization
- UI modifications replace or enhance existing interfaces
- Custom scripts are executed for specialized functionality
Database Approach
Most modding in Civilization VII is accomplished through:- Insertions - Adding new rows to game tables (new civilizations, units, buildings)
- Updates - Modifying existing values (changing unit stats, building yields)
- Replacements - Completely replacing entries (changing text or behaviors)
- Core gameplay schema (
<GAME_RESOURCES>/Base/Assets/schema/gameplay/01_GameplaySchema.sql) - Modding framework schema (
<GAME_RESOURCES>/Base/Assets/schema/modding/schema-modding-10.sql) - Icon management schema (
<GAME_RESOURCES>/Base/Assets/schema/icons/IconManager.sql) - Localization schema (
<GAME_RESOURCES>/Base/Assets/schema/loc/schema-loc-10.sql)
Modding Workflow
A typical modding workflow involves:- Planning - Determining scope and dependencies for your mod
- Setup - Creating the mod folder and
.modinfofile - Implementation - Writing XML/SQL data, text, and scripts
- Testing - Ensuring the mod works as expected in-game
- Iteration - Refining based on testing and feedback
- Distribution - Packaging for sharing with other players
Age Transitions and Mod Compatibility
For details on handling age transitions in mods, see the Age Architecture document.Best Practices
Organization
- Use unique identifiers for all content (prefixed with mod name)
- Maintain consistent folder structure for easy navigation
- Group related files logically (data, text, UI, etc.)
- Comment code for clarity and future maintenance
Compatibility
- Specify clear dependencies on base modules
- Use conditional loading for era-specific content
- Avoid direct edits to base game files
- Test with other popular mods when possible
Technical Execution
- Follow naming conventions from base game
- Balance new content against existing game elements
- Test incrementally during development
- Use the game’s logs for troubleshooting
Navigation Guide
The full modding documentation consists of the following sections:- Architecture Overview (this document)
- Technical References:
- Database Schemas - Detailed technical information about the game’s internal structure
- Age Architecture - Overall age system architecture
- Age Modules - Specifics about each Age module and its content
- Base-Standard Module - Core structure and implementation patterns
- DLC and Community Mod Patterns - Examples and best practices from existing mods
- Practical Guides:
- General: Creating New Civilizations - Step-by-step guide for adding civilizations
- General: Creating New Leaders - Process for implementing new leaders
- General: Modifying Existing Content - Approaches for balancing and changing game elements
- Appendices:
- File Paths Reference - Common file paths and structures
Getting Started
For newcomers to Civilization VII modding, we recommend:- Review this architecture document to understand the overall structure
- Examine the Database Schemas document to familiarize yourself with game tables
- Follow the General: Creating New Civilizations or General: Modifying Existing Content guides for hands-on practice
- Reference the DLC and Community Mod Patterns for real-world examples
Further Reading
For more information on modding specific aspects of Civilization VII:- Database Schemas - Detailed database schema reference
- Base Standard Module - Core game module documentation
- General: Creating Civilizations - Process for implementing new civilizations
- General: Creating Leaders - Process for implementing new leaders
- Age Modules - Understanding the Age module system