Jump to content

Playerbot (archive)


Recommended Posts

  • Replies 1.8k
  • Created
  • Last Reply

Top Posters In This Topic

Hi klunk,

Sorry I do not understand what you are trying to do.

I have created my own fork of mangos on git hub, identified check in 9162 and set a branch on that. I then checkout to that branch and add your repository. I get a load of conflicts that I have to manually merge, just by accepting the combined result, however NPCHandler.cpp is not so easy and I cannot understand whet the result should look like.

Are you trying to create your own online repo ?

or

Are you just trying to merge MaNGOS with Playerbot on your local hardrive?

I will help you if I can, but I need to know clearly what you are trying to achieve.

Please get back to me

@erazare Good to hear the code on blueboy is behaving itself. I'm trying out a few ideas that I hope will improve the AI. Keep on trucking ;)

Link to comment
Share on other sites

Hi klunk,

Sorry I do not understand what you are trying to do.

Are you trying to create your own online repo ?

or

Are you just trying to merge MaNGOS with Playerbot on your local hardrive?

I will help you if I can, but I need to know clearly what you are trying to achieve.

Please get back to me

@erazare Good to hear the code on blueboy is behaving itself. I'm trying out a few ideas that I hope will improve the AI. Keep on trucking ;)

good to hear always interested in new AI esp. concerning talents and spells.

also good to see your repo surviving the storm... my mangchat repo is now an epic fail thanks to whatever they are doing to the main branch as of late.. i cant make heads or tails of it.

Link to comment
Share on other sites

I have created a repo on github which is a fork of mangos at [9173], I then cloned that to my local machine, branched at [9162] where I am trying to apply the patch. I am getting gossip enums declared in 2 places and missing declarations in headers when I try to compile.

I am following your instructions on page 16 of this thread to generate the playerbot patch, but there are loads of compile errors.

When done I want to apply a number of patched, including AHbot, but I am starting with playerbot as I get the feeling this might be the hardest to intergrate.

Thanks for your help.

Link to comment
Share on other sites

I have created a repo on github which is a fork of mangos at [9173], I then cloned that to my local machine, branched at [9162] where I am trying to apply the patch. I am getting gossip enums declared in 2 places and missing declarations in headers when I try to compile.

I am following your instructions on page 16 of this thread to generate the playerbot patch, but there are loads of compile errors.

When done I want to apply a number of patched, including AHbot, but I am starting with playerbot as I get the feeling this might be the hardest to intergrate.

Thanks for your help.

what would you like to patch into it when you are all completed? Just curious because I have a functioning 9178 with playerbot, mangchat (yep it fixed), vehicles, and ahbot which I am going to push to my repo later today... firest I want to experiment just a tad further... i intend to branch add branches to my repo for all the seperate mods I use to build it so that each mod in my repo will have its seperate branch on the repo so if anyone wants to know exactly which mod i am using for it they can get the individual branch updates... (also helps me for future rebuilds)

Link to comment
Share on other sites

what would you like to patch into it when you are all completed? Just curious because I have a functioning 9178 with playerbot, mangchat (yep it fixed), vehicles, and ahbot which I am going to push to my repo later today... firest I want to experiment just a tad further... i intend to branch add branches to my repo for all the seperate mods I use to build it so that each mod in my repo will have its seperate branch on the repo so if anyone wants to know exactly which mod i am using for it they can get the individual branch updates... (also helps me for future rebuilds)

Well I want to do similar to what you have and maybe add a few more patches, not sure yet because I am new to mangos. I used to have a vanilla trinity server running. Its also partly an exercise in fun. I have not done C++ for a few years and I am happy to get my hands dirty, hence doing it myself, but the fun disappears when it does not seem to work that easily :)

Tell me, should I have scriptdev2 applied before I patch playerbot or not?

Link to comment
Share on other sites

I have created a repo on github which is a fork of mangos at [9173], I then cloned that to my local machine, branched at [9162] where I am trying to apply the patch. I am getting gossip enums declared in 2 places and missing declarations in headers when I try to compile.

I am following your instructions on page 16 of this thread to generate the playerbot patch, but there are loads of compile errors.

When done I want to apply a number of patched, including AHbot, but I am starting with playerbot as I get the feeling this might be the hardest to intergrate.

Thanks for your help.

Hi,

I see what you are doing now. O.K. What's your repo called. I just searched github to see if I could glean some more info, and could not find a reference to klunk. Is it a public or private repo?

It sounds like you did exactly what I did with my repo (you forked off Playerbot), and your going to suffer all the headaches I did. If your using this a means to appreciate 'git' & 'github' better, then thats fine. I'll guide you through any pitfalls. However if you want a repo that you can quickly use, you should have forked off blueboy.

The tell tale signs that this is so, are the issues with GOSSIP menu. From MaNGOS[8898] they moved alot of code around on the main MaNGOS branch, and it was necessary to move the playerbot code with it. They did not make the move in one commit, so this caused further issues.

O.K so your following my post #394, yes. I will assume you are using linux, or know how to convert bash scripts to something that is compatible with your system. I created the two scripts to fully automate the patch creation process. When run they will create the patch without any intervention. If you are having issues with the gethash.sh script, you can of course revert to manually obtaining the <commit HASH> as I did in the begining.

Run the 'pbot.sh' script in your working directory. This will call 'gethash.sh' when required.

Script Process

1. We need to determine what is the 'HEAD' or latest version of MaNGOS branch at the time of the current 'Playerbot' code. It is understood that we are looking at

git://github.com/blueboy/mangos.git
and not
git://github.com/playerbot/mangos.git
Or you will get the wrong code. I believe this is where you are going wrong. I suggest you change the line in 'pbot.sh',

# get hash for latest mangos release [XXXX], associated with playerbot release
git pull git://github.com/playerbot/mangos.git master

to

# get hash for latest mangos release [XXXX], associated with playerbot release
git pull git://github.com/blueboy/mangos.git master

and

# add remote playerbot branch to compare with local mangos branch
git remote add playerbot git://github.com/playerbot/mangos.git

to

# add remote playerbot branch to compare with local mangos branch
git remote add playerbot git://github.com/blueboy/mangos.git

Apply the created patch to your clean MaNGOS[9162] branch on your harddrive

patch --dry-run -p1 < playerbot.patch

(I like to use --dry-run to test the patch first)

To commit back to your repo,

git status

// will show all files modified

git add <modified files>

// will add modified files to commit

git commit -a -m "Commit description"

// 'git commit' without options for merges

git push

// upload commit

If it still doesn't work, let me know

Link to comment
Share on other sites

Well I want to do similar to what you have and maybe add a few more patches, not sure yet because I am new to mangos. I used to have a vanilla trinity server running. Its also partly an exercise in fun. I have not done C++ for a few years and I am happy to get my hands dirty, hence doing it myself, but the fun disappears when it does not seem to work that easily :)

Tell me, should I have scriptdev2 applied before I patch playerbot or not?

Hi,

Scriptdev2 is separate to the MaNGOS and playerbot code. You can download it before or after!. Remember to patch the code for scriptdev before compiling otherwise the scriptdev code with not compile with MaNGOS. I wrote a small script to make this easier,

#!/bin/bash 

unset BRANCH
unset PATCHES

BRANCH=$1
PATCHES="/home/mangos/compile/mangos1/src/bindings/ScriptDev2/patches/"

[ ! -z "${BRANCH}" ] || { echo "available patches:>"; ls ${PATCHES}; exit 1 ; }

patch -p1 < ${PATCHES}'MaNGOS-'${BRANCH}'-ScriptDev2.patch'

N.B Obviously, the directory tree for 'PATCHES' above will be different on your computer.

You can run the patch manually from the directory listed. Then finally before compiling

autoreconf --install --force

Hope this helps

Link to comment
Share on other sites

Hi,

I see what you are doing now. O.K. What's your repo called. I just searched github to see if I could glean some more info, and could not find a reference to klunk. Is it a public or private repo?

It sounds like you did exactly what I did with my repo (you forked off Playerbot), and your going to suffer all the headaches I did. If your using this a means to appreciate 'git' & 'github' better, then thats fine. I'll guide you through any pitfalls. However if you want a repo that you can quickly use, you should have forked off blueboy.

The tell tale signs that this is so, are the issues with GOSSIP menu. From MaNGOS[8898] they moved alot of code around on the main MaNGOS branch, and it was necessary to move the playerbot code with it. They did not make the move in one commit, so this caused further issues.

O.K so your following my post #394, yes. I will assume you are using linux, or know how to convert bash scripts to something that is compatible with your system. I created the two scripts to fully automate the patch creation process. When run they will create the patch without any intervention. If you are having issues with the gethash.sh script, you can of course revert to manually obtaining the <commit HASH> as I did in the begining.

Run the 'pbot.sh' script in your working directory. This will call 'gethash.sh' when required.

Script Process

1. We need to determine what is the 'HEAD' or latest version of MaNGOS branch at the time of the current 'Playerbot' code. It is understood that we are looking at and not Or you will get the wrong code. I believe this is where you are going wrong. I suggest you change the line in 'pbot.sh',

# get hash for latest mangos release [XXXX], associated with playerbot release
git pull git://github.com/playerbot/mangos.git master

to

# get hash for latest mangos release [XXXX], associated with playerbot release
git pull git://github.com/blueboy/mangos.git master

and

# add remote playerbot branch to compare with local mangos branch
git remote add playerbot git://github.com/playerbot/mangos.git

to

# add remote playerbot branch to compare with local mangos branch
git remote add playerbot git://github.com/blueboy/mangos.git

Apply the created patch to your clean MaNGOS[9162] branch on your harddrive

patch --dry-run -p1 < playerbot.patch

(I like to use --dry-run to test the patch first)

To commit back to your repo,

git status

// will show all files modified

git add <modified files>

// will add modified files to commit

git commit -a -m "Commit description"

// 'git commit' without options for merges

git push

// upload commit

If it still doesn't work, let me know

I think you have just pointed out my problem here, the git add refers to playerbot and not blueboy, this could account for the merge problems I am getting at the end of your pbot script. It works fine if I change that one as well.

So even if I get a good patch I am in danger of having issues with gossip if I start with the main mangos repo? That's a shame.

Link to comment
Share on other sites

Hi klunk,

No you should not have problems with gossip?. You had created an old patch only compatible with MaNGOS[8898]. The revised patch that you create should work fine, try it

Edit: Oh, yeah I think you forked off the correct branch, now I have had chance to think about it. Your repo will be thus separate from Playerbot & Blueboy.

Cheers

Link to comment
Share on other sites

I think you have just pointed out my problem here, the git add refers to playerbot and not blueboy, this could account for the merge problems I am getting at the end of your pbot script. It works fine if I change that one as well.

So even if I get a good patch I am in danger of having issues with gossip if I start with the main mangos repo? That's a shame.

I know it's bad form to reply (with quote) your own posts, but I wanted to say thanks to blueboy for pointing out where I have gone wrong. I now have a build that is working and please ignore my question above, I understand what you were saying now.

Link to comment
Share on other sites

Hi klunk,

No you should not have problems with gossip?. You had created an old patch only compatible with MaNGOS[8898]. The revised patch that you create should work fine, try it

Edit: Oh, yeah I think you forked off the correct branch, now I have had chance to think about it. Your repo will be thus separate from Playerbot & Blueboy.

Cheers

I realise I didnt answer two of your questions, my git repo is klunk/mangos and I am using linux. One question for you, not really related to playerbot I know, but now I have a fork of mangos on giyhub and I clone that locally, how do I update the fork on git hub to the lastes from main mangos? Do I have to merge them in to my local git repo and then push them up to the server from my machine?

Link to comment
Share on other sites

I realise I didnt answer two of your questions, my git repo is klunk/mangos and I am using linux. One question for you, not really related to playerbot I know, but now I have a fork of mangos on giyhub and I clone that locally, how do I update the fork on git hub to the lastes from main mangos? Do I have to merge them in to my local git repo and then push them up to the server from my machine?

Its nice to see someone else using Linux for a change, I was begining to think I was the only one. Welcome to the forum and if you are able to contirbute that would be great, particularly if you have some experience with trintycore. There are a number of threads that would be interested in your opinions. The answer to your merge question is yes. Treat your hardrive as your workbench. For a merge, First clone your repo to your computer. Then set up a 'remote' branch that you wish to merge with.

Your repo will automatically be labelled 'master'.

git clone [email][email protected]:klunk/mangos.git[/email]

git remote add mangos git://gthub.com/mangos/mangos.git

git pull mangos master

fix any conflicts

git commit

git push

Careful when you commit. I do not use or like the commandline editor 'vi'. This is automatically opened after you commit a merge. It took me ages to work out that the editor had been opened. It does this so you can edit the message used for the merge. I thought that the commit had corrupted.

Making normal changes is similar, except you need to add modified files before commiting, and you specify a message 'what you have changed',

git add <modified files>

git commit -a -m "What you did"

git push

Hope this helps

Link to comment
Share on other sites

This patch which will be cleanly applied to mangos 9183 http://pastebin.ca/1752418

blueboy please check the patch if it got any error.

my commit for playerbot is here http://github.com/bizkut/mangos/commit/c9448600a023ffd0191dcf15e7cd07085fc4be9a

with "playerbot" branch

Hi,

I've checked the code on pastebin, with a patch I created from your repo. I tested both against MaNGOS [9183] and they both work perfectly. I haven't checked whether the code compiles, but I am fairly sure that you won't get any problems.

Cheers

Link to comment
Share on other sites

hey blue boy I just wanted to point out some findings that have occured in game when i tried to merge your repo up to 9183 and use it...

first of all during the git-merge a strange merge error occurs in Player.h to the effect of a button-call if you clean it up and leave that in the server will build, if you take it out, the server wont.

with the built server everything seems to be all well and fine til you try to group your bot.

at this point the server CLI flags the following error:

2010-01-15 13:21:42 ERROR:ERROR: Attempted to get in ByteBuffer (pos: 0 size: 0) value with size: 4
2010-01-15 13:21:42 ERROR:WorldSession::Update ByteBufferException occured while parsing a packet (opcode: 110) from client 192.168.xxx.xxx, accountid=135. Skipped packet.

in-game the bot doesnt have any characteristics of being grouped but if you try to group the bot again it says that its already in your group.

this of course means you cant loot its kills and other group related needs... I noticed that bizkut patched his repo I am going to try and pull that and see if it fixes it.

Link to comment
Share on other sites

i just tried merging bizkut's getting the same error in player.h

       bool canSeeSpellClickOn(Creature const* creature) const;
<<<<<<< HEAD
       uint32 GetActionButtonSpell(uint8 button) const
       {
           ActionButtonList::const_iterator ab = m_actionButtons.find(button);
           return ab != m_actionButtons.end() && ab->second.uState != ACTIONBUTTON_DELETED && ab->second.GetType() == ACTION_BUTTON_SPELL ? ab->second.GetAction() : 0;
       }
=======

       // Playerbot mod:
       // A Player can either have a playerbotMgr (to manage its bots), or have playerbotAI (if it is a bot), or
       // neither. Code that enables bots must create the playerbotMgr and set it using SetPlayerbotMgr.
       void SetPlayerbotAI(PlayerbotAI* ai) { assert(!m_playerbotAI && !m_playerbotMgr); m_playerbotAI=ai; }
       PlayerbotAI* GetPlayerbotAI() { return m_playerbotAI; }
       void SetPlayerbotMgr(PlayerbotMgr* mgr) { assert(!m_playerbotAI && !m_playerbotMgr); m_playerbotMgr=mgr; }
       PlayerbotMgr* GetPlayerbotMgr() { return m_playerbotMgr; }
       void SetBotDeathTimer() { m_deathTimer = 0; }

>>>>>>> bizkut/playerbot
   protected:

any ideas? if you clear it up this way :

       bool canSeeSpellClickOn(Creature const* creature) const;
       uint32 GetActionButtonSpell(uint8 button) const
       {
           ActionButtonList::const_iterator ab = m_actionButtons.find(button);
           return ab != m_actionButtons.end() && ab->second.uState != ACTIONBUTTON_DELETED && ab->second.GetType() == ACTION_BUTTON_SPELL ? ab->second.GetAction() : 0;
       }

       // Playerbot mod:
       // A Player can either have a playerbotMgr (to manage its bots), or have playerbotAI (if it is a bot), or
       // neither. Code that enables bots must create the playerbotMgr and set it using SetPlayerbotMgr.
       void SetPlayerbotAI(PlayerbotAI* ai) { assert(!m_playerbotAI && !m_playerbotMgr); m_playerbotAI=ai; }
       PlayerbotAI* GetPlayerbotAI() { return m_playerbotAI; }
       void SetPlayerbotMgr(PlayerbotMgr* mgr) { assert(!m_playerbotAI && !m_playerbotMgr); m_playerbotMgr=mgr; }
       PlayerbotMgr* GetPlayerbotMgr() { return m_playerbotMgr; }
       void SetBotDeathTimer() { m_deathTimer = 0; }

the server will build but the packet error mentioned in previous reply occurs...

if you clean it up the other way :

       bool canSeeSpellClickOn(Creature const* creature) const;

       // Playerbot mod:
       // A Player can either have a playerbotMgr (to manage its bots), or have playerbotAI (if it is a bot), or
       // neither. Code that enables bots must create the playerbotMgr and set it using SetPlayerbotMgr.
       void SetPlayerbotAI(PlayerbotAI* ai) { assert(!m_playerbotAI && !m_playerbotMgr); m_playerbotAI=ai; }
       PlayerbotAI* GetPlayerbotAI() { return m_playerbotAI; }
       void SetPlayerbotMgr(PlayerbotMgr* mgr) { assert(!m_playerbotAI && !m_playerbotMgr); m_playerbotMgr=mgr; }
       PlayerbotMgr* GetPlayerbotMgr() { return m_playerbotMgr; }
       void SetBotDeathTimer() { m_deathTimer = 0; }

   protected:

the server wont build.

any ideas?

Link to comment
Share on other sites

Hi erazare,

Are you using Tassadar's vehicle code with this. I got a conflict in Player.h when I tried to integrate 'playerbot' and 'vehicle' code together. (Details post #510) I just integrated bizkut code into MaNGOS[9183] without a problem. Have you got anything else in the code that might be conflicting.

Cheers

Link to comment
Share on other sites

hmm I see what you did, you moved the code around a little.. will that really affect the overall?

Not at all. Here is the diff between original Player.h and playerbot patch

55a56,59
> // Playerbot mod
> class PlayerbotAI;
> class PlayerbotMgr;
> 
2338a2343,2352
>  
>         // Playerbot mod:
>         // A Player can either have a playerbotMgr (to manage its bots), or have playerbotAI (if it is a bot), or
>         // neither. Code that enables bots must create the playerbotMgr and set it using SetPlayerbotMgr.
>         void SetPlayerbotAI(PlayerbotAI* ai) { assert(!m_playerbotAI && !m_playerbotMgr); m_playerbotAI=ai; }
>         PlayerbotAI* GetPlayerbotAI() { return m_playerbotAI; }
>         void SetPlayerbotMgr(PlayerbotMgr* mgr) { assert(!m_playerbotAI && !m_playerbotMgr); m_playerbotMgr=mgr; }
>         PlayerbotMgr* GetPlayerbotMgr() { return m_playerbotMgr; }
>         void SetBotDeathTimer() { m_deathTimer = 0; }
> 
2598a2613,2616
>          // Playerbot mod:
>         PlayerbotAI* m_playerbotAI;
>     PlayerbotMgr* m_playerbotMgr;
> 

Link to comment
Share on other sites

I explained how you integrate the two together in #510. I presume this is what causes your conflict. Playerbot into MaNGOS works fine.

When I create individual patches, each is compared to a clean MaNGOS branch. The patch only expects to find MaNGOS code. I explained that vehicle and playerbot both update the same section of code in Player.h. I suggest you apply playerbot first and edit the vehicle.patch to account for the change in the patch 'pattern'

three lines following the mod,

     protected:

        uint32 m_contestedPvPTimer;

with


      // Playerbot mod:
      // A Player can either have a playerbotMgr (to manage its bots), or have playerbotAI (if it is a bot), or

Cheers

Link to comment
Share on other sites

ok for the record, it is NOT vehicle that is doing this to cause the end result of the bots behaving badly... I just compiled tiamat without the vehicle branch and it still returns the errors I listed earlier.. all branches in my build are mangos based not Tasssadar's

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