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-23-2008, 07:02 AM
trevius's Avatar
trevius
Developer
 
Join Date: Aug 2006
Location: USA
Posts: 5,946
Default

if you wanted to add a rule in for damage bonuses, all you should have to do is add:

In attack.cpp
Code:
if(RuleB(Combat, UseDamageBonus)){

}
So that it encompasses your damage bonus calculations completely.

Then, just add it to the ruletypes.h file like this:

Code:
RULE_BOOL ( Combat, UseDamageBonus, true) //default is true to enable damage bonuses
into the combat section of the file.

Then just add the optional SQL if you want to disable it. But you don't even need the SQL if you want to leave it enabled, since the default is true:

Optional SQL:
Code:
Insert into rule_values values (0, 'Combat:UseDamageBonus', true);
__________________
Trevazar/Trevius Owner of: Storm Haven
Everquest Emulator FAQ (Frequently Asked Questions) - Read It!
Reply With Quote
  #2  
Old 09-23-2008, 08:30 AM
trevius's Avatar
trevius
Developer
 
Join Date: Aug 2006
Location: USA
Posts: 5,946
Default

Oh and I got the latest submission in this thread compiled and tested on my server. It looks good to me! Definitely better than the current code in the emulator lol.
__________________
Trevazar/Trevius Owner of: Storm Haven
Everquest Emulator FAQ (Frequently Asked Questions) - Read It!
Reply With Quote
  #3  
Old 09-23-2008, 10:45 AM
ChaosSlayer
Demi-God
 
Join Date: May 2007
Posts: 1,032
Default

very good Trev! I hope it makes in with the Rule you described
Reply With Quote
  #4  
Old 09-23-2008, 11:35 AM
Cantus
Fire Beetle
 
Join Date: Sep 2008
Location: New York
Posts: 18
Default

Quote:
Originally Posted by ChaosSlayer View Post
very good Trev! I hope it makes in with the Rule you described
Heya, Chaos and Trev!

ChaosSlayer's suggestion of a flag to allow server administrators to turn damage bonuses on and off is already in the code I posted above. It is not implemented as a standard type of rule as Trevius suggests, but there's a reason for that. Please let me explain, but first, here's the code snippet that mentions the change:

Code:
#ifndef EQEMU_NO_WEAPON_DAMAGE_BONUS

// If you include the preprocessor directive "#define EQEMU_NO_WEAPON_DAMAGE_BONUS", that indicates that you do not
// want damage bonuses added to weapon damage at all. This feature was requested by ChaosSlayer on the EQEmu Forums.
//
// This is not recommended for normal usage, as the damage bonus represents a non-trivial component of the DPS output
// of weapons wielded by higher-level melee characters (especially for two-handed weapons).
All you'd have to do to disable Damage Bonuses, Chaos, is include the line ""#define EQEMU_NO_WEAPON_DAMAGE_BONUS" anywhere in a file that gets parsed before Attack.cpp (or even at the top of Attack.cpp), and damage bonuses will never apply on your server. If you want to enable them in the future, just remove that line and re-compile.


While I understand ChaosSlayer's points that it would be nice to try things out without damage bonuses, and rely entirely upon the native damage/delay of the weapon, the fact is that most servers are not going to choose to disable damage bonuses.

If we implemented the check for whether or not the server administrator wants damage bonuses at runtime, using the standard Rule method that Trevius suggests, that means that every time a melee toon lands a hit with a 2H weapon, there's the extra overhead of calling that Rule function.

I know, that doesn't seem like a big deal. But keep in mind that if someone Rampages with an Earthshaker, this code could potentially be called hundreds of times in a split second, for example. Or if someone pops a riposte discipline like Furious or Whirlwind with lots of mobs hitting them. Or if a lot of toons are raiding a mob, and they're landing many hits at once (double, triple, quad hits against the target). In all of these cases, this function will be called many times in rapid succession, so even a small difference -- like the function call overhead involved with checking a rule in the traditional way -- may become significant.

So, as this is one of the places where we want things to be as efficient as possible, I used a C/C++ preprocessor directive to allow folks like ChaosSlayer to turn on or off damage bonuses. It is not as slick as Trev's suggestion, as it must be done by adding a line of code and then re-compiling the server, vs. making a database change during runtime, but I still think it's in everyone's best interests -- as it does not slow down processing by involving needless function call overhead every time a 2H weapon hits.

I may be wrong... that happens a lot! So if you prefer, feel free to make it a rule, or just ask me and I'll do it for you!
Reply With Quote
  #5  
Old 09-23-2008, 11:46 AM
Cantus
Fire Beetle
 
Join Date: Sep 2008
Location: New York
Posts: 18
Default

Quote:
Originally Posted by trevius View Post
Oh and I got the latest submission in this thread compiled and tested on my server. It looks good to me! Definitely better than the current code in the emulator lol.
That's great to hear, Trevius!

It may already be too late, as you've re-built your server using the new code. But if you still have an old build around on a test machine, it'd be neat to run a quick test to make sure things are working as expected.

What I'd recommend is either use your GM to twink a toon with a nice, slow 2H weapon like "A Weighted Axe", or just farm one in the Burning Woods. They drop commonly.

That's a perfect 2H weapon to test with, as its native ratio sucks, but due to its slow speed, it receives a massive damage bonus.

Fight a mob with it on a server compiled with the old code. Watch for the average and maximum hit (or just go all out and parse it).

Then re-build that server with the new damage bonus code. Attack a similar mob, and watch the damage output. It should be greatly increased if things are working well.
Reply With Quote
Reply

Thread Tools
Display Modes

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 10:35 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 - 2025, Jelsoft Enterprises Ltd.
Template by Bluepearl Design and vBulletin Templates - Ver3.3