Go Back   EQEmulator Home > EQEmulator Forums > Development > Development::Bots

Development::Bots Forum for bots.

Reply
 
Thread Tools Display Modes
  #1  
Old 06-14-2011, 07:16 PM
louis1016
Hill Giant
 
Join Date: Dec 2009
Posts: 157
Default Bot stats getting doubled

I have noticed with the #showstats command that stat points added to the base bot stats based on class and race are being doubled.

For example, a wood elf druid is supposed to start with 115 wisdom from what is intended in the code, but somehow its doubling the amount of points given from both race and class and it ends up with 155.

The code intends to add 35 wisdom from it being a druid (but gives 70 instead) and it intends to add 5 points from being a wood elf (but gives 10 instead).

This happens with every other class and results in our bots being way overpowered compared to the stats of the player.

How can I modify my code to fix this? (this is with the latest revision but i know the problem existed for a long while)

AC is an issue too, bots naturally have way more AC then any non geared player of the same race/class so i suspect something is also being added that shouldnt be.

Any help would be greatly appreciated , for now ill just half all the stat bonuses in my source code to even it out, although I hope somebody can fix this in the source code permamently.
Reply With Quote
  #2  
Old 07-04-2011, 05:06 PM
dark_fusion's Avatar
dark_fusion
Fire Beetle
 
Join Date: Jun 2007
Posts: 18
Default

I noticed this as well, and would really like some help to fix. It also seems that once bots exceed a certain amount of ac or hp, they become immortal. I have witnessed bots tanking world bossess without even getting a scratch when it should not be that way.
Reply With Quote
  #3  
Old 07-05-2011, 01:01 AM
Ganedar
Fire Beetle
 
Join Date: Dec 2009
Posts: 16
Default

i was able to fix the doubling of race/class bonuses by removing GenerateBaseStats() from both constructors.

I am looking around to try and figure out what may cause the abnormal AC levels for bots but it seems a bit more complicated than i have found out thus far.

looking back i'm wondering if it might be wiser to remove GenerateBaseStats() from CalcBonuses() and leave it in the creation constructor.

perhaps someone with more experience in bot code can detail what would be better.
Reply With Quote
  #4  
Old 07-05-2011, 12:23 PM
dark_fusion's Avatar
dark_fusion
Fire Beetle
 
Join Date: Jun 2007
Posts: 18
Default

I may have found something with the ac/avoidance, its seems there is no check for the avoidance cap in GenerateArmorClass - this could lead to bots having unlimited avoidance? could be the reason they become nearly un-hittable when fully geared/augd

Im going to try adding a line that checks for the avoidance limit, and sets it to the limit if exceeded.
Reply With Quote
  #5  
Old 07-05-2011, 05:06 PM
dark_fusion's Avatar
dark_fusion
Fire Beetle
 
Join Date: Jun 2007
Posts: 18
Default

Well the avoidance idea didn't do anything.

I did find the problem with ac though, its the mitigation calc - its very generous for bots and gives about double the ac they should have.

I toyed around with this for awhile till the calculation seemed accurate.

I changed a line in GenerateArmorClass:(around line 1220)
was:
Code:
displayed += ((avoidance+mitigation)*1000)/847;
Changed to:
Code:
displayed += ((avoidance+mitigation)*500)/950;
now ac is way more accurate on bots, around the same as players.
Reply With Quote
  #6  
Old 07-05-2011, 10:07 PM
Ganedar
Fire Beetle
 
Join Date: Dec 2009
Posts: 16
Default

did you check to see if there's a shielding cap enabled for bots?

the way emu shielding works it can be way OP with high caps.
Reply With Quote
  #7  
Old 07-11-2011, 12:19 AM
bad_captain
Developer
 
Join Date: Feb 2009
Location: Cincinnati, OH
Posts: 512
Default

It's been a while since I've looked at it, but I believe when calling #showstats, it uses mob::GetAC, which differs from Bot::GetAC, as the mob version returns the actual AC (bot::AC), plus item and spell bonuses, which causes it to be higher. If you look at the Bot::GenerateArmorClass, it is exactly the same as the clients' CalcAC without the heroic stats stuff. I had tried to change #showstats to use the correct AC calc for bots, but it didn't compile for non-bot builds, (I didn't think about using #ifdef BOTS), and I haven't gone back and fixed it. I believe ATK differs as well.

I will try and test out removing GenerateBaseStats from CalcBonuses, but it still doesn't make sense to me why it would be doubling up.
Reply With Quote
  #8  
Old 07-11-2011, 12:42 AM
lerxst2112
Demi-God
 
Join Date: Aug 2010
Posts: 1,742
Default

The GetAC() function is virtual, so it should call the correct one for bots. The problem I see is that the function signature is different than the base class.

Code:
Mob: inline virtual sint16 GetAC() const { return AC + itembonuses.AC + spellbonuses.AC; } // Quagmire - this is NOT the right math

Bot: inline virtual sint16 GetAC()	{ return AC; }
I'm actually surprised that #showstats doesn't blow up on a bot or mob. It appears the ATK is displayed using this->CastToClient()->GetTotalATK() for everything, not just clients, and that function doesn't exist in the base.
Reply With Quote
  #9  
Old 07-14-2011, 12:40 PM
bad_captain
Developer
 
Join Date: Feb 2009
Location: Cincinnati, OH
Posts: 512
Default

When #Showstats is called, it is on a Mob*, not Bot*, which I believe causes it to call the Mob version of GetAC(). That version adds in item and spell AC, which has already been included in the AC value.

Last night I added in a #bot showstats command within bot.cpp, so I knew I was getting a Bot*. From #Showstats, my 65 WAR's AC was reported at 2085, from #bot showstats, it was 1537. I have this character loaded in magelo, and it says it should be 1485. I'm not sure I have all AAs matched up, since I put him in by hand. Magelo says he is getting 466 from equipment. Add that to #bot showstats, and I get 2033. Add less than 100 for spell AC (Virtue), and it's right about what #showstats reports.

From this, I believe #showstats displays a bot's AC with Item and Spell AC add in twice.

I still haven't figured out the race/class stat doubling, but I believe AC and ATK (#showstats 686, #bot showstats 1649) are just display issues from using mob-based #showstats. This should get fixed eventually. I tried to fix it a while ago, but caryatis was in the process of revamping #showstats, so I shelved my changes.
Reply With Quote
  #10  
Old 07-14-2011, 12:51 PM
bad_captain
Developer
 
Join Date: Feb 2009
Location: Cincinnati, OH
Posts: 512
Default

Quote:
Originally Posted by dark_fusion View Post
I noticed this as well, and would really like some help to fix. It also seems that once bots exceed a certain amount of ac or hp, they become immortal. I have witnessed bots tanking world bossess without even getting a scratch when it should not be that way.
Could you give me an example? Maybe things don't scale well as we progress further, but I am running lvl 65, starting Elemental Planes, loot geared (I equip only what I loot- no cheating), and have not seen this issue. I am at a disadvantage of using a bot to tank since he cannot use all of the skills/disciplines available to a human tank (even though I do have a #defensive command that helps a lot). Without healing rotations (I am working on a rewrite), my tank usually makes it halfway through pre-EP planar gods, leaving me to hope my secondary tanks can make it the rest of the way through.

I've heard of issues when AC gets 5,10k+, but that may be an issue with the server as a whole, not just bots.
Reply With Quote
  #11  
Old 07-14-2011, 04:54 PM
lerxst2112
Demi-God
 
Join Date: Aug 2010
Posts: 1,742
Default

Quote:
Originally Posted by bad_captain View Post
When #Showstats is called, it is on a Mob*, not Bot*, which I believe causes it to call the Mob version of GetAC(). That version adds in item and spell AC, which has already been included in the AC value.
It sounds like you may not know how virtual functions work. Virtual means that no matter what type of pointer you have in a class hierarchy, calling a virtual function will call the most derived function available that matches the proper signature.

The GetAC function in the bot class doesn't match the signature of any virtual function in the base class, so it is never called as a virtual function. If the signature was corrected to match the base it would work just fine.
Reply With Quote
  #12  
Old 07-14-2011, 06:37 PM
lerxst2112
Demi-God
 
Join Date: Aug 2010
Posts: 1,742
Default

I should also point out that because of the incorrect signature on GetAC any other function that calls GetAC using a NPC, Mob, or Entity pointer will likely get the wrong result, and even using a const Bot pointer will get the wrong result because the non-const function can't be called from a const function.

This may be the cause of the extra AC in hit and damage calculations that you're experiencing.
Reply With Quote
  #13  
Old 07-19-2011, 05:08 PM
bad_captain
Developer
 
Join Date: Feb 2009
Location: Cincinnati, OH
Posts: 512
Default

Quote:
Originally Posted by lerxst2112 View Post
It sounds like you may not know how virtual functions work. Virtual means that no matter what type of pointer you have in a class hierarchy, calling a virtual function will call the most derived function available that matches the proper signature.

The GetAC function in the bot class doesn't match the signature of any virtual function in the base class, so it is never called as a virtual function. If the signature was corrected to match the base it would work just fine.
You can tell I'm a C# ASP.NET coder and not C++... It just seemed like you should be able to get the version you want by casting to the desired type. Oh, well. I missed that the signature was missing the const, so it wasn't even getting the bot version.

I have fixed GetAC, and I am fixing GetATK(). GetATK works differently than the client version, so I had to add a couple other functions to get it right. The values seem low, however, so I need to look at it again to see why it might be off.

I'll submit once I get GetATK fixed, then #Showstats should work with bots finally.
Reply With Quote
  #14  
Old 08-04-2011, 01:04 AM
bad_captain
Developer
 
Join Date: Feb 2009
Location: Cincinnati, OH
Posts: 512
Default

Quote:
Originally Posted by dark_fusion View Post
I may have found something with the ac/avoidance, its seems there is no check for the avoidance cap in GenerateArmorClass - this could lead to bots having unlimited avoidance? could be the reason they become nearly un-hittable when fully geared/augd

Im going to try adding a line that checks for the avoidance limit, and sets it to the limit if exceeded.

GenerateArmorClass matches the client calculation for CalcAC. I just updated the MeleeMitigation for Bots to match the mob version, which utilizes soft caps. Let me know if this addresses this issue. I tend to stick to realistic values for my equipment, so I'm not sure how this would affect bots who have AC > 6-10k.. (I run in the 2-2.5k range for my tank)
Reply With Quote
  #15  
Old 08-12-2011, 12:26 AM
bad_captain
Developer
 
Join Date: Feb 2009
Location: Cincinnati, OH
Posts: 512
Default

Quote:
Originally Posted by louis1016 View Post
I have noticed with the #showstats command that stat points added to the base bot stats based on class and race are being doubled.

For example, a wood elf druid is supposed to start with 115 wisdom from what is intended in the code, but somehow its doubling the amount of points given from both race and class and it ends up with 155.

The code intends to add 35 wisdom from it being a druid (but gives 70 instead) and it intends to add 5 points from being a wood elf (but gives 10 instead).

This happens with every other class and results in our bots being way overpowered compared to the stats of the player.

How can I modify my code to fix this? (this is with the latest revision but i know the problem existed for a long while)

AC is an issue too, bots naturally have way more AC then any non geared player of the same race/class so i suspect something is also being added that shouldnt be.

Any help would be greatly appreciated , for now ill just half all the stat bonuses in my source code to even it out, although I hope somebody can fix this in the source code permamently.
This has been fixed in Rev 1994.
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 03:31 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