Thread: Game Mechanics: AC may not be working correctly
View Single Post
  #2  
Old 11-26-2013, 02:18 PM
Treats Treats is offline
Fire Giant


Join Date: Feb 2010
Posts: 981
Default

Quote:
Originally Posted by Alecta [You must be logged in to view images. Log in or Register.]
Disclaimer: I cant step through my debugger right now, it's late, and I am out of town for the week, so this information might be wrong.

The AC system isn't very clean, but from what I can tell:
  • The shield AC isnt handled any differently from normal AC
  • Soft caps arent in place (?)

These are both due to the fact that the "NPC hitting a target" code uses the AC variable (which is what is displayed client side) and doesnt use the RealAC variable (which is what takes into account soft caps, shield AC, etc).

Also, I'd ignore the #ac_test command since that simulates "Player attacking something" and not "NPC attacking something" - and those follow different code paths.

NPC::ProcessAttack -> Mob::MeleeMitigation -> defender->GetAC()
vs
Client::ProcessAttack -> Client::ThrowATKvAC_D20I -> defender->GetRealAC()

Off topic: I am curious if the Monk AC bonus is working properly all the time. It seems that due to the order the bonuses are calculated, it might not be.

Anyway, will post more when I have more time to dig into this.
(Don't use anything from my previous post here in the Bug forums about AC, some of it is not correct)

Player vs NPC AC

NPC AC is easy to calculate but the problem is determining the value of their Mitigation AC from Equipment
NPC Avoidance AC = Agility from Table + (Defense * 16/9)
NPC Mitigation AC = (Buffs/4) + (Defense/3) + (Equipment * 4/3)

NPC's rarely wear any armor. The only thing I could think of that NPCs would have used was the max capped value for their level. This would be determined in relation to whether they were a Melee or a Caster.

Melee (non casters)

60 - 289
59 - 275
58 - 261
57 - 247
56 - 233
55 - 219
54 - 205
53 - 191
52 - 177
51 - 163
50 - 149 or 50 - 160
40 - 119 or 40 - 130
30 - 89 or 30 - 100
20 - 59 or 20 - 70
10 - 29 or 10 - 40
1 - 2 or 1 - 10

Caster (Nec/Wiz/Mag/Ench)

60 - 385
59 - 366
58 - 348
57 - 329
56 - 310
55 - 292
54 - 273
53 - 254
52 - 236
51 - 217
50 - 198
40 - 158
30 - 118
20 - 78
10 - 38
1 - 2

So an Enchanter NPC that is level 42 would have 166 Raw AC for Mitigation -- Just like a player wearing that amount of Hardcapped Raw Mitigation AC. This would also explain why Trakanon Mitigated damage so well, I think he was classified as a fucking Necro (lol) so his Mitigation AC was off the charts.

Bonuses

These are the three bonuses that I know of (think there is one more):

Iksar Bonus (Level / 2) + 5 added to Mitigation
Monk Bonus ((Level + 5) * 4) / 3 to Mitigation
Rogue bonus ((Level + 5) * 4) / 3 to Mitigation

Hardcaps/Softcaps

In reality there should not be any Total Hardcaps or Softcaps
Defense Skill is capped per level
Agility is capped at 255
Melee Raw AC is capped per level
Caster Raw AC is capped per level
Buffs Values are exact depending on Spell

Player AC

NPC::ProcessAttack -> Mob::MeleeMitigation -> defender->GetAC()

This needs to totally be reworked from the ground up, its fucked here.
Reply With Quote