View Single Post
  #16  
Old 09-25-2008, 07:18 PM
Cantus
Fire Beetle
 
Join Date: Sep 2008
Location: New York
Posts: 18
Default

Quote:
Originally Posted by ChaosSlayer View Post
I probably asking too much. but imho the combat engine would have been if it was writen to mimic eq2 model rather than eq1.
Trevius and Chaos have some awesome ideas.

Maybe I'm just "corrupted" by happily playing for so long on PEQ The Grand Creation (a server that strives to be as legit and Live-like as possible), but I tend to think that the primary goal of the EQEmu engine should be to duplicate Live's way of doing things as much as possible... even if we occasionally think that Live's way of doing things isn't the best way!

But I absolutely agree with ChaosSlayer, and folks like him, that we shouldn't ignore the desires of folks who would have a blast playing on highly customized servers!


I know I’ve only recently started contributing and participating on these forums, so it may not be my place to voice my opinion. But I can’t help thinking that we shouldn't clog up the current combat functions with a lot of rule checks. As Derision pointed out, there's little overhead in each check... but adding a buttload of these checks, and the conditionals they're embedded in, may actually start making a difference in server speed (considering that these functions are invoked each time a melee hit is made... which is frequent!)

Also, it'd make the combat code fairly difficult to understand and maintain.


Here's a possibility: Make a copy of the combat code (for example, copy Attack.cpp and make CustomAttack.cpp). Add "Custom_" before the function names in these new files. And then have a single rule check where either the "Legit" or the "Custom" version of the attack functions are called for each hit.

For speed, we'd create a single static variable that’s a pointer to a function. We’d set it to point to either the “Legit” or the “Custom” attack functions based on a master rule read either at zone load-time, or when rules are manually re-loaded. Then when a hit occurs, we simply use the () operator on this variable to invoke the selected version!

If it points to the "Custom" functions, then a ton of other rules are queried to allow the custom server administrator quite a bit of control over how combat is carried out. If none of these rules are set, "Custom" will operate just like "Legit" (just a bit slower due to all of the rule checks sprinkled throughout it).

On the plus side, it allows the “Legit” code that will be used in most cases to remain lean and mean, so that it runs fast and is easily comprehended and maintained.

But it also gives custom versions of these functions that are extremely customizable by non-coders.

The downside is that any changes to attack handling in the “Legit” versions probably would have to be mirrored over to the “Custom” versions of the functions.

I’d suggest that the highest priority right now probably should be to make sure that the current functions work as well as possible, and are as close to Live as we can make them. Once that’s accomplished, we have the perfect opportunity to duplicate them and add all kinds of customizability!
Reply With Quote