I have been running combat simulations on and off for the last couple days, and I have been having issues making every thing "work" together to create a smooth running system.
Here is what I have, maybe someone can figure out a better system than what I have.
( this is real time combat )
Combat Level - derived from several of the base skills ( haven't figured out a good way to calculate this yet )
HP - health ... regenerates based on combat level
MP - magic ... regenerates based on combat level
RP - religion ... regenerates based on combat level
Strength - how hard something can hit
Accuracy - percent added to damage
Agility - percentage chance of dodging some or all of an attack
Defense - amount of damage that can be absorbed
Armor - percentage of damage that can be absorbed
Luck - positive or negative random effect
* A difference of 3 or more combat levels between the combatants will change percentage of damage dealt and damage taken
* The level of MP & RP is the attack and defence level.
Hit Given = (Strength * (Accuracy bonus + luck) ) * combat level difference penalty or bonus percentage
Hit Taken = (Hit Given - ( (Defense * armor bonus) * (agility bonus + luck) ) ) * combat level difference penalty or bonus percentage
Take a step back and discard as much as possible until you have no more things left, which you can take away without collapsing the combat system.
Example:
Hp - keep it
Mana,Relegion,Strength - just let's call it power for now (=how hard did an attack hit,regardless of its nature).
Accuracy- ditch it, just an modifier of damage, damage is derived from power
agility,defense,armor - just let's call it defense for now (=how good are you to avoid damage)
luck - random seed modifier, ditch it
Leaving for just combat related stuff:
Hp, Dmg, Def
While power is something special, either it is a resource like hp for casting spells etc. or it modifies the dmg output.
Now start building a simple system relying on these attributes, something like this:
hp' = max(0,hp - dmg/(1+def))
Now you need to think about a basic balancing. Start to set a fix value for one value, like hp is always 100. Then think about what avg dmg/def values would make sense to have a combat situation, like if you have X dmg and half of it as def, the defender should survive 5 hits.
The next step is to consider the effect of your combat level on the formula. Don't make it to complex. A linear effect would be a good start,something like this
hp'=max(0,hp*cl_d-dmg*cl_a/(1+def))/cl_d
with cl = combat_level factor, for attacker (cl_a) and defender (cl_d), if cl_a=cl_d, then you get
hp'=max(0,hp*cl_a-dmg*cl_a/(1+def))/cl_a=max(0,hp-dmg/(1+def))
Bevor we differentiate between different, more detailed attributes, add some modifiers, just ignore the combat level because it is linear:
hp' = max(0, hp*f_hp - dmg * f_dmg / (1+def * f_def))/f_hp
This way you have the option to handle different combat situation more gracefully:
1. example: a spell, which protects you vs 50% of any incoming dmg =>f_hp=2
2. example: a spell, which ignores any defense value => f_def = 0
Now you can begin to differentiate between different influences on the basic attributes, that is, you derive the basic combat stats like hp,dmg,def on-the-fly, example:
dmg
= strength * factor * weapon_base_dmg, if basic melee attack
= magic * factor * spell_base_dmg, if basic spell attack
= relgion * factor * praying_base_dmg ...