Resource icon

Additional Yield Change Tables 1.0

Castar

Warlord
Joined
May 26, 2007
Messages
100
Castar submitted a new resource:

Additional Yield Change Tables - This modcomponent adds several new finer-grained YieldChange tables for other mods to use.

What
This is a modcomponent that allows other mods to make use of some extra YieldChanges tables (which change Plot yields). This mod has no in-game effect on its own.

The new tables are:

- Improvement_FeatureYieldChanges
- Improvement_ResourceYieldChanges
- Technology_FeatureYieldChanges
- Technology_ResourceYieldChanges
- Building_FeatureYieldChanges
- Building_ResourceYieldChanges

Why
The "vanilla" YieldChanges tables, such as Improvement_YieldChanges, are...

Read more about this resource...
 

Castar

Warlord
Joined
May 26, 2007
Messages
100
A detailed overview of the tables and their fields

Improvement_FeatureYieldChanges:
This table allows a mod to specify a yield change that will be applied to a plot when the given improvement is built on a plot which either has the given feature, or has no feature at all (the FeatureType column is null).
Columns:
  • ImprovementType: the Improvement. Cannot be NULL.
  • FeatureType: the Feature which must be present for the yieldchange to take effect. If this is NULL, the yield change will take effect only if there are NO features on the plot.
  • YieldType
  • YieldChange: similar to other YieldChanges tables, these specify which yield should in-/decrease, and by how much. These cannot be NULL.
Improvement_ResourceYieldChanges:
This table allows a mod to specify a yield change that will be applied to a plot when a given improvement is built on a plot which either has a given visible resource, or has no visible resources (the ResourceType column is null).
Columns:
  • ImprovementType: the Improvement. Cannot be NULL.
  • ResourceType: the Resource which must be present and visible for the yield change to take effect. If this is NULL, the yield change will take effect only if there are no visible resources on the plot.
  • YieldType
  • YieldChange: similar to other YieldChanges tables, these specify which yield should in-/decrease, and by how much. These cannot be NULL.
Technology_FeatureYieldChanges:
This table allows a mod to specify a yield change that will be applied to all plots owned by a player who has researched the given Technology, for those plots that have a given Feature and, optionally, only when the plot either has any improvement, or has no improvement.
Columns:
  • TechnologyType: the Technology. Cannot be NULL.
  • FeatureType: the Feature that must be present. Cannot be NULL.
  • Unimproved: a boolean column which specifies if the yield change should apply to plots without an improvement.
  • Improved: a boolean column which specifies if the yield change should apply to plots with an improvement.
  • YieldType
  • YieldChange: similar to other YieldChanges tables, these specify which yield should in-/decrease, and by how much. These cannot be NULL.
Extra restriction on this table: Unimproved and Improved cannot both be 0 (false). This would be nonsensical as then the yield change would apply to no tiles. The can both be 1 (true) however. In this case, the yield change doesn't care about the improvement status of a plot.

Technology_ResourceYieldChanges:
This table allows a mod to specify a yield change that will be applied to all plots owned by a player who has researched the given Technology, for those plots that have a given Resource and, optionally, only when the plot either has any improvement, or has no improvement.
Columns:
  • TechnologyType: the Technology. Cannot be NULL.
  • ResourceType: the Resource that must be present. Cannot be NULL.
  • Unimproved: a boolean column which specifies if the yield change should apply to plots without an improvement.
  • Improved: a boolean column which specifies if the yield change should apply to plots with an improvement.
  • YieldType
  • YieldChange: similar to other YieldChanges tables, these specify which yield should in-/decrease, and by how much. These cannot be NULL.
Extra restriction on this table: Unimproved and Improved cannot both be 0 (false). This would be nonsensical as then the yield change would apply to no tiles. The can both be 1 (true) however. In this case, the yield change doesn't care about the improvement status of a plot.

Building_FeatureYieldChanges:
This table allows a mod to specify a yield change that will be applied to all plots owned by a city which has the given Building, for those plots that have a given Feature and, optionally, only when the plot either has any improvement, or has no improvement.
Columns:
  • BuildingType: the Building. Cannot be NULL.
  • FeatureType: the Feature that must be present. Cannot be NULL.
  • Unimproved: a boolean column which specifies if the yield change should apply to plots without an improvement.
  • Improved: a boolean column which specifies if the yield change should apply to plots with an improvement.
  • YieldType
  • YieldChange: similar to other YieldChanges tables, these specify which yield should in-/decrease, and by how much. These cannot be NULL.
Extra restriction on this table: Unimproved and Improved cannot both be 0 (false). This would be nonsensical as then the yield change would apply to no tiles. The can both be 1 (true) however. In this case, the yield change doesn't care about the improvement status of a plot.

Building_ResourceYieldChanges:
This table allows a mod to specify a yield change that will be applied to all plots owned by a city which has the given Building, for those plots that have a given Resource and, optionally, only when the plot either has any improvement, or has no improvement.
Columns:
  • BuildingType: the Building. Cannot be NULL.
  • ResourceType: the Resource that must be present. Cannot be NULL.
  • Unimproved: a boolean column which specifies if the yield change should apply to plots without an improvement.
  • Improved: a boolean column which specifies if the yield change should apply to plots with an improvement.
  • YieldType
  • YieldChange: similar to other YieldChanges tables, these specify which yield should in-/decrease, and by how much. These cannot be NULL.
Extra restriction on this table: Unimproved and Improved cannot both be 0 (false). This would be nonsensical as then the yield change would apply to no tiles. The can both be 1 (true) however. In this case, the yield change doesn't care about the improvement status of a plot.
 
Last edited:

Castar

Warlord
Joined
May 26, 2007
Messages
100
I have a simple mod on Steam that demonstrates the use of this mod: https://steamcommunity.com/sharedfiles/filedetails/?id=1675372674

The demo mod Requires this mod, does not concern itself with LoadOrder, and has the following SQL as it's only data updates:

Code:
INSERT INTO Improvement_FeatureYieldChanges
(   ImprovementType,               FeatureType,           YieldType,               YieldChange   ) VALUES
(   'IMPROVEMENT_FARM',               null,                   'YIELD_CULTURE',       1           ),
(   'IMPROVEMENT_FARM',               'FEATURE_MARSH',       'YIELD_SCIENCE',       1           );

INSERT INTO Improvement_ResourceYieldChanges
(   ImprovementType,               ResourceType,           YieldType,               YieldChange   ) VALUES
(   'IMPROVEMENT_MINE',               null,                   'YIELD_CULTURE',       1           ),
(   'IMPROVEMENT_MINE',               'RESOURCE_COPPER',       'YIELD_SCIENCE',       1           );

INSERT INTO Technology_FeatureYieldChanges
(   TechnologyType,       FeatureType,       Improved,   Unimproved,   YieldType,           YieldChange   ) VALUES
(   'TECH_MINING',       'FEATURE_FOREST',   1,           1,           'YIELD_FAITH',       1           ),
(   'TECH_MINING',       'FEATURE_FOREST',   0,           1,           'YIELD_CULTURE',   1           ),
(   'TECH_MINING',       'FEATURE_FOREST',   1,           0,           'YIELD_SCIENCE',   1           );

INSERT INTO Technology_ResourceYieldChanges
(   TechnologyType,       ResourceType,       Improved,   Unimproved,   YieldType,           YieldChange   ) VALUES
(   'TECH_POTTERY',       'RESOURCE_IVORY',   1,           1,           'YIELD_FAITH',       1           ),
(   'TECH_POTTERY',       'RESOURCE_IVORY',   0,           1,           'YIELD_CULTURE',   1           ),
(   'TECH_POTTERY',       'RESOURCE_IVORY',   1,           0,           'YIELD_SCIENCE',   1           );

INSERT INTO Building_FeatureYieldChanges
(   BuildingType,               FeatureType,       Improved,   Unimproved,   YieldType,           YieldChange   ) VALUES
(   'BUILDING_MONUMENT',       'FEATURE_JUNGLE',   1,           1,           'YIELD_FAITH',       1           ),
(   'BUILDING_MONUMENT',       'FEATURE_JUNGLE',   0,           1,           'YIELD_CULTURE',   1           ),
(   'BUILDING_MONUMENT',       'FEATURE_JUNGLE',   1,           0,           'YIELD_SCIENCE',   1           );

INSERT INTO Building_ResourceYieldChanges
(   BuildingTYpe,           ResourceType,       Improved,   Unimproved,   YieldType,           YieldChange   ) VALUES
(   'BUILDING_MONUMENT',   'RESOURCE_BANANAS',   1,           1,           'YIELD_FAITH',       1           ),
(   'BUILDING_MONUMENT',   'RESOURCE_BANANAS',   0,           1,           'YIELD_CULTURE',   1           ),
(   'BUILDING_MONUMENT',   'RESOURCE_BANANAS',   1,           0,           'YIELD_SCIENCE',   1           );

The results are as follows:

Improvements
In the following screenshot, you can see the effects for farms and mines. The farm on a plot wiht no feature has +1 Culture, while the farm on the plot with a marsh has +1 Science instead. Similarly, the mine on the resourceless plot has +1 Culture, while the mine on the copper has +1 Science instead.

Technology
In the first screenshot below, you can see improved ivory and forest tiles to the south of the city, and their unimproved cousins to the north. Neither Mining nor Pottery has been researched, so no additional yields are applied.
Next, Mining is researched. Now, all forests show +1 Faith. The unimproved Forest also has +1 Culture, while the improved Forest has +1 Science instead.
Finally, Pottery is researched, and the same effects are applied to the Ivory resource plots. All Ivory plots have +1 Faith. The unimproved Ivory has +1 Culture, while the improved Ivory has +1 Science instead.

Building
In the first screenshot below, there are improved Bananas and Jungle tiles to the south, and unimproved Bananas and Jungle to the north. No Monument has been built, so no yields extra yields are applied.
Next, a Monument is built. Now all Bananas and Jungle tiles have +1 Faith. The unimproved Bananas and Jungles also have +1 Culture, while the improved Bananas and Jungle have +1 Science instead.
 
Last edited:

qqqbbb

Prince
Joined
Sep 25, 2010
Messages
530
Great idea and implementation. This really shows how powerful the effect system is. To do something like this in any previous Civ game you would need source code.
 
Top Bottom