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

Development::Bots Forum for bots.

Reply
 
Thread Tools Display Modes
  #1  
Old 11-05-2012, 08:44 PM
Trackye
Sarnak
 
Join Date: Feb 2008
Posts: 87
Default Bot issue latest compile...

Regardless of what is attempted on a fresh compile of latest svn repo.

Level 1 Berserker Bot crashes zone on attacking..

Have tested with weapon without weapon. What not. All other bots work fine but as soon as a level 1 Berserker Bot is in group and player attacks. Crash.

Tested on level 15 character and using a Berserker bot works fine.

Any more information I can offer please let me know and where I can find it.

Thanks.
Reply With Quote
  #2  
Old 11-05-2012, 11:28 PM
Uleat's Avatar
Uleat
Developer
 
Join Date: Apr 2012
Location: North Carolina
Posts: 2,815
Default

I haven't followed it back to the database yet, but a shot in the dark says this is a problem...

[bots.cpp:oClassAttacks()]
Code:
if(skill_to_use == FRENZY)
	{
		int AtkRounds = 3;
		int skillmod = 100*GetSkill(FRENZY)/MaxSkill(FRENZY);
		sint32 max_dmg = (26 +  ((((GetLevel()-6) * 2)*skillmod)/100))  * ((100+RuleI(Combat, FrenzyBonus))/100);
		sint32 min_dmg = 0;
		DoAnim(anim2HSlashing);
int skillmod = 100*GetSkill(FRENZY)/MaxSkill(FRENZY) could be giving a 'divbyzero' error.

If anyone can look this up, the 'FRENZY' skill id is 74..I'm not near a database atm...


here is the reference code for 'MaxSkill':
Code:
uint16 SharedDatabase::GetSkillCap(int8 Class_, SkillType Skill, int8 Level) {
	if(Class_ == 0)
		return(0);
	int SkillMaxLevel = RuleI(Character, SkillCapMaxLevel);
	if (SkillMaxLevel < 1) {
		SkillMaxLevel = RuleI(Character, MaxLevel);
	}
	if(Level > SkillMaxLevel){
		return EMuShareMemDLL.SkillCaps.GetSkillCap(Class_-1, Skill, SkillMaxLevel);
	}
	else{
		return EMuShareMemDLL.SkillCaps.GetSkillCap(Class_-1, Skill, Level);
	}
}

Trackye: try leveling to 2(..3..4...) and see if this bot still crashes zone.
__________________
Uleat of Bertoxxulous

Compilin' Dirty
Reply With Quote
  #3  
Old 11-06-2012, 12:03 AM
bad_captain
Developer
 
Join Date: Feb 2009
Location: Cincinnati, OH
Posts: 512
Default

I'll have to take a look. The code is basically a copy of Client:: DoClassAttacks, with a call to database.GetSkillCap(class_, skillid, level), so I'm not sure what would be different.

Code:
int16 Bot::MaxSkill(SkillType skillid, int16 class_, int16 level) const {
	return(database.GetSkillCap(class_, skillid, level));
}
Reply With Quote
  #4  
Old 11-06-2012, 12:44 AM
bad_captain
Developer
 
Join Date: Feb 2009
Location: Cincinnati, OH
Posts: 512
Default

After thinking about it, I can see how it differs from a client. Clients will only call this when the person uses a hotkey or something, so they would already have to have the skill, MaxSkill would never return 0. It may be an issue if they are charmed or something and call if while under AI control, but there aren't many times when a lvl 1 will be charmed. If that would even work.

I'll try to get a commit in soon to fix this.

A simple check to see if MaxSkill > 0 before assigning the skill mod should suffice, although then you'd have to declare skill mod before assigning to it.. Something like:

Code:
if(skill_to_use == FRENZY)
	{
		int AtkRounds = 3;
		int skillmod = 0;

                if(MaxSkill(FRENZY) > 0) 
                        skillmod = 100*GetSkill(FRENZY)/MaxSkill(FRENZY);

		sint32 max_dmg = (26 +  ((((GetLevel()-6) * 2)*skillmod)/100))  * ((100+RuleI(Combat, FrenzyBonus))/100);
		sint32 min_dmg = 0;
		DoAnim(anim2HSlashing);
Although a more thorough check is probably warranted to see if there are any other similar issues.
Reply With Quote
  #5  
Old 11-06-2012, 12:51 AM
Trackye
Sarnak
 
Join Date: Feb 2008
Posts: 87
Default

Is it possible that it is due to the fact that Berserkers do not attain Frenzy until level 6? Maybe there should be some sort of a level check there?
Reply With Quote
  #6  
Old 11-06-2012, 12:54 AM
bad_captain
Developer
 
Join Date: Feb 2009
Location: Cincinnati, OH
Posts: 512
Default

Yeah, but instead of hard coding a level check (which would work), a better solution would be to just check the skill level, since many custom servers may change the level classes receive certain skills. Just make sure they actually have at least a skill of 1 before using that line to set the skillmod.
Reply With Quote
  #7  
Old 11-06-2012, 01:00 AM
Uleat's Avatar
Uleat
Developer
 
Join Date: Apr 2012
Location: North Carolina
Posts: 2,815
Default

I'll see what I can get from it tonight... I see what you're talking about though. The only difference I saw was where you initiated the timers.

If I run across something definitive, I'll post back.
__________________
Uleat of Bertoxxulous

Compilin' Dirty
Reply With Quote
  #8  
Old 11-20-2012, 03:35 PM
Trackye
Sarnak
 
Join Date: Feb 2008
Posts: 87
Default

To update this Bad_captain. The crashes did indeed stop once the bot was level 6+. Also i input your code into my core and it stopped the pre level 6 crashes as well.
Reply With Quote
  #9  
Old 11-20-2012, 06:11 PM
bad_captain
Developer
 
Join Date: Feb 2009
Location: Cincinnati, OH
Posts: 512
Default

Thanks. I'll try to get this is as soon as I can.
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 08:23 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