Post by Damian on Aug 31, 2016 13:11:37 GMT 10
I have finally had some time to consider the processing of combat effects on characters and how they are represented in the user interface and the game world.
That is, when attacking with weapon/body part that has a combat effect damage and buffs/debuffs are now calculated.
I have a two-phase approach in place that appears to be working quite well.
It's worth noting that I am not attempting to replicate the Dungeons & Dragons rule set at all.
Phase 1: Combat Effect Damage
When a weapon or undead minion's arm has a Frost Combat Effect applied there is also a Modifier that is associated with attack e.g. 5% Frost Damage
Here is a typical example when attacking with a sword that does 12 damage and has a 5% Frost Modifier:
Simplified math:
Actual Damage = ((Weapon Base Damage + Critical Damage) - Physical Resistance) + (Frost Damage - Frost Resistance)
Phase 2: Combat Effect...Effects
There are 3 ways an effect can be applied to a character based on the Combat Effect and whether or not the target is an enemy or friendly.
Each effect will last a number of seconds based on the Frost Modifier.
In this example we have a chance to apply the Frozen Debuff.
* We check if the target has resisted the Frozen Debuff with their Frost Resistance.
* If the combat effect succeeds then the character will suffer a Frozen Debuff that reduces their movement and attack speed for the duration of the effect.
The character can have many combat effects applied at once, but only one of each combat effect can be applied at one time.
This means that the target can be Immolated, Weakened and Frozen but they cannot be frozen again whilst the previous Frozen Debuff is active.
This is to prevent the character being frozen for the entirety of the fight or stacking damage or increasing duration of multiple Frozen Debuffs.
It's also to ensure that any one character does not become a performance bottle neck whilst an infinite number of combat effects are processed every second.
Extending Combat Effects
I have written the combat effects system in a modular way so we can just slot in additional effects in future.
That means the much requested Confusion and Fear combat effects can easily be slotted in without very much work at all. Hooray!
Balancing Particles
I really should have seen this coming, but there are now way too many particle effects on an undead character with special body parts and combat effects applied.
It's impossible to determine if the fire particles are indicating that the minion has a fiery Arm of Burning equipped or if he is in fact on fire.
So we're making a small change to how we represent combat effects on weapons and active combat buffs/debuffs. These changes should still be visually pleasing whilst still giving you a good idea as to what is going in combat.
I'm pretty happy with how this works and looks now. I've even engineered the behaviour in a way that directly feeds into the Skill System.
The Skill System that I have written twice and scrapped twice. I have a good feeling about the third attempt though
That is, when attacking with weapon/body part that has a combat effect damage and buffs/debuffs are now calculated.
I have a two-phase approach in place that appears to be working quite well.
It's worth noting that I am not attempting to replicate the Dungeons & Dragons rule set at all.
Phase 1: Combat Effect Damage
When a weapon or undead minion's arm has a Frost Combat Effect applied there is also a Modifier that is associated with attack e.g. 5% Frost Damage
Here is a typical example when attacking with a sword that does 12 damage and has a 5% Frost Modifier:
- Base Melee Damage is calculated from equipped weapon/body part and randomised by 10% i.e. between 11.8 and 13.2
- Then we calculate whether or not the attacker has landed a Critical Hit.
- If a Critical Hit was successful then we add the Weapon's Critical Hit Modifier e.g. 20% to the Base Damage to give us Actual Damage.
- Actual Damage is offset by the target's Physical Resistance i.e. melee resistance.
- We then use the Frost Damage Modifier to calculate 5% of Actual Damage to determine Frost Damage.
- The Frost Damage is then offset by the target's Frost Resistance to give us Actual Frost Damage.
- We add Actual Frost Damage to Actual Damage.
- Then we apply the Actual Damage to the character.
Simplified math:
Actual Damage = ((Weapon Base Damage + Critical Damage) - Physical Resistance) + (Frost Damage - Frost Resistance)
Phase 2: Combat Effect...Effects
There are 3 ways an effect can be applied to a character based on the Combat Effect and whether or not the target is an enemy or friendly.
Each effect will last a number of seconds based on the Frost Modifier.
- Buff - Increases a character statistic.
- Debuff - Decreases a character statistic.
- Periodic - Applies damage every second.
In this example we have a chance to apply the Frozen Debuff.
* We check if the target has resisted the Frozen Debuff with their Frost Resistance.
* If the combat effect succeeds then the character will suffer a Frozen Debuff that reduces their movement and attack speed for the duration of the effect.
The character can have many combat effects applied at once, but only one of each combat effect can be applied at one time.
This means that the target can be Immolated, Weakened and Frozen but they cannot be frozen again whilst the previous Frozen Debuff is active.
This is to prevent the character being frozen for the entirety of the fight or stacking damage or increasing duration of multiple Frozen Debuffs.
It's also to ensure that any one character does not become a performance bottle neck whilst an infinite number of combat effects are processed every second.
Extending Combat Effects
I have written the combat effects system in a modular way so we can just slot in additional effects in future.
That means the much requested Confusion and Fear combat effects can easily be slotted in without very much work at all. Hooray!
Balancing Particles
I really should have seen this coming, but there are now way too many particle effects on an undead character with special body parts and combat effects applied.
It's impossible to determine if the fire particles are indicating that the minion has a fiery Arm of Burning equipped or if he is in fact on fire.
So we're making a small change to how we represent combat effects on weapons and active combat buffs/debuffs. These changes should still be visually pleasing whilst still giving you a good idea as to what is going in combat.
- Equipping Weapons/Body Parts that have combat effects will change the skin material only.
- Weapons and Arms/Hands that have combat effects will be displayed as particles just on the weapon or hands of the attacker.
- Active Buffs and Debuffs on a character will be displayed as particles on the whole body.
I'm pretty happy with how this works and looks now. I've even engineered the behaviour in a way that directly feeds into the Skill System.
The Skill System that I have written twice and scrapped twice. I have a good feeling about the third attempt though
