Go Back   EQEmulator Home > EQEmulator Forums > Development > Development::Development

Development::Development Forum for development topics and for those interested in EQEMu development. (Not a support forum)

Reply
 
Thread Tools Display Modes
  #1  
Old 09-05-2008, 08:52 PM
Leere
Sarnak
 
Join Date: Sep 2008
Location: Home
Posts: 31
Default Combat System Notes

A collection of what is known about how it works on Live.

The primary aim is, to collect in one place all (or at least most) of the known aspects of the EQ combat system seen on Live. The last time I looked in detail, most of the things weren't exactly implemented yet, or were... well, a bit wrong. (Shielding being one good example.)

I apologize in advance for the somewhat long-winded format, and any errors that might have slipped into this. Corrections are more than welcome.


Mob Damage

First, let's start with NPC -> PC damage. The info below is based primarily on various class boards, and memories of lots of getting beat on by mobs. (A hill giant hits you for ... -- Oh, look what pretty birdies...)

At it's heart, a mob can hit for 20 discrete values. These are based on two input parameters (let's call them DB, for damage base or bonus, and DI, for damage interval).

dmg = DB + [1-20] * DI

The above would be a simple representation of that as a formula. Just where in the [1-20] interval you land depends on how your mitigation AC compares to the attack value of the mob, and of course the RNG. (More on why I'm calling it mitigation AC below.)

A min hit would be: DB + 1*DI
A max hit: DB + 20*DI

To make the above seem more real, an example.

If the mob info I have is right, a Tacvi mob would have something like DB = 1000 and DI = 200. That would mean a min hit of 1200 and a max hit of 5000, with the rest falling between those two values.

A bog standard level 37 hill giant would have DB = 33 and DI = 3.2. (Yes, DI doesn't have to be a whole number. It also isn't going to be what EQ uses directly, or what should be used by the emu.)

To expand on the DI usage thing, DI10 (10*DI) is my best guess for what is actually used. This would be the equivalent of the DMG value of a player weapon. A player just doesn't have the hard cap of 2*DMG, that a mob has. (Yes, that one quote the EQ Devs made at some point, about how players hit harder than mobs, actually seems to be accurate. Of course, no player is walking around with a 2000 dmg weapon, like that Tacvi mob above, so...)

With a basic combat formula for mob damage establish, on to two concepts central to tanking, shielding and defensive (the disc).


Shielding

In short, shielding is a percentage reduction of DB in the combat formula, up to a cap of 35%. (So, in the above example, with 30% shielding DB would be 700 for the dmg calculation, instead of 1000.) It doesn't do a thing about the DI portion of the damage.


Defensive

This affects the DI portion of the dmg formula. The mechanism for it is actually pretty much identical for the innate 5% bonus warriors have, how Stonestance (the Monk discipline) works, and of course Defensive. The only thing that differs is stacking and the percentage involved.

Anyway, Defensive works by multiplying DI by 50%. (Going back to our Tacvi test dummy from above, DI would be 100 suddenly, instead of 200, leading to a new max hit of 3000, instead of 5000.)

Implementation wise, I'd suggest something like setting the value to how much dmg is meant to still be done, while under any of these mitigation effects. No reason to throw an extra substraction into the workload for the server. (So, 100% for non-warriors, 95% for warriors, and so on...)

[1-20] * DI * mitigation%

Given that that whole portion of the formula is all multiplications, it doesn't really matter if Defensive is meant to slash down the [1-20] or the DI part, the end result is identical. (To simplify the PvP headache, just go with the DI, which can get applied to player weapons more or less directly.)

I can't really find a definitive answer if the innate defensive bonus of warriors stacks with Defensive or not.


Shielding and Defensive, yes, they stack. So, let's expand our dmg formula.

dmg = DB * (100% - shielding%) + [1-20] * DI * Def%


Fun observations about mob design, that arise out of this formula, and just what defensive does.

- If you want to minimize the impact of Defensive, give the mob a high DB, with a compartively low DI.
- Shielding can be very powerful (several hundreds worth of damage mitigated per hit).
- For a while, DB seems to have been what was used directly for bash and kick dmg of mobs. (This has changed a bit, with some kind of variable entering into it a couple of expansions back, but back during classic, that hill giant would indeed bash for 33.)


Dmg spread

Or just when you learnt to hate Gauss-curves...

In all seriousness. When you look at a graphical hit probabiliy distribution for DI, it never is evenly spread. You usually have spikes at DI1 and DI20, with a soft curving for the values in between.

Whether or not the DI1 or the DI20 spike is bigger, depends on how your AC compares to the mobs attack. My limited attempts at replicating this effect have lead me to a Gauss-curve, that is used to map a map a straight random into a weighted number, which is then used to genertate the [1-20] pick.

Where you start on the curve is dictated by the AC - ATK comparison.

Given the earlier observations about how mob dmg relates to player dmg, if you keep the translation of the weighted random variable (fixed divisor for mobs, a sliding 'damage table' for players), you can even use the same code for player and mob damage.

I realize that this section is rather lacking, but for the most part it also seems to be the least understood area, simply due to how hard it is to accurately test.


Hit steps

The order of checks for each hit.
Block, Dodge, Parry and Riposte are all subject to a strikethrough check as well.

1. Check Block
2. Check Parry
3. Check Riposte
4. Check Dodge
5. Check Shield Block
6. Check Avoidance (hit roll)


Mod 2s

The group of item stats that were introduced with PoP.

Shielding: Caps at 35%
DoT Shielding: Caps at 35%
Spell Shielding: Caps at 35%
Attack: Caps at 250. (300 with AA, not sure if this has been raised since.)
Avoidance: Caps at 100
Accuracy: Increase hit chance. Caps at 150
Damage Shield: Increase DS from spells. There has to be some kind of DS coming from an effect, for this to do anything. Caps at ?
Strikethrough: Chance to ignore a dodge/parry/block/riposte roll, and just hit the target anyway. Caps at 35%
Stunresist: Caps at 35%
Combat Effects: Increase the chance to get a proc from a weapon. Caps at 100


AC and Shield use

The AC that is displayed by the client is pretty much meaningless, since it's a combination of the avoidance and mitigation aspects.

Mitigation is all about the AC on items. Only those matter. But, it of course doesn't end there. To further complicate matters, there is a soft-cap for mitigation AC. This cap is dependant on both class and level, and it's frighteningly low.

AC over the cap is subject to a modifier. This modifier is something like .45 for warriors, and close to that for the other tanks. Casters are the lowest on the totem pole, getting something like 1:20.

Shields are the odd-man out for this whole thing. For everything else, all item AC is added together, the part that is over the softcap is divided by the modifier, and then added to the cap-AC. This is your active mitigation AC. Shields raise the soft-cap, or in other words are always counted in full.

The Combat Stability AA raises the softcap. That is all that it does. So, someone who isn't wearing any armor, or isn't even managing to reach the base cap, isn't going to get any benefit from the AA. (To be fair, with soft-caps in the low hundreds, it's very hard not to reach that, with any kind of decent armor.)

Exact numbers for soft-caps are in rather short supply, though I might just have missed them in my searches. The exact modifiers for the over-cap AC is also guess-work at best, with only a rough order being found. (In general, plate>chain>leather>silk, with casters of all sorts falling below the melee types. Clerics and Bards being the oddballs, by actually being somewhat close to the tanks they share their armor archetype with. Druids are the worst of the non-silk classes. And the silk-classes are just screwed.)


And on that note, I'll end this installment. I hope the presented information wasn't too confusing in it's layout, and that it might actually help to improve the emu. I'll add other things to this as they are found, or are needed.
Reply With Quote
  #2  
Old 09-05-2008, 09:34 PM
Rogean's Avatar
Rogean
Administrator
 
Join Date: Jul 2003
Location: Massachusetts
Posts: 708
Default

Ton of good information here. I looked at a lot of that stuff a while ago (A lot of that is available on the shaman website.. samanna's or something? I forget). And I looked at implimenting some of it. The problem is that the combat code in eqemu was written a long time ago with tons of hack fixes and additions here and there.. it really is a mess.. We don't even use a real attack to AC formula (last I saw it was just /random between min hit and max hit), also the aggro code is majorly wrong in eqemu. Just lots of stuff that needs to be re-done but its so imbedded that it would be rough. I'm not an expert in C++ Compared to some of the other devs so I wouldn't even know how to start with an overhaul like that.
__________________
EQEmulator Developer / Administrator
Reply With Quote
  #3  
Old 09-05-2008, 09:59 PM
ChaosSlayer
Demi-God
 
Join Date: May 2007
Posts: 1,032
Default

I just want to insert my 2 copper:

do not try to copy original EQ combat formulas to the letter.

First reason- you will never get them exactly as LIVE unless EQ devs will post the whole thing (not to mention they prabobly ALWAYS change something with every patch in a process of never ending tunign up)

Second reason - work out a solid and intelegent YOUR OWN combat model for Emu and stick to it - will do you MUCH more good in the long run
Reply With Quote
  #4  
Old 09-06-2008, 03:11 AM
KLS
Administrator
 
Join Date: Sep 2006
Posts: 1,348
Default

I actually rewrote much of the combat code to include a lot of this a little while back. That said, you can't really copy it to the letter because that's impossible, sony doesn't give us any information to create a baseline to measure how these mechanics work further than the base.

We know the basics of the system but can only guess on how to implement the specifics of it. I spent a long time trying different things before I settled on AC code that I thought was acceptable, not perfect but I think it's going to be as close as I'm going to get right now.
Reply With Quote
  #5  
Old 09-06-2008, 02:41 PM
Leere
Sarnak
 
Join Date: Sep 2008
Location: Home
Posts: 31
Default

It seems that the paragraph about missing or 'wrongly' implemented features was ill-chosen. I apologize for that, it wasn't intended as a critique of the existing code. My main motivation for posting came from a thread about shielding, and how it was obliterating all mob damage. I didn't just want to bump that old thread though, and so instead gathered some other information, that seemed to apply to existing combat code pieces. And to keep the thread helpful beyond that small issue, the bigger focus of the whole combat system was chosen. I probably should have communicated that intention better. Bleh, the internet and context, always making it hard to have it come across right. x_x

None of what I posted was really meant as a 'do it this way, because that is how it is on live.' Rather, it was meant as a comparison to what live has, and by extension what we might easily (or not so easily) incorporate into the server code.

ChaosSlayer makes a good point about having our own combat system, and, as KLS noted as well, replicating SOE's implementation is pretty much impossible anyway. The existing re-write was actually what got me to finally play around with an implementation of the combat as is. (With the whole Shielding issue getting me to look up the relevant code pieces in the existing source.)

Sadly, my understanding of the relevant code-paths isn't in depth enough, to offer more than the mechanics I did. The fuzzy vision I have, of simplifying the combat routine, and having one piece handle abstract combat between two entities, is a rather far-reaching change, that a) seems to demean the great work already done, and b) looks to be a minor nightmare to properly debug, anyway.

In the meantime, I'm hopeful that any of the information I posted, or post is at all helpful, but if it isn't, I'm not going to be upset.


Oh, and since it was mentioned, some fun tidbits about aggro. I have no idea if any of this is already in use by the existing code, or if it would even help, but in keeping with the overall purpose of the thread...

Aggro

The basic hate of a weapon attack is based upon its damage (the stat), and the fact that you tried to bean the mob with it. You can miss, you can crit for a million points, or land a minor hit; the hate you get is going to be identical. (At least, if the warrior and shadowknight boards haven't been lying to me. ;) -- Though, in all seriousness, that jives with what I remember from playing. Perhaps not the best endorsement, but keeping the code simple should minimize headaches.)

Likewise, the hate from a spell cast is also based upon its base damage, and not if you crit or not. (That is, this applies to damage effects. There are a number of effects that mobs hate with a passion, snare, stun, fear, slow and charm leading that list.)

Heals are handled pretty much identical, the base amount is used for aggro purposes, with no regards to actual health healed. (With regards to group heals, it seems to matter how many people are actually hit by the heal.) Given how efficient heals are, and that EQ isn't filled with clerics getting swarmed at their first cast, the base value is probably divided by some factor.

Bard songs were stated as being pretty uniformly 1 hate.

Runes seem to be treated as somewhat akin to a heal, but without the modifier, making them some of the biggest aggro around. (And part of the reason why rune procs make for great AE aggro procs, without actually doing AE damage.) Likewise, the good old Wizard Epic 1.0 was a very big aggro magnet back in the day, and since it has a rune effect, this again speaks for the high hate value on these.

Taunt, on a successful one, you are meant to end up at the top of the hate-list. (Highest hate value + 1) There was some testing done that has thrown some doubt on the instant highest +1 part (four successful taunts necessary, to get aggro from a target that has stopped attacking, but otherwise pissed off the mob big time), but what it certainly doesn't do, is add any appreciable hate when you are already at the top of the hate-list. So, the taunt smashing school of tanking isn't exactly doing any good. (Murky info at best, I know, but the idea is to pick and chose ideas that might help the emu, not a laundry list of 'do this.')


Resists and aggro. In general, this goes along the same lines as a weapon swing. The mob hates you for even trying, no matter that it didn't work. With immunities I have conflicting data. I know that stuns will give the same hate value (and it's a big one) as they do when they land, fears are also treated the same way (hybrids were using fear for aggro for a good while, due to the high hate, low cast time, and mobs 55+ being immune), but I don't know about snare and mobs that a immune.

Simplicity would suggest that snare is capable of pissing off the mobs immune to run-speed changes, but I just can't really remember it happening that much. (*shrugs* I probably didn't try enough, and the simplicity of not needing to special case the code, speaks for it working the same as everything else.)


Rooted mobs and proximity

Whatever is closest to a rooted mob is attacked. The actual hate a mob holds for the targets doesn't matter, when they are rooted.

Pets and their aggro

In groups with more than 3 players, a pet is just plain incapable of getting aggro. (This was a change to nerf charm tanking, since around the PoP area charmed pets were just insane DPS.) For the smaller groups, proximity is still key. A mob will only attack a pet if it is the closest target to it. (So, much as if root was in play, only that the mob does this all the time.)


Snare and movement speed

Not directly aggro, but it plays into it, with regards to things like mobs running away at low health, feign splitting and so on.

Why mobs stop and just stand there: Much like players, mobs, when they get low health, are no longer capable of running. The only real alternative to run is walking. Walking is simulated by setting down the movement speed to 50% (or thereabouts). A snare effect isn't a percentage of your current movement speed, but rather is directly substracted from it. (So, the mob trying to walk away is further slowed down by the effect of the snare, landing it at 0% movement speed. It's still trying to run, but just not getting anywhere.)

This isn't exactly smart on the part of the mob, since it's just standing there, and this could be something improved by the emu, by either applying the the snare proportionately (another multiplication, or rather multiplication and division, since EQ seems to primarily use pure int math), or just letting the mob recognize that it isn't getting anywhere.

And this is probably all part of the emu already anyway, and I'm just telling you what you already know and do.

For completeness sake, why feign splitting works wonders with snare: In short, it comes down to the mobs walking back to their spawn-points. Much like with the running mob, the snare pushes down the walk speed of the mob in question to 0%, effectively rooting it. It can still move while in aggro mode, and is thus running, but the return mode is walking.


This isn't the be all, end all of aggro, and probably both full of holes, missing info, as well as already implemented in parts, but I hope it was still at least helpful as a reference checklist of what all the emu can already do. :)

PS: Yes, you are right, Rogean, a good part is available on the Shaman site. http://crucible.samanna.net/ The shadowknight, warrior, enchanter and mage forums also provided some aspects. I didn't just want to copy and paste those sources though, which is why I focused on the parts that seemed to be directly applicable, with some interpretation and personal experiences/anecdotes as well.
Reply With Quote
  #6  
Old 09-06-2008, 04:46 PM
Rogean's Avatar
Rogean
Administrator
 
Join Date: Jul 2003
Location: Massachusetts
Posts: 708
Default

I know a lot about these systems from playing eqlive myself and trust me, if it was easy to impliment these formulas into eqemu it would be done. The problem isn't getting the information, the problem is finding the time and talent to overhaul systems like combat, defense, aggro, etc.
__________________
EQEmulator Developer / Administrator
Reply With Quote
  #7  
Old 09-06-2008, 07:43 PM
KLS
Administrator
 
Join Date: Sep 2006
Posts: 1,348
Default

Well the AC system I put in a few months back follows the DB + DI rules... mostly... Shielding and spell defensive is a little off, you can blame the people that complained every time I tried to fix it for that though; im tired of hearing that so I found a happy medium until I can go back and fix it in full. Softcaps and class bonuses aren't calculated yet either.

Aggro should be fine for the most part I changed it to be based off of potential damage before modifiers instead of actual damage caused which is what it used to be. It will also take into account proximity, is a pet, sitting, lowhp, etc. There's some issue with invuln but I consider it low priority atm.

I think the problem with snare and walking mobs is just the order in which things are calculated; with walk being calculated last instead of first.

In terms of combat checks we check to-hit first, a simple hit miss check. Then using a single table roll we check Riposte, Dodge, Parry, Block. It's done on a single combat table instead of sep. ones so one stat isn't more effective than the others just by being calculated first, but I'm unsure if that's how it should work.

Shield related stuff isn't implemented yet, they basically just add to your AC atm. Since there are no softcaps to bypass it can't really do that. Back when I played shields really didn't do much.
Reply With Quote
  #8  
Old 09-06-2008, 10:00 PM
ChaosSlayer
Demi-God
 
Join Date: May 2007
Posts: 1,032
Default

while on the topic.

KLS could you tell excatly HOW "to hit" is calculated? whats taken into account? any class based hard caps?

another thing - do we have a HARD stat/hp/mana/ac cap? (I realy hope not) =)

thanks
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

   

All times are GMT -4. The time now is 02:04 AM.


 

Everquest is a registered trademark of Daybreak Game Company LLC.
EQEmulator is not associated or affiliated in any way with Daybreak Game Company LLC.
Except where otherwise noted, this site is licensed under a Creative Commons License.
       
Powered by vBulletin®, Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Template by Bluepearl Design and vBulletin Templates - Ver3.3