Connecting Civilization and Leader Traits to Golden Ages

greyTiger

Warlord
Joined
Oct 7, 2010
Messages
198
Location
Australia
I recently added a Golden Ages mod to the steam workshop that allows moders to add Golden Age related abilities to their custom civilizations. If anyone is interested in adding some additional abilities to their civs then this thread explains the Golden Age modding tables and how they can be used.

Golden Ages are triggered when the player has accumulated a calculated number of Golden Age points which are based on Great People points. Prophets, Writers, Artists and Musicians all provide 30% of their points per turn toward Golden Ages, while other great people provide higher amounts based on selected policies.

Great People Points

It is possible to change the types of great people (and the percentage of points) that provide progress for a civilization or leader. This can be done through the GoldenAgeGreatPeoplePoints table.

Code:
GoldenAgeGreatPeoplePoints
  .CivilizationType       The unique identifier of the civilization. e.g. 'CIVILIZATION_ENGLAND'
   .LeaderType               The unique identifier of the leader. e.g. 'LEADER_VICTORIA'. 
   .GreatPersonClass       The type of great person that the modifier should apply to. e.g. 'GREAT_PERSON_CLASS_ADMIRAL'.
   .Modifier               The percentage of great person points that should be converted to Golden Age points.

Great People Classes supported:
Code:
GREAT_PERSON_CLASS_ADMIRAL
GREAT_PERSON_CLASS_ARTIST
GREAT_PERSON_CLASS_ENGINEER
GREAT_PERSON_CLASS_GENERAL
GREAT_PERSON_CLASS_MERCHANT
GREAT_PERSON_CLASS_MUSICIAN
GREAT_PERSON_CLASS_PROPHET
GREAT_PERSON_CLASS_SCIENTIST
GREAT_PERSON_CLASS_WRITER

An example of how to use this can be seen below where we give Victoria (England) the ability to gain Golden Age progress from 100% of great admiral points per turn.

Code:
  <GoldenAgeGreatPeoplePoints>
       <Row CivilizationType="CIVILIZATION_ENGLAND" LeaderType="LEADER_VICTORIA" GreatPersonClass="GREAT_PERSON_CLASS_ADMIRAL" Modifier="100"/>
   </GoldenAgeGreatPeoplePoints>

NOTE: If you want the change to affect the civilization as a whole (all leaders of the civ) then you can either change the LeaderType to "ANY" or just leave out the LeaderType completely.

Code:
  <GoldenAgeGreatPeoplePoints>
       <Row CivilizationType="CIVILIZATION_ENGLAND" GreatPersonClass="GREAT_PERSON_CLASS_ADMIRAL" Modifier="100"/>
   </GoldenAgeGreatPeoplePoints>

It is also possible to remove existing abilities from civilizations\leaders. Lets say that we do not want Victoria to get progress from Artists, Musicians and Writers. Then we would add the following.

Code:
  <GoldenAgeGreatPeoplePoints>
       <Row CivilizationType="CIVILIZATION_ENGLAND" LeaderType="LEADER_VICTORIA" GreatPersonClass="GREAT_PERSON_CLASS_ARTIST" Modifier="-30"/>
       <Row CivilizationType="CIVILIZATION_ENGLAND" LeaderType="LEADER_VICTORIA" GreatPersonClass="GREAT_PERSON_CLASS_MUSICIAN" Modifier="-30"/>
       <Row CivilizationType="CIVILIZATION_ENGLAND" LeaderType="LEADER_VICTORIA" GreatPersonClass="GREAT_PERSON_CLASS_WRITER" Modifier="-30"/>
   </GoldenAgeGreatPeoplePoints>

Progress from Buildings
If your civilization has a custom building then you can have the building provide a set number of progress points per turn by using the following.

Code:
GoldenAgeBuildingPoints
.BuildingType The unique identifier of the building that will provide progress points each turn toward Golden Ages.
.PointsPerTurn The points per turn to add from the building.

The following example adds 0.5 points per turn toward Golden Ages for the Palace building.

Code:
  <GoldenAgeBuildingPoints>
       <Row BuildingType="BUILDING_PALACE" PointsPerTurn="0.5"/>
   </GoldenAgeBuildingPoints>

Golden Age Bonuses
Adding Golden Age bonuses for a civilization or leader is a little more complex since we also need to add data to the Modifiers, ModifierArguments and the TraitModifiers tables. This is required because I have not yet found a way to create or alter the Modifiers and ModifierArguments rows at runtime.

So, to add a bonus for a civilization or leader during a Golden Age we would need the modifiers, and also need to add data to the GoldenAgeBonuses table which is responsible for displaying the bonus in the UI on the Golden Ages panel.

Note: There are two properties that can be affected without the need for any Modifiers or ModifierArguments. These are the Duration and the GPPPercentage.

Examples for these properties can be seen a little farther down where we alter the bonuses for Egypt.

Code:
GoldenAgeBonuses
.CivilizationType The unique identifier of the civilization. e.g. 'CIVILIZATION_INDIA'.
.LeaderType The unique identifier of the leader. e.g. 'LEADER_GHANDI'.
.PropertyName The name of the bonus that you want to affect. e.g. 'Production'. PropertyName items can be seen in section 4.1
.Modifier The percentage value of the bonus.

Property Names supported:
Code:
Culture (Used by the UI to display the bonus culture during a Golden Age.)
Duration (Affects the duration of Golden Ages.)
Faith (Used by the UI to display the bonus faith during a Golden Age.)
Food (Used by the UI to display the bonus food during a Golden Age.)
Gold (Used by the UI to display the bonus gold during a Golden Age.)
GPPPercentage (Affects the bonus great people points conversion rate.)
Production (Used by the UI to display the bonus production during a Golden Age.)
Science (Used by the UI to display the bonus science during a Golden Age.)
Tourism (Used by the UI to display the bonus tourism during a Golden Age.)

An example of how to use this can be seen below where we give India (all leaders) an extra 25% food and 10% production during a Golden Age. As with the GoldenAgeGreatPeoplePoints table we can omit the LeaderType field to have all leaders of the civilization gain the bonus.

Code:
  <GoldenAgeBonuses>
       <Row CivilizationType="CIVILIZATION_INDIA" PropertyName="Faith" Modifier="25"/>
       <Row CivilizationType="CIVILIZATION_INDIA" PropertyName="Production" Modifier="10"/>
   </GoldenAgeBonuses>

The following add the required modifiers and arguments to have the effect take place during a Golden Age. Note in the Modifiers table we have a RequirementSet which is used to ensure that the bonus is only applied during a Golden Age. This requirement set is part of the Golden Age mod, so just ensure your civ loads after the mod to prevent db errors.

Code:
  <Modifiers>
       <Row ModifierId="TRAIT_DHARMA_GOLDEN_AGE_FAITH" ModifierType="MODIFIER_PLAYER_CITIES_ADJUST_CITY_YIELD_MODIFIER" SubjectRequirementSetId="GOLDEN_AGE_MONUMENT_REQUIREMENTS" />
       <Row ModifierId="TRAIT_DHARMA_GOLDEN_AGE_PRODUCTION" ModifierType="MODIFIER_PLAYER_CITIES_ADJUST_CITY_YIELD_MODIFIER" SubjectRequirementSetId="GOLDEN_AGE_MONUMENT_REQUIREMENTS" />
   </Modifiers>
 
   <ModifierArguments>
       <Row ModifierId="TRAIT_DHARMA_GOLDEN_AGE_FAITH" Name="YieldType" Value="YIELD_FAITH" />
       <Row ModifierId="TRAIT_DHARMA_GOLDEN_AGE_FAITH" Name="Amount" Value="25" />
       <Row ModifierId="TRAIT_DHARMA_GOLDEN_AGE_PRODUCTION" Name="YieldType" Value="YIELD_PRODUCTION" />
       <Row ModifierId="TRAIT_DHARMA_GOLDEN_AGE_PRODUCTION" Name="Amount" Value="10" />
   </ModifierArguments>
 
   <TraitModifiers>
       <Row TraitType="TRAIT_CIVILIZATION_DHARMA" ModifierId="TRAIT_DHARMA_GOLDEN_AGE_FAITH"/>
       <Row TraitType="TRAIT_CIVILIZATION_DHARMA" ModifierId="TRAIT_DHARMA_GOLDEN_AGE_PRODUCTION"/>
   </TraitModifiers>

The following is an example where we double the length of Golden Ages for Egypt. This only needs a row in the GoldenAgeBonuses table. No modifiers required.

Code:
  <GoldenAgeBonuses>
       <Row CivilizationType="CIVILIZATION_EGYPT" PropertyName="Duration" Modifier="100"/>
   </GoldenAgeBonuses>

And here we have an example where we double the default conversion rate of great people points.

Code:
   <GoldenAgeBonuses>
       <Row CivilizationType="CIVILIZATION_EGYPT" PropertyName="GPPPercentage" Modifier="100"/>
   </GoldenAgeBonuses>

Policies and Beliefs
Policies and Beliefs can be created that affect Golden Ages in the same fashion as specified in the previous section. The GoldenAgePolicyBonuses and GoldenAgeBeliefBonuses are similar to the GoldenAgeBonuses table and have the same rules regarding modifiers, while the GoldenAgePolicyGreatPeoplePoints and GoldenAgeBeliefGreatPeoplePoints tables are similar to the GoldenAgeGreatPeoplePoints table and work in a similar fashion.

Code:
GoldenAgePolicyBonuses
.PolicyType The unique identifier of the policy. e.g. 'POLICY_MYPOLICY'.
.PropertyName The name of the bonus that you want to affect. e.g. 'Production'. PropertyName items can be seen in section 4.1
.Modifier The percentage value of the bonus.

(Use this table to have policies affect Golden Age bonuses granted to any player using the policy.)

GoldenAgePolicyGreatPeoplePoints
.PolicyType The unique identifier of the policy. e.g. 'POLICY_MYPOLICY'.
.GreatPersonClass The type of great person that the modifier should apply to. e.g. 'GREAT_PERSON_CLASS_ADMIRAL'. Classes can be seen in section 4.2
.Modifier The percentage of great person points that should be converted to Golden Age points.

(Use this table to have policies affect the type of great people that provide Golden Age progress.)

GoldenAgeBeliefBonuses
.BeliefType The unique identifier of the belief. e.g. 'BELIEF_MYBELIEF'.
.PropertyName The name of the bonus that you want to affect. e.g. 'Production'. PropertyName items can be seen in section 4.1
.Modifier The percentage value of the bonus.

(Use this table to have beliefs affect Golden Age bonuses for any player that has selected the belief.)

GoldenAgeBeliefGreatPeoplePoints
.BeliefType The unique identifier of the belief. e.g. 'BELIEF_MYBELIEF'.
.GreatPersonClass The type of great person that the modifier should apply to. e.g. 'GREAT_PERSON_CLASS_ADMIRAL'. Classes can be seen in section 4.2
.Modifier The percentage of great person points that should be converted to Golden Age points. 

(Use this table to have beliefs affect the type of great people that provide Golden Age progress.)

Future versions of the Golden Age mod will include additional tables for such things as Golden Age points on kills and city captures, Golden Age points from specialists, etc
 
This is very impressive. This mod does a number of things I didn't realize were possible with the current code base. I'm eager to take a look through it.
 
Will soon be releasing my first civilization which will have the optional ability of extra golden age points from great generals. Hopefully it will generate some interest in golden age mod for civ creators.
 
Top Bottom