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

Looks interesting hehe. I am getting:

Code:
Error: Calculate2HDamageBonus was not declared in this scope
when trying to compile it. Not sure where that needs to be declared exactly, but probably just missing something small somewhere.

Seems like many people are working on making the 2H damage bonus better lately for some reason lol. Here are some other examples:

http://www.eqemulator.net/forums/showthread.php?t=26200

http://www.eqemulator.net/forums/showthread.php?t=26127

And some other combat related ones:

http://www.eqemulator.net/forums/showthread.php?t=26099

http://www.eqemulator.net/forums/showthread.php?t=26213

I wonder why the sudden flood of code for this lol. Not complaining, but it is a little weird to see 3 different posts with fixes for 2H bonuses in the past week or 2.
__________________
Trevazar/Trevius Owner of: Storm Haven
Everquest Emulator FAQ (Frequently Asked Questions) - Read It!
Reply With Quote
  #2  
Old 09-22-2008, 12:28 AM
renoofturks1
Sarnak
 
Join Date: Jan 2008
Posts: 60
Default

One of them was my attempt at it. It wasn't working as accurately as I had hoped and Cantus offered to take a look at it. After much discussion on our guild forum, this is where we ended up. It came out very well in the end. My biggest concern was time to parse that much code. The look up table's actually ended up parsing far faster than some of the formula's I was attempting to use. It is a very good solution to our problem.
Reply With Quote
  #3  
Old 09-22-2008, 12:42 AM
trevius's Avatar
trevius
Developer
 
Join Date: Aug 2006
Location: USA
Posts: 5,946
Default

So, where does Calculate2HDamageBonus function go? I can't figure out where to put it and it errors as shown in my previous post if I put it directly in my attack.cpp.
__________________
Trevazar/Trevius Owner of: Storm Haven
Everquest Emulator FAQ (Frequently Asked Questions) - Read It!
Reply With Quote
  #4  
Old 09-22-2008, 08:43 AM
Cantus
Fire Beetle
 
Join Date: Sep 2008
Location: New York
Posts: 18
Default

ChaosSlayer, you're right... it is great to see people getting more involved with the project! I'm glad that our contributions seem to be well received by the established community and senior developers. I hope that I'll have more opportunities to help in the future!



Trevius, I did see that others were working on this particular problem, as well. I did work along with several of them (such as Reno) to develop what we believe to be the final solution to the problem, as posted above. Unlike the other threads, we're confident saying "it's done; it's fixed" with the code in this thread.

Please do review and test, and if you agree, please feel free to throw it into the next build!


Quote:
Originally Posted by trevius View Post
So, where does Calculate2HDamageBonus function go? I can't figure out where to put it and it errors as shown in my previous post if I put it directly in my attack.cpp.
Trevius, you have several options.

The GetWeaponDamageBonus() is a member of the Mob class, so it's trying to call a Calculate2HDamageBonus() that's also a member of that class. There is none, as Calculate2HDamageBonus() is declared as a global function.

The quick fix is to, when Calculate2HDamageBonus() is called, add two colons (the C++ Scope Resolution Operator) before its name to indicate that it's a function that resides in the global namespace, like this:

Code:
return ::Calculate2HDamageBonus( GetLevel(), Weapon->Delay );

A better long-term choice would probably be to make the Calculate2HDamageBonus() a member of the Mob class. As this is my first contribution and I'm therefore a very junior contributor, I didn't want to presume to add a new function to someone else's class. But if you want to do it, here's a rough description of how:

Sorry that I can't give precise line numbers, as I'm at work, and do not have a copy of the Emu source available. Find the declaration of the Mob class, and add a prototype for the Calculate2HDamageBonus() function. Then add "Mob" and the scope resolution operator before the definition of the function.


A third possibility is: You could also rip out the guts of the function and plug it directly into GetWeaponDamageBonus(), but that'll make the GetWeaponDamageBonus() function huge and ugly. I'd recommend keeping Calculate2HDamageBonus() as a function.


I'll be happy to post more detail on these changes when I get home from work tonight!

Take care,

-Eric
Reply With Quote
  #5  
Old 09-23-2008, 01:49 AM
AndMetal
Developer
 
Join Date: Mar 2007
Location: Ohio
Posts: 648
Default

Quote:
Originally Posted by trevius View Post
So, where does Calculate2HDamageBonus function go? I can't figure out where to put it and it errors as shown in my previous post if I put it directly in my attack.cpp.
You should be able to define it in zone/mob.h, just like GetWeaponDamageBonus is. It's all a part of the Mob class, which is basically what the Mob:: prefix means.
__________________
GM-Impossible of 'A work in progress'
A non-legit PEQ DB server
How to create your own non-legit server

My Contributions to the Wiki
Reply With Quote
  #6  
Old 09-23-2008, 06:43 AM
renoofturks1
Sarnak
 
Join Date: Jan 2008
Posts: 60
Default

It's all merged together in that new set he posted. No need to define a new function.
Reply With Quote
  #7  
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
  #8  
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
  #9  
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
  #10  
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 07:48 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