Recent site activity

Battles‎ > ‎

Damage Calculations

    A major component of the journey consists enemy encounters that result in battles.  The combination of statistics for characters, enemies, landscapes, items, weapons, armor, and magics, can lead to complex calculations that need to be performed in steps.

Left shift (<<) and right shift (>>) are used when possible to speed up calculations.  To determine the equivalent multiply and divide values, raise two to the power after the operator.  For instance, SpellPower<<2 is the same as SpellPower*(22) or SpellPower*4.  All calculations are based on integer values, so fractions are ignored.  Calculations are performed on variables to the right then assigned on the left.

These calculations were originally based on Final Fantasy VI, but they will be altered considerably since many of TMJ's stats differ.
Showing 22 items
ClassSourceStepCalculation
Sort 
 
Sort 
 
Sort 
 
Sort 
 
Fight Character 1 (Max Damage) Damage = Power + 9 * ( Level * Level * Power ) >> 10 
Fight Character 2 (Critical Hit) Damage *= RANDOM[0,32] >> 16 
Fight Character 3 (Random Variance) Damage = Damage * RANDOM[224,255] >> 8 + 1 
Fight Character 4 (Defense) Damage = Damage * (255 - Power) >> 8 + 1 
Fight Character 5 (Dodging) Damage *= 1 - ( RANDOM[Dodge, 128] >> 6 ) 
Fight Enemy 1 (Max Damage) Damage = 5 * Level * Level * Power >> 8 
Fight Enemy 2 (Critical Hit) Damage *= RANDOM[0,32] >> 16 
Fight Enemy 3 (Random Variance) Damage = Damage * RANDOM[224,255] >> 8 + 1 
Fight Enemy 4 (Defense) Damage = Damage * (255 - Power) >> 8 + 1 
Fight Enemy 5 (Dodging) Damage *= 1 - ( RANDOM[Dodge, 128] >> 6 ) 
Magic Character 1 (Max Damage) Damage = SpellPower << 2 + ( Level * MPower * SpellPower >> 5 ) 
Magic Character 3 (Random Variance) Damage = Damage * RANDOM[224,255] >> 8 + 1 
Magic Character 4 (Defense) Damage = Damage * (255 - MPower) >> 8 + 1 
Magic Character 5 (Elemental Strong) Damage = Damage >> 1 + 1 
Magic Character 5 (Elemental Weak) Damage = Damage << 1 + 1 
Magic Character 6 (Dodging) Damage *= 1 - ( RANDOM[MDodge, 128] >> 6 ) 
Magic Enemy 1 (Max Damage) Damage = SpellPower << 2 + ( 3 * Level * MPower * SpellPower >> 6 ) 
Magic Enemy 3 (Random Variance) Damage = Damage * RANDOM[224,255] >> 8 + 1 
Magic Enemy 4 (Defense) Damage = Damage * (255 - MPower) >> 8 + 1 
Magic Enemy 5 (Elemental Strong) Damage = Damage >> 1 + 1 
Magic Enemy 5 (Elemental Weak) Damage = Damage << 1 + 1 
Magic Enemy 6 (Dodging) Damage *= 1 - ( RANDOM[MDodge, 128] >> 6 ) 
Showing 22 items

Comments

Matthew Marshall - Sep 13, 2009 6:36 PM

this looks really great hull. im curious as to how the programming of relics, etc. are going to complicate things. such as critical hit boosters, etc. will it be simple? or what?

Daniel Gump - Sep 13, 2009 7:57 PM

I still have to work in status enhancements and detractors, including relics. They shouldn't be too tough.

Matthew Marshall - Sep 14, 2009 2:23 AM

oh, alright hull. and will there be status boosting items like strength potions?

Matthew Marshall - Sep 16, 2009 3:48 AM

hullbreach, could there be a damage code that applies the status effects of weapons, such as a 10% death probability or burn, paralyze, etc? i think i could make one, but i dont wanna screw up.

Daniel Gump - Sep 16, 2009 5:38 PM

I still have a few things to add to these equations as game development progresses (terrain enhancements, for instance). Weapon enhancements will be one of those.

Matthew Marshall - Sep 17, 2009 3:16 AM

ok. i see.

Jauan Durbin - Nov 8, 2009 7:27 AM

I think a 10 second energy loss is good.