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

Development::Bots Forum for bots.

Reply
 
Thread Tools Display Modes
  #1  
Old 10-07-2010, 08:16 AM
Hargael
Fire Beetle
 
Join Date: Aug 2010
Location: France
Posts: 5
Default

Hello

Here are some news from my testing :

- Enchanter : I added some spells in the npc_spells_entries table for mez (I am currently 55 so I added spells 1691, 1692, 3341 and 3358 ), and now my enchanter bot mez ! But he has lots of trouble finding a target to mez (LoS problems), I think I will check how he should find one and perhaps modify some code. Btw he still casts too many runes, I will remove them from table, and use the runeme command.

- Cleric : now I known why my cleric bot never sees me engaged. My hate list is always empty. In AddToHateList (attack.cpp) the test
Code:
if(IsClient() && !IsAIControlled())
is always true for me (me = client and not AI controlled), so nothing in hate_list, so IsEngaged() returns false ... I put this test in comment, and now my bot sees me engaged, and change his heal spell.

I also still have the problem of no heal for a certain range of hps (in fact it's the result of the GetBestBotSpellForRegularSingleTargetHeal function). Maybe I will check the table for missing heals, or check the way this function find one.

To be continued ...
Reply With Quote
  #2  
Old 10-07-2010, 01:18 PM
Longdarkhair
Fire Beetle
 
Join Date: Jul 2010
Posts: 25
Default

Nice findings, thanks for sharing this work. =)
Reply With Quote
  #3  
Old 10-08-2010, 07:18 AM
Hargael
Fire Beetle
 
Join Date: Aug 2010
Location: France
Posts: 5
Default

Thanks for the comment, if this can help improve the system ...

Here are some news, it works MUCH better !

- Cleric bot : I was right, some spells are missing in the table. In fact, there is no direct heal. The function GetBestBotSpellForRegularSingleTargetHeal is looking for direct heals (type SE_CurrentHP). In the npc_spells_entries table, we can find Complete Healing, some HoT like Celestial Healing, but no big direct heal like Divine Light. So I used Lucy and added this one in the table (it's in the range of level where I am actually, around 55). I added it the same way I added the mez spells (cleric bot spell list 701, spell type 2).

I also have a question about a property of spell struct : priority. How does it work ? I put 1 for the different spells I added, but not sure it's correct. Maybe someone could complete the table more precisely ...

- Enchanter bot : my bot has mez spells, but almost never cast them, and now I know why. I found a bug in the range calculation : in the GetFirstIncomingMobToMez function (botspellsai.cpp), we search for a mob to mez, and compare the distance between the bot and each mob to the spell range. Of course we use the Pythagore theorem, but the test is wrong (mobs are always too far). I changed this :
Code:
if(npc->DistNoRootNoZ(*botCaster) <= spells[botSpell.SpellId].range) {
by this :
Code:
if(npc->DistNoRootNoZ(*botCaster) <= spells[botSpell.SpellId].range * spells[botSpell.SpellId].range) {
and it works !

Next time I will disable automatic runes. I don't want to delete them from the table, so I have to find another way. Maybe priority or a new SpellType ...

EDIT : the DistNoRootNoZ function is often used, maybe we should check all tests done with it ...
Reply With Quote
  #4  
Old 10-09-2010, 03:41 PM
Longdarkhair
Fire Beetle
 
Join Date: Jul 2010
Posts: 25
Default

Explanation of priority, found this in the Wiki:

npc_spells_entries

Entries in this table represent entries in spell sets defined in npc_spells. The spells in this list (and potentially a single parent list) will be loaded at spawn time, and sorted by increasing priority. Basically, the lowest priority value spell will always be chosen over a higher priority value spell. There is no garuntee which spell will be chosen if two of the same type of spell are set at the same priority, but only one will be used (currently).
Reply With Quote
  #5  
Old 10-09-2010, 03:57 PM
Hargael
Fire Beetle
 
Join Date: Aug 2010
Location: France
Posts: 5
Default

Thanks ! I forgot the wiki, I will read it more deeply !

Btw, I changed SpellType for the runes, put 0, and now they are not automatically casted anymore. I ask for them with the "runeme" command. Thus my enchanter bot has more time (and mana) for mez and slow.
Reply With Quote
  #6  
Old 10-10-2010, 06:59 AM
c0ncrete's Avatar
c0ncrete
Dragon
 
Join Date: Dec 2009
Posts: 719
Default

I ran across the same problem with heals from bots. I would suggest making changes just to the bot code to fix bot specific issues, however.

I use GetAggroCount() for clients to determine if they are engaged in combat as clients don't use a hate list unless they are AI controlled, and they'll still have an aggro count even if they are.

example:
Code:
// is target engaged?
bool tarIsEngaged = tar->IsClient() ? tar->CastToClient()->GetAggroCount() : tar->IsEngaged();
Reply With Quote
Reply

Thread Tools
Display Modes

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