Modify yield changes due to improvement

LordTerrin

Chieftain
Joined
Nov 5, 2001
Messages
15
I've searched the SQL in tons of mods and I haven't found any that modify what happens to a resource when you improve it, (e.g. - build a farm on wheat, build a quarry on stone)

I can set the BASE values of stone's production, for example, by doing this:
Code:
UPDATE Resource_YieldChanges SET YieldChange = '4' WHERE ResourceType = 'RESOURCE_STONE' ;

or to add a value to a resource that didn't have it in the first place:
Code:
INSERT INTO Resource_YieldChanges (ResourceType, YieldType, YieldChange) VALUES ('RESOURCE_WHEAT', 'YIELD_PRODUCTION', '1') ;

Going off the table structure in \Documents\My Games\Sid Meier's Civilization VI\CacheDebugGameplay.sqllite
Code:
INSERT INTO Improvement_YieldChanges (ImprovementType, YieldType, YieldChange) VALUES ('IMPROVEMENT_FARM', 'YIELD_PRODUCTION', '2');

but I've executed this code and it doesn't not add two additional production to a resource when I farm it.

My question is: Does anyone know the syntax for modifying improvements?
 
Last edited:
The database schema doesn't have a pre-baked table for adjusting the yields of a plot when a specified improvement is placed upon a specific type of resource. YieldChanges from Improvements are applied wherever the improvement is placed, regardless of whether there is a resource. You'd have to try using an <ImprovementModifiers> entry, I would think. Most of the ones added by Firaxis are for adjacency effects but you ought to be able to specify that plot resources of type-X are given an extra production or whatever when the the improvement is placed on the same plot.
 
Sorry, maybe I wasn't clear in my OP. I don't care what the specific resource is, just whenever someone builds a mine, instead of increasing the production yield by 1, maybe I want it to increase it by 5 - regardless of whether there is a resource there or they're just building it on hills.

In this instance, it looks as though the Improvement_YieldChanges table is the perfect fit. You already have the schema there... but adding new rows doesn't do anything.

This is for Civ 6 btw.

 
How are you "adding new rows" exactly ?

I mean executing SQL on DebugGameplay.sqllite is only useful to check your syntax, but won't change anything in the game, you need to apply those changes using a mod.

The debug table is only here for debugging, so you know what's the game is using, but it's only a copy of the table loaded in the DLL for the game.
 
This is within a mod - I was just using the .SQLITE file to see syntax.

I got it to work using the following at the beginning of my mod:

Code:
INSERT INTO Improvement_BonusYieldChanges (ImprovementType, YieldType, BonusYieldChange, PrereqTech, PrereqCivic) VALUES ('IMPROVEMENT_MINE', 'YIELD_PRODUCTION', 2, 'TECH_MINING', NULL);
 
Top Bottom