Gerikes
User of Run-on Sentences.
Warning: This patch breaks previous save-games!
Ok, here's my first attempt at the Support Fire system. I'll explain briefly how it works, the math that it uses, and the XML you can use to affect it. Note that I can change this up if you want, I'm just putting down everything I have so that things can be changed if needed.
This thread can be used for questions about the Support Fire system, as well as, if you wish, a place to discuss any balance changes related to Support Fire that you might wish to have in the future (unless you have a seperate thread for that).
Support Fire (SF) is the ability for a unit in a plot being attacked that is not the defender to do collateral damage to all units where the attacker is striking from that is not the attacker.
SF is an ability that can be given to units via XML tags. Each unit has three tags that can be added to it's info:
These tags follow the same pattern as normal collateral damage XML tags.
As well, there is a defined variable (placed in GlobalDefinesAlt.xml) that defines SUPPORT_FIRE_DAMAGE. This is the base amount of damage a support fire unit will do during a round of support fire.
Determining Support Fire Values:
Just using what you know about the XML values should be enough, raising and lowering each until they're right. However, this should help you in determining what values you want.
In a nutshell, this is how it works. Targets are randomly picked from the defending plot (with targets that have higher amounts of HP left more likely to get picked). Each of these units is dealt damage (see below). Only a certain number of units will be affected, with the max being the iSupportFireDamageMaxUnits value for the SF unit. Each unit is dealt it's damage, but will not have damage dealt higher than the unit's iSupportFireDamageLimit, just like normal collateral damage.
How damage is calculated:
First off, the damage dealt starts at the value for SUPPORT_FIRE_DAMAGE, located in the GlobalDefinesAlt xml file.
This number is modified to actually be higher or lower, depending on how powerful the SF unit is to the target. The two are compared by the SF unit's Collateral Strength (it's base strength hightened or lowered by using the iSupportFireDamage value) and the Target unit's base strength.
So, when determining the values, here is my suggestion without having to worry too much about math:
1.) Start with a SUPPORT_FIRE_DAMAGE value. I've made it 10. This means, by default, if the SF unit's iSupportFireDamage value is 100 (default), and the SF unit and target unit have equal strength, than the target unit will recieve 10 damage. This is where you start from: how much damage do you want an equally-matched unit to deal against an equally matched unit.
2.) To make unit more/less powerful, heighten or lower the iSupportFireDamage value for that unit. Lowering it means that the unit will do less damage. Making it 50 means approx a 20% drop in damage against equally-strengthed unit, about a 33% drop in damage against unit twice as strong, and about a 38% drop in damage against a unit three times as strong.
As you can see, the higher the difference in the strengths, the less change is done. This means that making the value for a unit 200 (double it's typical strength) will not double it's damage, nor will making it's value 1000 make it do 10x the damage (in fact, at 1000 it wil only do about 70% more damage than normal against similarly-strengthed units).
So, don't be afraid to raise it very high, or drop it very low, as the farther from 100 you go the less change it will make. The drop from 100 to 80 makes a bigger difference than from 80 to 60.
3.) To make a unit more/less powerful without having to worry about these factors, you can also change the other two values. These are probably good for making later-era units more powerful than early-era while still maintaining a level amount of damage being dealt in one blow.
How SF Works and it's Calculations
If you really want to get to the nitty gritty, I've put all the math below:
SF follows the same exact way of calculating collateral damage as done typical collateral damage, with the exception being where in normal collateral damage the defending plot and it's occupants are affected, in SF the plot that the attack is launching from is affected.
First, a unit attacks a plot. The plot goes through it's typical phase to find the best defender. This process is unchanged.
After the defender is selected, there is then a check made to find the best SF-capable unit in the group. (Note: The function to determine the "best" support fire unit is still to be determined. Currently, it just takes one of them). Then, that one unit does it's SF damage.
The damage is calculated like Collateral damage, so if you know how that works you can use that as your guide. First, each unit in the plot is checked to see if it can be affected by SF. A unit is considered available to be a target of SF if that unit...
Each one of these units is given a random number between 1 and 1000, and that number is multiplied by their total strength. This gives each unit a "Target Value".
Next, the targets to be hit are choosen. The number of targets "hit" will be the SF unit's "iSupportFireDamageMaxUnits" value. If the number of possible targets is less than or equal to this amount, then all the possible targets are hit. Otherwise, only the top N targets are hit (with N being the "iSupportFireDamageMaxUnits).
The amount of damage done to any unit is then determined in according to this series of formulae (warning: math ahead):
---
Collateral Strength = (SFBS * SFD) / 100
This is basically the strength of the unit for these calculating purposes after being modified by the unit's iSupportFireDamage value. (Thus, a "100" for "iSupportFireDamage" means the unit's iCollateralStrength will be their base strength. A 200 means it will be double their base strength, etc)
SFBS = SupportFireBaseStrength, the base strength of the SF unit (if it's an air unit then the SFBS is their base air strength).
SFD = The unit's iSupportFireDamage value.
---
StrengthFactor = ((CollateralStrength + TBS + 1) / 2)
This is the "strength factor" against any one target that the SF unit is dealing damage to. It is used to determine
CollateralStrength: Computed above.
TBS: Target's Base Combat Strength
---
Support Fire Damage
The way that it is actually computed is otherwise, but thought this formula which I factored to was more aesthetically pleasing.
What this basically means is that the amount of damage done to a unit from SF will basically rely on the Collateral Strength and the Target Unit's base strength. Thus, if the SF unit's Collateral Strength and the target unit's base strength is equal, the amount of damage done will be SUPPORT_FIRE_DAMAGE.
CollateralStrength: Collateral Strength of the SF against the Target Unit (Calculated above)
TBS: Target's Base Strength
SUPPORT_FIRE_DAMAGE: A constant (defined in GlobalDefinesAlt).
---
Target's Final Damage = max(TCD, min(TCD + SupportFireDamage, SFDL))
This basically means that the Target's Final damage is going to be at least it's current damage, and at most the limit of damage that the SF unit can do.
TCD = Target's Current Damage
This is the value of the unit's "damage" (0 being not damaged, 100 being dead) before the SF occured.
SFD = Support Fire Damage
This is the value of the Support Fire Damage that is done to the unit. Calculated Above.
SFDL = Support Fire Damage Limit
This is the SF unit's iSupportFireDamageLimit.
Other Notes on Support Fire
Every unit can only do one support fire shot per turn. This value is completely independent of whether or not that unit has movement points left or not. Once a unit uses it's support fire shot, it does not regain the ability to use that support fire shot until it's next turn (which means the beginning of the player's turn).
A unit does not use up it's support fire shot per turn if the unit that is attacking is attacking from a plot that has no units in it, or if the units that are in it can not be targetted for support fire (such as if the units are all already at their limit).
Finally, the patch
This is obsolete. Support Fire is now included into the game.
Ok, here's my first attempt at the Support Fire system. I'll explain briefly how it works, the math that it uses, and the XML you can use to affect it. Note that I can change this up if you want, I'm just putting down everything I have so that things can be changed if needed.
This thread can be used for questions about the Support Fire system, as well as, if you wish, a place to discuss any balance changes related to Support Fire that you might wish to have in the future (unless you have a seperate thread for that).
Support Fire (SF) is the ability for a unit in a plot being attacked that is not the defender to do collateral damage to all units where the attacker is striking from that is not the attacker.
SF is an ability that can be given to units via XML tags. Each unit has three tags that can be added to it's info:
- iSupportFireDamage: The strength of the unit when doing SF. This is recognized as a percentage value of the unit's typical strength. Thus, when this value is 100, the unit's strength doing SF collateral damage is the same as normal. At 200, the unit's strength is double that than normal. All unit's default to zero, meaning they have strength zero, which means they can't do supporting fire damage.
- iSupportFireDamageLimit: The maximum amount of damage that the unit's SF damage can do to the unit. This is an over-time value. Thus, if this value is 50, then at any time the damage done to the unit from SF can not go over 50% of the unit's strength.
- iSupportFireDamageMaxUnits: The maximum amount of units that can be harmed during SF.
These tags follow the same pattern as normal collateral damage XML tags.
As well, there is a defined variable (placed in GlobalDefinesAlt.xml) that defines SUPPORT_FIRE_DAMAGE. This is the base amount of damage a support fire unit will do during a round of support fire.
Determining Support Fire Values:
Just using what you know about the XML values should be enough, raising and lowering each until they're right. However, this should help you in determining what values you want.
In a nutshell, this is how it works. Targets are randomly picked from the defending plot (with targets that have higher amounts of HP left more likely to get picked). Each of these units is dealt damage (see below). Only a certain number of units will be affected, with the max being the iSupportFireDamageMaxUnits value for the SF unit. Each unit is dealt it's damage, but will not have damage dealt higher than the unit's iSupportFireDamageLimit, just like normal collateral damage.
How damage is calculated:
First off, the damage dealt starts at the value for SUPPORT_FIRE_DAMAGE, located in the GlobalDefinesAlt xml file.
This number is modified to actually be higher or lower, depending on how powerful the SF unit is to the target. The two are compared by the SF unit's Collateral Strength (it's base strength hightened or lowered by using the iSupportFireDamage value) and the Target unit's base strength.
So, when determining the values, here is my suggestion without having to worry too much about math:
1.) Start with a SUPPORT_FIRE_DAMAGE value. I've made it 10. This means, by default, if the SF unit's iSupportFireDamage value is 100 (default), and the SF unit and target unit have equal strength, than the target unit will recieve 10 damage. This is where you start from: how much damage do you want an equally-matched unit to deal against an equally matched unit.
2.) To make unit more/less powerful, heighten or lower the iSupportFireDamage value for that unit. Lowering it means that the unit will do less damage. Making it 50 means approx a 20% drop in damage against equally-strengthed unit, about a 33% drop in damage against unit twice as strong, and about a 38% drop in damage against a unit three times as strong.
As you can see, the higher the difference in the strengths, the less change is done. This means that making the value for a unit 200 (double it's typical strength) will not double it's damage, nor will making it's value 1000 make it do 10x the damage (in fact, at 1000 it wil only do about 70% more damage than normal against similarly-strengthed units).
So, don't be afraid to raise it very high, or drop it very low, as the farther from 100 you go the less change it will make. The drop from 100 to 80 makes a bigger difference than from 80 to 60.
3.) To make a unit more/less powerful without having to worry about these factors, you can also change the other two values. These are probably good for making later-era units more powerful than early-era while still maintaining a level amount of damage being dealt in one blow.
How SF Works and it's Calculations
If you really want to get to the nitty gritty, I've put all the math below:
Spoiler :
SF follows the same exact way of calculating collateral damage as done typical collateral damage, with the exception being where in normal collateral damage the defending plot and it's occupants are affected, in SF the plot that the attack is launching from is affected.
First, a unit attacks a plot. The plot goes through it's typical phase to find the best defender. This process is unchanged.
After the defender is selected, there is then a check made to find the best SF-capable unit in the group. (Note: The function to determine the "best" support fire unit is still to be determined. Currently, it just takes one of them). Then, that one unit does it's SF damage.
The damage is calculated like Collateral damage, so if you know how that works you can use that as your guide. First, each unit in the plot is checked to see if it can be affected by SF. A unit is considered available to be a target of SF if that unit...
- Not the attacking unit.
- At war with the SF unit's team.
- Not invisible.
- is a defendable unit. (i.e. Not a worker / Settler/ Other non-defenable unit)
Each one of these units is given a random number between 1 and 1000, and that number is multiplied by their total strength. This gives each unit a "Target Value".
Next, the targets to be hit are choosen. The number of targets "hit" will be the SF unit's "iSupportFireDamageMaxUnits" value. If the number of possible targets is less than or equal to this amount, then all the possible targets are hit. Otherwise, only the top N targets are hit (with N being the "iSupportFireDamageMaxUnits).
The amount of damage done to any unit is then determined in according to this series of formulae (warning: math ahead):
---
Collateral Strength = (SFBS * SFD) / 100
This is basically the strength of the unit for these calculating purposes after being modified by the unit's iSupportFireDamage value. (Thus, a "100" for "iSupportFireDamage" means the unit's iCollateralStrength will be their base strength. A 200 means it will be double their base strength, etc)
SFBS = SupportFireBaseStrength, the base strength of the SF unit (if it's an air unit then the SFBS is their base air strength).
SFD = The unit's iSupportFireDamage value.
---
StrengthFactor = ((CollateralStrength + TBS + 1) / 2)
This is the "strength factor" against any one target that the SF unit is dealing damage to. It is used to determine
CollateralStrength: Computed above.
TBS: Target's Base Combat Strength
---
Support Fire Damage
The way that it is actually computed is otherwise, but thought this formula which I factored to was more aesthetically pleasing.
Code:
2(CollateralStrength) + TBS + 1
SupportFireDamage = ------------------------------ * SUPORT_FIRE_DAMAGE
2(TBS) + CollateralStrength + 1
What this basically means is that the amount of damage done to a unit from SF will basically rely on the Collateral Strength and the Target Unit's base strength. Thus, if the SF unit's Collateral Strength and the target unit's base strength is equal, the amount of damage done will be SUPPORT_FIRE_DAMAGE.
CollateralStrength: Collateral Strength of the SF against the Target Unit (Calculated above)
TBS: Target's Base Strength
SUPPORT_FIRE_DAMAGE: A constant (defined in GlobalDefinesAlt).
---
Target's Final Damage = max(TCD, min(TCD + SupportFireDamage, SFDL))
This basically means that the Target's Final damage is going to be at least it's current damage, and at most the limit of damage that the SF unit can do.
TCD = Target's Current Damage
This is the value of the unit's "damage" (0 being not damaged, 100 being dead) before the SF occured.
SFD = Support Fire Damage
This is the value of the Support Fire Damage that is done to the unit. Calculated Above.
SFDL = Support Fire Damage Limit
This is the SF unit's iSupportFireDamageLimit.
Other Notes on Support Fire
Every unit can only do one support fire shot per turn. This value is completely independent of whether or not that unit has movement points left or not. Once a unit uses it's support fire shot, it does not regain the ability to use that support fire shot until it's next turn (which means the beginning of the player's turn).
A unit does not use up it's support fire shot per turn if the unit that is attacking is attacking from a plot that has no units in it, or if the units that are in it can not be targetted for support fire (such as if the units are all already at their limit).
Finally, the patch
This is obsolete. Support Fire is now included into the game.