Project 1999

Go Back   Project 1999 > Class Discussions > Tanks

Reply
 
Thread Tools Display Modes
  #71  
Old 09-15-2025, 02:31 PM
shovelquest shovelquest is online now
Planar Protector

shovelquest's Avatar

Join Date: Oct 2019
Posts: 3,857
Default

Quote:
Originally Posted by DeathsSilkyMist [You must be logged in to view images. Log in or Register.]
If your friend hasn't played Everquest before, it may be a bit difficult for him to navigate the EQEMU code, as it has code for features that go past Velious. He will need to know that he must disregard code for AA's, Bane Damage, etc. The links I will post below go to the EQEMU github repo. Your friend should be familiar with how to use github.

From my understanding of hate generation, the weapon damage is acquired here:

https://github.com/EQEmu/Server/blob...tack.cpp#L1648

And the damage bonus for your main hand (if applicable) is acquired here:

https://github.com/EQEmu/Server/blob...tack.cpp#L1689

Both are basically just added together and applied to the hate value, which gets added to the hate list here:

https://github.com/EQEmu/Server/blob...tack.cpp#L1736

The formulas are built into the functions, and again they often have code that isn't used in P99. You can link your friend to my damage calculator as well, which condenses a lot of the EQEMU code into simpler formulas specific to P99, but I haven't added hate generation or bow formulas yet. Your friend would need to look through the EQEMU code to find the bow stuff.

https://drive.google.com/file/d/114b...ew?usp=sharing
I pasted these (10s of thousands lines of code, wow!!) into Chatgpt and asked it what the code does.

Amazing on all accounts.

FWIW i left out the //comments.. so that it could only look at the code and try to parse it, not what you said it is! Wild.

Quote:
Short version: this is the melee-combat core for EQEmu. It decides what swing animation to play, which skill is used, whether the swing connects, how much damage it does after armor and bonuses, how much hate it generates, and what happens on death. It also houses all the class/level softcaps and heroic-stat hooks that shape avoidance, mitigation, and damage bonuses.

A typical swing goes like this. Mob::Attack picks the weapon and the correct animation (AttackAnimation) and figures out the base weapon damage against the target (GetWeaponDamage), including checks for magical/bane requirements, elemental add-damage, recommended level scaling, and hand-to-hand fallbacks. It adds damage bonus when appropriate (main-hand, 2H logic, off-hand with Sinister Strikes) and builds a DamageHitInfo with the used skill, offense value (offense()), and a to-hit value from GetTotalToHit, which layers in raw accuracy from skills, item/AA/spell accuracy mods, archery special handling, and auto-hit overrides.

DoAttack then runs the avoidance gauntlet via AvoidDamage in live order: riposte → block (including from behind if granted) → parry → dodge → shield block/two-hand-blunt block, with heroic strikethrough reducing those chances, AA/spell/item “10000” autoprocs forcing success, and positional checks (must be in front for parry, etc.). If the swing isn’t avoided—or is forced through by Strike Through—it rolls the actual hit chance with CheckHitChance: attacker accuracy vs defender avoidance (both turned into opposed random rolls), with ties coin-flipped.

If it’s a hit, damage is mitigated in MeleeMitigation. That uses the defender’s mitigation AC (GetMitigationAC feeding from ACSum) and the attacker’s offense in a D20-style roll (RollD20) that maps to a 0.1–2.0 multiplier on base damage, with optional armor-penetration and level-difference bonuses. The result is clamped and logged, then applied to the defender. Damage shields and reverse damage shields are applied in DamageShield. Hate is added every swing (AddToHateList) using subtlety/hatemod reductions, pet/owner mirroring, tunnel vision, and initial aggro bonuses, plus guard-assist behavior in PvP.

The big stat math is split out. compute_tohit and GetTotalToHit build attacker accuracy from offense/skill, intoxication/berserk tweaks, item/AA/spell accuracy and hit-chance effects, and archery penalties. compute_defense and GetTotalDefense build defender avoidance from defense skill, AGI (or heroic AGI), item mod2s, AA/spell avoidance, and intoxication. AC is aggregated in ACSum with item AC, shield AC, class/race bonuses (monk weight rules, rogue/beastlord AGI bumps, iksar racial), defense-skill contributions, spell/AA AC, softcap per class/level (GetACSoftcap) and softcap returns (GetSoftcapReturns) so anything over cap has diminished effect. Hand-to-hand damage and delay have both “revamp” and legacy tables. Weapon damage bonus (GetWeaponDamageBonus) follows live-like 1H/2H and delay-based formulas, with an alternate off-hand formula option.

There’s a lot of special-case game feel in here: dual-wield animation chance when delays match, stun chance when an NPC smacks a moving client from behind, PvP damage reductions (archery/throwing vs melee), low-level damage caps by class (DoDamageCaps), and a long list of immunities (melee immunity, magic-only, bane-only). On death (Client:[You must be logged in to view images. Log in or Register.]eath / NPC:[You must be logged in to view images. Log in or Register.]eath) it sends the packets, does exp loss and corpse creation, splits exp to group/raid, fires quest hooks, logs player events, and handles loot/rename logic and adventure counters.

If you want, I can trace a single swing end-to-end with your class, level, stats, weapon, and target to show exactly which numbers and rules fire.
__________________
I am a highly open and reflective and conscientious individual with moderate to low agreeableness and a moderate level of emotional reactivity/sensitivity.
Reply With Quote
  #72  
Old 09-15-2025, 02:40 PM
DeathsSilkyMist DeathsSilkyMist is offline
Planar Protector

DeathsSilkyMist's Avatar

Join Date: Jan 2014
Posts: 7,923
Default

Quote:
Originally Posted by shovelquest [You must be logged in to view images. Log in or Register.]
I pasted these (10s of thousands lines of code, wow!!) into Chatgpt and asked it what the code does.

Amazing on all accounts.

FWIW i left out the //comments.. so that it could only look at the code and try to parse it, not what you said it is! Wild.
Yeah AI can be good when it comes to summarizing code. It isn't 100% accurate, so you typically need to go over the summary and confirm whether or not it has hallucinated in some areas.

I like that AI called skills like riposte "the avoidance gauntlet" lol.

10k lines of code isn't too much either. Modern game engines have millions of lines of code in them.
Reply With Quote
  #73  
Old 09-15-2025, 02:46 PM
shovelquest shovelquest is online now
Planar Protector

shovelquest's Avatar

Join Date: Oct 2019
Posts: 3,857
Default

Yeah. I still can't believe that i can give it 10k lines of code and it will be able to tell me anything discernable from it.

Cool stuff DSM, as usual.
__________________
I am a highly open and reflective and conscientious individual with moderate to low agreeableness and a moderate level of emotional reactivity/sensitivity.
Reply With Quote
  #74  
Old 09-15-2025, 02:55 PM
sammoHung sammoHung is offline
Aviak


Join Date: Jun 2023
Posts: 89
Default

Quote:
Originally Posted by DeathsSilkyMist [You must be logged in to view images. Log in or Register.]
1H weapons tend to be more consistent DPS-wise, while 2H weapons tend to be more variable. That is one reason why 1H weapon parses can seem quite similar (or better) than 2H parses. This is especially true when the difference in average DPS between the two weapon sets isn't large. The average DPS difference between Frostwrath and Flamberge is only about 8%.
Yah, the consistency is what I'm after, heh. It's a long grind to 60.

I wonder how critical hits change this, or if any people with extensive warrior knowledge can piggyback on your sentiment.

Critical / Crippling blows with a 2-hander are quite absurd. 600+ crippling blows with a Reaver - but it's not consistent.
Reply With Quote
  #75  
Old 09-15-2025, 03:13 PM
DeathsSilkyMist DeathsSilkyMist is offline
Planar Protector

DeathsSilkyMist's Avatar

Join Date: Jan 2014
Posts: 7,923
Default

Quote:
Originally Posted by sammoHung [You must be logged in to view images. Log in or Register.]
Yah, the consistency is what I'm after, heh. It's a long grind to 60.

I wonder how critical hits change this, or if any people with extensive warrior knowledge can piggyback on your sentiment.

Critical / Crippling blows with a 2-hander are quite absurd. 600+ crippling blows with a Reaver - but it's not consistent.
I put in the critical / crippling blow formula into my DPS calculator recently. Haven't done extensive testing against P99, but here are the results.

This example is a 60 Warrior with 255 STR, 100% Haste, and 100 ATK fighting a level 60 mob while berserking:

1. Horn of Hsagra + Blade of Carnage - Horn did 50,000 damage total. 3000 of that damage was Crippling Blows. Blade did 29,000 damage. 2500 of that damage was Crippling Blows. So 5500 Crippling Blow damage / 79,000 total damage = ~7% of your damage comes from Crippling Blows.

2. Reaver - 166,000 damage total. 13,600 of that damage was from Crippling Blows. So 13600 Crippling Blow Damage / 166000 total damage = ~8% of your damage comes from crippling blows.

RNG plays a factor on a per parse basis. But after doing the caluclations a few times, it looks like the percentage of Crippling Blow damage between 1H weapons and 2H weapons is similar on paper. Those 600+ damage hits do feel great though!
Last edited by DeathsSilkyMist; 09-15-2025 at 03:15 PM..
Reply With Quote
  #76  
Old 09-15-2025, 03:26 PM
Jimjam Jimjam is offline
Planar Protector


Join Date: Jul 2013
Posts: 12,543
Default

Quote:
Originally Posted by sammoHung [You must be logged in to view images. Log in or Register.]
Yah, the consistency is what I'm after, heh. It's a long grind to 60.

I wonder how critical hits change this, or if any people with extensive warrior knowledge can piggyback on your sentiment.

Critical / Crippling blows with a 2-hander are quite absurd. 600+ crippling blows with a Reaver - but it's not consistent.
2handed
You don’t miss them when they don’t happen since they are rare, but you appreciate them when they do.

Vs

2hands
They happen often enough and small enough you just can accept them as part of the base dps rate.

An underdiscussed advantage of dw a fast pair is that at low hp they can spit out a bunch of crip blows, which can stun opponents thus reducing incoming dps or even letting you attack from rear fora while.
Reply With Quote
  #77  
Old 09-15-2025, 03:44 PM
DeathsSilkyMist DeathsSilkyMist is offline
Planar Protector

DeathsSilkyMist's Avatar

Join Date: Jan 2014
Posts: 7,923
Default

Quote:
Originally Posted by Jimjam [You must be logged in to view images. Log in or Register.]
An underdiscussed advantage of dw a fast pair is that at low hp they can spit out a bunch of crip blows, which can stun opponents thus reducing incoming dps or even letting you attack from rear fora while.
That is pretty cool! I always forget about the stun component. All of my monks weapons have stun procs, so i can see the appeal for sure.
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 01:29 AM.


Everquest is a registered trademark of Daybreak Game Company LLC.
Project 1999 is not associated or affiliated in any way with Daybreak Game Company LLC.
Powered by vBulletin®
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.