Game is not loading, dropping to the main menu.

The MunchKING

Chieftain
Joined
Jul 8, 2008
Messages
17
So I was trying to make a modified version of Teddy's power for a civilization, and all the sudden the game won't load anymore. When I try to start a game it just drops to the main menu.

The Database log says...

Code:
[2490164.670] [Gameplay] ERROR: UNIQUE constraint failed: CivilizationTraits.CivilizationType, CivilizationTraits.TraitType
[2490164.670] [Gameplay]: While executing - 'insert into CivilizationTraits('CivilizationType', 'TraitType') values (?, ?);'
[2490164.670] [Gameplay]: In XMLSerializer while inserting row into table insert into CivilizationTraits('CivilizationType', 'TraitType') with  values (CIVILIZATION_DOUGCIV, TRAIT_CIVILIZATION_CONCENT_GOVERNED, ).
[2490164.670] [Gameplay]: In XMLSerializer while updating table CivilizationTraits from file FunCivs_Civilizations.xml.
[2490164.670] [Gameplay] ERROR: UNIQUE constraint failed: CivilizationTraits.CivilizationType, CivilizationTraits.TraitType
[2490164.673] [Gameplay] ERROR: FOREIGN KEY constraint failed
[2490164.673] [Gameplay] ERROR: FOREIGN KEY constraint failed
[2490164.673] [Gameplay]: Validating Foreign Key Constraints...
[2490164.674] [Gameplay] ERROR: Invalid Reference on Buildings.TraitType - "TRAIT_CIVILIZATION_BUILDING_VIDEO_GAME" does not exist in Traits
[2490164.675] [Gameplay] ERROR: Invalid Reference on CivilizationTraits.TraitType - "TRAIT_CIVILIZATION_CONCENT_GOVERNED" does not exist in Traits
[2490164.685] [Gameplay]: Failed Validation.
[2490164.710] [Gameplay]: Validating Foreign Key Constraints...
[2490164.724] [Gameplay]: Passed Validation.
[2490166.483] [FullTextSearch]: FTS - Creating Context
[2490166.605] [Configuration] ERROR: no such table: DiplomacyInfo
[2490166.605] [Configuration]: In Query - insert into DiplomacyInfo('Type', 'BackgroundImage') values (?, ?);
[2490166.605] [Configuration]: In XMLSerializer while updating table DiplomacyInfo from file FunCivs_Config.xml.
[2490167.441] [Configuration]: Validating Foreign Key Constraints...
[2490167.441] [Configuration]: Passed Validation.
[2490172.778] [FullTextSearch]: FullTextSearch - Shutting down

And the relevant code I was inserting to try and upgrade Teddy's power is...

Code:
    <TraitModifiers>
       <Row TraitType="TRAIT_CIVILIZATION_MIGHTY" ModifierId="TRAIT_MIGHTY_AUTOCRACY_BONUS_RATE"/>
        <Row TraitType="TRAIT_CIVILIZATION_MIGHTY" ModifierId="TRAIT_MIGHTY_OLIGARCHY_BONUS_RATE"/>
        <Row TraitType="TRAIT_CIVILIZATION_MIGHTY" ModifierId="TRAIT_MIGHTY_CLASSICAL_REPUBLIC_BONUS_RATE"/>
        <Row TraitType="TRAIT_CIVILIZATION_MIGHTY" ModifierId="TRAIT_MIGHTY_MONARCHY_BONUS_RATE"/>
        <Row TraitType="TRAIT_CIVILIZATION_MIGHTY" ModifierId="TRAIT_MIGHTY_THEOCRACY_BONUS_RATE"/>
        <Row TraitType="TRAIT_CIVILIZATION_MIGHTY" ModifierId="TRAIT_MIGHTY_MERCHANT_REPUBLIC_BONUS_RATE"/>
        <Row TraitType="TRAIT_CIVILIZATION_MIGHTY" ModifierId="TRAIT_MIGHTY_FASCISM_BONUS_RATE"/>
        <Row TraitType="TRAIT_CIVILIZATION_MIGHTY" ModifierId="TRAIT_MIGHTY_COMMUNISM_BONUS_RATE"/>
        <Row TraitType="TRAIT_CIVILIZATION_MIGHTY" ModifierId="TRAIT_MIGHTY_DEMOCRACY_BONUS_RATE"/>
    </TraitModifiers>
    <Modifiers>
        <Row>
            <ModifierId>TRAIT_MIGHTY_AUTOCRACY_BONUS_RATE</ModifierId>
            <ModifierType>MODIFIER_PLAYER_GOVERNMENT_ADJUST_BONUS_RATE</ModifierType>
        </Row>
        <Row>
            <ModifierId>TRAIT_MIGHTY_OLIGARCHY_BONUS_RATE</ModifierId>
            <ModifierType>MODIFIER_PLAYER_GOVERNMENT_ADJUST_BONUS_RATE</ModifierType>
        </Row>
        <Row>
            <ModifierId>TRAIT_MIGHTY_CLASSICAL_REPUBLIC_BONUS_RATE</ModifierId>
            <ModifierType>MODIFIER_PLAYER_GOVERNMENT_ADJUST_BONUS_RATE</ModifierType>
        </Row>
        <Row>
            <ModifierId>TRAIT_MIGHTY_MONARCHY_BONUS_RATE</ModifierId>
            <ModifierType>MODIFIER_PLAYER_GOVERNMENT_ADJUST_BONUS_RATE</ModifierType>
        </Row>
        <Row>
            <ModifierId>TRAIT_MIGHTY_MERCHANT_REPUBLIC_BONUS_RATE</ModifierId>
            <ModifierType>MODIFIER_PLAYER_GOVERNMENT_ADJUST_BONUS_RATE</ModifierType>
        </Row>
        <Row>
            <ModifierId>TRAIT_MIGHTY_THEOCRACY_BONUS_RATE</ModifierId>
            <ModifierType>MODIFIER_PLAYER_GOVERNMENT_ADJUST_BONUS_RATE</ModifierType>
        </Row>
        <Row>
            <ModifierId>TRAIT_MIGHTY_DEMOCRACY_BONUS_RATE</ModifierId>
            <ModifierType>MODIFIER_PLAYER_GOVERNMENT_ADJUST_BONUS_RATE</ModifierType>
        </Row>
        <Row>
            <ModifierId>TRAIT_MIGHTY_FASCISM_BONUS_RATE</ModifierId>
            <ModifierType>MODIFIER_PLAYER_GOVERNMENT_ADJUST_BONUS_RATE</ModifierType>
        </Row>
        <Row>
            <ModifierId>TRAIT_MIGHTY_COMMUNISM_BONUS_RATE</ModifierId>
            <ModifierType>MODIFIER_PLAYER_GOVERNMENT_ADJUST_BONUS_RATE</ModifierType>
        </Row>
    </Modifiers>
    <ModifierArguments>
        <Row>
                <ModifierId>TRAIT_MIGHTY_AUTOCRACY_BONUS_RATE</ModifierId>
            <Name>BonusRate</Name>
            <Value>300</Value>
        </Row>
        <Row>
            <ModifierId>TRAIT_MIGHTY_AUTOCRACY_BONUS_RATE</ModifierId>
            <Name>BonusType</Name>
            <Value>GOVERNMENTBONUS_WONDER_CONSTRUCTION</Value>
        </Row>
        <Row>
            <ModifierId>TRAIT_MIGHTY_OLIGARCHY_BONUS_RATE</ModifierId>
            <Name>BonusRate</Name>
            <Value>300</Value>
        </Row>
        <Row>
            <ModifierId>TRAIT_MIGHTY_OLIGARCHY_BONUS_RATE</ModifierId>
            <Name>BonusType</Name>
            <Value>GOVERNMENTBONUS_COMBAT_EXPERIENCE</Value>
        </Row>
        <Row>
            <ModifierId>TRAIT_MIGHTY_CLASSICAL_REPUBLIC_BONUS_RATE</ModifierId>
            <Name>BonusRate</Name>
            <Value>300</Value>
        </Row>
        <Row>
            <ModifierId>TRAIT_MIGHTY_CLASSICAL_REPUBLIC_BONUS_RATE</ModifierId>
            <Name>BonusType</Name>
            <Value>GOVERNMENTBONUS_GREAT_PEOPLE</Value>
        </Row>
        <Row>
            <ModifierId>TRAIT_MIGHTY_MONARCHY_BONUS_RATE</ModifierId>
            <Name>BonusRate</Name>
            <Value>300</Value>
        </Row>
        <Row>
            <ModifierId>TRAIT_MIGHTY_MONARCHY_BONUS_RATE</ModifierId>
            <Name>BonusType</Name>
            <Value>GOVERNMENTBONUS_ENVOYS</Value>
        </Row>
        <Row>
            <ModifierId>TRAIT_MIGHTY_THEOCRACY_BONUS_RATE</ModifierId>
            <Name>BonusRate</Name>
            <Value>300</Value>
        </Row>
        <Row>
            <ModifierId>TRAIT_MIGHTY_THEOCRACY_BONUS_RATE</ModifierId>
            <Name>BonusType</Name>
            <Value>GOVERNMENTBONUS_FAITH_PURCHASES</Value>
        </Row>
        <Row>
            <ModifierId>TRAIT_MIGHTY_MERCHANT_REPUBLIC_BONUS_RATE</ModifierId>
            <Name>BonusRate</Name>
            <Value>300</Value>
        </Row>
        <Row>
            <ModifierId>TRAIT_MIGHTY_MERCHANT_REPUBLIC_BONUS_RATE</ModifierId>
            <Name>BonusType</Name>
            <Value>GOVERNMENTBONUS_GOLD_PURCHASES</Value>
        </Row>
        <Row>
            <ModifierId>TRAIT_MIGHTY_FASCISM_BONUS_RATE</ModifierId>
            <Name>BonusRate</Name>
            <Value>300</Value>
        </Row>
        <Row>
            <ModifierId>TRAIT_MIGHTY_FASCISM_BONUS_RATE</ModifierId>
            <Name>BonusType</Name>
            <Value>GOVERNMENTBONUS_UNIT_PRODUCTION</Value>
        </Row>
        <Row>
            <ModifierId>TRAIT_MIGHTY_COMMUNISM_BONUS_RATE</ModifierId>
            <Name>BonusRate</Name>
            <Value>300</Value>
        </Row>
        <Row>
            <ModifierId>TRAIT_MIGHTY_COMMUNISM_BONUS_RATE</ModifierId>
            <Name>BonusType</Name>
            <Value>GOVERNMENTBONUS_OVERALL_PRODUCTION</Value>
        </Row>
        <Row>
            <ModifierId>TRAIT_MIGHTY_DEMOCRACY_BONUS_RATE</ModifierId>
            <Name>BonusRate</Name>
            <Value>300</Value>
        </Row>
        <Row>
            <ModifierId>TRAIT_MIGHTY_DEMOCRACY_BONUS_RATE</ModifierId>
            <Name>BonusType</Name>
            <Value>GOVERNMENTBONUS_DISTRICT_PROJECTS</Value>
        </Row>
    </ModifierArguments>
 
File FunCivs_Civilizations.xml contains code that is attempting to add info to table CivilizationTraits that already exists within the table. This error in and of itself does not cause shunting back to the main menu. It does, however, cause the game to stop reading anything more from the file into the game's database, and this is almost certainly the root cause of the errors that are causing the return to the main menu.

The following two errors are causing the game to shunt back to the main menu:
  1. TRAIT_CIVILIZATION_BUILDING_VIDEO_GAME which is being referred to in table Buildings has not successfully been added to the game and is therefore not valid
  2. TRAIT_CIVILIZATION_CONCENT_GOVERNED which is being referred to in table CivilizationTraits has not successfully been added to the game and is therefore not valid
---------------------------------------------------------------------

this error
Code:
[2490166.605] [Configuration] ERROR: no such table: DiplomacyInfo
is being caused by an attempt in the "FrontEnd" (or Settings) to write to a table that does not exist in the "FrontEnd" database. This also will not in and of itself cause a return to the main menu, but if it is within your mod should be fixed by not attempting to write to game-tables that are not valid for their "context".

---------------------------------------------------------------------

If none of this is contained within your own mod, then some other mod is malformed and causing the error(s).

The code you have quoted on your post does not contain any of this.

If you have mods enabled that are not 100% required in order for your mod to function properly, turn all these un-needed mods off in the Additional Content menu. Otherwise, you are just fighting uphill against other people's mistakes and malformed mods.
 
Last edited:
File FunCivs_Civilizations.xml contains code that is attempting to add info to table CivilizationTraits that already exists within the table. This error in and of itself does not cause shunting back to the main menu. It does, however, cause the game to stop reading anything more from the file into the game's database, and this is almost certainly the root cause of the errors that are causing the return to the main menu.

The following two errors are causing the game to shunt back to the main menu:
  1. TRAIT_CIVILIZATION_BUILDING_VIDEO_GAME which is being referred to in table Buildings has not successfully been added to the game and is therefore not valid
  2. TRAIT_CIVILIZATION_CONCENT_GOVERNED which is being referred to in table CivilizationTraits has not successfully been added to the game and is therefore not valid
---------------------------------------------------------------------

Those are defined in the file that it's refusing to read, and they were working before I tried to add this other code.

this error
Code:
[2490166.605] [Configuration] ERROR: no such table: DiplomacyInfo
is being caused by an attempt in the "FrontEnd" (or Settings) to write to a table that does not exist in the "FrontEnd" database. This also will not in and of itself cause a return to the main menu, but if it is within your mod should be fixed by not attempting to write to game-tables that are not valid for their "context".

---------------------------------------------------------------------

If none of this is contained within your own mod, then some other mod is malformed and causing the error(s).

That was in the code I used as a template. It's been sending that one back for a while. I don't know what it's talking about for that either as I couldn't find any reference to a Diplomacyinfo in my code.

The code you have quoted on your post does not contain any of this.

If you have mods enabled that are not 100% required in order for your mod to function properly, turn all these un-needed mods off in the Additional Content menu. Otherwise, you are just fighting uphill against other people's mistakes and malformed mods.

No, all I have is the DLC for the game and this. And it only started refusing to read the file when I added that code, so I'm wondering what the problem is. If the problem is it's trying to add something to a table that already exists in a table would changing the names of the trait or modifierIDs help?
 
the error is stating that this combination already exists within a row in table CivilizationTraits: CIVILIZATION_DOUGCIV, TRAIT_CIVILIZATION_CONCENT_GOVERNED

So you need to check you have not inadvertently stated the same combination twice within the table.

My Boiler-Plate Response in Such Situations: Add Your Mod to A Forum Post (Civ6):
  1. It's better to just take the mod from the game's MODS folder, zip it, and attach the result directly to a post. It is far easier to look at your actual code and the actual structure of the mod as it is being seen by the game than any attempt to determine what you are doing wrong by analyzing descriptions of the problem, or out-of-context snippets of the code.
  2. Very often what a new modder thinks the problem is and what the problem actually is are two different things. Having the actual mod as you are currently trying to use it allows us to look for the actual problem, and if all else fails to simply drop the mis-behaving mod into our MODS folder and run the mod to see what the game tells us.
  3. Zip the version of the mod the game is actually trying to use, which will be found as a sub-folder in ~\Documents\My Games\Sid Meier's Civilization VI\Mods. Zip the whole sub-folder for your mod.
    • Do not (unless specifically asked by someone trying to help diagnose your problem) zip the modbuddy project folder
      Spoiler why not :
      1. This is useless in most cases and requires us to dump it into our modbuddy folder and then start modbuddy and then attempt to analyse what you are doing wrong.
      2. If we cannot spot the issue we then have to create the built and usable version of the mod on our end, which is what we really needed in the 1st place.
      3. And in all this process we have to hope that we are not wasting our time in the event the modbuddy project does not contain the same code as the built version of the mod that is non-functional
      4. People completely corrupt via fix-attempts the built version of the mod in the game's MODS folder and then package and send the modbuddy solution all the time. This results in what we see being different from what the novice mod-maker is seeing in-game.
  4. To attach the zip to a forum post, look for a button called Upload A File when composing your thread reply: this button opens a browse menu where you can select the zipped folder to attach directly to a forum post.
  5. If the zipped folder is too large for the forum to accept then upload the zipped mod to a file-sharing site such as dropbox and provide a link where the mod can be downloaded.
    • Mediafire is not really a very good choice any more because they have become rife with spam and malware, as well as attempts to get you to download unwanted and uneeded kludge by confusing the layout of the download pages. You'll note for example that Mediafire links are no longer allowed on Steam, whereas CFC (this site) and dropbox links are still allowed.
 
My Boiler-Plate Response in Such Situations: Add Your Mod to A Forum Post (Civ6):
  1. It's better to just take the mod from the game's MODS folder, zip it, and attach the result directly to a post. It is far easier to look at your actual code and the actual structure of the mod as it is being seen by the game than any attempt to determine what you are doing wrong by analyzing descriptions of the problem, or out-of-context snippets of the code.
  2. Very often what a new modder thinks the problem is and what the problem actually is are two different things. Having the actual mod as you are currently trying to use it allows us to look for the actual problem, and if all else fails to simply drop the mis-behaving mod into our MODS folder and run the mod to see what the game tells us


Very Well... The one labeled "Latest" is the one that is not working. The one labeled "Backup" is a backup from before I tried to change Mighty to a copy of Teddy's ability. It works fine, but Mighty is something else from the files I got this template from.
 

Attachments

  • FunCivs Backup.zip
    1.1 MB · Views: 31
  • FunCivs Latest.zip
    1.1 MB · Views: 45
  1. When you get shunted back to the main menu the first thing to do is to check the database.log, and then to do a search through the indicated file(s) mentioned in the errors therein for the offending string of code. I found your first fundamental error by doing a search through the file for "TRAIT_CIVILIZATION_CONCENT_GOVERNED".
  2. From File All The Fun Civs\Data\FunCivs_Civilizations.xml:
    Code:
    	<CivilizationTraits>
    		<Row CivilizationType="CIVILIZATION_DOUGCIV" TraitType="TRAIT_CIVILIZATION_CONCENT_GOVERNED"/>	
    		<Row CivilizationType="CIVILIZATION_DOUGCIV" TraitType="TRAIT_CIVILIZATION_CONCENT_GOVERNED"/>
    		<Row CivilizationType="CIVILIZATION_DOUGCIV" TraitType="TRAIT_CIVILIZATION_BUILDING_VIDEO_GAME"/>		
    	</CivilizationTraits>
    This error causes the remainder of the file not to be read. This was the name of the file mentioned in the Database.log error messages, and the offending code-string.
  3. Fixing this error then reveals the following error:
    Code:
    [3605735.267] [Gameplay] ERROR: Invalid Reference on Traits.TraitType - "TRAIT_CIVILIZATION_MIGHTY" does not exist in Types
    • Here you are creating the trait in table <Traits>
      Code:
      	<Traits>
      		<Row TraitType="TRAIT_CIVILIZATION_CONCENT_GOVERNED" Name="LOC_TRAIT_CIVILIZATION_CONCENT_GOVERNED_NAME" Description="LOC_TRAIT_CIVILIZATION_CONCENT_GOVERNED_DESCRIPTION"/>
      		<Row TraitType="TRAIT_CIVILIZATION_MIGHTY" Name="LOC_TRAIT_LEADER_MIGHTY_NAME" Description="LOC_TRAIT_LEADER_MIGHTY_DESCRIPTION"/>
      		<Row TraitType="TRAIT_CIVILIZATION_BUILDING_VIDEO_GAME" Name="LOC_BUILDING_VIDEO_GAME_NAME" Description="LOC_BUILDING_VIDEO_GAME_DESCRIPTION"/>		
      	</Traits>
    • But you have never defined the trait-name as a <Type>
      Code:
      	<Types>
      		<Row Type="CIVILIZATION_DOUGCIV" Kind="KIND_CIVILIZATION"/>
         		<Row Type="TRAIT_CIVILIZATION_CONCENT_GOVERNED" Kind="KIND_TRAIT" />
      		<Row Type="TRAIT_CIVILIZATION_BUILDING_VIDEO_GAME" Kind="KIND_TRAIT" />	
      	</Types>
  4. Nor have you attached "TRAIT_CIVILIZATION_MIGHTY" to either the civilization or the leader
  5. You have created a similar-named leader trait here in table <Types>
    Code:
    	<Types>
    		<Row Type="LEADER_DOUG" Kind="KIND_LEADER"/>
    		<Row Type="TRAIT_LEADER_MIGHTY" Kind="KIND_TRAIT"/>
    		<Row Type="TRAIT_LEADER_UNIT_ENFIELD" Kind="KIND_TRAIT" />
    	</Types>
    But then you've never actually used "TRAIT_LEADER_MIGHTY" anywhere I can see. Everything you have defined for anything called "MIGHTY" you've done in the FunCivs_Civilizations.xml file but then never attached the actual trait to the civilization.
  6. Try the attached altered version of the mod. You still have art issues and some issues with text that hasn't been alterred from the original template mod, but art is not my thing so I am not sure what if anything you are doing wrong there.
 

Attachments

  • All The Fun Civs.zip
    1.1 MB · Views: 44
read. This was the name of the file mentioned in the Database.log error messages, and the offending code-string.
  1. Fixing this error then reveals the following error:
    Code:
    [3605735.267] [Gameplay] ERROR: Invalid Reference on Traits.TraitType - "TRAIT_CIVILIZATION_MIGHTY" does not exist in Types
  2. Nor have you attached "TRAIT_CIVILIZATION_MIGHTY" to either the civilization or the leader
  3. You have created a similar-named leader trait here in table <Types>
    Code:
        <Types>
            <Row Type="LEADER_DOUG" Kind="KIND_LEADER"/>
            <Row Type="TRAIT_LEADER_MIGHTY" Kind="KIND_TRAIT"/>
            <Row Type="TRAIT_LEADER_UNIT_ENFIELD" Kind="KIND_TRAIT" />
        </Types>
    But then you've never actually used "TRAIT_LEADER_MIGHTY" anywhere I can see. Everything you have defined for anything called "MIGHTY" you've done in the FunCivs_Civilizations.xml file but then never attached the actual trait to the civilization.

Really? Dang it, I thought I did. Well now I feel stupid. :D

Thank you for helping me out with this.

EDIT: Oh I know what the problem is. The second Concent was supposed to be changed to Mighty. I must have Copy/Pasted and then not corrected it. Dur.

Although that didn't explain why it wasn't defined as a type either. Huh...

  1. Try the attached altered version of the mod. You still have art issues and some issues with text that hasn't been alterred from the original template mod, but art is not my thing so I am not sure what if anything you are doing wrong there.

Well yeah, that is more me wanting to get the game mechanics right first. I can amend text whenever.
 
Last edited:
Top Bottom