Quote:
Originally Posted by ChaosSlayer
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!