PDA

View Full Version : Write-up on NPC Low-health fleeing mechanic


RangerDown
02-12-2005, 06:33 PM
Since fear pathing is in game, mob fleeing at low health may be put in soon. Per FNW's request, I am doing this write-up on how EQLive's flee mechanics work. I'm posting it publicly so that if you feel something I said is inaccurate, please point that out.

To summarize: when a mob gets below around 20-25% health, it will turn around and run. It will continue to try and run as if feared until it either dies or its health goes back up above the flee threshold. If its health gets back above 20% or whatever the threshold is, it will return to normal combat mode and pursue/attack the players again.

As you might have guessed, it's not always that simple 100% of the time :( Here's a couple of clarifications and exceptions to the rule that I've observed from eqlive:

First, the threshold for fleeing seems to vary a bit between 15 and 25 percent, and I suspect that the primary (probably the only) determining factors in this are the difference in level between the mob and its primary hate-list target, and the primary hate-list target's percent of health. It seems that if the mob is green, he almost religiously flees at 25 percent health, but when I'm fighting dark blue xp mobs they'll wait till 15 to 20 percent to flee.

The mob's target's HP comes into play because of the notorious "blood aggro" mechanic -- this mechanic means that if the mob's target goes below 20 percent health, that mob is gonna stay on that target and all the taunting in the world isn't gonna shake him until either the mob dies, the mob's target dies, or the mob's target gets healed back up to 20+ percent. This mechanic falls more under the category of aggro/hate AI than flee AI, and I'm betting it's not even in EQEmu. But in case the mechanic goes into some future version, it's important to note that if a mob has blood aggro on its primary target at the time it hits its flee threshold, it's not gonna flee until after blood aggro is lost.

Movement speed debuffs ("snare" and the like) don't change the fact that a mob will continue fleeing. Mobs (are supposed to) gradually run slower and slower after they get below 20 percent. When they get to within a sliver of their life, they will be running at approx. 40 percent of their normal run speed. If the mob has SoW or another run speed buff, this can offset his running slowly from being wounded, and the flip side is a snare slows him down even more. So yes, that means that if there's a snarer in the group, by the time the mob hits about 10% health, his speed's gone down to 0 and he's just letting the group get free hits on him. *ROOTS* however, will cause the mob to go back into combat mode until the root breaks. (This should be the case if the mob is feared by a spell too.)

While the mob is in flee mode, he does not attack. If he has riposte skill, though, he still has a chance to riposte melee attacks from any player trying to hit him from the front.

When running, if it passes some of its allies and those allies are high enough level to assist, they should assist. The group may or may not be anywhere near the fleeing mob when it runs past its ally; the ally should assist just the same and begin running to the player/group. This is the main reason flee mechanics were put into the game -- if you can't control your fleeing mob, you're likely to end up with one hell of a train. I've observed that if a mob has allies in the immediate vicinity at the time it reaches its flee threshold, it will not flee at that time. Should that situation change (all its buddies die, for example) then it may begin fleeing.

It is important to note that once a mob goes into flee mode, it should STAY in flee mode until it either dies or heals back up above the flee threshold -- even if it found buddies along its flee path who will assist. The allies assisting will immediately dispatch to take care of the problem, but the fleeing mob will continue running around until he heals. The paragraph above means that if there's buddies in the immediate vicinity, his flee flag will not turn on -- but once a mob's flee flag turns on, it's gonna stay on until healed or dead. Think of root as only superceding the flee flag -- the mob's flee flag is still on, but root is temporarily overriding it and making him go to combat mode. The second that root breaks, it's back to running for him.

And finally, not ALL mobs flee. There's a few that'll stay put and fight to the bitter end. A handful of undead come to mind -- especially the skellies that are level 10 but will still run up and pick a fight with every level 60 that passes :P This is totally unrelated to Unfearable, and even though only undead come to mind right now, I can also think of undead that DO flee so don't try to evaluate the bodytype. This may have to be resolved with another field in npc_types. The number of mobs that don't flee is so small that at this point if there are other pressing matters, don't concern yourself with this, but do keep that tidbit in mind.

mollymillions
02-12-2005, 07:54 PM
Are the .path files and fear_hints table available from anywhere.

[size=2]Regarding the fleeing mechanism, there was a time on Live, it may not be the case any more, that you could stand next to water and cast a spell on a mob that was in the water, but very close to the edge/surface, and it would flee almost immediately as it was impossible for it to attack the player (i used to stand on the wall on the docks in Erudin and do this and on occasions you could blast the sharks). This has no bearing on EQEmu as currently the water surfaces aren't included in the LOS maps so the mob will attack anyway - and when the water surfaces do get included in the LOS maps (-cant be too far off) the LOS code will disallow the spell and ensure that this situation doesn