EQEmulator Forums

EQEmulator Forums (https://www.eqemulator.org/forums/index.php)
-   Development::Development (https://www.eqemulator.org/forums/forumdisplay.php?f=590)
-   -   Some stuff (https://www.eqemulator.org/forums/showthread.php?t=21718)

Damilis 11-06-2006 10:26 PM

Quote:

Originally Posted by John Adams
Ok, now I know you are an engineer IRL. ;)

If I had a dime...

Now now, there's nothing wrong with engineers :P

KLS earns two thumbs up IMHO. Give that man a Klondike Bar!

Dralanna 11-09-2006 06:07 AM

Looking at your code for backstabs, and I'm a little confused.

the old code for max damage is
Code:

skillmodifier = (float)bs_skill/25.0;        //formula's from www.thesafehouse.org
max_hit = (int)(((float)primaryweapondamage * 2.0) + 1.0 + ((level - 25)/3.0) + ((GetSTR()+GetSkill(BACKSTAB))/100));
max_hit *= (int)skillmodifier;

the new code is
Code:

skillmodifier = (bs_skill*100)/25;        //formula's from www.thesafehouse.org
if(level > 25){
max_hit = ((primaryweapondamage*2) + 1 + ((level-25)/3) + ((GetSTR()+bs_skill)/100));
}
else{
max_hit = ((primaryweapondamage*2) + 1 + ((GetSTR()+bs_skill)/100));
}
max_hit *= skillmodifier;
max_hit /= 100;

So unless I'm missing something, for rogues over 25th level, the code is the same. In the new code you're multiplying the backstab skill by 100 in the skillmodifier variable, but then dividing by 100 in the end. Seems like an unneeded calculation.

KLS 11-09-2006 09:13 AM

The backstab formulas are wrong, Rogean is working on more accurate ones at the moment. The current ones pretty much under estimate backstab damage across the board, I just rewrote the formula for under 25 because part of it becomes increasingly negative for every 3 levels under 25 you become.

Let me explain what's happening with the new code with the * 100 / 100 later thing.

skillmodifier = (bs_skill*100)/25;

this makes our skill modifier for say 90 skill 360, in the old code we used floats for accuracy but we don't like to mix float and int math where we can avoid it. The old mod for a 90 skill would have been 3.6 but if we tried to simply switch that over we would lose the accuracy of using floats.. but when working with larger numbers you don't lose that accuracy when dividing.

Essentially we don't lose a .6 in the calculation doing it this way and don't have to convert from ints to floats to ints again.

I may not of explained it as well as I could have but meh.

Dralanna 11-09-2006 09:42 AM

Nope, that explains it perfectly... makes sense.

Thanks,

bufferofnewbies 11-10-2006 08:49 AM

Quote:

Originally Posted by KLS
Essentially we don't lose a .6 in the calculation doing it this way and don't have to convert from ints to floats to ints again.

You know, the more I watch you guys in action. The more I am impressed with the things you do. Very insightful work around on the (non-)conversion. I wish I would have had more people like you on my crew back in the Navy.

Damilis 11-10-2006 09:23 AM

Quote:

Originally Posted by bufferofnewbies
I wish I would have had more people like you on my crew back in the Navy.

Woohoo I'm not the only squid here!

mattmeck 11-10-2006 09:47 AM

Quote:

Originally Posted by Damilis
Woohoo I'm not the only squid here!


EQEmu coveres all branches, lots of everyone but the marines...

bufferofnewbies 11-10-2006 11:12 AM

<<-- Bubblehead. Those who know will understand. :)


All times are GMT -4. The time now is 04:49 PM.

Powered by vBulletin®, Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.