Calculating NPC Offense and To-Hit

From The Al`Kabor Project Wiki
Revision as of 07:45, 23 October 2016 by Torven (talk | contribs)
Jump to navigation Jump to search

For an in-depth explanation of EQ's melee mechanics and TAKP's model of it, see this thread on eqemulator.org.

All NPCs and PCs have an offense and mitigation value which are used to determine how hard they hit or get hit in melee combat. The displayed ATK and AC values displayed in the client are both actually comprised of two values. ATK is offense plus to-hit, and AC is mitigation plus avoidance.

TAKP grants NPCs a default offense value based on level. The ATK field in the database is a bonus offense value that is added to the default offense. It's important to understand how the default offense is calculated when tuning an NPC's offense in the database.

Requirements

This will require using a spreadsheet and running one of Torven's log parsing lua scripts. If you can't use spreadsheet software, then this is over your head and you should stick to basic stats.

Calculating an offense estimate from Live NPCs requires using a level 65 warrior tank in most cases, because that is one of the few class/level combinations that has known AC softcap+overcap divisor values. Knowing the tank's precise mitigation vlaue is required to calculate the attacker's offense. A level 100 of any class can also be used. A tank of any level that has AC below their softcap may also be used for lower offense NPCs. Note that the 65 warrior will need to be well geared to tank the harder NPCs. PoTime is of course a good place to get gear. Don't make an iksar. Don't wear gear with heroic dex, heroic agil and avoidance. Don't get the Armor of Wisdom AA.

You will also need a high level cleric for this, both for the hitpoint buffs and to heal the tank. Vie buffs can also be used so long as they are recast frequently and never drop from the tank. Shielding gear is also fine, even preferable. A high level shaman is also recommended for additional hitpoint buffs and healing, however CLICK OFF THE 'Increase Chance to Avoid Melee' BUFF (icon has two boots) or it will ruin the to-hit estimate. Note 'high level' in this case is probably around level 85 at the minimum; harder NPCs will certainly need higher.

A high level bard is semi-required for the mana regen and group healing as the healers will be chain casting heals for hours. You may or may not need this depending on the NPC.

A high level SK is not required but preferred. The SK can be used to pull the NPCs and take over as the tank when setting up your characters.

Low to mid level NPCs don't have such strict requirements, however their offense values are very predictable and known. The above eqemulator thread explains.

Determining Your Mitigation AC

Your mitigation AC is calculated from your worn AC, your defense skill, agility, buffs, AAs, class and racial bonuses, and food/drink. Fully explaining this would be needlessly long and confusing, so I'm just going to tell you to get my spreadsheet and copy the cells in it.

Download this and copy the cells on the NPC vs PC tab (the first tab) and make a new row at the bottom. You can then plug in your character's stats. I'll explain what the columns mean.

Spreadsheet Input Variables

Agility, Defense, Dodge, Parry, Riposte are obvious.

Worn AC - This is the sum of all the AC values displayed in the item stats window for even item you are wearing. The client does not display this value, so you must add them all up. Yes this is very annoying.

Buff AC - This value is a bit of a pain to get. You have to look at the raw spell data to get it. The number in the spell description is wrong. For example, the Credence spell says 299 in slot 4. 299 is not the number we want. On Allakhazam, click raw spell data. The number after 'base4' is what we want (997). The AC is in slot 4, so it's the base4 value we want.

Combat Stability Mult - This is the multiplier from the Combat Stability AA. 1 means no AAs. For a level 65 warrior with full AAs, this would be 1.27. (25% from Combat Stability plus 2% from Physical Enhancement)

Combat Agility Mult - Similar to Combat Stability. This would also be 1.27 for a full AAed 65 warrior.

Softcap - This number is 430 for a level 65 warrior. See this thread for level 100 overcap+softcap numbers.

Returns - This number is 0.35 for a level 65 warrior. See this thread for level 100 overcap+softcap numbers.

Avoidance, Target - This is your +avoidance sum from equipment, easily seen from your character sheet.

The columns 'swings' through 'DI20' and 'Landed' through 'Riposted' are pasted in from a lua script. This is explained below.

Spreadsheet Output Variables

Softcap, modified - This is your AC softcap after AAs are applied.

Mitigation AC, Actual - This is your mitigation AC and the value we care about.

Mitigation AC, Sheet - This is the mitigation AC you would have if you had no armor softcap at all. This is here because the character sheet AC does not factor in the softcap. You can ignore this number.

Sheet AC Calc - This is the number displayed in your character sheet in the game UI. DO NOT MAKE LOGS UNTIL THIS NUMBER IN-GAME MATCHES YOUR SPREADSHEET. If it does not match, you missed something. Check your worn AC sum. It's probably a good idea not to have AC food/drink so you don't run out of it mid-log or have to recalculate your worn AC when you run out.

Avoidance AC, Actual - This is your effective avoidance AC after AAs are applied and the number used by the game to check if you avoid hits or not.

Avoidance AC, Sheet - Like mitigation, the AC value displayed in the client ignores AAs for avoidance. This number is here so the spreadsheet can calculate other cells.

Procedure

Once you have your characters leveled and geared and you have your 65 warior's mitigation known, you can start producing logs.

Before you pull the NPC you want to parse, you'll want to try and get your warrior's mitigation AC somewhere around the NPC's offense. If the two are too dissimilar then the estimates will be less accurate or even unusable. Most raid boss NPC offenses are fairly low, in the neighborhood of 400-500, so you'll want to skip getting Combat Stability/PE. Don't buy these AAs if you level up production server characters. Test server characters can simply /resetaa. Some bosses (not many) do however have a high offense (like 700+) so in those cases you'll want more mitigation.

Never get the Combat Agility AAs as they only serve to decrease the amount of data in your log.

At this point you'll need a tool to automate spell casts. The main Data Collection page explains how to use Torven's 2spam.au3 script. There is another version of that script that functions the same but has longer recast delays. This second script is called 2spamlong.au3 and you would want to use that instead if you have a healer casting HoTs instead of direct heals.

To keep my warrior alive, I used an automated cleric that hit a macro which casted both Vie and a HoT. This macro also hit the spells twice in case of fizzles. On the harder NPCs, I had a second machine botting heals with my high level shaman who had a macro to both cannibalize (the AA) and cast heals rapidly. My bard also sung the hp/mana plus the heal focus+mana regen plus possibly a resists song if the warrior needed it. (note: resist songs have a +AC component but it's very small)

Mercs can be used instead for the weaker raid bosses, but they will not keep you alive on PoP bosses or the harder Velious/Luclin bosses.

At this point you're ready to engage the NPC. You can attack it to get a mitigation estimate from the same log. See the page on mitigation to know how to set your character up for a mitigation log. Ensure that your AC does not change for the entire log.

The longer the log the lower the margin of error. I've done 6 hour logs on some NPCs, but generally I go about 3 hours. Shorter logs can give you a ballpark figure however. You may need to reset the NPC and allow it to heal and re-engage if you're also doing a mitigation log.

The last thing you should do is kill the NPC and jot down what it had in the spreadsheet. Do a /say or /g or something and link the loot for the log.

Parsing the Log

Once you have a log, you need to parse it with a lua script Torven wrote. The script is meleedmg.lua. Script output looks like this:

Combat statistics for attacker Lord Yelinak
--- Damage Type: hit -------------------------------------------
29605 29 567 272.09812991147 116 0.30955933552173 0.038794389734408 0.039540435690839 0.037948870983786 0.042524619516562 0.040435690838556 0.041480155177559 0.039142544514075 0.039440962896648 0.042474883119467 0.042076991942704 0.038545707748931 0.032975231274246 0.031682084949766 0.029841838257237 0.028250273550184 0.024122152591266 0.020043768029444 0.017208793395006 0.063911270267582
0.67914203681811 0.32085796318189 0.15122445532849 0.081337611889883 0.08829589596352 0
Total Damage: 5470805
Normal Hits: 20106 (100.0%)
- Min Normal Hit: 29 (31.0%)
- Modal Normal Hit: 116 (31.0%)
- Max Normal Hit: 567 (6.4%)
- Avg Normal Hit: 272
Total Swings: 29605; Landed Blows: 20106 (67.914%); Avoided Swings: 9499 (32.085%)
- Misses: 4477 (15.122%)
- Dodged: 2408 (8.133%)
- Parried: 2614 (8.829%)
- Riposted: 0 (0%)
Normal Hits:
1] 116: 6224 (30.9%)
2] 140: 780 (3.8%)
3] 164: 795 (3.9%)
4] 187: 763 (3.7%)
5] 211: 855 (4.2%)
6] 235: 813 (4%)
7] 259: 834 (4.1%)
8] 282: 787 (3.9%)
9] 306: 793 (3.9%)
10] 330: 854 (4.2%)
11] 354: 846 (4.2%)
12] 377: 775 (3.8%)
13] 401: 663 (3.2%)
14] 425: 637 (3.1%)
15] 449: 600 (2.9%)
16] 472: 568 (2.8%)
17] 496: 485 (2.4%)
18] 520: 403 (2%)
19] 544: 346 (1.7%)
20] 567: 1285 (6.3%)

It's very important that the NPC have 20 damage values and no more or less. If there aren't 20, then the log is not usable. If your Vie buff faded in the log, then snip out the parts where it was gone.

Note that Daybreak recently made a change to ripostes: if an NPC hits you as the result of a riposte, then the damage is significantly reduced. This is very annoying for us, as we must remove these hits from the log. The script attempts to do so by default, but just be aware in case it fails to catch them all. Also Wild Rampage hits are usually less damaging than full damage hits and should be removed if so; the script doesn't do that however as not all rampage hits are indicated by parentheses.

Mitigation of the Mighty adds another wrinkle: you'll need to set your character name in the script variables on these NPCs, because the client gives two different crit damages so the script needs the character name to know which crits are from you.

There are two lines under the "Damage Type: hit" line that are strings of numbers. These are intended to be pasted into the spreadsheet. The first line is Swings through DI20, and the second line is Landed through Riposted. Player character output is intended to be pasted into the 'PC vs NPC' tab (second tab) in the spreadsheet and has different output instead of the DIs; this is where you calculate NPC mitigation.

From here you need merely copy the cells at the end of the lines on the 'NPC vs PC' tab and it will compute some offense and to-hit estimates. There is one column for to-hit, and 3 columns for offense which have different ways of calculating an estimate.

Note that Mitigation of the Mighty NPCs get a to-hit bonus from the buff so to-hits from Mighty'ed NPCs are incorrect. Offense however is unchanged by the buff. You'll have to parse on production servers to get to-hit. To-hit is fairly predictable however on most NPCs.

Tuning an NPC in the Database

The default NPC offense for NPCs on TAKP is calculated this way:

Offense = MIN(level*5.5-4, 320)+(level*2-40)

When you enter a value in the ATK field, it is added to the above calculation. To set the NPC to a certain offense value, you need to subtract the above default offense from the desired offense value and put the result into the ATK field.

To-hit works similarly:

To-hit = MIN(level, 50)*10+12

Bonus to-hit goes into the accuracy database field.

NPC Equipment

One last thing: NPCs sometimes wear their equipment, which may grant them extra offense (from strength) and armor class. As of yet we have not determined definitively which stats NPCs gain from equipment. (over than resists, which they do in some cases at least) This is further complicated by the fact that some NPCs equip and some don't.

Whether NPCs wear their inventory or not on TAKP is set in the database. If they are set to do so, then they gain the stats from it, so this should be accounted for when tuning NPCs. +Offense = 2/3rds the strength they gain from gear. If your parsed NPC has gear (for example, an AoW is slashing, indicating that he can wear inventory) then you'll need to account for this. I have three AoW logs that range from +215 to +258 ATK above the default, so I set him at +200 in the database has his gear has plenty of strength on it. It's important to note what they had in the spreadsheet.