Jump to content

Playerbot (archive)


Recommended Posts

  • Replies 1.8k
  • Created
  • Last Reply

Top Posters In This Topic

Blueboy,the replacement works 100% ,DuB yes ,that error is from the AH ill post the new code for ya:

MailSender(MailMessageType messageType, uint32 sender_guidlow_or_entry, MailStationery stationery = MAIL_STATIONERY_DEFAULT)
           : m_messageType(messageType), m_senderId(sender_guidlow_or_entry), m_stationery(stationery)
       {
       }

replace that in mail.h and

void MailDraft::SendReturnToSender(uint32 sender_acc, ObjectGuid sender_guid, ObjectGuid receiver_guid)

in mail.cpp

Link to comment
Share on other sites

I have a small error today

10> PlayerbotRogueAI.cpp

10>..\\..\\src\\game\\playerbot\\PlayerbotMgr.cpp(348): error C3861: 'GUID_LOPART': identifier not found

10>..\\..\\src\\game\\playerbot\\PlayerbotMgr.cpp(367): error C3861: 'GUID_LOPART': identifier not found

Did I miss something ?

(I am using portal code)

Link to comment
Share on other sites

Hi mrelfire,

Yes thanks, I've just had to fix that, whilst compiling the latest core with playerbot.

They have dropped the use of 'GUID_LOPART' and there is a work around. I will update both repos shortly, but in the meantime here is a patch.

diff --git a/src/game/playerbot/PlayerbotMgr.cpp b/src/game/playerbot/PlayerbotMgr.cpp
index 975ab7d..991e17f 100644
--- a/src/game/playerbot/PlayerbotMgr.cpp
+++ b/src/game/playerbot/PlayerbotMgr.cpp
@@ -323,7 +323,8 @@ void PlayerbotMgr::HandleMasterIncomingPacket(const WorldPacket& packet)

            sLog.outDebug("PlayerbotMgr: CMSG_REPAIR_ITEM");

-            uint64 npcGUID, itemGUID;
+            ObjectGuid npcGUID;
+            uint64 itemGUID;
            uint8 guildBank;

            p.rpos(0);    //reset packet pointer
@@ -345,7 +346,7 @@ void PlayerbotMgr::HandleMasterIncomingPacket(const WorldPacket& packet)
                Creature *unit = bot->GetNPCIfCanInteractWith(npcGUID, UNIT_NPC_FLAG_REPAIR);
                if (!unit)     // Check if NPC can repair bot or not
                {
-                    sLog.outDebug("PlayerbotMgr: HandleRepairItemOpcode - Unit (GUID: %u) not found or you can't interact with him.", uint32(GUID_LOPART(npcGUID)));
+                    sLog.outDebug("PlayerbotMgr: HandleRepairItemOpcode - Unit (GUID: %s) not found or you can't interact with him.", npcGUID.GetString().c_str());
                    return;
                }

@@ -364,7 +365,7 @@ void PlayerbotMgr::HandleMasterIncomingPacket(const WorldPacket& packet)
                }
                else      // Handle feature (repair all items) for bot
                {
-                    sLog.outDebug("ITEM: Repair all items, npcGUID = %u", GUID_LOPART(npcGUID));
+                    sLog.outDebug("ITEM: Repair all items, npcGUID = %s", npcGUID.GetString().c_str());

                    TotalCost = bot->DurabilityRepairAll(true, discountMod, guildBank > 0 ? true : false);
                }

Hope this helps

Link to comment
Share on other sites

hey blueboy, I have a question. Is there any other way to test my changes instead of re-compiling the whole project and then setting up the server and trying to see the changes in game?

Yes, there is no need to re-compile the whole project.

If your using *nix, just run

1. make to ensure the changes work. Only files that have changed need re-compiling

2. make install to actually build the object code.

and if your using windows I believe there is a re-build command in Visual C, that does the same.

Note: If any header files (*.h) are changed, the compiler will force a full compilation, due to the interdependancy of these files.

I also have written a service script (clean.sh) for *nix systems, that backs up the server config files before installation. These can then be quickly restored, to save time. You should be able to adapt this for windows.

#!/bin/bash
rm -R /home/mangos/wow/bin
if [ -d "/home/mangos/wow/etc.old" ] && [ -d "/home/mangos/wow/data" ]; then
   rm -R /home/mangos/wow/etc.old
fi
mv /home/mangos/wow/etc /home/mangos/wow/etc.old
rm -R /home/mangos/wow/data
rm -R /home/mangos/wow/lib

Run clean.sh, Before compilation

and after compilation

rm -r etc

mv etc.old etc

Then just load the server.. :D

Hope this helps

Link to comment
Share on other sites

I'm using Windows Vista and VS 2010, thanks for that advice. :)

I did notice that you've been trying to complete the basic bot's functions, so it seems fewer updates about AI are coming out recently.

What I actually mean is can we find out another way, for instance, using an emulator or something like that, to test the bot's behavior especially in a combat scenario, and record every bot's action as an output, just like what the combat log always does. So with this convenience, we could have a look at the details of what happened and efficiently fix what needs to be fixed. I think it's a more comfortable way to test things out for the developers engaged in bot's AI coding rather than rebuilding the solution and reloading the server and game everytime a change is made, or maybe you guys already have your own better idea about it.

Besides, I need a little help here. there were some errors when I was trying to build your latest commit in branch 'training':

2    IntelliSense: identifier "BotSpellList" is undefined    e:\\syenet-portal\\src\\game\\playerbot\\playerbotai.h    208
53    IntelliSense: identifier "BotLootList" is undefined    e:\\syenet-portal\\src\\game\\playerbot\\playerbotai.h    214
54    IntelliSense: identifier "BotLootList" is undefined    e:\\syenet-portal\\src\\game\\playerbot\\playerbotai.h    371
55    IntelliSense: identifier "BotSpellList" is undefined    e:\\syenet-portal\\src\\game\\playerbot\\playerbotai.h    372

All other errors seem relative to these ones, any suggestion?

Link to comment
Share on other sites

To Syenet:

There's no need to log bot actions to understand what happens during combat. Just look at the code and you'll see that combat performance cannot be efficient now. All class AIs use same idea - spell sequences. Usually there are three of them. Bot iterates over one sequence and switches to another one. I wonder if this code was written by bots as well...

If you know a bit of C++ then fixing combat for a chosen class wouldn't be a big problem. Playerbot has most of functionality required in combat.

To fix compilation try to add this to PlayerbotAI class:

typedef std::list<uint64> BotLootList;
typedef std::list<uint32> BotSpellList;

Blueboy probably forgot to include typedefs into last commit.

Link to comment
Share on other sites

Blueboy probably forgot to include typedefs into last commit.

Yes, When I was renaming things, I forgot to rename the typedef declarations of

typedef std::list<uint64> BotLootCreature;

typedef std::list<uint32> BotSpellTraining;

to

typedef std::list<uint64> BotLootList;

typedef std::list<uint32> BotSpellList;

Sorry about that :o I'll be pushing a new commit today and I'll correct it then. If you are testing 'training' code; If you have a large group of bots, it's easy to forget which bot has what? .... I have a new command ('skill') that will shows the current status of bot primary professions.

Hope this helps

Link to comment
Share on other sites

There's no need to log bot actions to understand what happens during combat. Just look at the code and you'll see that combat performance cannot be efficient now.

kyle1, I have read the AI code and I know what you mean. We can analyse the code and predict what the bot will do when the code is simple, but if we hope our bots in a party would be able to co-operate in a more complicated situation such as a dungeon or an arena, we have to consider everything that may happen, well that's not quite possible I'm afraid. Since we can only test the code to see the effect in the game, I think the only way to improve the AI is to look at the combat log and find out why a raid fails and how to avoid. I know the log would contain real huge information to read, so I came up with that idea of making an emulator to visualize the data and simulate a scenario, then wait to see the result without reloading the server and game.

Of course I don't know if it's possible and if you guys wish the bot to be that capable, it's just my little proposal. btw, I'm still getting familiar with the code, I wish I could help and thanks for your commitment.

and there's no definition of TrainerSpellData const* Creature::GetTrainerTemplateSpells() const

Error    3    error C2039: 'GetTrainerTemplateSpells' : is not a member of 'Creature'    E:\\syenet-portal\\src\\game\\playerbot\\PlayerbotAI.cpp    4361
Error    5    error LNK1181: cannot open input file 'E:\\syenet-portal\\win\\VC100\\game__Win32_Release\\game.lib'    E:\\syenet-portal\\win\\VC100\\LINK
Error    6    error LNK1181: cannot open input file 'mangosd.lib'    E:\\syenet-portal\\win\\VC100\\LINK
Error    7    IntelliSense: class "Creature" has no member "GetTrainerTemplateSpells"    e:\\syenet-portal\\src\\game\\playerbot\\playerbotai.cpp    4361

Link to comment
Share on other sites

I have a little problem with the last "trainer" update

11>------ Rebuild All started: Project: realmd, Configuration: Release Win32 ------
11>  AuthSocket.cpp
11>  BufferedSocket.cpp
10>  pchdef.cpp
11>  Main.cpp
11>  PatchHandler.cpp
11>  RealmList.cpp
10>c:\\mangos\\mangos\\spp\\src\\game\\playerbot/PlayerbotAI.h(208): error C2061: syntax error : identifier 'BotSpellList'
10>c:\\mangos\\mangos\\spp\\src\\game\\playerbot/PlayerbotAI.h(214): error C2061: syntax error : identifier 'BotLootList'
10>c:\\mangos\\mangos\\spp\\src\\game\\playerbot/PlayerbotAI.h(370): error C2146: syntax error : missing ';' before identifier 'm_lootTargets'
10>c:\\mangos\\mangos\\spp\\src\\game\\playerbot/PlayerbotAI.h(370): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
10>c:\\mangos\\mangos\\spp\\src\\game\\playerbot/PlayerbotAI.h(370): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
10>c:\\mangos\\mangos\\spp\\src\\game\\playerbot/PlayerbotAI.h(371): error C2146: syntax error : missing ';' before identifier 'm_spellsToLearn'
10>c:\\mangos\\mangos\\spp\\src\\game\\playerbot/PlayerbotAI.h(371): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
10>c:\\mangos\\mangos\\spp\\src\\game\\playerbot/PlayerbotAI.h(371): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
11>  WheatyExceptionReport.cpp
11>     Creating library ..\\..\\bin\\Win32_Release\\realmd.lib and object ..\\..\\bin\\Win32_Release\\realmd.exp
11>  realmd.vcxproj -> c:\\MaNGOS\\MANGOS\\spp\\win\\VC100\\..\\..\\bin\\Win32_Release\\realmd.exe
12>------ Rebuild All started: Project: mangosd, Configuration: Release Win32 ------
12>  stdsoap2.cpp
12>  soapServer.cpp
12>..\\..\\dep\\src\\gsoap\\stdsoap2.cpp(835): warning C4244: 'return' : conversion from 'std::streamsize' to 'size_t', possible loss of data
12>  soapC.cpp
12>  MaNGOSsoap.cpp
12>  CliRunnable.cpp
12>  Main.cpp
12>c:\\mangos\\mangos\\spp\\src\\game\\playerbot/PlayerbotAI.h(208): error C2061: syntax error : identifier 'BotSpellList'
12>c:\\mangos\\mangos\\spp\\src\\game\\playerbot/PlayerbotAI.h(214): error C2061: syntax error : identifier 'BotLootList'
12>c:\\mangos\\mangos\\spp\\src\\game\\playerbot/PlayerbotAI.h(370): error C2146: syntax error : missing ';' before identifier 'm_lootTargets'
12>c:\\mangos\\mangos\\spp\\src\\game\\playerbot/PlayerbotAI.h(370): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
12>c:\\mangos\\mangos\\spp\\src\\game\\playerbot/PlayerbotAI.h(370): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
12>c:\\mangos\\mangos\\spp\\src\\game\\playerbot/PlayerbotAI.h(371): error C2146: syntax error : missing ';' before identifier 'm_spellsToLearn'
12>c:\\mangos\\mangos\\spp\\src\\game\\playerbot/PlayerbotAI.h(371): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
12>c:\\mangos\\mangos\\spp\\src\\game\\playerbot/PlayerbotAI.h(371): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
12>  Master.cpp
12>  RASocket.cpp
12>c:\\mangos\\mangos\\spp\\src\\game\\playerbot/PlayerbotAI.h(208): error C2061: syntax error : identifier 'BotSpellList'
12>c:\\mangos\\mangos\\spp\\src\\game\\playerbot/PlayerbotAI.h(214): error C2061: syntax error : identifier 'BotLootList'
12>c:\\mangos\\mangos\\spp\\src\\game\\playerbot/PlayerbotAI.h(370): error C2146: syntax error : missing ';' before identifier 'm_lootTargets'
12>c:\\mangos\\mangos\\spp\\src\\game\\playerbot/PlayerbotAI.h(370): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
12>c:\\mangos\\mangos\\spp\\src\\game\\playerbot/PlayerbotAI.h(370): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
12>c:\\mangos\\mangos\\spp\\src\\game\\playerbot/PlayerbotAI.h(371): error C2146: syntax error : missing ';' before identifier 'm_spellsToLearn'
12>c:\\mangos\\mangos\\spp\\src\\game\\playerbot/PlayerbotAI.h(371): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
12>c:\\mangos\\mangos\\spp\\src\\game\\playerbot/PlayerbotAI.h(371): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
12>c:\\mangos\\mangos\\spp\\src\\game\\playerbot/PlayerbotAI.h(208): error C2061: syntax error : identifier 'BotSpellList'
12>c:\\mangos\\mangos\\spp\\src\\game\\playerbot/PlayerbotAI.h(214): error C2061: syntax error : identifier 'BotLootList'
12>c:\\mangos\\mangos\\spp\\src\\game\\playerbot/PlayerbotAI.h(370): error C2146: syntax error : missing ';' before identifier 'm_lootTargets'
12>c:\\mangos\\mangos\\spp\\src\\game\\playerbot/PlayerbotAI.h(370): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
12>c:\\mangos\\mangos\\spp\\src\\game\\playerbot/PlayerbotAI.h(370): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
12>c:\\mangos\\mangos\\spp\\src\\game\\playerbot/PlayerbotAI.h(371): error C2146: syntax error : missing ';' before identifier 'm_spellsToLearn'
12>c:\\mangos\\mangos\\spp\\src\\game\\playerbot/PlayerbotAI.h(371): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
12>c:\\mangos\\mangos\\spp\\src\\game\\playerbot/PlayerbotAI.h(371): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
12>  WorldRunnable.cpp
12>  WheatyExceptionReport.cpp
13>------ Rebuild All started: Project: script, Configuration: Release Win32 ------
13>  ScriptMgr.cpp
13>  sc_default.cpp
13>c:\\mangos\\mangos\\spp\\src\\game\\playerbot/PlayerbotAI.h(208): error C2061: syntax error : identifier 'BotSpellList'
13>c:\\mangos\\mangos\\spp\\src\\game\\playerbot/PlayerbotAI.h(214): error C2061: syntax error : identifier 'BotLootList'
13>c:\\mangos\\mangos\\spp\\src\\game\\playerbot/PlayerbotAI.h(370): error C2146: syntax error : missing ';' before identifier 'm_lootTargets'
13>c:\\mangos\\mangos\\spp\\src\\game\\playerbot/PlayerbotAI.h(370): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
13>c:\\mangos\\mangos\\spp\\src\\game\\playerbot/PlayerbotAI.h(370): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
13>c:\\mangos\\mangos\\spp\\src\\game\\playerbot/PlayerbotAI.h(371): error C2146: syntax error : missing ';' before identifier 'm_spellsToLearn'
13>c:\\mangos\\mangos\\spp\\src\\game\\playerbot/PlayerbotAI.h(371): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
13>c:\\mangos\\mangos\\spp\\src\\game\\playerbot/PlayerbotAI.h(371): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
13>  sc_defines.cpp
13>  system.cpp
13>c:\\mangos\\mangos\\spp\\src\\game\\playerbot/PlayerbotAI.h(208): error C2061: syntax error : identifier 'BotSpellList'
13>c:\\mangos\\mangos\\spp\\src\\game\\playerbot/PlayerbotAI.h(214): error C2061: syntax error : identifier 'BotLootList'
13>c:\\mangos\\mangos\\spp\\src\\game\\playerbot/PlayerbotAI.h(370): error C2146: syntax error : missing ';' before identifier 'm_lootTargets'
13>c:\\mangos\\mangos\\spp\\src\\game\\playerbot/PlayerbotAI.h(370): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
13>c:\\mangos\\mangos\\spp\\src\\game\\playerbot/PlayerbotAI.h(370): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
13>c:\\mangos\\mangos\\spp\\src\\game\\playerbot/PlayerbotAI.h(371): error C2146: syntax error : missing ';' before identifier 'm_spellsToLearn'
13>c:\\mangos\\mangos\\spp\\src\\game\\playerbot/PlayerbotAI.h(371): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
13>c:\\mangos\\mangos\\spp\\src\\game\\playerbot/PlayerbotAI.h(371): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
========== Rebuild All: 10 succeeded, 3 failed, 0 skipped ==========

Link to comment
Share on other sites

Hi Syenet,

Syenet wrote:and there's no definition of TrainerSpellData const* Creature::GetTrainerTemplateSpells() const

Hmmm, this looks like VC100 can't find Creature.h for some reason. I have looked at the header file and Creature.cpp and it definitely exists

class MANGOS_DLL_SPEC Creature : public Unit

{

..... extract from Creature.h

uint32 UpdateVendorItemCurrentCount(VendorItem const* vItem, uint32 used_count);

TrainerSpellData const* GetTrainerTemplateSpells() const;

TrainerSpellData const* GetTrainerSpells() const;

CreatureInfo const *GetCreatureInfo() const { return m_creatureInfo; }

I haven't compiled the code on a windows box for awhile. Leave it with me, the VC100 build files may need to be updated.

Hope this helps

Link to comment
Share on other sites

I have a little problem with the last "trainer" update

Yes, I haven't pushed the fix mentioned in post #1585 yet. ;) Once I have renamed the declarations of these two lists, it should silence the errors. In the meantime you can make the changes manually in PlayerbotAI.h

EDIT: I have just pushed my latest commit with fixes for previous issues. The code on branch 'training' has been tested with MaNGOS [10899] and compiles and runs without issue.

Hope this helps, and thanks for testing the 'training' code.

Link to comment
Share on other sites

Hi,

I searched at https://github.com/blueboy/portal/blob/training/src/game/Creature.h and still can't find it.

Then I added a declaration in Creature.h and a definition in Creature.cpp myself with the same code of TrainerSpellData const* GetTrainerSpells(), so it can be compiled with no error.

This is most strange. The extract I gave in my last post was taken for Creature.h in the core, with no mods.

https://github.com/mangos/mangos/blob/master/src/game/Creature.h

What version of the core are you running? This was added to the core in MaNGOS[10867]

https://github.com/mangos/mangos/commit/605ecf175f19883529bf4c39354d2b06da75a46d

Hope this helps

Link to comment
Share on other sites

Hi,

I don't get it, I cloned your latest 'portal' from git://github.com/blueboy/portal.git and checked out 'training', does it mean we're using the same code? the same version of core? the same everything? I just cloned and compiled, and got errors, nothing more.

I know what has happened. The code on portal is currently merged with core code MaNGOS[10856]. The change in the code was made in ManGOS[10867]. I create standalone patches and apply this directly to the latest core code. I will merge the code on portal and blueboy with the latest core, and this will fix the issue.

Hope this helps

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