I was looking more into how DFU calculates how the player rolls for their attacks against a monster, such as a skeleton warrior or a rat. I went through the code here "https://github.com/Interkarma/daggerfal ... r.cs/#L944" for the FormulaHelper script and made this equation based on it.

and I guess "ChanceToHitMod" is just the value that is displayed when you click on your agility attribute, so if it's say 60, it would be +1 and 70 +2? I omitted adding the Adrenaline Rush variables to the chanceToHit equation for simplicity, but I know they exist.

Then all of this gets ran through a 1-100 Diceroll method, where you can't go below 3 nor above 97.
__________________________________________________________________________

So with all of that mess aside, let me put up an example or two to see if i'm understanding this correctly.

So when the 100 sided dice is rolled, if it rolls any number BELOW 52, my hit will collide and deal all of the other damage modification formula damage. Likewise, if it rolls ABOVE 52, my hit will miss.
__________________________________________________________________________

So when the 100 sided dice is rolled, if it rolls any number BELOW 97, my hit will collide and deal all of the other damage modification formula damage. Likewise, if it rolls ABOVE 97, my hit will miss.
__________________________________________________________________________

Before I ask more about details like "So difference in luck stat only effects hit chance by 1% per 10 point difference" or "So every 10 points of agility has a 2% effect on hit chance" or "Do monsters not have a dodge stat?". I want to make sure that I am understanding the math here correctly, am I missing anything?

I'd hoped one of the devs would jump in, but rather than let this languish ...

As I recall from original D&D, your end result is correct. The "to hit AC0 (THAC0) system" is summarized as "roll low". The "chance to hit" must be rolled under the THAC0 value. Defense bonuses reduce the THAC0 value (making it harder to achieve a hit) while attack bonuses (such as weapon "to hit" enchantments) increase it.

An apparent point of confusion is the subtle difference between the terms "armor CLASS" and "armor VALUE". The two tend to be "conflated" and used interchangeably, but in the code are not. "Class" appears to be used as a comparative relation to "AC0", while "Value" is the "current chance to hit percentage".

However, the Player "paperdoll" does not appear to be showing an "armor class". It is showing armor values (reductions to THAC0) at particular parts of the body, which only apply when that particular body part is struck. (See the "FormulaHelper.cs" code in the referenced thread below.)

As pointed out by l3lessed in How does AC of a creature works? "monster" equipment armor value may get used only if it is better than their base monster type armor value. However, I think he misspoke when he said "So, armor value increases your chance to hit value. As a result, everytime that 100 sided dice is rolled, it is less likely it will roll a number larger than your now modified armor value and tell the engine it was a successful hit." That is directly contradicted by his immediately preceding statement: "For a successful hit, the random number needs to be smaller than the end chancetohit number" and the code following, because "chance to hit" is essentially "armor value" with adjustments. It should read "So, armor value DEcreases your chancetohit value" and "it is less likely it will roll a number LESS than your now modified armor value". (The operator "-=" subtracts the value on the right from the variable on the left. The "+=" operator does the opposite. Defensive factors ("target") are subtracted while offensive factors ("attacker") are added to the "chanceToHit" variable.)

Pardon my ignorance.
When I asked about hit chance on discord I was told it's a d20 roll with modifiers. However looking at the code I'm not seeing this case?
Specifically I asked how Agility affected hit chance and was told the game rolls a D20, then each 10 points of agility adds +1 to that. If you're 20 or above you're gurenteed to hit.

I'd hoped one of the devs would jump in, but rather than let this languish ...

As I recall from original D&D, your end result is correct. The "to hit AC0 (THAC0) system" is summarized as "roll low". The "chance to hit" must be rolled under the THAC0 value. Defense bonuses reduce the THAC0 value (making it harder to achieve a hit) while attack bonuses (such as weapon "to hit" enchantments) increase it.

An apparent point of confusion is the subtle difference between the terms "armor CLASS" and "armor VALUE". The two tend to be "conflated" and used interchangeably, but in the code are not. "Class" appears to be used as a comparative relation to "AC0", while "Value" is the "current chance to hit percentage".

However, the Player "paperdoll" does not appear to be showing an "armor class". It is showing armor values (reductions to THAC0) at particular parts of the body, which only apply when that particular body part is struck. (See the "FormulaHelper.cs" code in the referenced thread below.)

As pointed out by l3lessed in How does AC of a creature works? "monster" equipment armor value may get used only if it is better than their base monster type armor value. However, I think he misspoke when he said "So, armor value increases your chance to hit value. As a result, everytime that 100 sided dice is rolled, it is less likely it will roll a number larger than your now modified armor value and tell the engine it was a successful hit." That is directly contradicted by his immediately preceding statement: "For a successful hit, the random number needs to be smaller than the end chancetohit number" and the code following, because "chance to hit" is essentially "armor value" with adjustments. It should read "So, armor value DEcreases your chancetohit value" and "it is less likely it will roll a number LESS than your now modified armor value". (The operator "-=" subtracts the value on the right from the variable on the left. The "+=" operator does the opposite. Defensive factors ("target") are subtracted while offensive factors ("attacker") are added to the "chanceToHit" variable.)

All of which is to say: "I think you have it correct."

Yeah, I figured I was not too far off, but I think I got one "big" detail incorrect in this post, that being that monsters actually appear to have skills, just like the player, but their value is based on the level of the monster, with a default value of 30 in all skills, and the rest being based on monster_level * 5, so the lowest possible level enemy, being the level 1 Rat, has 35 skill in everything. While the highest level enemy being the ancient lich having 100 skill in everything (everything is capped at 100, besides magic schools, which cap at 80 for monsters). This info coming from this source: https://en.uesp.net/wiki/Daggerfall:Bestiary

The point of this mistake correction being that the hit chances that I used as examples are actually a fair amount off from what their actual values would be with this info in mind. With a monster being level 14 or higher, having an inherent -25 modifier to their chance of being hit due to their 100 dodge skill, and EVERY monster in the game having AT LEAST a -8.75 modifier to their chances of being hit.

So I feel like my math and the majority of my assumptions on this system are correct, but who knows, that Unofficial source could be completely off to how Daggerfall Unity has coded these things and I could be completely wrong.

Pardon my ignorance.
When I asked about hit chance on discord I was told it's a d20 roll with modifiers. However looking at the code I'm not seeing this case?
Specifically I asked how Agility affected hit chance and was told the game rolls a D20, then each 10 points of agility adds +1 to that. If you're 20 or above you're gurenteed to hit.

At least from the code that I read, I did not see anywhere that a D20 is ever rolled, at least not in the formula for chance to hit. I'm also not even sure if the code-base has a class for rolling a D20, the only one that I saw was the "Dice100" class. At least if you search "Dice" in the API documentation here: https://thelacus.github.io/daggerfall-u ... index.html

Excellent point about "do monsters have Luck", but there is an apparent tendency to use "(Level * 5)" as a substitute for any missing stat, at least in the code fragments I've seen published in threads. Suspect it would be more prudent to assume that instead of "zero" for any missing formula element until it can be determined absolutely.