Is My Math Right or Wrong for The Hit Formula?

Discuss Daggerfall Unity and Daggerfall Tools for Unity.
User avatar
Magicono43
Posts: 279
Joined: Tue Nov 06, 2018 7:06 am

Re: Is My Math Right or Wrong for The Hit Formula?

Post by Magicono43 » 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:

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);
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.

User avatar
mikeprichard
Posts: 1029
Joined: Sun Feb 19, 2017 6:49 pm

Re: Is My Math Right or Wrong for The Hit Formula?

Post by mikeprichard » Sat Mar 07, 2020 12:16 am

FYI, the fact that armor values displayed on the player paper doll in game are only 1/5 of the "actual" values used in game calculations has been documented previously:

https://en.uesp.net/wiki/Daggerfall:Armor
viewtopic.php?f=8&t=2514&start=10#p29618
etc.

User avatar
Magicono43
Posts: 279
Joined: Tue Nov 06, 2018 7:06 am

Re: Is My Math Right or Wrong for The Hit Formula?

Post by Magicono43 » Sat Mar 07, 2020 1:08 am

mikeprichard wrote:
Sat Mar 07, 2020 12:16 am
FYI, the fact that armor values displayed on the player paper doll in game are only 1/5 of the "actual" values used in game calculations has been documented previously:

https://en.uesp.net/wiki/Daggerfall:Armor
viewtopic.php?f=8&t=2514&start=10#p29618
etc.
So that just goes to show how wrong my math was really. The paper-doll displayed values also has a quirk with the "Strengthens" and "Weakens" armor effects you can enchant pieces of equipment with. It either takes or gives 5 to all parts of the character body, but this does not actually appear to be multiplied by 5 like normal armor values.

In fact, it seems to be bugged if i'm reading the values correctly in my log. It seems to actually have the effects swapped. Strengthens makes you easier to hit by 5, and weakens makes you harder to hit by 5, which is reversed.

This fact changes how I planned on "balancing" the enemies quite a bit, AC means a lot more than initially assumed 5 times more in fact.

Post Reply