Jump to content

Playerbot (archive)


Recommended Posts

HELLO! got problem...:( Maybe I lost something....

9>g:\\mangos\\src\\game\\PlayerbotAI.h(183) : error C2061: syntax error : identifier 'WorldObject'

9>g:\\mangos\\src\\game\\PlayerbotAI.h(186) : error C2061: syntax error : identifier 'Quest'

9>..\\..\\src\\game\\PlayerbotAI.cpp(1382) : error C2511: 'void PlayerbotAI::AcceptQuest(const Quest *,Player *)' : overloaded member function not found in 'PlayerbotAI'

9> g:\\mangos\\src\\game\\PlayerbotAI.h(17) : see declaration of 'PlayerbotAI'

9>..\\..\\src\\game\\PlayerbotAI.cpp(1638) : error C2660: 'PlayerbotAI::FollowCheckTeleport' : function does not take 1 arguments

9>..\\..\\src\\game\\PlayerbotAI.cpp(1642) : error C2660: 'PlayerbotAI::FollowCheckTeleport' : function does not take 1 arguments

9>..\\..\\src\\game\\PlayerbotAI.cpp(1759) : error C2660: 'PlayerbotAI::FollowCheckTeleport' : function does not take 1 arguments

9>..\\..\\src\\game\\PlayerbotAI.cpp(2168) : error C2511: 'bool PlayerbotAI::FollowCheckTeleport(WorldObject &)' : overloaded member function not found in 'PlayerbotAI'

9> g:\\mangos\\src\\game\\PlayerbotAI.h(17) : see declaration of 'PlayerbotAI'

Link to comment
Share on other sites

  • Replies 1.8k
  • Created
  • Last Reply

Top Posters In This Topic

@showhh123: oh yes... I saw it. I investigate it currently. Tried it on my win32 server and the git repos compiled fine. Still trying to get it compiled on linux. Will post fix if I got any..
Updating to 8222 this problem is gone.
Link to comment
Share on other sites

Thx for the info. Good to know that this will be fixed. But anyway, updated Playerbot to compile without problems. Pushed it to github already

Update:

- fixed compile problems on linux

Working on FindAttacker and combat orders. Seems FindAttacker is not working as expected, it cannot find any target if called like FindAttacker( (ATTACKERINFOTYPE)(AIT_VICTIMNOTSELF|AIT_HIGHESTTHREAT), m_targetProtect )

Link to comment
Share on other sites

Update:

- fixed a logic bug in PlayerbotAI::FindAttacker()

- added some configuration variables (follow distance and whispers)

- updated readme and todo

What did change:

A stupid logic bug within FindAttacker prevented bots from getting a target when trying to find a target not attacking itself/attacking a specific player or bot. Happened when bot tried to protect or assist. Should be awake when writing such functions...

Added some configuration variables for PlayerbotAI. It's explained in the bot_readme.txt. You now can define the follow distance min and max. And there is a variable to enable debug whispering. Well, I beg everyone who is messing with a playerbot class to add the if-switch for m_confDebugWhisper before TellMaster stuff. This way we can keep the combat messages (casted spells) and someone who not need it can disable it.

Link to comment
Share on other sites

Update:

- added call to Player::SetPosition to PlayerbotAI::MovementUpdate

Info:

As for a real player this is called automatically, setting the underwater/swim state and checking for newly explored areas. For bots we have to call it manually. This makes bots able to explore areas while following its master. And water movement should be correctly displayed now.

To-Do:

1) Talk to flight masters in the way it was implemented for questgivers...

2) Make it possible for bots to interact with GOs (especially lootable GOs having quest items inside). Maybe by selecting and using point emote?!?!

@marry521: I cannot reproduce the error, and tried it in different ways. Is it possible for you to run the server in a debug session? I think your host system is win32, and you are using Visual C++?! Because I do not get how/when/where the PlayerbotMGR::HandleMasterIncomingPacket is calling WorldSession::SendAddonsInfo. When running mangosd in debug mode from Visual C++ it is possible to view the call stack in detail. It will also jump to the position where a function was called and which variables where used and to what memory area they are pointing etc.

Link to comment
Share on other sites

Update:

To-Do:

1) Talk to flight masters in the way it was implemented for questgivers...

2) Make it possible for bots to interact with GOs (especially lootable GOs having quest items inside). Maybe by selecting and using point emote?!?!

#1 Cool

#2 I've not been able to "target" a GO so I don't know how your going to make that work unless you change something in the core to make GO targetable. But it would be really cool to get this working, at the moment if I have bots that have a quest that needs to get items out of a GO I have to log in with that character and do the quest to catch it up to the "Main" character.

I like being able to now tell the bot which reward to select when there is multiple rewards.

It's been happening more ofter then not lately but it relates to what I said in #2.

Lets say I'm playing as Joe the hunter and I have a bot Angel the priest. I'm running around doing quests as Joe and Angel is doing her thing as a bot. Now I switch and I'm running around as Angel and bring in Joe as the bot, problem is Joe comes in as Unknown and When I try to Right click on Joe it says you can't invite him to group because it says "You can't invite yourself to join a group". So somehow the server gets confused as to who is actually logged in when you switch like that. I've even tried kicking my bot from the group and dismissing them before I log out and back in. This may have been fixed in a newer version or a newer mangos core, I haven't been able to test a newer version of this or mangos yet because my "compiling" computer got knocked out by a storm and this computer has an error when trying to use Windows Installer so I can't install VC++.

Link to comment
Share on other sites

Hi Everyone,

First of all, great job on this project. This is going to be such a lifesaver for small population servers and for those that want to work on alts.

I have been experiencing the server crash when teleporting with a bot and would like to lend some info. I had the crash happen last night twice using a mage and portals. Below is the crash log from Mangos. Both times I experienced the crash, the logs were exactly the same, including the fault address.

Please let me know if I can help in any way with testing, debugging, etc. Unfortunately I am very new to C++ and coding, but if there is anything I can do to help, please let me know. I have plenty of ways to test things for you also.

Here is an example of what the last lines of the Mangos log outputs with full logging:

2009-07-24 00:11:57 CMSG_TIME_SYNC_RESP

2009-07-24 00:11:57 response sent: counter 0, time 21624439 (HEX: 149F677), ms. time 3376373031, diff 940218703

2009-07-24 00:11:57 WORLD: Recvd MSG_MOVE_FALL_LAND (201, 0xC9) opcode

2009-07-24 00:11:57 zDiff = 0.000000

2009-07-24 00:11:58 Player Cassa is being teleported to map 1

And the crash log:

Revision: * * 8220 8ea4213cda255891477b3d923069191197c1f6fc

Date 24:7:2009. Time 0:11

//=====================================================

*** Hardware ***

Processor: Intel® Xeon CPU 3.20GHz

Number Of Processors: 4

Physical Memory: 2096400 KB (Available: 1087556 KB)

Commit Charge Limit: 4042060 KB

*** Operation System ***

Microsoft Windows Server 2003 Enterprise Edition Service Pack 1 (Version 5.2, Build 3790)

//=====================================================

Exception code: C0000005 ACCESS_VIOLATION

Fault address: 0045AE76 01:00059E76 C:\\Mangos31-ahbot-bots\\mangosd.exe

Registers:

EAX:00000000

EBX:0000008D

ECX:7813EE63

EDX:00250000

ESI:133724E8

EDI:00000001

CS:EIP:001B:0045AE76

SS:ESP:0023:04DBEE28 EBP:00000000

DS:0023 ES:0023 FS:003B GS:0000

Flags:00010246

Call stack:

Address Frame Function SourceFile

Call stack:

Address Frame Function SourceFile

7C82ED54 00000000 KiFastSystemCallRet+0

77E6BA42 00000000 WaitForSingleObject+12

Call stack:

Address Frame Function SourceFile

7C82ED54 00000000 KiFastSystemCallRet+0

77E424C1 00000000 Sleep+F

00573343 00000000 ?SetSource@Config@@QAE_NPBD_N@Z+7F3

0076A240 00000000 ??_7DatabaseMysql@@6B@+74

006B48D0 00000000 ?HandleTaxiQueryAvailableNodes@WorldSession@@QAEXAAVWorldPacket@@@Z+20E30

FFFFFDC8 FFFFFFFF 0000:00000000

Call stack:

Address Frame Function SourceFile

7C82ED54 00000000 KiFastSystemCallRet+0

77E424C1 00000000 Sleep+F

00573343 00000000 ?SetSource@Config@@QAE_NPBD_N@Z+7F3

0076A240 00000000 ??_7DatabaseMysql@@6B@+74

006B48D0 00000000 ?HandleTaxiQueryAvailableNodes@WorldSession@@QAEXAAVWorldPacket@@@Z+20E30

FFFFFDC8 FFFFFFFF 0000:00000000

Call stack:

Address Frame Function SourceFile

7C82ED54 00000000 KiFastSystemCallRet+0

77E424C1 00000000 Sleep+F

00573343 00000000 ?SetSource@Config@@QAE_NPBD_N@Z+7F3

0076A240 00000000 ??_7DatabaseMysql@@6B@+74

006B48D0 00000000 ?HandleTaxiQueryAvailableNodes@WorldSession@@QAEXAAVWorldPacket@@@Z+20E30

FFFFFDC8 FFFFFFFF 0000:00000000

Call stack:

Address Frame Function SourceFile

7C82ED54 00000000 KiFastSystemCallRet+0

04DBDA90 00000000 0000:00000000

548DD5FF 00000000

Link to comment
Share on other sites

@Greystar: The problem you experiencing is a session thing. There is nothing wrong in the core itself. It's the playerbot who messes this up. Did not dig into this yet - but I think there some session based variables we are not correctly using/resetting when bots and or player logs out.

@witzel: Thx for providing debug info! In general this should be useful... but... :) it seems the call stacks are not usable for me. It seems it crashes on a normal teleport/taxi thing. Maybe this is not playerbot related at all. In my last post I explained to marry how to correctly debug with visual c++ on windows. Maybe you also could run it this way? Think I have to write some wiki tutorials on playerbot on how to debug the whole stuff correctly, so that even ppl new to coding can do it with their tools :)

Link to comment
Share on other sites

@Greystar: The problem you experiencing is a session thing. There is nothing wrong in the core itself. It's the playerbot who messes this up. Did not dig into this yet - but I think there some session based variables we are not correctly using/resetting when bots and or player logs out.

@witzel: Thx for providing debug info! In general this should be useful... but... :) it seems the call stacks are not usable for me. It seems it crashes on a normal teleport/taxi thing. Maybe this is not playerbot related at all. In my last post I explained to marry how to correctly debug with visual c++ on windows. Maybe you also could run it this way? Think I have to write some wiki tutorials on playerbot on how to debug the whole stuff correctly, so that even ppl new to coding can do it with their tools :)

Okay thanks for the information. After tomorrow I'll probably be offline for a while (moving), so you won't get any comments from this user for a while.

Link to comment
Share on other sites

merged branch 'master' of git://github.com/mangos/mangos.

since 3.2.0 is right around the corner i played with merging playerbot into 320 branch and all went well :)

for those interested heres a simple batch file i wrote to get you started on playerbot 320...dont forget those 320 sqls ;)

@echo off
cd "C:\\svn"
call "C:\\Program Files\\Git\\cmd\\git.cmd" clone git://github.com/playerbot/mangos.git playerbot
cd playerbot
call "C:\\Program Files\\Git\\cmd\\git.cmd" checkout -b 320
call "C:\\Program Files\\Git\\cmd\\git.cmd" pull git://github.com/mangos/mangos.git 320
pause

enjoy :D

Link to comment
Share on other sites

For the crash thingy: When PlayerbotAI crashes on map change (i.e. Outland->Azeroth), shouldn't it also crash on map changes from Eastern Kingdom to Kalimdor, or from Eastern Kingdom to The Stockades? Logically it's the same process. But I do not get any crashes. Only suggestion is that only (!) win32/64 servers crash at this point. Didn't test this deep on my debug machine yet. Just tried the working code in depth on my linux server...

Link to comment
Share on other sites

Runsttren It is also crashing on Heroics here is what i have so far.

Revision: * * 8261 *
Date 27:7:2009. Time 18:0 
//=====================================================
*** Hardware ***
Processor: AMD Phenom(tm) II X4 940 Processor
Number Of Processors: 4
Physical Memory: 4194303 KB (Available: 3190744 KB)
Commit Charge Limit: 4194303 KB

*** Operation System ***
Windows Vista or Windows Server 2008 Home Edition Service Pack 1 (Version 6.0, Build 6001)

//=====================================================
Exception code: C0000005 ACCESS_VIOLATION
Fault address:  004395EB 01:000385EB D:\\mangosd.exe

Registers:
EAX:00000B74
EBX:0DF5F890
ECX:10946E70
EDX:00000000
ESI:00000000
EDI:00871BF0
CS:EIP:0023:004395EB
SS:ESP:002B:0F6F2834  EBP:0F6F384C
DS:002B  ES:002B  FS:0053  GS:002B
Flags:00010212

Call stack:
Address   Frame     Function      SourceFile
004395EB  00000000  WorldObject::GetBaseMap+7B
00437101  00000000  WorldObject::GetZoneAndAreaId+11
004BA907  00000000  Player::Update+9A7
00495D26  00000000  Map::Update+D6
0049BCD3  00000000  InstanceMap::Update+13
007DFC2E  00000000  MapInstanced::Update+DE
005FAF68  00000000  MapManager::Update+128
005DF60B  00000000  World::Update+77B
0042F31E  00000000  WorldRunnable::run+8E
00871C07  00000000  ACE_Based::Thread::ThreadTask+17
701F14D4  00000000  __WSAFDIsSet+FFFFFFFFFFFCC45C
70CF3433  00000000  _endthreadex+44
70CF34C7  00000000  _endthreadex+D8
75D2E4A5  00000000  BaseThreadInitThunk+E
77AFCFED  00000000  RtlCreateUserProcess+8C
77AFD1FF  00000000  RtlCreateProcessParameters+4E
========================
Local Variables And Parameters

Call stack:
Address   Frame     Function      SourceFile
004395EB  00000000  WorldObject::GetBaseMap+7B
   Local  <user defined> 'this'

00437101  00000000  WorldObject::GetZoneAndAreaId+11
   Local  <user defined> 'this'
   Local  <user defined> 'zoneid'
   Local  <user defined> 'areaid'

004BA907  00000000  Player::Update+9A7
punting on symbol newzone
punting on symbol newarea
   Local  <user defined> 'this'
punting on symbol p_time
punting on symbol now
   Local  <user defined> 'pet'

00495D26  00000000  Map::Update+D6
   Local  <user defined> 'this'
   Local  <user defined> 't_diff'
   Local  <user defined> 'updater'
   Local  <user defined> 'world_object_update'
   Local  <user defined> 'grid_object_update'

0049BCD3  00000000  InstanceMap::Update+13
   Local  <user defined> 'this'
   Local  <user defined> 't_diff'

007DFC2E  00000000  MapInstanced::Update+DE
   Local  <user defined> 'this'
   Local  <user defined> 't'
   Local  <user defined> 'i'

005FAF68  00000000  MapManager::Update+128
   Local  <user defined> 'iter'
   Local  <user defined> 'this'
punting on symbol diff

005DF60B  00000000  World::Update+77B
punting on symbol i
   Local  <user defined> 'this'
punting on symbol diff
   Local  unsigned int 'autobroadcaston' = 1

0042F31E  00000000  WorldRunnable::run+8E
punting on symbol diff
   Local  <user defined> 'this'
punting on symbol realCurrTime
punting on symbol realPrevTime
punting on symbol prevSleepTime

00871C07  00000000  ACE_Based::Thread::ThreadTask+17
punting on symbol param
   Local  <user defined> '_task'

701F14D4  00000000  __WSAFDIsSet+FFFFFFFFFFFCC45C

70CF3433  00000000  _endthreadex+44

70CF34C7  00000000  _endthreadex+D8

75D2E4A5  00000000  BaseThreadInitThunk+E

77AFCFED  00000000  RtlCreateUserProcess+8C

77AFD1FF  00000000  RtlCreateProcessParameters+4E

========================
Global Variables

Debug points to

Located in Object.cpp



Map const* WorldObject::GetBaseMap() const
{
   ASSERT(m_currMap);
   return m_currMap->GetParent();<---------------this is the line that is causing the crashes
}


void WorldObject::GetZoneAndAreaId(uint32& zoneid, uint32& areaid) const
{
   GetBaseMap()->GetZoneAndAreaId(zoneid, areaid, m_positionX, m_positionY, m_positionZ);<---------------this is the line that is causing the crashes
}

Hope this helps try going in to a Heroic mode or raid.

Link to comment
Share on other sites

I have more .

mangosd.exe!WorldObject::GetBaseMap()  Line 1584 + 0x9 bytes    C++
    mangosd.exe!WorldObject::GetZoneAndAreaId(unsigned int & zoneid=0, unsigned int & areaid=0)  Line 1115 + 0x8 bytes    C++
    mangosd.exe!Player::Update(unsigned int p_time=110)  Line 1254    C++
>    mangosd.exe!Map::Update(const unsigned int & t_diff=110)  Line 577    C++
    mangosd.exe!MapManager::Update(unsigned int diff=47)  Line 257    C++
    mangosd.exe!World::Update(unsigned int diff=47)  Line 1579    C++
    mangosd.exe!WorldRunnable::run()  Line 66    C++
    mangosd.exe!ACE_Based::Thread::ThreadTask(void * param=0x0e181c10)  Line 161    C++
    ACE.dll!ACE_OS_Thread_Adapter::invoke()  + 0x74 bytes    C++
    msvcr90.dll!_callthreadstartex()  Line 348 + 0x6 bytes    C
    msvcr90.dll!_threadstartex(void * ptd=0x0f2a3c68)  Line 326 + 0x5 bytes    C
    kernel32.dll!75d2e4a5()     
    [Frames below may be incorrect and/or missing, no symbols loaded for kernel32.dll]    
    ntdll.dll!77afcfed()     
    ntdll.dll!77afd1ff()     

hope this helps

Link to comment
Share on other sites

For the crash thingy: When PlayerbotAI crashes on map change (i.e. Outland->Azeroth), shouldn't it also crash on map changes from Eastern Kingdom to Kalimdor, or from Eastern Kingdom to The Stockades? Logically it's the same process. But I do not get any crashes. Only suggestion is that only (!) win32/64 servers crash at this point. Didn't test this deep on my debug machine yet. Just tried the working code in depth on my linux server...

Actually it happens on any map changing, like entering a instance, switching map while taking boats, etc

I am using x64 unix system....

Link to comment
Share on other sites

Guest
This topic is now closed to further replies.
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. Privacy Policy Terms of Use