CIV 6 - Change XML files without modding?

Misplay

Chieftain
Joined
Nov 6, 2016
Messages
18
Hi folks!

I tried to tweak the xml files, as I don't know how to make mods but... Nothing happens.

Example 1:
I want to add 1 scout at the beginning of each game. I opened the "eras.xml" file (steamapps\common\Sid Meier's Civilization VI\Base\Assets\Gameplay\Data) and added this line:
<Row Era="ERA_ANCIENT" Unit="UNIT_SCOUT" NotStartTile="true"/>
between those two lines:
<Row Era="ERA_ANCIENT" Unit="UNIT_WARRIOR" NotStartTile="true"/>
<Row Era="ERA_ANCIENT" Unit="UNIT_SETTLER" AiOnly="true" MinDifficulty="DIFFICULTY_EMPEROR" DifficultyDelta="0.5"/>

Example 2:
I want to reduce the cost (production) of the scout. I changed this line:
<Row UnitType="UNIT_SCOUT" BaseMoves="3" Cost="30"
To:
<Row UnitType="UNIT_SCOUT" BaseMoves="3" Cost="20"


Then I deleted all the files in the "My games" folder (Documents\My Games\Sid Meier's Civilization VI) and started a new game. Still nothing. :(

What did I do wrong?!
 
Thx for the quick reply. Here's the file (eras.xml):
 

Attachments

  • Eras (modif).xml
    19 KB · Views: 645
Weird. I removed two others files I had in the Data folder (steamapps\common\Sid Meier's Civilization VI\Base\Assets\Gameplay\Data), called:
> "eras (base).xml" (the original "eras.xml" file)
> And "eras (modif).xml" (the custom file)
And it's working now... I didn't change anything else.

(I copied those files back in the Data folder, and the issue was here again: I didn't start with a scout).
 
Last edited:
Ok, thx a lot Gyogen 2!
Here's the database.log (I added".txt" because the Website can't upload a file with a ".log" extension). That's weird: the files I deleted shouldn't conflict with the whole game.
 

Attachments

  • Database.log.txt
    1.8 KB · Views: 373
Here's a quick mod to add starting units. I only did scout, since that's what you initially had. If you want to add more, just follow the format/
Can also add Quantity by adding it to the line:

Spoiler Example :
INSERT INTO MajorStartingUnits('Era', 'Unit', 'Quantity', 'NotStartTile') VALUES ('ERA_ANCIENT', 'UNIT_SCOUT', 2, 'true')


If you can, it's usually better to do mod than just change vanilla files, mainly because when the game updates, you could lose all your changes.

EDIT: Took down file since not working
 
Last edited:
Here's what your problem was:

Spoiler :
[987480.174] [Gameplay] ERROR: UNIQUE constraint failed: Kinds.Kind
[987480.174] [Gameplay]: While executing - 'insert into Kinds('Kind') values (?);'
[987480.174] [Gameplay]: In XMLSerializer while inserting row into table insert into Kinds('Kind') with values (KIND_ERA, ).
[987480.174] [Gameplay]: In XMLSerializer while updating table Kinds from file Eras (modif).xml.
[987480.174] [Gameplay] ERROR: UNIQUE constraint failed: Kinds.Kind
[987480.174] [Gameplay]: While executing - 'insert into Kinds('Kind') values (?);'
[987480.174] [Gameplay]: In XMLSerializer while inserting row into table insert into Kinds('Kind') with values (KIND_ERA, ).
[987480.174] [Gameplay]: In XMLSerializer while updating table Kinds from file Eras.xml.
[987480.470] [Gameplay] ERROR: UNIQUE constraint failed: Kinds.Kind
[987480.470] [Gameplay]: While executing - 'insert into Kinds('Kind') values (?);'
[987480.470] [Gameplay]: In XMLSerializer while inserting row into table insert into Kinds('Kind') with values (KIND_UNIT, ).
[987480.470] [Gameplay]: In XMLSerializer while updating table Kinds from file Units.xml.


Somehow the same entry was getting updated twice, which basically results in canceling each other out, and neither being loaded.
 
Very nice, Sir!
I'm not fluent in english, so it's hard to explain how much I thank you for your time and your mod. Un grand merci à toi! :)
 
You cannot leave any extra xml files in the C:\Program Files (x86)\Steam\SteamApps\common\Sid Meier's Civilization VI\Base\Assets\Gameplay\Data folder. The game will attempt to load the contents of such a file. I dropped a file called NewBuilding.xml with the following contents into the folder, and the game loaded and executed the code:
Code:
<!-- Author: LeeS/lshipp -->

<GameInfo>
	<Table name="Quatloos">
		<Column name="QuatlooType" type="text" notnull="true" unique="true"/>
		<Column name="PrereqTech" type="text" reference="Technologies(TechnologyType)"/>
		<Column name="Name" type="text" default="0"/>
		<Column name="Description" type="text" default="0"/>
	</Table>
	<Kinds>
		<Row Kind="KIND_QUATLOO"/>
	</Kinds>
	<Types>
		<Row Type="QUATLOO_EARLYBUMP2" Kind="KIND_QUATLOO" />
	</Types>
	<Quatloos>
		<Replace>
			<QuatlooType>QUATLOO_EARLYBUMP2</QuatlooType>
			<Name>LOC_DISTRICT_HOLY_SITE_NAME</Name>
			<Description>LOC_DISTRICT_HOLY_SITE_DESCRIPTION</Description>
			<PrereqTech>TECH_ASTROLOGY</PrereqTech>
		</Replace>
	</Quatloos>
</GameInfo>
An inspection of the DebugGameplay.sqlite showed the full xml contents of the file were loaded into the game's database.

Having backup files or other copies of original gamefiles in the folder will cause the game to attempt to load both files worth of code. But since you cannot pre-determine which will be added 1st, 2nd, 3rd, you cannot know which set of code will be used. Only code from the 1st such file accessed and loaded into the game's database would get completely implemented.

This load up everything in the folder behavior is probably true of any of the other game folders.
 
@ Gyogen 2:
I hate to be that guy, but I tried your mod this morning (unzip in the mod folder, activation when you start the game), and sadly, nothing happened. Any ideas?

@ LeeS
Understood. Still surprised, as I used to do that with XCOM 2 (an other Firaxis's game), and never had troubles.

@ Others
A new topic (from Gyogen 2), to learn how to make mods!
http://forums.civfanatics.com/threads/starting-modding.604319/

EDIT:
Ok, this file should work! I used the xml version (cf link below). I also had a french translation (name of the mod). ;)

@ Gyogen 2:
Thx a lot (again). Nothing would be possible if you didn't write the other topic!
 

Attachments

  • StartingUnits.rar
    692 bytes · Views: 271
Last edited:
@ LeeS
Understood. Still surprised, as I used to do that with XCOM 2 (an other Firaxis's game), and never had troubles.
You must expect troubles at some time when modifying the original files, any patch can change the way the files are loaded, IIRC it happened with civ5.
 
Understood. Still surprised, as I used to do that with XCOM 2 (an other Firaxis's game), and never had troubles.
XCOM2 is an UnrealEngine 3.5 game while Civilization6 uses a dedicated engine. Totally different applications even if they come from the same developers (well, the same developer company because i doubt the same team worked on both projects)
You must expect troubles at some time when modifying the original files
And yes, expect issues sooner or later when doing this and try to remember you changed game files so if your game breaks at some point you'll know why.
 
Hi! If you change the cost of any parameter, it will also applied to AI? Or only to Human player?
 
Top Bottom