Skip to content

tutorials Creating a Building

ghost-ng edited this page Jan 28, 2026 · 1 revision

Tutorial: Creating a New Building

This tutorial walks through creating a complete custom building for Civilization VII, including yields, prerequisites, unique civilization buildings, and icons.

What You'll Learn

  • Registering building types in the database
  • Defining building properties and yields
  • Setting technology prerequisites
  • Creating adjacency bonuses
  • Making unique civilization buildings
  • Adding icons and localization

Example: The Grand Library

We'll create a "Grand Library" - a powerful science building that provides science bonuses and additional yields based on adjacent buildings.

File Structure

my-grand-library/
├── data/
│   ├── buildings.xml
│   └── game-effects.xml
├── icons/
│   └── icons.xml
├── text/
│   └── text.xml
└── my-grand-library.modinfo

Step 1: Create the .modinfo File

my-grand-library.modinfo

<?xml version="1.0" encoding="utf-8"?>
<Mod id="my-grand-library" version="1" xmlns="ModInfo">
    <Properties>
        <Name>Grand Library Building</Name>
        <Description>Adds the Grand Library, a powerful science building.</Description>
        <Authors>Your Name</Authors>
        <AffectsSavedGames>1</AffectsSavedGames>
    </Properties>
    <Dependencies>
    </Dependencies>
    <ActionCriteria>
        <Criteria id="antiquity-age">
            <AgeInUse>AGE_ANTIQUITY</AgeInUse>
        </Criteria>
    </ActionCriteria>
    <ActionGroups>
        <ActionGroup id="antiquity-game" scope="game" criteria="antiquity-age">
            <Actions>
                <UpdateDatabase>
                    <Item>data/buildings.xml</Item>
                    <Item>data/game-effects.xml</Item>
                </UpdateDatabase>
                <UpdateText>
                    <Item>text/text.xml</Item>
                </UpdateText>
                <UpdateIcons>
                    <Item>icons/icons.xml</Item>
                </UpdateIcons>
            </Actions>
        </ActionGroup>
    </ActionGroups>
</Mod>

Step 2: Define the Building Database Entries

data/buildings.xml

<?xml version="1.0" encoding="utf-8"?>
<Database>
    <!-- ================================================
         REGISTER TYPES
         ================================================ -->
    <Types>
        <Row Type="BUILDING_GRAND_LIBRARY" Kind="KIND_CONSTRUCTIBLE"/>
    </Types>

    <!-- ================================================
         CONSTRUCTIBLE (Base Definition)
         ================================================ -->
    <Constructibles>
        <Row
            ConstructibleType="BUILDING_GRAND_LIBRARY"
            Name="LOC_BUILDING_GRAND_LIBRARY_NAME"
            Description="LOC_BUILDING_GRAND_LIBRARY_DESCRIPTION"
            Cost="180"
            Population="1"
            ConstructibleClass="BUILDING"
            RequiresUnlock="true"
        />
    </Constructibles>

    <!-- ================================================
         BUILDING-SPECIFIC PROPERTIES
         ================================================ -->
    <Buildings>
        <Row
            ConstructibleType="BUILDING_GRAND_LIBRARY"
            BuildQueue="true"
            Town="false"
        />
    </Buildings>

    <!-- ================================================
         CLASSIFICATION TAGS
         ================================================ -->
    <TypeTags>
        <Row Type="BUILDING_GRAND_LIBRARY" Tag="SCIENCE"/>
        <Row Type="BUILDING_GRAND_LIBRARY" Tag="CULTURE"/>
    </TypeTags>

    <!-- ================================================
         BASE YIELDS
         ================================================ -->
    <Constructible_YieldChanges>
        <Row ConstructibleType="BUILDING_GRAND_LIBRARY" YieldType="YIELD_SCIENCE" YieldChange="4"/>
        <Row ConstructibleType="BUILDING_GRAND_LIBRARY" YieldType="YIELD_CULTURE" YieldChange="2"/>
    </Constructible_YieldChanges>

    <!-- ================================================
         TECHNOLOGY PREREQUISITE
         ================================================ -->
    <ProgressionTreeNodeUnlocks>
        <Row
            ProgressionTreeNodeType="NODE_TECH_AQ_WRITING"
            TargetKind="KIND_CONSTRUCTIBLE"
            TargetType="BUILDING_GRAND_LIBRARY"
            UnlockDepth="1"
        />
    </ProgressionTreeNodeUnlocks>

    <!-- ================================================
         BUILDING PREREQUISITE (Requires Library)
         ================================================ -->
    <Constructible_Prerequisites>
        <Row
            ConstructibleType="BUILDING_GRAND_LIBRARY"
            PrereqType="BUILDING_LIBRARY"
        />
    </Constructible_Prerequisites>

    <!-- ================================================
         SLOT REQUIREMENTS (Optional)
         ================================================ -->
    <!-- If using the urban planning system with slots -->
    <Constructible_Slots>
        <Row
            ConstructibleType="BUILDING_GRAND_LIBRARY"
            SlotTag="URBAN_SLOT_SCIENCE"
            SlotCount="1"
        />
    </Constructible_Slots>
</Database>

Key Tables Explained

Table Purpose
Types Registers the building in the type system
Constructibles Core properties (cost, population, class)
Buildings Building-specific settings
TypeTags Classification for game logic
Constructible_YieldChanges Static yield bonuses
ProgressionTreeNodeUnlocks Tech/civic unlock
Constructible_Prerequisites Requires another building

Constructible Columns

Column Type Description
ConstructibleType TEXT Primary key
Name TEXT Localization key
Description TEXT Localization key
Cost INTEGER Production cost
Population INTEGER Population bonus (0-2)
ConstructibleClass TEXT BUILDING, IMPROVEMENT, or WONDER
RequiresUnlock BOOLEAN Needs tech/civic to build

Step 3: Add Adjacency Bonuses (Optional)

data/game-effects.xml

<?xml version="1.0" encoding="utf-8"?>
<GameEffects xmlns="GameEffects">
    <!-- ================================================
         ADJACENCY BONUS: +1 Science per adjacent Science building
         ================================================ -->
    <Modifier id="MOD_GRAND_LIBRARY_ADJACENCY"
              collection="COLLECTION_CITY_PLOT_YIELDS"
              effect="EFFECT_PLOT_ADJUST_YIELD">
        <SubjectRequirements type="REQUIREMENTSET_TEST_ALL">
            <Requirement type="REQUIREMENT_PLOT_ADJACENT_CONSTRUCTIBLE_TAG">
                <Argument name="Tag">SCIENCE</Argument>
            </Requirement>
        </SubjectRequirements>
        <Argument name="YieldType">YIELD_SCIENCE</Argument>
        <Argument name="Amount">1</Argument>
    </Modifier>

    <!-- ================================================
         CITY-WIDE BONUS: +10% Science in this city
         ================================================ -->
    <Modifier id="MOD_GRAND_LIBRARY_CITY_SCIENCE"
              collection="COLLECTION_OWNER_CITY"
              effect="EFFECT_CITY_ADJUST_YIELD_PERCENT">
        <Argument name="YieldType">YIELD_SCIENCE</Argument>
        <Argument name="Amount">10</Argument>
    </Modifier>
</GameEffects>

Link modifiers to the building:

<!-- Add to buildings.xml -->
<ConstructibleModifiers>
    <Row ConstructibleType="BUILDING_GRAND_LIBRARY" ModifierId="MOD_GRAND_LIBRARY_ADJACENCY"/>
    <Row ConstructibleType="BUILDING_GRAND_LIBRARY" ModifierId="MOD_GRAND_LIBRARY_CITY_SCIENCE"/>
</ConstructibleModifiers>

Step 4: Add Localization

text/text.xml

<?xml version="1.0" encoding="utf-8"?>
<Database>
    <LocalizedText>
        <Row Tag="LOC_BUILDING_GRAND_LIBRARY_NAME" Language="en_US">
            <Text>Grand Library</Text>
        </Row>
        <Row Tag="LOC_BUILDING_GRAND_LIBRARY_DESCRIPTION" Language="en_US">
            <Text>+4[icon:YIELD_SCIENCE] Science, +2[icon:YIELD_CULTURE] Culture. +10% [icon:YIELD_SCIENCE] Science in this city. +1[icon:YIELD_SCIENCE] Science from adjacent Science buildings. Requires Library.</Text>
        </Row>
    </LocalizedText>
</Database>

Step 5: Add Icon (Optional)

icons/icons.xml

<?xml version="1.0" encoding="utf-8"?>
<Database>
    <!-- If you have a custom DDS texture -->
    <IconTextureAtlases>
        <Row Name="ICON_ATLAS_GRAND_LIBRARY" IconSize="50" Filename="icons/grand_library_50.dds"/>
        <Row Name="ICON_ATLAS_GRAND_LIBRARY" IconSize="38" Filename="icons/grand_library_38.dds"/>
    </IconTextureAtlases>

    <IconDefinitions>
        <Row Name="ICON_BUILDING_GRAND_LIBRARY" Atlas="ICON_ATLAS_GRAND_LIBRARY" Index="0"/>
    </IconDefinitions>
</Database>

Without a custom icon, the game uses a default placeholder.

Step 6: Install and Test

  1. Copy your mod folder to:

    • Windows: %LOCALAPPDATA%\Firaxis Games\Sid Meier's Civilization VII\Mods\
  2. Enable the mod in Additional Content

  3. Start an Antiquity game

  4. Research Writing

  5. Build a Library, then the Grand Library

Advanced: Creating a Wonder

Wonders use ConstructibleClass="WONDER" and typically have unique requirements:

<Database>
    <Types>
        <Row Type="WONDER_GREAT_LIBRARY" Kind="KIND_CONSTRUCTIBLE"/>
    </Types>

    <Constructibles>
        <Row
            ConstructibleType="WONDER_GREAT_LIBRARY"
            Name="LOC_WONDER_GREAT_LIBRARY_NAME"
            Description="LOC_WONDER_GREAT_LIBRARY_DESCRIPTION"
            Cost="400"
            Population="0"
            ConstructibleClass="WONDER"
            RequiresUnlock="true"
        />
    </Constructibles>

    <!-- Wonders are unique - only one per game -->
    <TypeTags>
        <Row Type="WONDER_GREAT_LIBRARY" Tag="WONDER"/>
        <Row Type="WONDER_GREAT_LIBRARY" Tag="UNIQUE"/>
    </TypeTags>

    <!-- Terrain/feature requirements -->
    <Constructible_ValidTerrains>
        <Row ConstructibleType="WONDER_GREAT_LIBRARY" TerrainType="TERRAIN_PLAINS"/>
        <Row ConstructibleType="WONDER_GREAT_LIBRARY" TerrainType="TERRAIN_GRASS"/>
    </Constructible_ValidTerrains>

    <!-- Era score for completing -->
    <Constructible_EraScore>
        <Row ConstructibleType="WONDER_GREAT_LIBRARY" EraScore="3"/>
    </Constructible_EraScore>
</Database>

Advanced: Unique Civilization Building

Make a building unique to a specific civilization:

<Database>
    <!-- Define the unique building -->
    <Types>
        <Row Type="BUILDING_MUSAEUM" Kind="KIND_CONSTRUCTIBLE"/>
    </Types>

    <Constructibles>
        <Row
            ConstructibleType="BUILDING_MUSAEUM"
            Name="LOC_BUILDING_MUSAEUM_NAME"
            Description="LOC_BUILDING_MUSAEUM_DESCRIPTION"
            Cost="150"
            Population="1"
            ConstructibleClass="BUILDING"
            RequiresUnlock="true"
        />
    </Constructibles>

    <!-- Mark as unique replacement -->
    <TypeTags>
        <Row Type="BUILDING_MUSAEUM" Tag="UNIQUE"/>
    </TypeTags>

    <!-- Link to civilization -->
    <CivilizationUniqueBuildings>
        <Row
            CivilizationType="CIVILIZATION_GREECE"
            BuildingType="BUILDING_MUSAEUM"
            ReplacesBuildingType="BUILDING_LIBRARY"
        />
    </CivilizationUniqueBuildings>

    <!-- Hide from other civs -->
    <Constructible_CivilizationRequirements>
        <Row
            ConstructibleType="BUILDING_MUSAEUM"
            CivilizationType="CIVILIZATION_GREECE"
        />
    </Constructible_CivilizationRequirements>
</Database>

Advanced: Warehouse Buildings

Buildings that provide storage capacity:

<Constructible_WarehouseYields>
    <Row ConstructibleType="BUILDING_GRAND_LIBRARY" YieldType="YIELD_SCIENCE" Amount="20"/>
</Constructible_WarehouseYields>

Advanced: Great Work Slots

Buildings that can hold great works:

<Constructible_GreatWorkSlots>
    <Row ConstructibleType="BUILDING_GRAND_LIBRARY" GreatWorkSlotType="GREATWORKSLOT_WRITING" NumSlots="2"/>
</Constructible_GreatWorkSlots>

Troubleshooting

Issue Solution
Building doesn't appear Check tech unlock and RequiresUnlock="true"
Can't build in cities Verify prerequisite building exists
Wrong production cost Check Cost column in Constructibles
No yields showing Verify Constructible_YieldChanges entries
Icon missing Check atlas paths and IconDefinitions

Common Technology Nodes

Node Technology
NODE_TECH_AQ_WRITING Writing
NODE_TECH_AQ_MASONRY Masonry
NODE_TECH_AQ_BRONZE_WORKING Bronze Working
NODE_TECH_AQ_IRON_WORKING Iron Working
NODE_TECH_AQ_ENGINEERING Engineering
NODE_TECH_AQ_MATHEMATICS Mathematics

Related Tables Reference

Table Purpose
Constructible_ValidTerrains Terrain placement restrictions
Constructible_ValidBiomes Biome placement restrictions
Constructible_ValidFeatures Feature requirements
Constructible_ValidResources Resource requirements
Constructible_TransitionRemoves Remove on age transition
Constructible_Adjacencies Predefined adjacency bonuses

Next Steps

Clone this wiki locally