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. |
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.
|
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. |
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. |
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; Code:
displayed += ((avoidance+mitigation)*500)/950; |
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. |
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. |
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 |
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. |
Quote:
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. |
Quote:
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. |
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. |
Quote:
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. |
Quote:
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) |
Quote:
|
All times are GMT -4. The time now is 12:40 AM. |
Powered by vBulletin®, Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.