NPC Attack Rates Explained
In this post, I will detail everything I know about NPC rates of attack and offer a few recommendations as to how EQ Emulator can be made to be a more accurate recreation of EQLive.
Attack Rate Defined Attack rate can be represented in two ways: the time delay between attacks (attack delay) and attacks per unit time (attack speed). It is important to understand the difference when dealing with the code or an NPC database, because the two are sort of inverse to each other-- when one gets larger the other gets smaller and vice versa. Example: An NPC with an attack delay of 2 seconds would have an attack speed of 0.5 attacks per second. Be mindful which term I use when discussing an issue in this post. EQ Emulator's code actually uses 'attack_speed' as the variable name for a mob's attack delay, which should probably be renamed for clarity. The Default NPC Attack Rate There isn't one. There is no common rate of attack that the vast majority of NPCs have. As evidence I have this spreadsheet that I made myself using data I collected entirely myself using a parser I wrote myself: https://docs.google.com/spreadsheets...gid=1227743551 That is a google sheets copy of my NPC spreadsheet which is where I put all my NPC data I gather for TAKP. The actual logs I used to parse the majority of NPCs on that list (almost all of the non-raid boss NPCs) as well as the parser script I wrote can be found on my google drive here: https://drive.google.com/folderview?...p=sharing#grid There are however some patterns:
EQ Emulator's input variable for attack rate is a percentile modifier to a default attack delay of 3.6 seconds (3600 milliseconds). So if somebody wanted to make an NPC attack faster, they would input something like -50% to get an attack delay of 1.8 seconds. That is certainly usable, however it is unintuitive and very cumbersome as it requires a calculator to figure out what input EQ Emulator requires to produce the desired attack delay for an NPC. My first recommendation would be to replace this input with an absolute attack delay value in the tens of seconds. I.e. '18' for an attack delay of 1.8 seconds. This appears to be the unit SOE uses because every NPC I was ever able to parse to a high degree of accuracy had an attack delay rounded to the nearest tens of seconds. Also, weapon delays in the item stats box uses the tens of seconds unit. An NPC with a value of 0 could be made to default to 30 (3 seconds). One more thing before getting into spell effects: The weapon an NPC uses will sometimes change its attack delay. An NPC will have the lower of the two attack delays from either the weapon it wields or its set weaponless rate. I have not checked to see if EQ Emulator handles this as it's sort of a minor issue. Attack Rate Modifying Spell Effects Slow spells on EQ Emulator are bugged, very bugged. The formula used in the code is wrong. Allakhazam's Lucy lists the spell Turgur's Insects as having this effect: Decrease Attack Speed by 66% (L51) to 75% (L60) Recall earlier when I made the distinction between attack speed and attack delay. Attack rate modifying spells adjust the speed not the delay. What the EQ Emulator code is doing right now is multiplying the attack delay by 1.75 in the case of a level 60 Turgur's, when it should be multiplying it by 4. How do I get 4? 75% less of something is 1/4th, which means 4 times the attack delay. But don't just take my word for it: Code:
Unslowed NPC: This is also very easily verified by using a stopwatch or looking at logs. Yes, an unmitigated Turgur's Insectsed NPC will bash/kick every 32 seconds instead of 8. The solution is simple: in mob.cpp, change Code:
if(GetHaste() > 0) Code:
if(GetHaste() != 0) Dividing one by the haste% inverts it to modify the attack delay instead of speed. The incorrect slow code multiplies by 1 which does nothing. Note that these formula are used in two places. (they really should be consolidated) One last note regarding slow mitigation: as far as I can tell, it's implemented correctly in EQ Emulator, and GetHaste() gets modified correctly. Since the problem with slows not functioning correctly is in code executed after GetHaste(), slow mitigation code does not need to be altered and will work correctly with the fix. Bash and Kick Rates NPCs have a bash delay that is separate from the attack delay. When that timer is up, they will either kick or bash choosing one with some unknown logic. The important item of note here is that this timer is ALWAYS 8 seconds unslowed/unhasted. Changing the NPC's attack delay will not alter the bash delay on EQLive, but it currently does in EQ Emulator: if you give an NPC a -50% attack rate in the editor, it will bash twice as fast. This is a problem because the default attack delay on EQ Emulator is so high that making NPCs with correct attack delays will make them bash/kick far too often. The fix is, of course, to ignore the attack rate modifier for bashes. Some parses to back my claim: Code:
Here is a level 10 mob I parsed dual wield rates with. His normal attack rate Incidentally bashes having a static 8 second delay on unhasted/unslowed NPCs makes it easier to calculate slow mitigation using bash delays or to simply tell if the mob is hasted/slowed in parses. One more thing about this bash timer: it resets when an NPC flurries. It currently does not reset on EQ Emulator. EQLive log proof: Code:
eqlog_Torven_test mobs 1.txt 89141 [Mon Jan 27 07:27:18 2014] Hydrotha bashes YOU for 386 points of damage. |
For once a wall of text is worth reading. I always felt slows were off but didn't really know enough to diagnose it. Glad you posted this.
|
Would it be possible to get some comparison parses up? I would just like to see some before and after shit I guess :P (like parse on current EQEmu, parse with change, see if it reflects live etc)
I do think your suggestion is probably correct. I mean, Turgur's Insects (at max efficiency at least) is a 25% attack speed mod (75% slow) and Vallon's Quickening is a 168% attack speed mod (68% haste) Edit: slows OP |
What, my other two walls of text weren't worth reading? :P
I'm using the TAKP codebase and Cavedude added some things to #showstats there. One of which is NPC attack delay. This makes testing this much easier. The Idol of Zek is my current guinea pig NPC. Here's a pre-fix log: Code:
Fight #5 [3] The Idol of Rallos Zek - Mon Sep 08 16:11:27 2014 - Duration: 12m 55s Code:
[Mon Sep 08 16:35:40 2014] You say, '#showstats' Now here's a post-fix log: Code:
Fight #5 [3] The Idol of Rallos Zek - Mon Sep 08 16:53:27 2014 - Duration: 10m 34s Code:
[Mon Sep 08 16:53:23 2014] You say, '#showstats' |
Quote:
If no one else does, I'll probably push this changes after a quick verification on live :P (like 1min parses max XD) |
Okay, tested on live, verified your logs. Commited now.
Edit: In regards to the DB changes, I have no problem with them, but I'd want some input from the devs that deal more with that shit :P Also, if we could just change so the DB entry is what you suggested but it translates into what our code currently does, that could be fine as well :P |
I have a big correction to make. EQ Emulator is not currently changing the bash timer when you adjust a NPC's attack rate. I made this error because Cavedude globally reduced the attack rate of every NPC to a maximum of 3 seconds per my data in the database, and I assumed the faster bash rates I was seeing from NPCs was because of that and I stupidly didn't verify this.
So, the problem is merely that NPCs are just bashing too fast. It should be 8 seconds instead of 5. |
If someone else doesn't I'll look into getting the bash/kick stuff too.
|
On the bash/kick, do you have for hasted at all? What about other special attacks? (our code they all go through the same function to do class attacks)
EDIT: I have a tentative fix if I can verify the other concerns I have :P |
Actually my (EQLive) guild were experimenting with this and a chanter/shammy started testing out their slows and had this data:-
Quote:
Sadly I can't log in to live to test if there is a level based threshold as I still only have half a house so my home PC is packed away. |
Quote:
NPCs play by different rules. They get dual wield earlier, double attack earlier, and casters get both. Caster NPCs do not bash/kick though. As far as I know, HT and LoH have the same timers as PCs. (haven't really parsed for that though) Not sure what else NPCs have that might be relevant. Quote:
I would encourage you guys to run my attackspeed.lua script. (which can be found on my google drive in the Parsing Tools folder) I spent a lot of time on it. I made too many WoW addons to use something other than Lua for it. (lua fanboy here) You'll have to make some edits to the file opening code to run it on Linux though if you run that. None of the traditional parsers handle attack speed well, if at all. EQCompanion lists a crude attack speed value for fights but my 1000 line script was written specifically for it. |
I will try to get their raw logs and use your parser.
I did forget to mention that they were snake mobs.... but they probably still have the snake kicking bug from '99 for 'ole times sake ;) |
I need to find out the effect of haste on them. Rogue mobs also backstab so that's important.
EDIT: Okay, I pushed some fixes that reflect what you parsed, I would still like to get some parses on everything else just to verify though. |
Oh yes, backstab. How could I forget. NPC backstab delay is 10 seconds.
This is from Al'Kabor, but I highly doubt SOE changed the delay: Code:
Torrin DB DI collecting 1.txt 20073 [Fri Nov 01 18:34:15 2013] Kerosh Blackhand tries to backstab YOU, but misses! |
At least on live, rogue NPCs should only give frontal backstabs I'd they have a piercer (per devs realizing why the rog mobs in powar were OP at zone launch)
EDIT: Pushed some changes to hopefully bring all these findings into EQEmu :P |
Well I got their raw logs. The "tank" was a level 100 chanter, I suspect he can't riposte. The results don't seem all that clear to me, perhaps you can interpret the output better.
Code:
No Slow Code:
Chanter up to 73% slow Code:
Turgur's - 75% slow |
The parser handles ripostes by ignoring the hit above any riposte message.
From those parses I can tell that the mob is mitigating slow to about 25% normal effectiveness. Post-turgur's bash delay on this is ~10 seconds, when an unmitigated slowed mob would be 32. 0.75 * 0.25 = 0.1875 = how much Turgur's is slowing this mob 1 - 0.1875 = 0.8125 = 81.25% of normal attack rate 1 / 0.8125 ~ 1.231 // convert attack rate % into delay multiplier 8 unslowed bash delay * 1.231 = 9.848 slowed bash delay Now the parses give a number of 10.23 'adjusted' bash delay for turgur's, but this is why I have the script display each bash delay in a chain. You can easily see that the NPC did not bash each time the timer came up or the log missed it somehow. The script has an option to ignore outliers, so the adjusted value is a second computed value after ignoring those outliers. The default threshold for an outlier defaults to 2 times the non-adjusted average, so the 23 second bash got included, raising the average to 10.23. You can eyeball it and see that it's a chain of 10s and a few nines, meaning the real average is slightly below 10. The attack round delays also agree: 2 second attack delay unslowed * 1.231 = 2.462 slowed. Your enchanter slow log however is kind of screwy. It seems to be a bad log. You can still see some 10 second bashes in there, however there are large gaps of time without any bashes at all. (note that when I say bashes, I mean bashes OR kicks; the parser looks for both) The post slow attack delay is also lower than the preslow delay which is obviously wrong. It's important to know what's happening in the log because the script will not factor in things like dispelled or expired slows or multiple mobs with the same name. The swings per round in that log is also different than the other two for whatever reason. Generally when parsing for an accurate attack delay you want to not be fighting the mob at all (stuns and things can mess it up), turn your back to it, ensure you never leave melee range of it, and let it beat on you for like 5+ minutes at each rate value. |
Compiled yesterday and fired it up. Using the PEQ database from a month ago and the RoF client.
Anyways, I have a Zerker PC with a Ranger Bot. My Ranger Bot using a 2 Handed Sword (plain one, not magical) was constantly attacking like a delay of 1 when in Unrest facing several mobs. When I face one mob she attacks at normal rate, but when its multiple mobs she was attacking in rapid succession as if her delay was 1. Have not tried on other zones yet but will do that soon and see if it still happens. I did apply all the SQLs from the required folder. |
These changes shouldn't have changed bots behavior. Is your bot repoing or something crazy?
|
Strating to think its a bot issue and not related to these changes. I notice then when I toggled the archery setting for bots, she is holding her bow in one hand and the two handed sword in the other.
|
Is this something new, or did you just notice it?
|
Quote:
|
Quote:
|
Quote:
|
Follow up: when my bot respawns from death, she has that crazy hi speed attack rate until I zone.
When I log off the server and then get back on later, her attack rate is normal as long as she was alive when I logged off. It seems that she only wigs out when respawning from death. By wiggling out I mean the 1 attack delay. It is like a machine gun when she attacks in that state. |
Been parsing more NPCs to fill out my spreadsheet and I noticed something odd. It appears that rampage can reset the bash timer on live too, however it doesn't always do so, even from the same NPC. (it was a different spawn however) I have parses of Rydda`Dar with reset bash timers and others with it not reseting the timer. Rampage has some strange logic.
Incidentally I've noticed that some rampage NPCs can and do switch rampage targets. It's commonly assumed that rampage never changes target, but on some NPCs it does every so often, like Derakor the Vindicator. It's worth noting that a merc was the 'main' ramp tank however. (but it never lost aggro) Generally he would only switch ramp targets for a brief time, then go back to the first one for an extended length of time. Also, NPCs can have more than one special attack (Ramp, Wild Ramp, Flurry). Mith Marr does all three for example, with decreasing frequency. However I've only ever seen one per round. Does the EQ Emu code prevent multiple special attacks of different types in the same round? And one last note: Cleric and Shaman NPCs will also bash. |
More oddities: I found a rogue NPC that was bashing instead of backstabbing, and a cleric that didn't bash. These appear to not be tied to a NPC's class and set separately in SOE's code.
Ramp, flurry, and wild ramp should probably get a thread devoted to them, but I noticed that a NPC that was flurrying and only hitting for doubles was also flurrying for only one or two attacks, while quadding mobs flurry for 1-4 attacks. This suggests that flurries are actually an extra combat round. I also encounter raid bosses that execute some special attacks VERY infrequently. For example, I have a 6 hour parse of Vulak and he Wild Rampaged once. (although he was slowed the entire time, making it equivalent to a 1.5 hour unslowed parse) |
A correction: if an NPC is wielding a weapon and the weapon is faster than the innate delay, then it will only use the weapon's faster delay if the NPC is not a pet.
This includes charmed pets. You can charm an NPC and it will in fact start swinging more slowly if the weapon is faster than the innate delay. Interestingly this means that it would be more tactically sound to give charmed pets slower weapons so they pose less of a risk when charm breaks if you need to give them weapons to enable dual wield. |
All times are GMT -4. The time now is 06:25 PM. |
Powered by vBulletin®, Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.