Custom civ crashing when attempting to load

Abolition

Chieftain
Joined
Mar 16, 2021
Messages
2
I'm very new to civ 6 modding & I've been attempting to make a custom civ for myself (essentially a fictional joke civ for my personal playstyle). I've attempted to make it from scratch as I would rather build it all myself and actually learn what everything does rather than simply changing values on a template (I did create a working civ on a template before, however). For some reason now it's crashing, I suspect it has something to do with the loading screen as nothing on the loading screen works, despite the leader name being localized it only displays as $$LeaderName (something along those lines). I've looked over the entire project multiple times & I cannot find the issue. I've been using references from other mods along with the template & the game itself. I also cannot see anything in the database.log, it all seems normal, no mention of issues with my civ whatsoever.
 

Attachments

This is the entire content of the modinfo file of your mod
Code:
<?xml version="1.0" encoding="utf-8"?>
<Mod id="b55bab65-c40b-4f52-9cde-a5b20c09ab0a" version="1">
  <Properties>
    <Name>Abolition's Siberian Union</Name>
    <Description>Custom civ for myself.</Description>
    <Created>1615912921</Created>
    <Teaser>Custom civ for myself.</Teaser>
    <Authors>Abolition</Authors>
    <CompatibleVersions>1.2,2.0</CompatibleVersions>
  </Properties>
  <Dependencies>
    <Mod id="4873eb62-8ccc-4574-b784-dda455e74e68" title="Expansion: Gathering Storm" />
  </Dependencies>
  <FrontEndActions>
    <UpdateDatabase id="NewAction">
      <File>Core/Civ_Siberian_Union_Config.sql</File>
    </UpdateDatabase>
    <UpdateText id="NewAction">
      <File>Core/Civ_Siberian_Union_GameText.xml</File>
    </UpdateText>
    <UpdateColors id="NewAction">
      <File>Core/Civ_Siberian_Union_Colour.sql</File>
    </UpdateColors>
  </FrontEndActions>
  <InGameActions />
  <Files>
    <File>Core/Civ_Siberian_Union_Abilities.sql</File>
    <File>Core/Civ_Siberian_Union_Colour.sql</File>
    <File>Core/Civ_Siberian_Union_Config.sql</File>
    <File>Core/Civ_Siberian_Union_District.sql</File>
    <File>Core/Civ_Siberian_Union_GameDefines.sql</File>
    <File>Core/Civ_Siberian_Union_GameText.xml</File>
    <File>Core/Civ_Siberian_Union_Units.sql</File>
  </Files>
</Mod>
You have no InGame Actions. So even if things are more or less working on the game setup menus, as soon as you click "Start Game" there will be a crash because there is no InGame definition of the civilization, leader, etc.

You have files with code for the needed InGame stuff, but your modinfo file (and Modbuddy project if you are using Modbuddy) are not making any use of these files. You won't get database errors for code that is never loaded into the game.
 
This is the entire content of the modinfo file of your mod
Code:
<?xml version="1.0" encoding="utf-8"?>
<Mod id="b55bab65-c40b-4f52-9cde-a5b20c09ab0a" version="1">
  <Properties>
    <Name>Abolition's Siberian Union</Name>
    <Description>Custom civ for myself.</Description>
    <Created>1615912921</Created>
    <Teaser>Custom civ for myself.</Teaser>
    <Authors>Abolition</Authors>
    <CompatibleVersions>1.2,2.0</CompatibleVersions>
  </Properties>
  <Dependencies>
    <Mod id="4873eb62-8ccc-4574-b784-dda455e74e68" title="Expansion: Gathering Storm" />
  </Dependencies>
  <FrontEndActions>
    <UpdateDatabase id="NewAction">
      <File>Core/Civ_Siberian_Union_Config.sql</File>
    </UpdateDatabase>
    <UpdateText id="NewAction">
      <File>Core/Civ_Siberian_Union_GameText.xml</File>
    </UpdateText>
    <UpdateColors id="NewAction">
      <File>Core/Civ_Siberian_Union_Colour.sql</File>
    </UpdateColors>
  </FrontEndActions>
  <InGameActions />
  <Files>
    <File>Core/Civ_Siberian_Union_Abilities.sql</File>
    <File>Core/Civ_Siberian_Union_Colour.sql</File>
    <File>Core/Civ_Siberian_Union_Config.sql</File>
    <File>Core/Civ_Siberian_Union_District.sql</File>
    <File>Core/Civ_Siberian_Union_GameDefines.sql</File>
    <File>Core/Civ_Siberian_Union_GameText.xml</File>
    <File>Core/Civ_Siberian_Union_Units.sql</File>
  </Files>
</Mod>
You have no InGame Actions. So even if things are more or less working on the game setup menus, as soon as you click "Start Game" there will be a crash because there is no InGame definition of the civilization, leader, etc.

You have files with code for the needed InGame stuff, but your modinfo file (and Modbuddy project if you are using Modbuddy) are not making any use of these files. You won't get database errors for code that is never loaded into the game.


So I added InGame actions for all the files barring config as I could not find any other mods that put config in there, however the same issue persists. There was also an issue when adding any of the unit, abilities & district files where it would return me to the menu & tell me there was an issue with the mods and to disable any mods & try again, I only had my mod activated. I then put everything into one file, GameDefines, it "worked" as normal (meaning simply crashed when trying to load rather than returning me to menu). Also still nothing in the database, right now I have GameDefines, Colours & GameText added to InGame actions.

Here is the specific error I get:

Unhandled Exception
Code: EXCEPTION_ACCESS_VIOLATION
Error writing address 0x2c


The bit after "Error writing address" changes often, it's almost never the same thing twice.
 
Last edited:
  1. There's no such thing as YIELD_AMENITIES. Attempting to use that here ought to be causing an Invalid Reference error
    Code:
    INSERT INTO Adjacency_YieldChanges
    	(ID,					YieldType,			YieldChange,	TilesRequired,		AdjacentImprovement	)
    VALUES	('ABO_SIBERIAN_ENCAMPMENT_AMENITIES',	'YIELD_AMENITIES',		1,		1,			'IMPROVEMENT_PASTURE'	),
    	('ABO_SIBERIAN_ENCAMPMENT_AMENITIES',	'YIELD_AMENITIES',		1,		1,			'IMPROVEMENT_CAMP'	),
    	('ABO_SIBERIAN_ENCAMPMENT_RANGE',	'YIELD_CULTURE',		1,		1,			'IMPROVEMENT_PASTURE'	),
    	('ABO_SIBERIAN_ENCAMPMENT_RANGE',	'YIELD_CULTURE',		1,		1,			'IMPROVEMENT_CAMP'	);
    Invalid Reference errors will always shove you back to the game's main menu.
  2. Since there's no 3d art definition for the Unique Encampment district you will probably get either a giant red exclamation symbol ingame or an empty looking plot when you construct the district
  3. No terminating semi-colon here
    Code:
    INSERT INTO CivilizationTraits	
    	(TraitType,							CivilizationType					)
    VALUES	('TRAIT_CIVILIZATION_ABO_SIBERIAN_EFFICIENCY',			'CIVILIZATION_ABO_SIBERIAN_UNION'	),
    	('TRAIT_CIVILIZATION_ABO_DISTRICT_SIBERIAN_ENCAMPMENT',		'CIVILIZATION_ABO_SIBERIAN_UNION'	),	
    	('TRAIT_CIVILIZATION_UNIT_ABO_SIBERIAN_SCOUT',			'CIVILIZATION_ABO_SIBERIAN_UNION'	),
    	('TRAIT_CIVILIZATION_UNIT_ABO_SIBERIAN_SKIRMISHER',		'CIVILIZATION_ABO_SIBERIAN_UNION'	),
    	('TRAIT_CIVILIZATION_UNIT_ABO_SIBERIAN_RANGER',			'CIVILIZATION_ABO_SIBERIAN_UNION'	),
    	('TRAIT_CIVILIZATION_UNIT_ABO_SIBERIAN_SPEC_OPS',		'CIVILIZATION_ABO_SIBERIAN_UNION'	),
    You have a comma
  4. Missing the VALUES statement
    Code:
    INSERT INTO LeaderTraits	
    		(LeaderType,							TraitType								)
    		('LEADER_ABO_JOSEPH_STALIN_SIBERIAN',	'TRAIT_LEADER_ABO_COLD_SCIENCE'			),
    		('LEADER_ABO_JOSEPH_STALIN_SIBERIAN',	'TRAIT_LEADER_UNIT_ABO_SIBERIAN_BIPLANE'),
    		('LEADER_ABO_JOSEPH_STALIN_SIBERIAN',	'TRAIT_LEADER_UNIT_ABO_SIBERIAN_FIGHTER'),
    		('LEADER_ABO_JOSEPH_STALIN_SIBERIAN',	'TRAIT_LEADER_UNIT_ABO_SIBERIAN_JET'	);
  5. Since you are adding your text localizations into the localization database twice (once in the FrontEnd and once in the InGame) I'd advise using "Replace" instead of "Row" in order to ensure you do not get any Unique Constraint errors. Like this
    Code:
    	<Replace Tag="LOC_CIVILIZATION_ABO_SIBERIAN_UNION_NAME" Language="en_US">
    		<Text>Siberian Union Name</Text>
    	</Replace>
    "Replace" and its sql equivalent INSERT OR REPLACE INTO will write over the top of a matching item in any game table (localization or frontend/ingame database) if that matching item already exists, and will add the new item if it does not exist.
  6. You have so much stuff going on in your units file I did not look at it much except to make a quick look for obvious sytax errors. Like with the district since there's no art define for these units you'll probably get them all looking as Warriors, and there probably will not be a correct unit icon. The lack of Icon definitions for these units under an UpdateIcons action-type may or may not make the game have a meltdown at some point.
You have other errors in the mod which an attempt to run it after fixing the issues noted and the lack of InGameActions revealed, but I do not get an exception access violation error.
 
Some further info:

  1. StartingCivilizationType is not the correct column-name in table Civilizations
    The correct column name is "StartingCivilizationLevelType"
    Everything at and after your
    Code:
    INSERT INTO Civilizations
    fails because of this fatal syntax error.
  2. You've inadvertently added the Abilities themselves to the 'ABILITY_CLASS' tags rather than creating the CLASS in table Tags and assigning as 'ABILITY_CLASS'
    Code:
    INSERT INTO Tags	
    	(Tag,						Vocabulary)
    VALUES	('ABILITY_ABO_SIBERIAN_SCOUT',			'ABILITY_CLASS'),
    	('ABILITY_ABO_SIBERIAN_SKIRMISHER',		'ABILITY_CLASS'),
    	('ABILITY_ABO_SIBERIAN_RANGER',			'ABILITY_CLASS'),
    	('ABILITY_ABO_SIBERIAN_SPEC_OPS',		'ABILITY_CLASS'),
    	('ABILITY_ABO_SIBERIAN_BIPLANE',		'ABILITY_CLASS'),
    	('ABILITY_ABO_SIBERIAN_FIGHTER',		'ABILITY_CLASS'),
    	('ABILITY_ABO_SIBERIAN_JET',			'ABILITY_CLASS');
    
    --------------------------
    -- Type Tags
    --------------------------
    --Class
    INSERT INTO TypeTags
    	(Type,						Tag				)
    VALUES	('UNIT_ABO_SIBERIAN_SCOUT',			'CLASS_ABO_SIBERIAN_SCOUT'	),
    	('ABILITY_ABO_SIBERIAN_SCOUT',			'CLASS_ABO_SIBERIAN_SCOUT'	),
    	('UNIT_ABO_SIBERIAN_SKIRMISHER',		'CLASS_ABO_SIBERIAN_SKIRMISHER'	),
    	('ABILITY_ABO_SIBERIAN_SKIRMISHER',		'CLASS_ABO_SIBERIAN_SKIRMISHER'	),
    	('UNIT_ABO_SIBERIAN_RANGER',			'CLASS_ABO_SIBERIAN_RANGER'	),
    	('ABILITY_ABO_SIBERIAN_RANGER',			'CLASS_ABO_SIBERIAN_RANGER'	),
    	('UNIT_ABO_SIBERIAN_SPEC_OPS',			'CLASS_ABO_SIBERIAN_SPEC_OPS'	),
    	('ABILITY_ABO_SIBERIAN_SPEC_OPS',		'CLASS_ABO_SIBERIAN_SPEC_OPS'	),
    	('UNIT_ABO_SIBERIAN_BIPLANE',			'CLASS_ABO_SIBERIAN_BIPLANE'	),
    	('ABILITY_ABO_SIBERIAN_BIPLANE',		'CLASS_ABO_SIBERIAN_BIPLANE'	),
    	('UNIT_ABO_SIBERIAN_FIGHTER',			'CLASS_ABO_SIBERIAN_FIGHTER'	),
    	('ABILITY_ABO_SIBERIAN_FIGHTER',		'CLASS_ABO_SIBERIAN_FIGHTER'	),
    	('UNIT_ABO_SIBERIAN_JET',			'CLASS_ABO_SIBERIAN_JET'	),
    	('ABILITY_ABO_SIBERIAN_JET',			'CLASS_ABO_SIBERIAN_JET'	);
    While what you need is
    Code:
    INSERT INTO Tags	
    	(Tag,					Vocabulary)
    VALUES	('CLASS_ABO_SIBERIAN_SCOUT',		'ABILITY_CLASS'),
    	('CLASS_ABO_SIBERIAN_SKIRMISHER',	'ABILITY_CLASS'),
    	('CLASS_ABO_SIBERIAN_RANGER',		'ABILITY_CLASS'),
    	('CLASS_ABO_SIBERIAN_SPEC_OPS',		'ABILITY_CLASS'),
    	('CLASS_ABO_SIBERIAN_BIPLANE',		'ABILITY_CLASS'),
    	('CLASS_ABO_SIBERIAN_FIGHTER',		'ABILITY_CLASS'),
    	('CLASS_ABO_SIBERIAN_JET',		'ABILITY_CLASS');
  3. In table Tags you create a class of unit and assign it as a 'ABILITY_CLASS' for the Vocabulary argument
  4. In table TypeTags you assign both the Ability itself and all units to which the ability is to apply to the 'ABILITY_CLASS' you created in table Tags
  5. Table "Adjacency_YieldChanges" does not allow listing the same ID name more than once within the table. So this will fail because of the Unique Constraint violation
    Code:
    INSERT INTO Adjacency_YieldChanges
    	(ID,					YieldType,			YieldChange,	TilesRequired,		AdjacentImprovement	)
    VALUES	('ABO_SIBERIAN_ENCAMPMENT_AMENITIES',	'YIELD_PRODUCTION',		1,		1,			'IMPROVEMENT_PASTURE'	),
    	('ABO_SIBERIAN_ENCAMPMENT_AMENITIES',	'YIELD_PRODUCTION',		1,		1,			'IMPROVEMENT_CAMP'	),
    	('ABO_SIBERIAN_ENCAMPMENT_RANGE',	'YIELD_CULTURE',		1,		1,			'IMPROVEMENT_PASTURE'	),
    	('ABO_SIBERIAN_ENCAMPMENT_RANGE',	'YIELD_CULTURE',		1,		1,			'IMPROVEMENT_CAMP'	);
    I did not catch this earlier when looking through your code. I substituted 'YIELD_PRODUCTION' where you had the invalid Amenities in order to test your mod after fixing the missing InGameActions on my end.

    So you would need four different "ID" values in table "Adjacency_YieldChanges" and the matching four different YieldChangeId values in table "DistrictAdjacencies".
  6. You must specify the "Aqueduct" argument in table "Districts". Must be integer 0 for false or integer 1 for true. The game does not auto fill a default value when this column is not given an argument value.
  7. You also must provide an argument for column InternalOnly in table Districts. This ought to be 0 for false for your district.
 
Last edited:
Back
Top Bottom