• Civilization 7 has been announced. For more info please check the forum here .

Problem with debugging simple civilzation mod

Lyokoheros

Chieftain
Joined
Mar 1, 2020
Messages
15
Recently I regain my interest in Civilization V and modding it I tried to make a simple mod that adds civilization with modBuddy. Actually, I did some experiments before, like making some changes in used mods or changing one civ into a complete different one by modifying its colors, icon, trait, special units and buildings in game files (including making some custom building that reused existing building icons) - and it works perfectly fine.

But I didn't know how to make an actual mod, so I looked for some tutorials and I find this. I do everything like in that tutorial... and add actual XML lines which were supposed to add the actuall effect to new buildings, set them other icon, and set them as default building in given class for that civilization, making the trait etc.
I made it as quite OP but forcibly single city civilization, with some increased units maintenance cost. (Would it balance each other out? I don't know, but I don't care as much as it was kind of an experiment anyway, and It will be fun to play for me) So it has a bunch of unique buildings (including palace replacements) including 2 already existing.
(It's based on the idea of an ancient house from my Code Lyoko fanfiction, but those story-related details aren't very important here)

Anyway, I have a big problem with loading this mod. I mean in modBuddy all seems fine, but when I actually choose it in the game it always freezes (and then crashes after trying to use task manager). I tried to seek if there is some mistake in the XML files, but I didn't found anything all seemed to be fine (except some little mistakes I correct already) but it didn't help... well ONCE I was able to load the game (with in-game editor so I was able to verify that free "Native tongue" promotion (letting to choose a bonus from ancient ruin) to all scouts works) and star as that civ (starting bias seem to work...) but when I created my first city to my utter surprise it didn't have a palace (neither normal nor its replacement) and monument (or rather its replacement) didn't appear in the city menu. As I checked other buildings (I'm not 100% sure if all - I made mistake and try to reload this instead of fully checking the tech tree and civilopedia) also disappeared - I didn't have access either to normal or unique versions.
(I also did try to add some improvements (one custom "based" on Kasbah, and Portugal feitoria) but eventually just choose to not load this XML before all else will work)
Then I tried to seek where could be some mistake and tried to start the game with this mod as new civ but It did never succeed.

As I checked the log files nothing seem to point toward any error (at least any connected with my mod) I also tried to compare content of my XML files with original XMLs and XMLs from mods I know work... but it didn't help so I don't know what else Could I do and what I do wrong...
Here's the database log
Code:
[3487.917] columns StrategicViewType, TileType are not unique
[3487.917] While executing - 'INSERT INTO ArtDefine_StrategicView(StrategicViewType, TileType, Asset) VALUES(?,?,?)'
[3490.849] no such table: ContentPackage.LocalizedText
[3490.849] no such table: ContentPackage.LocalizedText
[3490.849] no such table: ContentPackage.LocalizedText
[3491.754] no such table: ContentPackage.LocalizedText
[3493.923] columns StrategicViewType, TileType are not unique
[3493.923] While executing - 'INSERT INTO ArtDefine_StrategicView(StrategicViewType, TileType, Asset) VALUES(?,?,?)'
[3494.859] no such table: ContentPackage.LocalizedText
[3494.874] no such table: ContentPackage.LocalizedText
[3494.874] no such table: ContentPackage.LocalizedText
[3499.476] Validating Foreign Key Constraints...
[3499.476] Invalid Reference on ArtDefine_Landmarks.LayoutHandler - "SPECIAL" does not exist in ArtDefine_LandmarkTypes
[3499.476] Invalid Reference on ArtDefine_Landmarks.LayoutHandler - "SPECIAL" does not exist in ArtDefine_LandmarkTypes
[3499.476] Invalid Reference on ArtDefine_Landmarks.LayoutHandler - "SPECIAL" does not exist in ArtDefine_LandmarkTypes
[3499.476] Invalid Reference on ArtDefine_Landmarks.LayoutHandler - "SPECIAL" does not exist in ArtDefine_LandmarkTypes
[3499.476] Invalid Reference on ArtDefine_Landmarks.LayoutHandler - "SPECIAL" does not exist in ArtDefine_LandmarkTypes
[3499.476] Invalid Reference on ArtDefine_Landmarks.LayoutHandler - "SPECIAL" does not exist in ArtDefine_LandmarkTypes
[3499.476] Invalid Reference on ArtDefine_Landmarks.LayoutHandler - "SPECIAL" does not exist in ArtDefine_LandmarkTypes
[3499.476] Invalid Reference on ArtDefine_Landmarks.LayoutHandler - "SPECIAL" does not exist in ArtDefine_LandmarkTypes
[3499.476] Invalid Reference on ArtDefine_Landmarks.LayoutHandler - "SPECIAL" does not exist in ArtDefine_LandmarkTypes
[3501.785] Failed Validation.
[3502.238]
-- SQLite Memory Statistics --
Memory Usage:
        [Cur]        [Max]
Malloc:        6368648        81321504
PageCache:    6        12
LookAside:    0        0
Scratch:    0        1

Static Buffer Overflows:
        [TooLarge]    [NoSpace]
PageCache:    5951736        67429488
Scratch:    0        0

Largest Allocations:
Malloc:        262144
PageCache:    1172
Scratch:    6376

Prepared Statements:
Current:        6
------------------------------
[3502.269] Validating Foreign Key Constraints...
[3502.269] Invalid Reference on ArtDefine_Landmarks.LayoutHandler - "SPECIAL" does not exist in ArtDefine_LandmarkTypes
[3502.269] Invalid Reference on ArtDefine_Landmarks.LayoutHandler - "SPECIAL" does not exist in ArtDefine_LandmarkTypes
[3502.269] Invalid Reference on ArtDefine_Landmarks.LayoutHandler - "SPECIAL" does not exist in ArtDefine_LandmarkTypes
[3502.269] Invalid Reference on ArtDefine_Landmarks.LayoutHandler - "SPECIAL" does not exist in ArtDefine_LandmarkTypes
[3502.269] Invalid Reference on ArtDefine_Landmarks.LayoutHandler - "SPECIAL" does not exist in ArtDefine_LandmarkTypes
[3502.269] Invalid Reference on ArtDefine_Landmarks.LayoutHandler - "SPECIAL" does not exist in ArtDefine_LandmarkTypes
[3502.269] Invalid Reference on ArtDefine_Landmarks.LayoutHandler - "SPECIAL" does not exist in ArtDefine_LandmarkTypes
[3502.269] Invalid Reference on ArtDefine_Landmarks.LayoutHandler - "SPECIAL" does not exist in ArtDefine_LandmarkTypes
[3502.269] Invalid Reference on ArtDefine_Landmarks.LayoutHandler - "SPECIAL" does not exist in ArtDefine_LandmarkTypes
[3504.562] Failed Validation.
[3504.999]
-- SQLite Memory Statistics --
Memory Usage:
        [Cur]        [Max]
Malloc:        6369824        81321504
PageCache:    6        12
LookAside:    0        0
Scratch:    0        1

Static Buffer Overflows:
        [TooLarge]    [NoSpace]
PageCache:    5952912        67429488
Scratch:    0        0

Largest Allocations:
Malloc:        262144
PageCache:    1172
Scratch:    6376

Prepared Statements:
Current:        6
------------------------------

and XML log:
Code:
[3499.461] **** Validating Game Database *****
[3501.785] Performing Localization Checks
[3501.785] Checking Tag Format...
[3501.785] Note: Tags must only use [A-Z_] characters, start with 'TXT_KEY_', and be under 128 characters long.
[3501.816] Validating UnitGameplay2DScripts
[3501.816] Missing Entry for UNIT_BARBARIAN_HORSEMAN
[3501.816] **** VALIDATION FAILED *****
[3501.816] Validation Took 2.352208 seconds
[3502.238] **** Validating Prefetch Process *****
[3502.238] **** Validation Success *****
[3502.238] SetGlobalActionInfo
[3502.238]
-- SQLite Memory Statistics --
Memory Usage:
        [Cur]        [Max]
Malloc:        6368648        81321504
PageCache:    6        12
LookAside:    0        0
Scratch:    0        1

Static Buffer Overflows:
        [TooLarge]    [NoSpace]
PageCache:    5951736        67429488
Scratch:    0        0

Largest Allocations:
Malloc:        262144
PageCache:    1172
Scratch:    6376

Prepared Statements:
Current:        6
------------------------------
[3502.253] **** Validating Game Database *****
[3504.562] Performing Localization Checks
[3504.562] Checking Tag Format...
[3504.562] Note: Tags must only use [A-Z_] characters, start with 'TXT_KEY_', and be under 128 characters long.
[3504.593] Validating UnitGameplay2DScripts
[3504.593] Missing Entry for UNIT_BARBARIAN_HORSEMAN
[3504.593] **** VALIDATION FAILED *****
[3504.593] Validation Took 2.330725 seconds
[3504.999] **** Validating Prefetch Process *****
[3504.999] **** Validation Success *****
[3504.999] SetGlobalActionInfo
[3504.999]
-- SQLite Memory Statistics --
Memory Usage:
        [Cur]        [Max]
Malloc:        6369824        81321504
PageCache:    6        12
LookAside:    0        0
Scratch:    0        1

Static Buffer Overflows:
        [TooLarge]    [NoSpace]
PageCache:    5952912        67429488
Scratch:    0        0

Largest Allocations:
Malloc:        262144
PageCache:    1172
Scratch:    6376

Prepared Statements:
Current:        6
------------------------------

[3499.461] **** Validating Game Database *****
[3501.785] Performing Localization Checks
[3501.785] Checking Tag Format...
[3501.785] Note: Tags must only use [A-Z_] characters, start with 'TXT_KEY_', and be under 128 characters long.
[3501.816] Validating UnitGameplay2DScripts
[3501.816] Missing Entry for UNIT_BARBARIAN_HORSEMAN
[3501.816] **** VALIDATION FAILED *****
[3501.816] Validation Took 2.352208 seconds
[3502.238] **** Validating Prefetch Process *****
[3502.238] **** Validation Success *****
[3502.238] SetGlobalActionInfo
[3502.238]
-- SQLite Memory Statistics --
Memory Usage:
        [Cur]        [Max]
Malloc:        6368648        81321504
PageCache:    6        12
LookAside:    0        0
Scratch:    0        1
Static Buffer Overflows:
        [TooLarge]    [NoSpace]
PageCache:    5951736        67429488
Scratch:    0        0
Largest Allocations:
Malloc:        262144
PageCache:    1172
Scratch:    6376
Prepared Statements:
Current:        6
------------------------------
[3502.253] **** Validating Game Database *****
[3504.562] Performing Localization Checks
[3504.562] Checking Tag Format...
[3504.562] Note: Tags must only use [A-Z_] characters, start with 'TXT_KEY_', and be under 128 characters long.
[3504.593] Validating UnitGameplay2DScripts
[3504.593] Missing Entry for UNIT_BARBARIAN_HORSEMAN
[3504.593] **** VALIDATION FAILED *****
[3504.593] Validation Took 2.330725 seconds
[3504.999] **** Validating Prefetch Process *****
[3504.999] **** Validation Success *****
[3504.999] SetGlobalActionInfo
[3504.999]
-- SQLite Memory Statistics --
Memory Usage:
        [Cur]        [Max]
Malloc:        6369824        81321504
PageCache:    6        12
LookAside:    0        0
Scratch:    0        1
Static Buffer Overflows:
        [TooLarge]    [NoSpace]
PageCache:    5952912        67429488
Scratch:    0        0
Largest Allocations:
Malloc:        262144
PageCache:    1172
Scratch:    6376
Prepared Statements:
Current:        6
------------------------------

I've also upload folder with my mod (with all buildings but palace replacement commented out. Actually while doing that I discover a few mistakes, but even when they are commented out game freezes and crashes) and logs, I hope it can help faster find what's the issue here.
 

Attachments

  • Logs.rar
    4.2 KB · Views: 52
  • Dragon Union - Doragon's civilization (v 1 - not fully working).rar
    16.2 KB · Views: 53
  • Dragon Union - Doragon's civilization (v 1 - working but incomplete).rar
    16.1 KB · Views: 62
Last edited:
Ok, I... get what was wrong finaly. Well kinda. I get what lines could cause that problem, but I failed to understand WHY.
I mean those lines are simply just copy of already existing building, even bofere adding lines which set some additional benefits it's presence in the XML code makes all new buildings now to work(not appearing on the tech tree, and civilization is unable to build their normal counterparts too as I said before). Though buildings which are just borrowed from other civs works.
This is replacement of an armory:
Code:
<Row>
            <Type>BUILDING_FER_DRAGON_ARMORY</Type>
            <BuildingClass>BUILDINGCLASS_ARMORY</BuildingClass>
            <Cost>175</Cost>
            <GoldMaintenance>2</GoldMaintenance>
            <PrereqTech>TECH_STEEL</PrereqTech>
            <Help>TXT_KEY_BUILDING_FER_DRAGON_ARMORY_HELP</Help>
            <Description>TXT_KEY_BUILDING_FER_DRAGON_ARMORY</Description>
            <Civilopedia>TXT_KEY_CIV5_BUILDINGS_FER_DRAGON_ARMORY_PEDIA</Civilopedia>
            <Strategy>TXT_KEY_BUILDING_FER_DRAGON_ARMORY_STRATEGY</Strategy>
            <ArtDefineTag>ART_DEF_BUILDING_BARRACKS</ArtDefineTag>
            <MinAreaSize>-1</MinAreaSize>
            <HurryCostModifier>25</HurryCostModifier>
            <IconAtlas>BW_ATLAS_1</IconAtlas>
            <NeverCapture>true</NeverCapture>
            <PortraitIndex>6</PortraitIndex>
        </Row>
It's all the same as in normal armory XML, just with cost and maintenance raised a little (to balance out the benefits it gives and the fact how many special buildings Doragons have - is it a good way for balance? I don't know but it seems to be fun to play anyway, so), <Type> name changed and changed TXT_KEYs accordingly. But still, it makes all the new buildings not working! (I'll update files in the first post). Strangely enough, this was also the case with one other building, but when I added (de-commented out) it again it start to work - but it didn't happen with this "Dragon Armory". Here are also parts of the code responsible for assigning this building to Doragons' civilization:
Code:
<Civilization_BuildingClassOverrides>     
        <Row>
            <CivilizationType>CIVILIZATION_DORAGONS</CivilizationType>
            <BuildingClassType>BUILDINGCLASS_ARMORY</BuildingClassType>
            <BuildingType>BUILDING_FER_DRAGON_ARMORY</BuildingType>
        </Row>
</Civilization_BuildingClassOverrides>
And to assigning required building:
Code:
<Building_ClassesNeededInCity>
        <Row>
            <BuildingType>BUILDING_FER_DRAGON_ARMORY</BuildingType>
            <BuildingClassType>BUILDINGCLASS_BARRACKS</BuildingClassType>
        </Row>
</Building_ClassesNeededInCity>
And for it's benefits
Code:
<Building_YieldChanges>
       <Row>
            <BuildingType>BUILDING_FER_DRAGON_ARMORY</BuildingType>
            <YieldType>YIELD_PRODUCTION</YieldType>
            <Yield>2</Yield>
        </Row>
        <Row>
            <BuildingType>BUILDING_FER_DRAGON_ARMORY</BuildingType>
            <YieldType>YIELD_CULTURE</YieldType>
            <Yield>1</Yield>
        </Row>
</Building_YieldChanges>
<Building_DomainProductionModifiers>
        <Row>
            <BuildingType>BUILDING_FER_DRAGON_ARMORY</BuildingType>
            <DomainType>DOMAIN_LAND</DomainType>
            <Modifier>15</Modifier>
        </Row>
    </Building_DomainProductionModifiers>
    <Building_DomainFreeExperiences>
        <Row>
            <BuildingType>BUILDING_FER_DRAGON_ARMORY</BuildingType>
            <DomainType>DOMAIN_LAND</DomainType>
            <Experience>15</Experience>
        </Row>
        <Row>
            <BuildingType>BUILDING_FER_DRAGON_ARMORY</BuildingType>
            <DomainType>DOMAIN_SEA</DomainType>
            <Experience>15</Experience>
        </Row>
        <Row>
            <BuildingType>BUILDING_FER_DRAGON_ARMORY</BuildingType>
            <DomainType>DOMAIN_AIR</DomainType>
            <Experience>15</Experience>
        </Row>
    </Building_DomainFreeExperiences>
The mod with those lines commented and uncommented is in the first post.
 
Last edited:
Top Bottom