Go Back   EQEmulator Home > EQEmulator Forums > General > General::General Discussion

General::General Discussion General discussion about EverQuest(tm), EQEMu, and related topics.
Do not post support topics here.

Reply
 
Thread Tools Display Modes
  #1  
Old 09-25-2008, 06:42 PM
Cantus
Fire Beetle
 
Join Date: Sep 2008
Location: New York
Posts: 18
Default

Quote:
Originally Posted by ChaosSlayer View Post
I havent looked ta actual code but in order to minimize extra calculation in mind it would look like this:

You store ALL values in a table which is accessed by parameters of Level and Dly

When weapon strike you simly add X(a,b) to the final damage, where X(a,b) points the table with pre-calculated values
Hi, Chaos!

What you're describing is a brute-force lookup table... just one that's built on-the-fly (which would, in all likelihood, be slower than a comprehensive, pre-built static lookup table.)

There are three options for calculating damage bonuses:
  • A brute-force table like what you describe
  • A pure-formula approach where damage bonuses are calculated mathematically
  • A hybrid approach where formulas are used in cases where they're simple and fast, and tables are used for all other situations

I tried all three possibilities, and the third option -- the hybrid approach -- is what provided the best performance.

That's what's implemented here in this thread. As I mentioned above, testing (that you can easily re-create) proves that this function is a very efficient and fast way of calculating these values, and that it will have an absolutely unnoticeable impact on server performance.

Please don't think I'm shooting down your idea! It's a great one! I'm just pointing out that it was considered, tested, and found to be not quite as efficient as the solution presented in this thread.
Reply With Quote
  #2  
Old 09-25-2008, 06:49 PM
ChaosSlayer
Demi-God
 
Join Date: May 2007
Posts: 1,032
Default

Quote:
Originally Posted by Cantus View Post

What you're describing is a brute-force lookup table... just one that's built on-the-fly (which would, in all likelihood, be slower than a comprehensive, pre-built static lookup table.)
.
Hiya!

I am not sure why you saying that this method is build on the fly
You create the table and populate it with values when server loads- and it NEVER changes - the values are very static.

You may very well put them directly into code. You simply pre-calc the values ONCE and then just add them to final dmg when/if needed

I am not arguing btw - I just not seeing the "complexity" in creating the table at server start up and keeping it static (just like you want it) until server shuts down

The bonus part of course is that BEFORE server loads you can populate the table with values based on ANY formula- again only once - and they stay static for whole duration
Reply With Quote
  #3  
Old 09-25-2008, 07:23 PM
Cantus
Fire Beetle
 
Join Date: Sep 2008
Location: New York
Posts: 18
Default

Quote:
Originally Posted by ChaosSlayer View Post
I am not arguing btw - I just not seeing the "complexity" in creating the table at server start up and keeping it static
If you take a look at the code that's posted, you'll see many of these pre-calculated tables already included.

There'd be no reason to build the table at run-time, even if just when the server starts. Better to populate them at compile-time.

You could do a full, brute-force lookup table, but my point is that testing proves that the hybrid approach listed here is the most efficient implementation.

It works, it's fast, and it'll soon have (as requested) the ability to return damage bonuses for toons level 81+, and also an option for a custom, linear damage bonus progression.
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 06:59 PM.


 

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