Jump to content

Playerbot (archive)


Recommended Posts

Hi.

I've found a small bug in portal repo (hasn't checked blueboy one). SD2 patch cannot be applied because of PlayerBot patch.

Here is the fix:

diff --git a/src/mangosd/Makefile.am b/src/mangosd/Makefile.am
index 833d991..b776b3d 100644
--- a/src/mangosd/Makefile.am
+++ b/src/mangosd/Makefile.am
@@ -42,9 +42,9 @@ mangos_worldd_SOURCES = \\
mangos_worldd_LDADD = \\
    ../bindings/universal/libmangosscript.la \\
    ../game/libmangosgame.a \\
-    ../game/playerbot/libmangosbot.a \\
    ../shared/Database/libmangosdatabase.a \\
    ../shared/Config/libmangosconfig.a \\
+    ../game/playerbot/libmangosbot.a \\
    ../shared/Auth/libmangosauth.a \\
    ../shared/libmangosshared.a \\
    ../shared/vmap/libmangosvmaps.a \\

Tested on latest SD2, patch name is MaNGOS-9519-ScriptDev2.patch. Check it please.

Hi,

I'm puzzled, you say that the SD2 patch can't be applied. I've had no problems applying MaNGOS-9519-ScriptDev2.patch to either repo. What problems do you get?

Here's what I get

patch -p1 < /home/mangos/compile/portal/src/bindings/ScriptDev2/patches/MaNGOS-9519-ScriptDev2.patch

patching file configure.ac
Hunk #1 succeeded at 309 (offset 1 line).
patching file src/bindings/Makefile.am
patching file src/mangosd/Makefile.am

Let me know

Link to comment
Share on other sites

  • Replies 1.8k
  • Created
  • Last Reply

Top Posters In This Topic

hi Blueboy

FIX white space, VC80 and VC100

http://www.mediafire.com/?ymxmudedjwd

Hi,

I could, but it would only last until I merged with the core again. The whitespaces are in the core. Playerbot does not use VC80 or VC100. I've taken a look at the game.vcproj files and I believe the offending whitspaces are actually surplus TABs @ EOL. My editor does not show these up, so I would have to take it line by line. I haven't had any problems myself with these files, but if you are I would ask the core guys to clean them :rolleyes:

If you have patches that contain text format anomalies, use the GNU 'patch' utility it's far more forgiving than the 'git apply' command.

Hope this helps

Link to comment
Share on other sites

try on!

 
md playbot
cd playbot
git pull git://github.com/mangos/mangos.git
git branch playbot
git pull git://github.com/blueboy/mangos.git
git diff master playbot > playerbot .diff

so you can see the difference

diff --git a/src/game/Chat.cpp b/src/game/Chat.cpp
index 8dc9148..10020d7 100644
--- a/src/game/Chat.cpp
+++ b/src/game/Chat.cpp
@@ -702,7 +702,9 @@ ChatCommand * ChatHandler::getCommandTable()
        { "flusharenapoints",SEC_ADMINISTRATOR, false, &ChatHandler::HandleFlushArenaPointsCommand,    "", NULL },
        { "repairitems",    SEC_GAMEMASTER,     true,  &ChatHandler::HandleRepairitemsCommand,         "", NULL },
        { "waterwalk",      SEC_GAMEMASTER,     false, &ChatHandler::HandleWaterwalkCommand,           "", NULL },
-        { "quit",           SEC_CONSOLE,        true,  &ChatHandler::HandleQuitCommand,                "", NULL },
+        //Playerbot mod
+ { "bot",            SEC_PLAYER,         false, &ChatHandler::HandlePlayerbotCommand,           "", NULL },
+ { "quit",           SEC_CONSOLE,        true,  &ChatHandler::HandleQuitCommand,                "", NULL },

        { NULL,             0,                  false, NULL,                                           "", NULL }
    };
@@ -935,7 +937,7 @@ bool ChatHandler::ExecuteCommandInTable(ChatCommand *table, const char* text, co
                        fullcmd.c_str(),p->GetName(),GetAccountId(),p->GetPositionX(),p->GetPositionY(),p->GetPositionZ(),p->GetMapId(),
                        sel_guid.GetString().c_str());
                }
-                else                                        // 0 account -> console
+                else                                   // 0 account -> console
                {
                    sLog.outCommand(GetAccountId(),"Command: %s [Account: %u from %s]",
                        fullcmd.c_str(),GetAccountId(),GetAccountId() ? "RA-connection" : "Console");

Link to comment
Share on other sites

Here is what I get when I try to apply SD2 patch:

Checking patch configure.ac...
Checking patch src/bindings/Makefile.am...
Checking patch src/mangosd/Makefile.am...
error: while searching for:

## Link world daemon against the shared library
mangos_worldd_LDADD = \\
   ../bindings/universal/libmangosscript.la \\
   ../game/libmangosgame.a \\
   ../shared/Database/libmangosdatabase.a \\
   ../shared/Config/libmangosconfig.a \\

error: patch failed: src/mangosd/Makefile.am:40
error: src/mangosd/Makefile.am: patch does not apply

If you look at src/mangosd/Makefile.am and patch, you'll see that this error should happen for you as well. I'm using git 1.6.3.3 under Linux (patching with git apply). Anyway the fix is straight and easy.

Link to comment
Share on other sites

Here is what I get when I try to apply SD2 patch:

Checking patch configure.ac...
Checking patch src/bindings/Makefile.am...
Checking patch src/mangosd/Makefile.am...
error: while searching for:

## Link world daemon against the shared library
mangos_worldd_LDADD = \\
   ../bindings/universal/libmangosscript.la \\
   ../game/libmangosgame.a \\
   ../shared/Database/libmangosdatabase.a \\
   ../shared/Config/libmangosconfig.a \\

error: patch failed: src/mangosd/Makefile.am:40
error: src/mangosd/Makefile.am: patch does not apply

If you look at src/mangosd/Makefile.am and patch, you'll see that this error should happen for you as well. I'm using git 1.6.3.3 under Linux (patching with git apply). Anyway the fix is straight and easy.

Hi,

I've just tried patching with git and this is what I get

git apply --check --verbose --whitespace=fix /home/mangos/compile/portal/src/bindings/ScriptDev2/patches/MaNGOS-9519-ScriptDev2.patch

Checking patch configure.ac...
Checking patch src/bindings/Makefile.am...
Checking patch src/mangosd/Makefile.am...

I'm using git version 1.6.4.2. Maybe you need to upgrade.

Hope this helps

Link to comment
Share on other sites

try on!

 
md playbot
cd playbot
git pull git://github.com/mangos/mangos.git
git branch playbot
git pull git://github.com/blueboy/mangos.git
git diff master playbot > playerbot .diff

so you can see the difference

diff --git a/src/game/Chat.cpp b/src/game/Chat.cpp
index 8dc9148..10020d7 100644
--- a/src/game/Chat.cpp
+++ b/src/game/Chat.cpp
@@ -702,7 +702,9 @@ ChatCommand * ChatHandler::getCommandTable()
        { "flusharenapoints",SEC_ADMINISTRATOR, false, &ChatHandler::HandleFlushArenaPointsCommand,    "", NULL },
        { "repairitems",    SEC_GAMEMASTER,     true,  &ChatHandler::HandleRepairitemsCommand,         "", NULL },
        { "waterwalk",      SEC_GAMEMASTER,     false, &ChatHandler::HandleWaterwalkCommand,           "", NULL },
-        { "quit",           SEC_CONSOLE,        true,  &ChatHandler::HandleQuitCommand,                "", NULL },
+        //Playerbot mod
+ { "bot",            SEC_PLAYER,         false, &ChatHandler::HandlePlayerbotCommand,           "", NULL },
+ { "quit",           SEC_CONSOLE,        true,  &ChatHandler::HandleQuitCommand,                "", NULL },

        { NULL,             0,                  false, NULL,                                           "", NULL }
    };
@@ -935,7 +937,7 @@ bool ChatHandler::ExecuteCommandInTable(ChatCommand *table, const char* text, co
                        fullcmd.c_str(),p->GetName(),GetAccountId(),p->GetPositionX(),p->GetPositionY(),p->GetPositionZ(),p->GetMapId(),
                        sel_guid.GetString().c_str());
                }
-                else                                        // 0 account -> console
+                else                                   // 0 account -> console
                {
                    sLog.outCommand(GetAccountId(),"Command: %s [Account: %u from %s]",
                        fullcmd.c_str(),GetAccountId(),GetAccountId() ? "RA-connection" : "Console");

Hi, I've just tried creating a patch your way and it's not right.

When you created the playbot folder prior to the 'pull', you must initialize the folder as an empty git repository. Otherwise it won't pull.

md playbot

cd playbot

git init

git pull git://github.com/mangos/mangos.git

git branch playbot

git pull git://github.com/blueboy/mangos.git

git diff master playbot > playerbot .diff

Snippet from your patch

diff --git a/bot_readme.txt b/bot_readme.txt
deleted file mode 100644
index f4d4975..0000000
--- a/bot_readme.txt
+++ /dev/null
@@ -1,178 +0,0 @@
-What it is:
-===========
-
-Playerbot lets you add another character from your account as a bot that you can control and which will hopefully help you. Only characters from your account can be used, so you can have a maximum of 9 bots at one time.
-
-This was taken from the Trinity site, and modified slightly by me to get some of the kinks out. I reworked the priest class and also added a mage class and a warrior class, which are still in crude form. Any class can be used as a bot - just don't expect much in the way of spells or abilities until someone writes the code for them.
-
-Bots will only use abilities that they have - for example, a priest will only use the renew spell if it has been trained. Also, bot's equipment will lose durability like any other character. So every so often you'll need to log in and repair and train your bot.
-
-For Mangos 7800+

Snippet from mine

diff --git a/bot_readme.txt b/bot_readme.txt
new file mode 100644
index 0000000..f4d4975
--- /dev/null
+++ b/bot_readme.txt
@@ -0,0 +1,178 @@
+What it is:
+===========
+
+Playerbot lets you add another character from your account as a bot that you can control and which will hopefully help you. Only characters from your account can be used, so you can have a maximum of 9 bots at one time.
+
+This was taken from the Trinity site, and modified slightly by me to get some of the kinks out. I reworked the priest class and also added a mage class and a warrior class, which are still in crude form. Any class can be used as a bot - just don't expect much in the way of spells or abilities until someone writes the code for them.
+
+Bots will only use abilities that they have - for example, a priest will only use the renew spell if it has been trained. Also, bot's equipment will lose durability like any other character. So every so often you'll need to log in and repair and train your bot.
+
+For Mangos 7800+

Notice that your patch actually removes playerbot code.

Use these bash scripts, and your patches will be O.K. Both scripts must be in the same directory

gethash.sh - Gets the MaNGOS version HASH from git log (thanks to skinlayers)

#!/bin/bash
[ -f "hash.txt" ] && rm hash.txt
git log --pretty=oneline > commit.txt
{
while read line
do
   echo $line > line.txt
   index=0
   while read -r -n1 char;    do
      MYARRAY[$index]=$char
      let "index++"
       done < line.txt

   ELEMENTS=${#MYARRAY[@]}

   i=0;t=1;n=2
   while [ $n -lt $ELEMENTS ]
   do
       [ "${MYARRAY[$t]}" == "[" ] && [ "${MYARRAY[$n]}" == "1" ] && exit
       echo -n "${MYARRAY[$i]}" >> hash.txt
       let "i++";let "t++";let "n++"
   done
       rm hash.txt
done
} < commit.txt

playerbot.sh - This calls the above script to create the playerbot.patch

#!/bin/bash -x
# create empty .git repository
mkdir playerbot
cd playerbot
git init
# get hash for latest mangos release [XXXX], associated with playerbot release
git pull git://github.com/blueboy/mangos.git master
../gethash.sh
# read hash into 'line' variable 
{
while read line
do
echo $line
done
} < hash.txt
# cleanup & remove unwanted .git repositiory
cd ..
rm -R playerbot
# create empty .git repository
mkdir playerbot
cd playerbot
git init
# pull mangos master branch
git pull git://github.com/mangos/mangos.git master
# change to mangos branch associated with hash
git checkout -b mangos $line
# add remote playerbot branch to compare with local mangos branch
git remote add playerbot git://github.com/blueboy/mangos.git
#merge remote branch with local branch
git pull playerbot master
# difference between merged local branch & mangos hash branch
git diff $line > playerbot.patch

Hope this helps

Link to comment
Share on other sites

Blueboy, I don't know o the Linux side of the world but I've compiled the core now 6 times since yesterday and with even a pull from an hourago just finished and this is what I got on windows with SD2:

1

Hi,

Yes, there shouldn't be a problem. Obviously the patch file MaNGOS-9519-ScriptDev2.patch is only needed on linux. In windows, you compile MaNGOS and ScriptDev2 as two separate projects. This patch modifies the build files Makefile.am and configure.ac, to allow ScriptDev2 & MaNGOS to build together on linux.

Cheers

Link to comment
Share on other sites

Hi.

Latest git 1.7.1.1 does the same for me. It is weird why are you not getting any errors. Look at the patch hunk that fails to apply:

diff --git a/src/mangosd/Makefile.am b/src/mangosd/Makefile.am
index fe1ace1..40b6fdd 100644
--- a/src/mangosd/Makefile.am
+++ b/src/mangosd/Makefile.am
@@ -40,7 +40,7 @@ mangos_worldd_SOURCES = \\

## Link world daemon against the shared library
mangos_worldd_LDADD = \\
-    ../bindings/universal/libmangosscript.la \\
+    ../bindings/ScriptDev2/libmangosscript.la \\
    ../game/libmangosgame.a \\
    ../shared/Database/libmangosdatabase.a \\
    ../shared/Config/libmangosconfig.a \\

and here is a fragment of Makefile.am:

## Link world daemon against the shared library
mangos_worldd_LDADD = \\
   ../bindings/universal/libmangosscript.la \\
   ../game/libmangosgame.a \\
   ../game/playerbot/libmangosbot.a \\
   ../shared/Database/libmangosdatabase.a \\
   ../shared/Config/libmangosconfig.a \\

Patch doesn't expect "../game/playerbot/libmangosbot.a \\" string here. We can avoid this conflict just by moving playerbot string a bit lower.

Link to comment
Share on other sites

Hi.

Latest git 1.7.1.1 does the same for me. It is weird why are you not getting any errors. Look at the patch hunk that fails to apply:

diff --git a/src/mangosd/Makefile.am b/src/mangosd/Makefile.am
index fe1ace1..40b6fdd 100644
--- a/src/mangosd/Makefile.am
+++ b/src/mangosd/Makefile.am
@@ -40,7 +40,7 @@ mangos_worldd_SOURCES = \\

## Link world daemon against the shared library
mangos_worldd_LDADD = \\
-    ../bindings/universal/libmangosscript.la \\
+    ../bindings/ScriptDev2/libmangosscript.la \\
    ../game/libmangosgame.a \\
    ../shared/Database/libmangosdatabase.a \\
    ../shared/Config/libmangosconfig.a \\

and here is a fragment of Makefile.am:

## Link world daemon against the shared library
mangos_worldd_LDADD = \\
   ../bindings/universal/libmangosscript.la \\
   ../game/libmangosgame.a \\
   ../game/playerbot/libmangosbot.a \\
   ../shared/Database/libmangosdatabase.a \\
   ../shared/Config/libmangosconfig.a \\

Patch doesn't expect "../game/playerbot/libmangosbot.a \\" string here. We can avoid this conflict just by moving playerbot string a bit lower.

Hi,

I know exactly what you mean. The reference to ../game/playerbot/libmangosbot.a \\ changes the 3 line patch pattern, that would normally flag an error. It does this on your box, but not on mine or anyone else's, otherwise the thread would have been flooded with error reports.

I have tried your patch and it works on my box. The ScriptDev2 patch works before and after your fix. So if it ensures the patch works on your box, update both repos accordingly. It might be a good idea to merge with the MaNGOS branch again, before you make your changes. In theory your absolutely correct.

Weird, by the way which linux distro are you using. I'm using OpenSuSe 11.2.

Cheers

Link to comment
Share on other sites

by your ripo in chat.cpp have 1 space

http://github.com/blueboy/mangos/blob/master/src/game/Chat.cpp#L707

for the mangos have 8 space

http://github.com/mangos/mangos/blob/master/src/game/Chat.cpp#L705

so you have white space to fix!

Hi,

I have removed the TAB formatting from Chat.cpp, you reference. By the way these are not flagged as whitespaces.

Cheers

Link to comment
Share on other sites

Blueboy...just something you told DaViper...I took a look at SD2 and instuctions for Windows, yes thier compiled seperately but it requires the patch inplace as well, and it won't compile(not on my system atleast) with out the patch being applied, I don't know if it's a problem with my VS2008 or if all are like this, I do know after I downloaded a SDK, can't remember which one exactly it was suggested in one of the threads here at MaNGOS, a few things changed and I'm getting more POSIX warnings and more compiler flexability...I've tried to use Unbuntu, Suse, and Gentoo but nomatter what I can't seem to get the hang of compiling on linux so I gave up and wen't back to Mac and Windows...and yes I do have the core running on a Mac Pro 8-Core...but that was just to see if I could do it...that machine is really for Video work only.

Link to comment
Share on other sites

Blueboy...just something you told DaViper...I took a look at SD2 and instuctions for Windows, yes thier compiled seperately but it requires the patch inplace as well, and it won't compile(not on my system atleast) with out the patch being applied, I don't know if it's a problem with my VS2008 or if all are like this, I do know after I downloaded a SDK, can't remember which one exactly it was suggested in one of the threads here at MaNGOS, a few things changed and I'm getting more POSIX warnings and more compiler flexability...I've tried to use Unbuntu, Suse, and Gentoo but nomatter what I can't seem to get the hang of compiling on linux so I gave up and wen't back to Mac and Windows...and yes I do have the core running on a Mac Pro 8-Core...but that was just to see if I could do it...that machine is really for Video work only.

O.K I thought that Makefile.* and configure.ac were only used by linux, my mistake.

I was wondering whether you could shed some light on using certain items in gameplay. I've been accumulating a number of consumable enchant items, and I have no idea how to use them. There is no text description for the item, save it's value. I have an enchanter, but I am puzzled as to their use. They must have a purpose, any ideas

Example

[Enchant Chest - Exceptional Stats] - http://www.wowhead.com/item=35429

Cheers

Link to comment
Share on other sites

That example is an easy one, I'll answer for my brother since he only plays Warriors...the scroll's come in 2 flavors 1 teaches you that spell. and 2 others can use for themselves with out Enchanting, also as an enchanter you can have someone with Inscription make Vellums which you can enchant with certain spells and sell them...basicly the vellums become the scrolls others can use...for more examples look in your Auctionhouse under Consumables/Item Enchanting...all of those items are just likeyour example with the only difference as to which profession made it ie: Weapon Chain is made by a Blacksmith, Jorgamel Leg Armour is made by a Leathercrafter, Scrolls are made by an Enchanter.

I hope this is what you looking for...

Link to comment
Share on other sites

That example is an easy one, I'll answer for my brother since he only plays Warriors...the scroll's come in 2 flavors 1 teaches you that spell. and 2 others can use for themselves with out Enchanting, also as an enchanter you can have someone with Inscription make Vellums which you can enchant with certain spells and sell them...basicly the vellums become the scrolls others can use...for more examples look in your Auctionhouse under Consumables/Item Enchanting...all of those items are just likeyour example with the only difference as to which profession made it ie: Weapon Chain is made by a Blacksmith, Jorgamel Leg Armour is made by a Leathercrafter, Scrolls are made by an Enchanter.

I hope this is what you looking for...

Oh, right so you need someone with Inscription skills to transcibe the consumable item to a scroll. Then the enchanter can learn these. Oh boy, I'll have to get one of my characters to acquire the Inscription skill. Many thanks

Cheers

Link to comment
Share on other sites

That example is an easy one, I'll answer for my brother since he only plays Warriors...the scroll's come in 2 flavors 1 teaches you that spell. and 2 others can use for themselves with out Enchanting, also as an enchanter you can have someone with Inscription make Vellums which you can enchant with certain spells and sell them...basicly the vellums become the scrolls others can use...for more examples look in your Auctionhouse under Consumables/Item Enchanting...all of those items are just likeyour example with the only difference as to which profession made it ie: Weapon Chain is made by a Blacksmith, Jorgamel Leg Armour is made by a Leathercrafter, Scrolls are made by an Enchanter.

I hope this is what you looking for...

Sorry, I think I have reached my limit for posting on GetMaNGOS. I can't edit my posts and private messages are also misfiring.

Cheers

Link to comment
Share on other sites

Blueboy, you will need to patch mangos core to make vellums work. Lynx3d created a patch long ago to support vellums, now he's in core dev team, but vellums are still not here. You can pull his branch 'vellums' from github.

And answering your question, i'm on Ubuntu 9.10 right now.

Link to comment
Share on other sites

Hi. I have some issues with PB.

Compilation and general functionality is great, no problems there. (Newest PB git Clone).

But I have some other ingame issues...

My server is on my local computer so my ping cannot be lower than this. Since I play with my cousin I get ping 5-6ms and he gets about 60ms.

However, when I add Playerbot (Rogue in this case) I get HORRIBLE lag. When PB attacks, it looks like he is attacking from 10 meters. Then he falls into the ground when following, then he "teleports" while following and many other lag symptoms. I know, I've seen them all on 56k modem.

When I select Duel, after 15-20 seconds I get 1500ms lag and my mangosd.exe dies with Windows exception error.

I've looked all over the internet but didn't find such issues so I guess I did something wrong. If anyone can point out what to do I would be grateful because this project is great and puts whole new level of fun into PvT servers where not many people plays.

PS. There is another bug also. When I summon a bot, I invite him to a party. He joins but when I enter instance bot won't follow. It says I need to be a party leader and could not teleport. But I am a party leader so I don't see the logic.

Thanks for any tips!

MaNGOS/0.16.0-DEV Revision 10131

YTDB - 554_FIX_10120

SD2 - 1734

VC100 x86 Build

If you need Crash reports or something else, I have them.

Link to comment
Share on other sites

When you enter a dungeon with bots following you, make sure you are a group leader. If there are several real players with bots each, every of you should become group leader, enter the dungeon and push leadership to next player with bots outside.

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