Re: Is My Math Right or Wrong for The Hit Formula?
Posted: Sat Mar 07, 2020 12:12 am
So I actually just found something while testing, and in the code. That makes a lot more sense now that I see it, but make a BIG difference in how difficult it is to hit enemies. The innate armor value that enemies have is not just a flat numbers, it is being multiplied by 5. So that ancient vampire with -12 AC is not just getting -12 chance to be hit, but a massive -60 when all is calculated. That enemy with +5 AC is actually +25 more likely to be hit.
I also, tested this with player armor. A naked unarmored player (or just any spot on the body that has no armor value) has a +100 modifier added to their chances of being hit, while a player with an iron pauldron with +7 armor (when it rolls to hit said section of the players body) will instead have a +65 modifier to their chances of being hit.
So in terms of the whole formula, this fact actually has pretty big implications, armor has a HUGE effect on the chances of hitting and getting hit. Like that enchantment that strengthens armor by +5 or the one that weakens armor by -5 is actually adding or subtracting 25 onto said hit odds.
EnemyEntity.cs:
I only have the code proof that it works this way for enemy entities, but from the debug logs I have been looking at while testing in game, this seems to also be the case for the Player entity as well, that being that any armor value is actually multiplied by 5.
I also, tested this with player armor. A naked unarmored player (or just any spot on the body that has no armor value) has a +100 modifier added to their chances of being hit, while a player with an iron pauldron with +7 armor (when it rolls to hit said section of the players body) will instead have a +65 modifier to their chances of being hit.
So in terms of the whole formula, this fact actually has pretty big implications, armor has a HUGE effect on the chances of hitting and getting hit. Like that enchantment that strengthens armor by +5 or the one that weakens armor by -5 is actually adding or subtracting 25 onto said hit odds.
EnemyEntity.cs:
Code: Select all
// Enemy monster has predefined level, health and armor values.
// Armor values can be modified below by equipment.
level = mobileEnemy.Level;
maxHealth = UnityEngine.Random.Range(mobileEnemy.MinHealth, mobileEnemy.MaxHealth + 1);
for (int i = 0; i < ArmorValues.Length; i++)
{
ArmorValues[i] = (sbyte)(mobileEnemy.ArmorValue * 5);