View Single Post
  #28  
Old 09-24-2008, 10:43 AM
Cantus
Fire Beetle
 
Join Date: Sep 2008
Location: New York
Posts: 18
Default

Derision,

Excellent information there. I apologize that I don't have the code in front of me... are the rule-checking functions inline? In other words, does the ASM that you posted also take into account function call overhead, unwinding the stack, etc. that would result from invoking a non-inline function?

Either way, I think you're right: The performance hit for implementing a rule is trivial. Though your point that the rule is queried from the DB only when a zone first boots is important for folks like ChaosSlayer to remember. If you toggle Damage Bonuses on or off in the DB, you'll have to reboot the zone for it to take effect.



Trevius,

Excellent points, as always! I think the info that Derision provided shows that adding in a rule adds only a tiny amount of overhead to the code, so let's go that route. I'll make the addition of that rule when I also add the code to continue ramping up Damage Bonus for levels 81+. Hopefully should have that posted in a day or two (work's been killing me this week -- very little free time. Sorry.)

You make another excellent point here. I may be able to put your fears to rest:

Quote:
Originally Posted by trevius View Post
it would be nice if there was a way to store that weapon bonus calculation and use it over and over instead of having to calculate it with every swing. I know for sure on my server that even before this change, anyone rampaging more than like 20 mobs is risking a zone crash. I haven't had feedback on the new code yet to see if it still causes that
That was a big concern for me, too. So I ran some tests. There's no problem at all. In fact, storing damage bonuses in an associative array along with character and/or weapon name would be MUCH slower and more complicated than just looking them up for each hit. At that point, you may as well go with a full-size, brute-force lookup table. Lookup tables are great and fast, but only if they're relatively small and cacheable.

Here is some data from a test I ran, as posted to our guild messageboard:

Quote:
I was worried about whether this function would slow down the server when, for example, a Warrior Shakerpages (uses an Earthshaker, which is a 2H weapon, along with Rampage to simultaneously hit a large number of mobs around him/her). So I ran a test.

On a Pentium II 450 MHz with 256 MB of RAM (the worst computer I have available), it takes:

227 milliseconds (0.227 seconds) to call the function 12,231,000 times. That's twelve million times.

That means that 122,310 Warriors could Rampage on 100 mobs each at precisely the same moment and only delay a server running on fifteen year old hardware for less than a quarter of a second.

At its peak, there were 430,000 subscriptions to Live EQ. Note that not all of those people who had an account were logged on at once. And they were certainly not all logged onto the same server. So we're never going to have anywhere close to 122,310 people logged on to the same EQEmu server at the same time.

Not to mention that there aren't 12 million mobs available across all of the zones in EQ to Shakerpage. And there aren't enough Earthshakers to be distributed to those 122,310 warriors.

Long story short: The function is smokin' fast. If anyone tells us that they don't like the fact that it uses some lookup tables, well, they're kinda showing their ignorance .
I can assure you that there is no problem with this function, and no added risk of server crash or latency. The Damage Bonus solution as posted in this thread is very stable and fast, and should have no noticible impact on a server (other than making players who like 2H weapons happy!)


One last point you made:

Quote:
Originally Posted by trevius View Post
not many people use 2H weapons on my server due to them sucking in the first place. I don't think it is only damage bonus that is messed up with 2H weapons. I think there seems to be some weird damage capping going on as well which makes them almost pointless.
Damage Bonus really does make up a significant chunk of the DPS output of 2H weapons... especially slower 2H weaps wielded by high level toons.

Please do give it another shot after compiling a version of the server using the new code in this thread. I bet you'll be a lot more pleased with 2H weapons than before! In fact, troll the Allakhazam pages for some popular 2H weapons to get people's feedback on how hard these weapons hit. Then use a GM to twink a toon out with that same weapon at the same player level, and see if it hits for about the same on EQEmu.

I believe Reno already ran this test, and concluded that, with these fixes, 2H weapons perform just like they did on Live.

If that's not the case, well then, we'll look at the code more carefully, find the problem, and fix it! Sound good?
Reply With Quote