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 11-14-2012, 05:04 PM
Furniture
Hill Giant
 
Join Date: Aug 2012
Posts: 205
Default Some problems with the combat code:

I have been analyzing the combat code as of late, and there are some things that look like need to be addressed to make it more live like.

1)EDIT - accuracy problem solved

2) Mitigation - I am also seeing issues with the Mitigation formula not properly reducing the damage to the proper interval. A level 40 with banded armor gets nearly identical damage mitigation to a level 40 with fine plate. I know this amount of AC difference is trivial at high end game, and changes must be made accordingly to end game content, but in its current state this is no where near live.

It is a messed up formula where if you are less then max level, playing in lower expansion zones, having a little bit of AC will give the same effect as having a high ac. For any server using this code and stock lower level zones/gear drops the 1-60 game is severaly 'bugged' so to speak.
Reply With Quote
  #2  
Old 11-14-2012, 05:27 PM
Kayen
Developer
 
Join Date: Mar 2009
Location: -
Posts: 228
Default

Your 'agility' statistic and your 'defensive skill' which makes up a portion of your AC value is what contributes to your 'chance to avoid melee' in the source.

Accuracy from items and spell effects is accounted for as well.

When YOU are attacked it checks the difference in level between YOU and attacker at derives the base line chance that you will be hit.

Then it subtracts from that value YOUR ( AC component[agility factor, defensive skills], spell and item bonus AVOIDANCE)

Then it adds back to that value the ATTACKER accuracy modifiers. (Accuracy from items / spells, Chance to Hit spell effects).

The final chance to hit value is then rolled to determine initial hit vs miss.
Reply With Quote
  #3  
Old 11-14-2012, 05:51 PM
Furniture
Hill Giant
 
Join Date: Aug 2012
Posts: 205
Default

Ok that makes sense, however it seems like the formula is changed a lot in the chance to hit code, where in the avoidance code it calculates it as:

int avoidance = (acmod() + ((GetSkill(DEFENSE) + itembonuses.HeroicAGI/10)*16)/9);

So does that mean the calculation of avoidance with this formula (which is the correct formula based on research) has nothing to do with combat and just for show in your AC values?
Reply With Quote
  #4  
Old 11-14-2012, 06:10 PM
Furniture
Hill Giant
 
Join Date: Aug 2012
Posts: 205
Default

When it comes to mitigation, what I'm looking to fix for low to mid game combat is basically:

1) Take more damage if mitigation rating is low

2) Take less damage if mitigation rating is high


Since these are tuned for higher level combat where you are expected to have very high mitigation it seems correct but like I said for lower level combat it is off.

I'm convinced theres somehow I can alter something in the following somehow to achieve my desired effects, but I havent figured it out yet:

Quote:
float d = 10.0;
float mit_roll = MakeRandomFloat(0, mitigation_rating);
float atk_roll = MakeRandomFloat(0, attack_rating);

if(atk_roll > mit_roll)
{
float a_diff = (atk_roll - mit_roll); //200
float thac0 = attack_rating * RuleR(Combat, ACthac0Factor); // 440
float thac0cap = ((attacker->GetLevel() * 9) + 20);
if(thac0 > thac0cap)
{
thac0 = thac0cap;
}
d -= 10.0 * (a_diff / thac0);
}
else if(mit_roll > atk_roll)
{
float m_diff = (mit_roll - atk_roll);
float thac20 = mitigation_rating * RuleR(Combat, ACthac20Factor);
float thac20cap = ((defender->GetLevel() * 9) + 20);
if(thac20 > thac20cap)
{
thac20 = thac20cap;
}
d += 10 * (m_diff / thac20);
}

if(d < 0.0)
{
d = 0.0;
}

if(d > 20)
{
d = 20.0;
}

float interval = (damage - minhit) / 20.0;
damage = damage - ((int)d * interval);
}

Any suggestions?
Reply With Quote
  #5  
Old 11-14-2012, 06:56 PM
Furniture
Hill Giant
 
Join Date: Aug 2012
Posts: 205
Default

Here is some parsing info:

I parsed a few different levels, 1-50 and found identical results.

Heres an example, a lvl 26 max defense character vs a white con lvl 26 warrior mob, on all values i parsed for a while until the data was rarely changing after time, my consistent results leads me to believe I have parsed for a significant amount of time


Quote:
Ungeared: AC - 323 Mitigation - 11
AVG Hit from mob - 37
Max Hit from mob - 52
Quote:
Full set of banded: AC - 466 Mitigation - 154
AVG Hit from mob - 25
Max Hit from mob - 52
Quote:
Full set of fine plate: AC - 537 Mitigation - 225
AVG Hit from mob - 24
Max Hit from mob - 52

As you can see, there was no significant damage mitigation increase from 154 mitigation to 225 mitigation, but there was a significant increase from 11 to 154.

What could be the cause?
Reply With Quote
  #6  
Old 11-14-2012, 07:15 PM
ChaosSlayerZ's Avatar
ChaosSlayerZ
Demi-God
 
Join Date: Mar 2009
Location: Umm
Posts: 1,492
Default

i would have simplified/rewritten entire combat formula from scratch and make it much
more straightforward and not level based at all, so ac/stats play more significant role....
Of course it won't be live-like anymore.... so forgive me for ranting
Reply With Quote
  #7  
Old 11-14-2012, 07:28 PM
KLS
Administrator
 
Join Date: Sep 2006
Posts: 1,348
Default

In all fairness so would I but alas. The reason why there's a huge jump from ungeared to geared then a small one beyond that is because there are very severe AC softcaps in play.
Reply With Quote
  #8  
Old 11-14-2012, 07:37 PM
Furniture
Hill Giant
 
Join Date: Aug 2012
Posts: 205
Default

The plate softcap for raw ac is 300, im not hitting anywhere close to that with my fine plate.

Unless Im missing something I dont see how the softcaps are effecting my mitigation, seeing how
Quote:
if(armor > softcap)
{
should be coming out false



I think I will mess with the ACthac20Factor and ACthac0Factor rules and see if I can get desired effects that way.
Reply With Quote
  #9  
Old 11-14-2012, 08:41 PM
Furniture
Hill Giant
 
Join Date: Aug 2012
Posts: 205
Default

unless the softcaps kls mentioned is the thac0cap and the thac20cap?

EDIT - I removed the thac0cap and the thac20cap and still no change in parse data
Reply With Quote
  #10  
Old 11-14-2012, 09:34 PM
lerxst2112
Demi-God
 
Join Date: Aug 2010
Posts: 1,742
Default

Quote:
Originally Posted by Furniture View Post
should be coming out false
No reason to ever say "should be". Add some code to tell you for certain if it is true or not.
Reply With Quote
  #11  
Old 11-14-2012, 10:34 PM
Furniture
Hill Giant
 
Join Date: Aug 2012
Posts: 205
Default

well i understand how this works enough to know that im not hitting that armor softcap so I wonder if theres another cap that im not seeing thats effecting this somehow
Reply With Quote
  #12  
Old 11-15-2012, 01:27 AM
Furniture
Hill Giant
 
Join Date: Aug 2012
Posts: 205
Default

EDIT - Nevermind, still need help here


I'll probably just have to add a + % bonus on armor rating while raising npc's attack rating so they hit for proper intervals, will be a lot of testing at varius levels to get things right but thats probably how ill have to do it
Reply With Quote
  #13  
Old 11-15-2012, 03:45 AM
Furniture
Hill Giant
 
Join Date: Aug 2012
Posts: 205
Default

Update: I figured it out, also parses on a nice bell curve for distribution like in on live/classic, just have to fine tune it
Reply With Quote
  #14  
Old 11-15-2012, 03:53 AM
trevius's Avatar
trevius
Developer
 
Join Date: Aug 2006
Location: USA
Posts: 5,946
Default

As far as parses for lower level content goes, you may want to refer to this thread as well, which I believe mostly deals with chance for min/max hits based on level:

http://www.eqemulator.org/forums/showthread.php?t=35666
__________________
Trevazar/Trevius Owner of: Storm Haven
Everquest Emulator FAQ (Frequently Asked Questions) - Read It!
Reply With Quote
  #15  
Old 03-23-2013, 07:54 PM
game
Fire Beetle
 
Join Date: Aug 2011
Posts: 19
Default

EpicEmu has a fix for this which will be released after more testing, you can read up on the changes on the forums, you may need to sign up to read it: https://epicemu.com/forum/ac-new-dam...ing-code-tests

The graphs show how the new code will reduce damage based on armor, so a full plate wearer will take less damage than a chain -> leather -> cloth -> etc. It factors in for the levels automatically and shifts the chance to miss making mobs chance to hit YOU scale with its level rather than be a flat % like most servers use now.
Reply With Quote
Reply


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