Cannot start new game

thinkingnut

Warlord
Joined
Sep 18, 2013
Messages
146
Hi Civ 6 Enthusiasts!

I'm a newbie modder who just created my first civ 6 custom civilisation. After adding and enabling it, I find that whenever I want to start a new game (either as this custom civ or any of the other civs), the game goes into the black "Loading" screen, then "Start Game" screen, then promptly returns me to the main menu. This problem only occurs if I have my custom mod enabled.

Why is this happening, and how do I fix it, people?

For your reference, I've uploaded the mod files. If I have made any mistakes anywhere, please do let me know as I'm very eager to get into game as my custom civ!!

Many thanks,
ThinkingNut
 

Attachments

look in file ~\Documents\My Games\Sid Meier's Civilization VI\Logs/Database.log there will almost certainly be an error there about an "Invalid Referecne" and likely there will be other error messages.

Getting shunted back to the main menu means you have told the game to use something undefined (for example MODIFIER_MY_GIANT_MODIFIER but no such modifier is defined in the Modifiers table). It does not matter what you are attempting to define within the files of your mod, it only matter what successfully gets read into the game's database so far as errors for "Invalid References" and the like.

If you have any error whatsoever in a file, the game ceases to read the contents of that file and moves on. Anything located farther down in the file would therefore never make it into the game's database.

Just zip the entire mod as it is in the game's MODS folder and attach that zip to a post rather than attaching the files individually. This way, if all else fails, we can run the mod on our end.
 
look in file ~\Documents\My Games\Sid Meier's Civilization VI\Logs/Database.log there will almost certainly be an error there about an "Invalid Referecne" and likely there will be other error messages.

Getting shunted back to the main menu means you have told the game to use something undefined (for example MODIFIER_MY_GIANT_MODIFIER but no such modifier is defined in the Modifiers table). It does not matter what you are attempting to define within the files of your mod, it only matter what successfully gets read into the game's database so far as errors for "Invalid References" and the like.

If you have any error whatsoever in a file, the game ceases to read the contents of that file and moves on. Anything located farther down in the file would therefore never make it into the game's database.

Just zip the entire mod as it is in the game's MODS folder and attach that zip to a post rather than attaching the files individually. This way, if all else fails, we can run the mod on our end.

Thank you for the prompt reply, LeeS. I've tried looking for the Database.log, but I cannot find it. I can't even find "Sid Meier's Civilisation VI" in "My Games". As a result, I don't know how to add my mod into the MODS folder. Maybe it is because I'm using a Mac and downloaded the game from the App Store? I've attached a picture of what I can see regarding this.

I've read and understood what you meant about errors and invalid references. I've also attached a zip version of my mod for your inspection.

May I ask how should I proceed from here?

Thank you very much.
 

Attachments

  • Warren Of Neo China.zip
    Warren Of Neo China.zip
    500.8 KB · Views: 76
  • Cannot Find Civ 6.jpeg
    Cannot Find Civ 6.jpeg
    269 KB · Views: 103
Yeah, Mac apparently shoves stuff into some other oddball place than My Games, etc.
Code:
[3219643.889] [Gameplay] ERROR: UNIQUE constraint failed: Modifiers.ModifierId
[3219643.889] [Gameplay]: While executing - 'insert into Modifiers('ModifierId', 'ModifierType') values (?, ?);'
[3219643.890] [Gameplay]: In XMLSerializer while inserting row into table insert into Modifiers('ModifierId', 'ModifierType') with  values (TRAIT_BUILDERPRODUCTION, MODIFIER_PLAYER_UNITS_ADJUST_UNIT_PRODUCTION, ).
[3219643.890] [Gameplay]: In XMLSerializer while updating table Modifiers from file Warren_Civilizations.xml.
[3219643.890] [Gameplay] ERROR: UNIQUE constraint failed: Modifiers.ModifierId
[3219643.890] [Gameplay] ERROR: UNIQUE constraint failed: Colors.Type
[3219643.890] [Gameplay]: While executing - 'insert into Colors('Type', 'Color') values (?, ?);'
[3219643.890] [Gameplay]: In XMLSerializer while inserting row into table insert into Colors('Type', 'Color') with  values (COLOR_PLAYER_CHINA_PRIMARY, 125,150,60,255, ).
[3219643.890] [Gameplay]: In XMLSerializer while updating table Colors from file Warren_Colours.xml.
[3219643.890] [Gameplay] ERROR: UNIQUE constraint failed: Colors.Type
[3219643.890] [Gameplay] ERROR: UNIQUE constraint failed: CivilizationCitizenNames.CivilizationType, CivilizationCitizenNames.CitizenName
[3219643.890] [Gameplay]: While executing - 'insert into CivilizationCitizenNames('CivilizationType', 'CitizenName') values (?, ?);'
[3219643.890] [Gameplay]: In XMLSerializer while inserting row into table insert into CivilizationCitizenNames('CivilizationType', 'CitizenName') with  values (CIVILIZATION_CHINA, LOC_CITIZEN_CHINA_MALE_1, ).
[3219643.890] [Gameplay]: In XMLSerializer while updating table CivilizationCitizenNames from file Warren_Gossip.xml.
[3219643.890] [Gameplay] ERROR: UNIQUE constraint failed: CivilizationCitizenNames.CivilizationType, CivilizationCitizenNames.CitizenName
[3219643.892] [Gameplay] ERROR: UNIQUE constraint failed: Modifiers.ModifierId
[3219643.892] [Gameplay]: While executing - 'insert into Modifiers('ModifierId', 'ModifierType') values (?, ?);'
[3219643.892] [Gameplay]: In XMLSerializer while inserting row into table insert into Modifiers('ModifierId', 'ModifierType') with  values (TRAIT_ADJUST_NON_CAPITAL_FREE_CHEAPEST_BUILDING, MODIFIER_PLAYER_CITIES_GRANT_CHEAPEST_BUILDING_IN_CITY, ).
[3219643.892] [Gameplay]: In XMLSerializer while updating table Modifiers from file Warren_Leaders.xml.
[3219643.892] [Gameplay] ERROR: UNIQUE constraint failed: Modifiers.ModifierId
Each of these sets of errors related to ERROR: UNIQUE constraint failed messages means you are attempting to re-add something the game already has within the specified xml-table.

You cannot do this, as an example because TRAIT_BUILDERPRODUCTION is already defined and used in the game.
Code:
	<Modifiers>
		<Row>
			<ModifierId>TRAIT_BUILDERPRODUCTION</ModifierId>
			<ModifierType>MODIFIER_PLAYER_UNITS_ADJUST_UNIT_PRODUCTION</ModifierType>
		</Row>
		<Row>
			<ModifierId>TRAIT_SETTLERPRODUCTION</ModifierId>
			<ModifierType>MODIFIER_PLAYER_UNITS_ADJUST_UNIT_PRODUCTION</ModifierType>
		</Row>		
	</Modifiers>
TRAIT_SETTLERPRODUCTION will be okay because it is not already defined within the game.

Once the game sees an attempt to re-define something is already has, as being done in this line
Code:
<ModifierId>TRAIT_BUILDERPRODUCTION</ModifierId>
The game ceases to read anything more from within the same file.

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

These all aready exist within the game's xml code:
  • TRAIT_BUILDERPRODUCTION
  • COLOR_PLAYER_CHINA_PRIMARY already exists within the game.
  • The combination of CIVILIZATION_CHINA and LOC_CITIZEN_CHINA_MALE_1 already exists within the game for table CivilizationCitizenNames
  • This combination already exists so you cannot attempt to redfine it:
    Code:
    <Modifiers>
    	<Row>
    		<ModifierId>TRAIT_ADJUST_NON_CAPITAL_FREE_CHEAPEST_BUILDING</ModifierId>
    		<ModifierType>MODIFIER_PLAYER_CITIES_GRANT_CHEAPEST_BUILDING_IN_CITY</ModifierType>
    	</Row>
    </Modifiers>
    You can make use of the existing trait like you are doing here:
    Code:
    	<TraitModifiers>
    		<Row TraitType="TRAIT_LEADER_SILVERTONGUEDLEGACY" ModifierId="TRAIT_ADJUST_NON_CAPITAL_FREE_CHEAPEST_BUILDING"/>
    		<Row TraitType="TRAIT_LEADER_SILVERTONGUEDLEGACY" ModifierId="TRAIT_DIPLOMATIC_GOVERNMENT_SLOT"/>
    	</TraitModifiers>
    You just cannot attempt to re-define the existing trait.
  • You already have this
    Code:
        <Row Tag="LOC_CIVILIZATION_WARREN_NAME" Language="en_US">
          <Text>Neo China</Text>
        </Row>
    in file Warren_Config_Text.xml so you cannot attempt to re-add it in file Warren_Text.xml. In order to use the same sets of text both in <FrontEndActions> and <InGameActions> you need to change all occurances of "Row" in both text files to "Replace".
 
Last edited:
Indeed. So what do I do now?

I've since managed to find Civ 6 in my applications. This is where I think my mod should go: ~\Applications\Civilization VI\Contents\Assets\DLC\Warren of Neo China. At least it shows up in game.

But still, don't know where to find the Database.log. Hm..
 
If Mac supplies you with (or allows you to download) a "search" program I would search your computer for where in the world a file called Database.log is located on your computer.
 
The DLC folder would not be where the mod is going (or would not be on Windows). How are you making your mod if you don't know where it is? I thought Modbuddy did not work on Mac machines.

It shouldn't hurt to have the mod placed in the DLC folder (doing so still makes the mod work on a Windows computer) but it is not usually where mods are placed.
 
If Mac supplies you with (or allows you to download) a "search" program I would search your computer for where in the world a file called Database.log is located on your computer.

I've already tried that, but with no success. Thanks for the suggestion though.
 
The DLC folder would not be where the mod is going (or would not be on Windows). How are you making your mod if you don't know where it is? I thought Modbuddy did not work on Mac machines.

Hmmm... Yes, Modbuddy does not work on Macs (I think), so I'm just copying and tweaking existing files from another mod to suit my custom civ. I would then put this mod folder in the DLC folder. It shows up fine though in the game creation screen, but just does not work when I actually want to start the game. :(

For example, I've attached a picture.
 

Attachments

  • Warren IG Civ 6.png
    Warren IG Civ 6.png
    3.5 MB · Views: 158
Right, so I've made changes to all the issues you have highlighted, LeeS. Thanks very much for your help so far. However, it's still not working in game.

So what else am I missing or doing wrong? I've attached an updated version of my mod files for your inspection.

Cheers.
 

Attachments

well, you need to check everything you are using in the mod and make sure it is not a repeat of what the game already has. Because once you fix one such error in FileA, if FileA contained three such errors you would then encounter the same issue but now for the second error within FileA. This is also why finding where Mac shoves saved games, mods files, and log files is important: so you can look through database.log to find additional errors as you fix the first ones the game encounters within a given file.
 
well, you need to check everything you are using in the mod and make sure it is not a repeat of what the game already has. Because once you fix one such error in FileA, if FileA contained three such errors you would then encounter the same issue but now for the second error within FileA. This is also why finding where Mac shoves saved games, mods files, and log files is important: so you can look through database.log to find additional errors as you fix the first ones the game encounters within a given file.

Yes, well said, LeeS. I'll check for such errors now in my mod files.

I appreciate your point about looking through the database.log, but I really cannot find anything remotely like that with my search function on my Mac. Guess I'll have to keep looking.

Thanks for your help so far, at any rate. :)
 
You still have this error:
Code:
[3233068.470] [Gameplay] ERROR: UNIQUE constraint failed: Modifiers.ModifierId
[3233068.470] [Gameplay]: While executing - 'insert into Modifiers('ModifierId', 'ModifierType') values (?, ?);'
[3233068.470] [Gameplay]: In XMLSerializer while inserting row into table insert into Modifiers('ModifierId', 'ModifierType') with  values (TRAIT_ADJUST_NON_CAPITAL_FREE_CHEAPEST_BUILDING, MODIFIER_PLAYER_CITIES_GRANT_CHEAPEST_BUILDING_IN_CITY, ).
[3233068.470] [Gameplay]: In XMLSerializer while updating table Modifiers from file Warren_Leaders.xml.
Coming from this within file Warren_Leaders.xml:
Code:
	<Modifiers>
		<Row>
			<ModifierId>TRAIT_ADJUST_NON_CAPITAL_FREE_CHEAPEST_BUILDING</ModifierId>
			<ModifierType>MODIFIER_PLAYER_CITIES_GRANT_CHEAPEST_BUILDING_IN_CITY</ModifierType>
		</Row>
	</Modifiers>
This is an attempt to re-define an existing ModifierId.

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

You can also therefore not have this as you currently have within the file Warren_Leaders.xml:
Code:
	<ModifierArguments>
		<Row>
			<ModifierId>TRAIT_ADJUST_NON_CAPITAL_FREE_CHEAPEST_BUILDING</ModifierId>
			<Name>Amount</Name>
			<Value>1</Value>
		</Row>
     .... other lines snipped because they would be ok for purposes of the Uniqueness Rule ....
	</ModifierArguments>
Because this too is already defined within the game's base files.

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

This part of the same file is OK because you are not attempting to re-define an existing ModifierId, you are merely making use of if it:
Code:
	<TraitModifiers>
		<Row TraitType="TRAIT_LEADER_SILVERTONGUEDLEGACY" ModifierId="TRAIT_ADJUST_NON_CAPITAL_FREE_CHEAPEST_BUILDING"/>
	</TraitModifiers>

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

In file Warren_Civilizations.xml you have mis-matched names.

Some places you are calling a ModifierId TRAIT_TRAILBLAZERRPRODUCTION and other places you are calling it TRAIT_TRAILBLAZERPRODUCTION The definition of the ModifierId in table <Modifiers> has an extra "R". The game requires exact character-string matching.

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

Code:
<Units>
	<Row UnitType="UNIT_HELPER" BaseMoves="3" Cost="50" AdvisorType="ADVISOR_GENERIC"
		BaseSightRange="2" ZoneOfControl="false" Domain="DOMAIN_LAND" FormationClass="FORMATION_CLASS_CIVILIAN"
		Name="LOC_UNIT_HELPER_NAME" Description="LOC_UNIT_HELPER_DESCRIPTION" CanCapture="False"
		CostProgressionModel="COST_PROGRESSION_PREVIOUS_COPIES" CostProgressionParam1="4"
		PurchaseYield="YIELD_GOLD" BuildCharges="3" TraitType="TRAIT_CIVILIZATION_UNIT_HELPER"/>	
	<Row UnitType="UNIT_TRAILBLAZER" BaseMoves="3" Cost="80" AdvisorType="ADVISOR_GENERIC"
		BaseSightRange="3" ZoneOfControl="false" Domain="DOMAIN_LAND" FormationClass="FORMATION_CLASS_CIVILIAN"
		FoundCity="true" PopulationCost="1" PrereqPopulation="2" Name="LOC_UNIT_TRAILBLZER_NAME"
		Description="LOC_UNIT_TRAILBLZER_DESCRIPTION" CanCapture="False" CostProgressionModel="COST_PROGRESSION_PREVIOUS_COPIES"
		CostProgressionParam1="20" PurchaseYield="YIELD_GOLD"
		PseudoYieldType="PSEUDOYIELD_UNIT_TRAILBLZER"
		TraitType="TRAIT_CIVILIZATION_UNIT_TRAILBLAZER"/>
</Units>
PseudoYieldType="PSEUDOYIELD_UNIT_TRAILBLZER" is just dangling undefined code which generates an Invalid Reference error and in and of itself would shunt the game back ot the main menu.
 
This is great stuff, LeeS! Thanks so much for your help! I'm especially grateful because a lot of your pointers are things I would have definitely missed or would take a long time to spot on my own.

I've done all you asked, and was finally able to start a game! I've also been able to finally locate the mods folder and the Database.log file. They were tucked away in a library section which was normally obscured from the search function, and which required manually opening it while holding down the alt key. Woohoo!

However, the loading screen looked like this... As you can see, the icons are broken, the Trailblazer name is garbled, the Qin leader head art is gone, and there is no music. I've checked the Database.log, but it doesn't seem to provide any clues as to why this is.

I've also tested the gameplay. The Helper (builder replacement) is not able to execute any of the normal worker functions. What now?
 

Attachments

  • Warren IG Civ 6.png
    Warren IG Civ 6.png
    3.5 MB · Views: 1,888
  • Loading Screen (Oh dear).png
    Loading Screen (Oh dear).png
    5.3 MB · Views: 63
  • Database log.jpeg
    Database log.jpeg
    311.6 KB · Views: 74
  • Warren Of Neo China v3.zip
    Warren Of Neo China v3.zip
    501 KB · Views: 49
Last edited:
Base game code. I'm not sure if the game allows more than one unit-type to construct the same improvement-type.
Code:
	<Improvement_ValidBuildUnits>
		<Row ImprovementType="IMPROVEMENT_FARM" UnitType="UNIT_BUILDER"/>
		<Row ImprovementType="IMPROVEMENT_MINE" UnitType="UNIT_BUILDER"/>
		<Row ImprovementType="IMPROVEMENT_QUARRY" UnitType="UNIT_BUILDER"/>
		<Row ImprovementType="IMPROVEMENT_FISHING_BOATS" UnitType="UNIT_BUILDER"/>
		<Row ImprovementType="IMPROVEMENT_PASTURE" UnitType="UNIT_BUILDER"/>
		<Row ImprovementType="IMPROVEMENT_PLANTATION" UnitType="UNIT_BUILDER"/>
		<Row ImprovementType="IMPROVEMENT_CAMP" UnitType="UNIT_BUILDER"/>
		<Row ImprovementType="IMPROVEMENT_LUMBER_MILL" UnitType="UNIT_BUILDER"/>
		<Row ImprovementType="IMPROVEMENT_OIL_WELL" UnitType="UNIT_BUILDER"/>
		<Row ImprovementType="IMPROVEMENT_OFFSHORE_OIL_RIG" UnitType="UNIT_BUILDER"/>
		<Row ImprovementType="IMPROVEMENT_BEACH_RESORT" UnitType="UNIT_BUILDER"/>
		<Row ImprovementType="IMPROVEMENT_FORT" UnitType="UNIT_MILITARY_ENGINEER"/>
		<Row ImprovementType="IMPROVEMENT_AIRSTRIP" UnitType="UNIT_MILITARY_ENGINEER"/>
		<Row ImprovementType="IMPROVEMENT_MISSILE_SILO" UnitType="UNIT_MILITARY_ENGINEER"/>
		<!--Unique Improvements -->
		<Row ImprovementType="IMPROVEMENT_CHATEAU" UnitType="UNIT_BUILDER"/>
		<Row ImprovementType="IMPROVEMENT_COLOSSAL_HEAD" UnitType="UNIT_BUILDER"/>
		<Row ImprovementType="IMPROVEMENT_GREAT_WALL" UnitType="UNIT_BUILDER"/>
		<Row ImprovementType="IMPROVEMENT_KURGAN" UnitType="UNIT_BUILDER"/>
		<Row ImprovementType="IMPROVEMENT_MISSION" UnitType="UNIT_BUILDER"/>
		<Row ImprovementType="IMPROVEMENT_ROMAN_FORT" UnitType="UNIT_ROMAN_LEGION"/>
		<Row ImprovementType="IMPROVEMENT_SPHINX" UnitType="UNIT_BUILDER"/>
		<Row ImprovementType="IMPROVEMENT_STEPWELL" UnitType="UNIT_BUILDER"/>
		<Row ImprovementType="IMPROVEMENT_ZIGGURAT" UnitType="UNIT_BUILDER"/>
	</Improvement_ValidBuildUnits>
If all you are after is to give your two units an extra movement point you may need to look into doing this through a trait modifier. But I am not expert enough yet in the various modifier types to know if one can be made specific to a unit-type like this would need to be.

LOC_UNIT_TRAILBLZER_NAME is not defined anywhere in Warren_Text.xml or Warren_Config_Text.xml that I can see. LOC_UNIT_TRAILBLZER_NAME is the designation in the Units table.

You have no Icon Definitions anywhere on the <InGameActions> for your unit's or building's icons, and no xml-file either.
Code:
  <InGameActions>
    <UpdateIcons id="IconDefinitions">
      <File>XML/Buildng_Icons.xml</File>
    </UpdateIcons>
  <InGameActions>
With this for a building in the Buildng_Icons.xml file:
Code:
<GameData>
	<IconTextureAtlases>
		<Row Name="ICON_ATLAS_ERA_BUILDINGS" IconSize="32" IconsPerRow="8" IconsPerColumn="8" Filename="EraBuildings_032.dds"/>
		<Row Name="ICON_ATLAS_ERA_BUILDINGS" IconSize="38" IconsPerRow="8" IconsPerColumn="8" Filename="EraBuildings_038.dds"/>
		<Row Name="ICON_ATLAS_ERA_BUILDINGS" IconSize="50" IconsPerRow="8" IconsPerColumn="8" Filename="EraBuildings_050.dds"/>
		<Row Name="ICON_ATLAS_ERA_BUILDINGS" IconSize="80" IconsPerRow="8" IconsPerColumn="8" Filename="EraBuildings_080.dds"/>
		<Row Name="ICON_ATLAS_ERA_BUILDINGS" IconSize="128" IconsPerRow="8" IconsPerColumn="8" Filename="EraBuildings_128.dds"/>
		<Row Name="ICON_ATLAS_ERA_BUILDINGS" IconSize="256" IconsPerRow="8" IconsPerColumn="8" Filename="EraBuildings_256.dds"/>
		<Row Name="ICON_ATLAS_ERA_BUILDINGS_FOW" IconSize="256" IconsPerRow="8" IconsPerColumn="8" Filename="EraBuildings_256.dds"/>
	</IconTextureAtlases>
	<IconDefinitions>
		<Row Name="ICON_BUILDING_NAVAL_ACADEMY_DUMMY_LRS" Atlas="ICON_ATLAS_ERA_BUILDINGS" Index="62"/>
		<Row Name="ICON_BUILDING_NAVAL_ACADEMY_DUMMY_LRS_FOW" Atlas="ICON_ATLAS_ERA_BUILDINGS_FOW" Index="62"/>
	</IconDefinitions>
</GameData>
If you are just going to use existing game icons for the units and the building, then all you need is
Code:
<GameData>
	<IconDefinitions>
		<Row Name="ICON_BUILDING_NAVAL_ACADEMY_DUMMY_LRS" Atlas="ICON_ATLAS_BUILDINGS" Index="0"/>
		<Row Name="ICON_BUILDING_NAVAL_ACADEMY_DUMMY_LRS_FOW" Atlas="ICON_ATLAS_BUILDINGS_FOW" Index="0"/>
	</IconDefinitions>
</GameData>
Index="0" is the same Icon as is used by the Monument building. Obviously you would need to change the building-name as well. Icon definitions require that you follow a format of "ICON_+[BUILDING_NAME]", so it requires <Row Name="ICON_BUILDING_MONUMENT" etc/> for the monument building. Units require "ICON_+[UNIT_NAME]".
 
Last edited:
for music and the rest you are beyond my kenning of the game's systems for art, etc.

As I understand it you get Teddy if the game cannot figure out what else to display on the Dawn of Man loading screen.
 
Of course. Thank you again for your help, LeeS.

I've done all you've highlighted, and at the very least the Trailblazer text is fixed, so thank you very much for that.

However, all the other problems remain. The Helper (builder) is at least able to harvest or remove improvements now, but all the other builder actions it still cannot perform, despite the coding I put in.

And the icons, even though I've now defined them and matched them with their respective sort codes from the base game, are still missing or random. Ie. Helper has the icon of the settler, then switches to monument when I start constructing them in City A.

Cheers and I wish you a great day, buddy. I'll worry about the music later. For now, I just want to get the artwork and the traits working, haha.
 

Attachments

  • Screen Shot 2017-05-01 at 09.47.59.png
    Screen Shot 2017-05-01 at 09.47.59.png
    4.7 MB · Views: 93
  • Screen Shot 2017-05-01 at 09.48.10.png
    Screen Shot 2017-05-01 at 09.48.10.png
    5.9 MB · Views: 1,568
  • Warren Of Neo China v4.zip
    Warren Of Neo China v4.zip
    509 KB · Views: 44
Back
Top Bottom