Jump to content

Playerbot


Recommended Posts

March 14, 2012: Pushed:branch skillbot

Added save/restore for combat delay .

It will be automatically saved when the order is given , either by using 'combat delay <0 - 10>' or by using the sliders and set button in the addon.

It will automatically be restored along with combat orders when using 'resumeorders' or by pressing [bot resume] or [party resume] in the addon.

to check it, give the command 'orders' .

Be SURE to apply the newest sql ( sql/playerbotai/playerbotai_characters_svdata_002.sql)

Link to comment
Share on other sites

  • Replies 799
  • Created
  • Last Reply

Top Posters In This Topic

I had the same question!

This was the answer:

When you create your local repo, your cloning the whole of blueboy to your hardrive. Only one branch is visible or active at anytime (indicated by a '*' symbol)

master

* skillbot

If for instance you wanted to view the code on the new-ai branch, just

git checkout new-ai

and it will switch to this branch.

master

* new-ai

skillbot

You can examine the code to prove this (Like chapters of a book). Now to sync all these local branches with those online, you need to 'git pull' and not 'git pull master'. If you type the later you will get something like this

calendar@blue:~/skillbot> git pull master

fatal: 'master' does not appear to be a git repository

fatal: The remote end hung up unexpectedly

If the online branches have changed since you cloned the repo or (push/pull)ed last, you will see somthing like this

calendar@blue:~/skillbot> git pull

Enter passphrase for key '/home/calendar/.ssh/id_rsa':

remote: Counting objects: 83, done.

remote: Compressing objects: 100% (3/3), done.

remote: Total 23 (delta 21), reused 22 (delta 20)

Unpacking objects: 100% (23/23), done.

From github.com:blueboy/portal

d5a1ce4..2a75938 autobot -> origin/autobot

c4d5c2e..289f2f3 loot-fix-bt -> origin/loot-fix-bt

6ba8de8..45706f6 sharedbots -> origin/sharedbots

95bec1e..7d2b2f3 skillbot -> origin/skillbot

Already up-to-date.

You will see the pull has syncd the autobot, loot-fix-bt, sharedbots and skillbot branches. If you then do a 'git status'

calendar@blue:~/skillbot> git status

# On branch skillbot

nothing to commit (working directory clean)

You see that the current branch is 'clean' with no outstanding work to commit and your code is ready for the next changes (next commit)

Link to comment
Share on other sites

hmm oke now i tried even the wiki guides but im just too dumb to manage with it...but mabye if anyone have a bit time and help me out with full patch file ....i tryed to make it myself but command had some keys in it what i cant find on my keyboard...mabye anyone can get full playerbot patch what have all sharebots,chatbot and so on in it...

i will be very thankful:d

Link to comment
Share on other sites

hmm oke now i tried even the wiki guides but im just too dumb to manage with it...but mabye if anyone have a bit time and help me out with full patch file ....i tryed to make it myself but command had some keys in it what i cant find on my keyboard...mabye anyone can get full playerbot patch what have all sharebots,chatbot and so on in it...

i will be very thankful:d

A full patch to include all developemt code is not possible. You'll either have to be patient until such time when we merge the develpment code, or do the merge directly as Gitch suggests. I have created a small bash script to facilitate a multiple merge. You will still need to resolve some minor conflicts, but these are very simply fixed.

bash script

#!/bin/bash -x
git clone git://github.com/mangos/mangos.git portal
cd portal
git fetch git://github.com/blueboy/portal.git master:portal
git fetch git://github.com/blueboy/portal.git skillbot:skillbot
git fetch git://github.com/blueboy/portal.git new-ai:new-ai
git fetch git://github.com/blueboy/portal.git autobot:autobot
git checkout master

# cd portal

# git branch

autobot

* master

new-ai

portal

skillbot

We will first switch to the portal branch.

# git checkout portal

Switched to branch 'portal'

then..

1. new-ai merge

# git merge new-ai

Auto-merging src/game/playerbot/PlayerbotAI.cpp

Merge made by recursive.

src/game/playerbot/PlayerbotAI.cpp | 31 ++-

src/game/playerbot/PlayerbotAI.h | 14 +-

src/game/playerbot/PlayerbotDeathKnightAI.h | 64 +++-

src/game/playerbot/PlayerbotDruidAI.cpp | 2 +-

src/game/playerbot/PlayerbotShamanAI.cpp | 524 ++++++++++++++++-----------

src/game/playerbot/PlayerbotShamanAI.h | 128 +++++++-

6 files changed, 527 insertions(+), 236 deletions(-)

2. skillbot merge

# git merge skillbot

Auto-merging src/game/playerbot/PlayerbotAI.cpp

CONFLICT (content): Merge conflict in src/game/playerbot/PlayerbotAI.cpp

Automatic merge failed; fix conflicts and then commit the result.

To fix this conflict, open PlayerbotAI.cpp with your text editor and search for the pattern HEAD

i. PlayerbotAI.cpp

<<<<<<< HEAD

HERB_GATHERING = initSpell(HERB_GATHERING_1);

MINING = initSpell(MINING_1);

SKINNING = initSpell(SKINNING_1);

=======

HERB_GATHERING = initSpell(HERB_GATHERING_1);

MINING = initSpell(MINING_1);

SKINNING = initSpell(SKINNING_1);

>>>>>>> skillbot

ii. PlayerbotAI.cpp

<<<<<<< HEAD

=======

// return true;

>>>>>>> skillbot

Remove the text in red and save. To apply the merge after fixing the conflicts

# git commit -a

Your default text editor will open giving you the opportunity to change the commit header. For simplicity, just save the file and your done.

3. autobot merge

# git merge autobot

Removing sql/playerbotai/playerbotai_characters_r1.sql

Auto-merging src/game/playerbot/PlayerbotAI.cpp

Auto-merging src/game/playerbot/PlayerbotAI.h

Auto-merging src/game/playerbot/PlayerbotMgr.cpp

Auto-merging src/game/playerbot/PlayerbotMgr.h

Auto-merging src/game/playerbot/config.h

CONFLICT (content): Merge conflict in src/game/playerbot/config.h

Auto-merging src/game/playerbot/config.h.in

CONFLICT (content): Merge conflict in src/game/playerbot/config.h.in

Auto-merging src/game/playerbot/playerbot.conf.dist.in

CONFLICT (content): Merge conflict in src/game/playerbot/playerbot.conf.dist.in

Automatic merge failed; fix conflicts and then commit the result.

You will see that there are three files causing conflicts. Repeat the process described for merge 2.

i. config.h

<<<<<<< HEAD

#define PLAYERBOT_CONF_VERSION 2012021401

=======

#define PLAYERBOT_CONF_VERSION 2011112001

>>>>>>> autobot

ii. config.h.in

<<<<<<< HEAD

#define PLAYERBOT_CONF_VERSION 2012021401

=======

#define PLAYERBOT_CONF_VERSION 2011112001

>>>>>>> autobot

iii. playerbot.conf.dist.in

<<<<<<< HEAD

ConfVersion=2012021401

=======

ConfVersion=2011112001

>>>>>>> autobot

<<<<<<< HEAD

PlayerbotAI.SellAll.LevelDiff = 10

=======

line space

PlayerbotAI.Autobot.MaxBots.Server = 100

PlayerbotAI.Autobot.AccountId = 4

PlayerbotAI.Autobot.NamesInUseReset = 0

>>>>>>> autobot

Remove the text in red and save.

To apply the merge after fixing the conflicts

# git commit -a

Your default text editor will open giving you the opportunity to change the commit header. For simplicity, just save the file and your done. I haven't merged all branches, but it will get you started.

Hope this helps

Link to comment
Share on other sites

  • 4 weeks later...

Hi blueboy,

followed by your last update post, I successfully integrated playerbots into my server, everything looks fine, but I noticed a bug from my spell caster bots, when I duel a spell caster or team with spell caster to fight mobs, the caster can cast all spells which need cast time instantly. e.g mage bot cast fireball without cast time, priest casts heal instantly. But when I logged in my mage or priest character, all those spell cast correctly based on their talent or Glyphs.

So is it a general bug so far or only my error.

Link to comment
Share on other sites

Hi blueboy,

followed by your last update post, I successfully integrated playerbots into my server, everything looks fine, but I noticed a bug from my spell caster bots, when I duel a spell caster or team with spell caster to fight mobs, the caster can cast all spells which need cast time instantly. e.g mage bot cast fireball without cast time, priest casts heal instantly. But when I logged in my mage or priest character, all those spell cast correctly based on their talent or Glyphs.

So is it a general bug so far or only my error.

Thanks for the info. I believe this is a real problem. Briefly looking at the AI for Mages,Warlocks,Priests, etc it is clear that the spell sequence (rotation) for duels is still quite primative.

e.g PlayerbotMageAI.cpp

switch (ai->GetScenarioType())

{

case PlayerbotAI::SCENARIO_DUEL:

if (FIREBALL > 0)

{

ai->CastSpell(FIREBALL);

ai->SetIgnoreUpdateTime(3);

}

return;

}

So mage attack will be a steady stream of fireballs, with no disernible break between each cast. For non-duel attack, the spell rotation is more elaborate, so there will appear to be a reasonable delay between each fireball.

It's agreed that there needs to be more work done on developing AI for duel combat. As a temporary solution you might try including a small delay in the AI to slow things down a bit (In green). One issue I have noticed while messing about with arenas was that warlock pets are unattackable with 'Phase Shift'. This is also true for duels, so it would be appropriate to disable this aura, while in these scenarios.

If it works, you can apply it to the other AI. Either way, I would like you to let me know how you get on ;)

Hope this helps

Link to comment
Share on other sites

Noobish question : I have compiled an old version of playerbot, but I'd like to add the feature "/t BOTNAME talent spec", which I currently don't have. What files would I need ? Is there a simple way to do that without to spend a night to understand errors and merge conflicts ? :)

EDIT : In other word, I think my question could be : can I ovewrite the playerbot folder with a new one without messing up all the compile process ?

Link to comment
Share on other sites

Noobish question : I have compiled an old version of playerbot, but I'd like to add the feature "/t BOTNAME talent spec", which I currently don't have. What files would I need ? Is there a simple way to do that without to spend a night to understand errors and merge conflicts ? :)

The talent spec code is available in all playerbot repos. Here is the read_me for our release code, that holds our oldest active code. Depending on how old the version of playerbot is and it's source, you shouldn't get any merge conflicts. As a demonstration I have merged the alpha branch 'new-ai' into our release code without conflict. Here is the script,

#!/bin/bash -x

git clone git://github.com/mangos/mangos.git playerbot

cd playerbot

git fetch git://github.com/playerbot/mangos.git master:portal

git fetch git://github.com/blueboy/portal.git new-ai:new-ai

git checkout portal

# git merge new-ai

Merge made by recursive.

bot_readme.txt | 41 +-

src/game/Player.h | 4 +

src/game/playerbot/PlayerbotAI.cpp | 1942 +++++++++++++++++++++----

src/game/playerbot/PlayerbotAI.h | 93 ++-

src/game/playerbot/PlayerbotDeathKnightAI.cpp | 1 -

src/game/playerbot/PlayerbotDeathKnightAI.h | 64 +-

src/game/playerbot/PlayerbotDruidAI.cpp | 799 ++++++-----

src/game/playerbot/PlayerbotDruidAI.h | 17 +-

src/game/playerbot/PlayerbotHunterAI.cpp | 13 +-

src/game/playerbot/PlayerbotMageAI.cpp | 1 -

src/game/playerbot/PlayerbotMgr.cpp | 98 +-

src/game/playerbot/PlayerbotPaladinAI.cpp | 39 +-

src/game/playerbot/PlayerbotPaladinAI.h | 4 +-

src/game/playerbot/PlayerbotPriestAI.cpp | 86 +-

src/game/playerbot/PlayerbotPriestAI.h | 3 +-

src/game/playerbot/PlayerbotRogueAI.cpp | 2 +-

src/game/playerbot/PlayerbotShamanAI.cpp | 553 +++++---

src/game/playerbot/PlayerbotShamanAI.h | 128 ++-

src/game/playerbot/PlayerbotWarlockAI.cpp | 1 -

src/game/playerbot/PlayerbotWarriorAI.cpp | 16 +-

20 files changed, 2878 insertions(+), 1027 deletions(-)

# git status

# On branch portal

nothing to commit (working directory clean)

N.B. If you are trying to merge our code into the code used on R2, there are guarantees that you won't get some merge conflicts.

@Edit If for instance you are using a very old version of playerbot, I would recommend that you build fresh. If it's recent code, after the merge;

linux;

Re-run cmake, before running make

Windows;

Rebuild the project using the *.sln file

Hope this helps

Link to comment
Share on other sites

Hi Blueboy,

thanks for your quick reply and confirm about the spell casters' bug. In aditional I tried to make the autobot enabled, but when I type for instance ".autobot add worldpvp dps", it seemed like it automaticly adds a random bot with a success report. Howerver I couldn't find any bots from player list nor in area around my character. when I check the character database, I found those bots were successfully added into a specifc account which GM level is player.

I am totally lost to make autobot system work. Thanks in advance if some1 could enlighten me a bit.

Link to comment
Share on other sites

Hi Blueboy,

thanks for your quick reply and confirm about the spell casters' bug. In aditional I tried to make the autobot enabled, but when I type for instance ".autobot add worldpvp dps", it seemed like it automaticly adds a random bot with a success report. Howerver I couldn't find any bots from player list nor in area around my character. when I check the character database, I found those bots were successfully added into a specifc account which GM level is player.

I am totally lost to make autobot system work. Thanks in advance if some1 could enlighten me a bit.

Yeah the autobot code is a 'work in progress' and I'm not sure whether it is operational yet. The best person to speak to would be kennumen, as it's his code.

Hope this helps

Link to comment
Share on other sites

[== PlayerbotMgr.cpp ==]
   uint32 accountId = sAccountMgr.GetPlayerAccountIdByGUID(guid);
   if (accountId != m_session->GetAccountId())
   {
       if (!sWorld.getConfig(CONFIG_BOOL_PLAYERBOT_SHAREDBOTS))
       {
           PSendSysMessage("|cffff0000You may only add bots from the same account.");
           SetSentErrorMessage(true);
           return false;
       }

       QueryResult *resultsocial = CharacterDatabase.PQuery("SELECT COUNT(*) FROM character_social s, characters c WHERE s.guid=c.guid AND c.online = 0 AND flags & 1 AND s.note "_LIKE_" "_CONCAT3_("'%%'","'shared'","'%%'")" AND s.friend = '%u' AND s.guid = '%llu'", m_session->GetPlayer()->GetGUIDLow(), guid.GetRawValue());
       if (resultsocial)
       {
           Field *fields = resultsocial->Fetch();
           if (fields[0].GetUInt32() == 0 && (cmdStr == "add" || cmdStr == "login"))
           {
               PSendSysMessage("|cffff0000You may only add bots from the same account or a friend's character that contains 'shared' in the notes on their friend list while not online.");
               SetSentErrorMessage(true);
               delete resultsocial;
               return false;
           }
       }
       delete resultsocial;
   }

Are these the only lines I need to add to have the "sharedbots" enabled ? That'd be great... but too easy I guess

Link to comment
Share on other sites

Hmm that was not really my point but anyway, thanks :) (I have conflicts with shared bots)

By the way, couldn't it be possible to have shared bots with all branches ? as you can activate/deactivate it in the conf anyway.

I'm a little puzzled :/ In your first post you wanted to include 'talent spec' code in your existing playerbot. You didn't mention that you were using sharedbots. The current sharedbots branch includes the 'talent spec' code. Have you tried just merging the current sharedbots branch into your code. If you get any conflicts, I will do my best to resolve them for you.

@Edit

Are these the only lines I need to add to have the "sharedbots" enabled ? That'd be great... but too easy I guess

Yes this is the part of the sharedbots patch that enables the code, based upon the playerbot.conf setting. Remember to follow

Sharing bots across accounts:

======================

It is possible to a load a bot from another account. This must be done by a player from a second account adding the master player to their friend's list and set a note with the keyword 'shared' on that player. After it is setup the bot can be added using either the botguy menu or the .bot add command if enabled.

Example: Frank and Bob are characters owned by different accounts. Bob would like to use Frank as a playerbot. Frank must add Bob as a friend then right click on Bob in the friend's list, click Set Note, then type 'shared'. Frank would not be able to use Bob as a playerbot until Bob setup Frank as above.

The reason it isn't included in all the branches yet is because it's still buggy. Although you can load bots from other accounts, it then refuses to load bots from your own account :/ I did find a fix for this, but it was thought to cause a security issue so wasn't implemented.

Hope this helps

Link to comment
Share on other sites

Hmm that strange. I called a bot A from my account, then a bot B from another account, and then a bot C from my account. It worked.

Have you tried summoning bots from the commandline and via 'botguy' ? I seem to remember it worked the one way, but not the other. I would be interested to know if it works for you?

Cheers

Link to comment
Share on other sites

I only tried the commandline, never used the botguy (don't have it in my version).

Is there a way to see what files exactly have been modified by playerbot ? Like the "compare" feature of Github, which, as far as I know, can't compare two repos.

As far as I know the compare feature on github will compare the code on each sub-branch with that on the master. If for instance you compare the sharedbots branch with the portal master, you will get a snapshot of the sharedbots patch. I hope that makes sense :/

Cheers

Link to comment
Share on other sites

I suppose it's complicated to merge remote branch 'origin/master' into sharedbots ? Because I see the sharedbots branch has not been updated since 9 february.

I'm gonna try the botguy and let you know.

merge remote branch 'origin/master' into sharedbots, done... ;)

Hope this helps

Link to comment
Share on other sites

I'm getting some patch errors while trying to patch mangos one. I downloaded the newest rep from github/mangos-one/server and used the bash script from your wiki.

This is what I get:

playerbot_one.patch:7342: tab in indent.

for(PlayerMails::reverse_iterator itr = m_bot->GetMailRBegin(); itr != m_bot->GetMailREnd(); ++itr)

error: patch failed: src/game/CMakeLists.txt:21

error: src/game/CMakeLists.txt: patch does not apply

error: patch failed: src/game/Chat.cpp:766

error: src/game/Chat.cpp: patch does not apply

error: patch failed: src/game/Chat.h:566

error: src/game/Chat.h: patch does not apply

error: patch failed: src/game/QuestHandler.cpp:30

error: src/game/QuestHandler.cpp: patch does not apply

What am I doing wrong?

thanks in advance

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