Resource icon

Star Signs v1.0 2016-10-05

Adds the concept of Omens to the game. These are very similar to the standard game events except they are based on your populations interpretation of them, and external factors can change the reading of these omens and impact the effect.

This started out as converting the Copernicus' Observatory wonder by Tsentom1 (http://forums.civfanatics.com/showthread.php?t=284188) from Python into the SDK, which then, as usual, got out of hand as I started adding concepts to it.

These events have been implemented through the addition of a new XML file CIV4StarEventInfos to allow people to add their own (within the constraints of the new tags of course). Each event may have multiple effects

Forum thread is here

Gameplay Synopsis
=============
Every configurable number of rounds an omen appears in the skies that your population will see and attempt to interpret. These interpretations may be good, bad on the population may conclude that the omen is not particularly significant, each city may interpret the omen in a different way. If the initial interpretation is bad then there is a chance that the population can be persuaded that things aren't as bad as they seem and the omen may be ignored. Things such as buildings, specialists, civics & traits can impact how good you are at persuading your population to ignore their initial bad interpretation. These same factors can also change the scale of the of effects of these events, so that they have a greater or lesser impact on the population.

I have included a sample set of files to see the changes in action, but nothing is hard-coded so this mod comp should be able to be slotted into any mod

Basic Mechanics
=============
The basic mechanics of the mod are:

1 - Each turn a check is made against the configured period between omens to see whether a new one should appear
2 - If an omen appears each team is looped through to see whether the omen could impact the player, another loop then goes through the individual players. A player will only ever be impacted once a turn
3 - For each player a random event (StarEventInfo from XML file) is selected and the following occurs
4 - A check is made whether the interpretation is that nothing happens by generating a random number and checking against a global configured const + any specific event config
5 - A check is then made as to whether the players population generally interprets the omen as good or bad
6 - The list of targets of the omen is established
7 - The actual interpretation of the omen is processed. Depending on the configuration this may vary, but the general concept is as follows
8 - Check each effect type (population change, food level change etc.) and for each one do the following
9 - Loop through each target and get the scale of the effect
10 - If the general player interpretation was bad check if the city manages to persuade the population to ignore it
11 - If the effect should be applied then find out the scale of the effect based on the cities buildings, specialists, etc.
12 - Apply the effect
13 - Report the effect with a message on the main screen.

Bad Effects
--------------------
There is a globally configured setting that determines the percentage chance that an omen will be interpreted as bad by the general population, each effect may also be configured to modify this value to determine the likelihood that the omen is interpreted as bad. A random percentage number is generated to determine if this is the case or not. If the interpretation is considered bad then any effects would be negated, so if the effect was to change the food in a target city by 20 then the actual result would be a reduction in the stored food. If the negative effect cannot happen, such as if there were no stored food, then the effect is ignored.

Effect Scaling
------------------
The scale of any effect on a city may vary based on the buildings and specialists in the city, both increasing or decreasing the effects based on XML tags in the appropriate Info files. The degree that these factors can impact the effect are also configurable by an individual event. The reason for this is that some effects have a greater impact on the game and could cause balance issues if the effect were to be increased for some players. An example of this would be the effect to change the population of a city, if this were to be doubled across all cities it could have a significant impact, but across a single city it would be lees of an issue...of course it could be a bad effect in which case the loss of 2 or more pop could really hurt. In order to allow for quite fine control over this the mechanics work as follows:
Code:
Multiplier for basic effect = 100 + ( (players scaling impact + city scaling impact - 100) / event configured divisor )
The player & city scaling impact is based on civics, traits, buildings and specialists, with the divisor being defined in the event info. The resulting multiplier is then applied to the basic scale of the event to see what the actual result is. An example is probably in order here:

Say we have an event that changes the food in a city with the following configured in the StarEventInfo element:
Food change = 20
Scaling divisor = 3
Player scaling = 75 (from civics & traits & buildings)
City scaling = 46 (from buildings & specialists)

scaling impact = 75 + 46 - 100 = 21
scaling multiplier = 100 + (21 / 3) = 107
In this city the actual effect is 20 * 107% = 21.4
This is rounded down to 21

If the event scaling divisor were changed from 3 to 1 it would give the following:
scaling multiplier = 100 + (21 / 1) = 121
actual effect = 20 * 121% = 24.2 -> 24

This may seem small but the player & city scaling effects could increase significantly based on the setting in the individual, building, civic etc. xml files.

Effect Mitigation
--------------------
If the initial interpretation of the omen is considered bad by the population then there is still a chance that the effect may not impact the target city. This is a much simpler mechanism where the player mitigation percentage (civics, traits, buildings) is added to the target cities mitigation percentage (buildings & specialists) and added to the roll taken to determine if the effect is bad. If this new value is still less than the global + event bad chance percentage then the city feels the negative effects, if this new value is higher then it is considered that the city population were convinced that their default interpretation was wrong and so no negative effect occurs.


AI
=============
As these are random changes there are no real AI decisions to be made.


Modders
=============
The following files are changed by this modcomp:

+++ GlobalTypes
Added the possible targets for the effects (must be synched with CvEnums.h)

+++ CIV4BuildingInfos
New tags added to allow buildings to:
- enable/disable all events
- disable all bad effects
- change the scaling of events in the buildings city
- change the chance of bad events being mitigated in the buildings city
- change the scaling of events across all cities
- change the chance of bad events being mitigated across all cities

+++ CIV4CivicInfos
----------
New tags added to allow civics to:
- enable/disable the events
- change the scaling of events
- change the chance of bad events being mitigated

+++ CIV4SpecialistInfos
----------
New tags added to allow specialists to:
- change the scaling of events
- change the chance of bad events being mitigated

+++ CIV4TraitInfos
New tags added to allow traits to:
- change the scaling of events
- change the chance of bad events being mitigated

+++ StarSign_GlobalDefines
This is a new file that sets some system wide settings and defaults
- Frequency that omens appear
- Variation on frequency (random number that is applied to base frequency to give some variation)
- Default chance that default interpretation by the population is negative (can be modified by individual effects)
- Default chance that omens are ignored by the population (can be modified by individual effects)
- Default text string keys for good. bad, neutral & mitigated interpretations (can be overriden by individual effects)
- Default number of targets before display string is aggregated (can be overriden by individual effects)

+++ CIV4StarEventInfos
This new xml file defines the different possible interpretations of the omens.
There is a commented tag at the end of the file providing all the tags with their default values for reference. The tags are split into 2 categories, those that define how the interpretation of the omen may happen and those that define the actual effect

-- Interpretation tags --
- Target of the event
- Text key to display for good, bad, neutral and mitigated interpretations
- When to aggregate the text display (if the event impacts > this number of cities only one message will be shown)
- If the event is against random cities the number of cities to potentially impact
- Whether the impact spans multiple rounds
- If the event spans multiple rounds how much it decays each round
- Change the percentage chance the the event will be bad
- Change the factor that increases the scale of the event (good or bad)
- Change the percentage chance the the omen will be ignored by the population
-- Actual effect tags --
- Population change
- Combat Points
- Food
- Gold
- Production
- Great Person Points
- Culture
- Conscript unit (no conscription anger)
- Spread state religion / create missionary
- Cause happiness for a number of rounds

+++ Changed SDK files are included and commented with Archid

Credits
=============
- Tsentom1 for the original concept and the ideas behind most of the new events
Author
Archid
Downloads
255
Views
255
First release
Last update
Rating
0.00 star(s) 0 ratings
Top Bottom