Jump to content

Playerbot


Recommended Posts

  • Replies 799
  • Created
  • Last Reply

Top Posters In This Topic

sorry to bump this but this is what i get when compiling with mangos zero and sd0 ...

at typing ingame .bot add mybot1 the game crashes with the following error in console

[== console ==]
[1 ms] SQL: SELECT guid FROM characters WHERE name = 'Magia' [1 ms] SQL: SELECT account FROM characters WHERE guid = '5' [0 ms] SQL: SELECT COUNT(*) FROM characters WHERE online = '1' AND account = '15' Illegal instruction

The log file does not give any errors..

Do i have to modify the db in any way before? i mean i got a clean db straight from mangos0 project.

What i did is pull the git compile the source again and run it.. should i do smthing more that i havent..?

LOOOK THIS IS full server.log

--log goes here--

Link to comment
Share on other sites

Hi ensiferum,

I've just compiled the code as is from https://github.com/blueboy/portalzero with the latest MaNGOS zero code. I summoned three bots with the following macro

.bot add one

.bot add two

.bot add three

and it works fine. I did notice a small discrepancy in the mangosd log you give.

2011-09-25 16:16:39 ERROR:MODS: Unable to open configuration file. Configuration values will use default.

Th core guys have added a new .conf file that needs configuring. The default file exists in the source code;

  • 'src/mangosd/mods.conf.dist.in'
If not present with your other conf files, you need to copy it across and rename it to mods.conf

For development purposes I do not use 'scripdev zero' code, but I wouldn't think that would cause your crash. I will take a closer look at the code, leave it with me.

Can you confirm that you are not using any wow addons or third party mods, in addition to playerbot. Did you have any merge conflicts, before compiling the code?

You only need to modify the world database if you are using mangos botguy. (mangos_botguy.sql) This only needs applying once to a clean db download.

EDIT: I have now tested portalzero code under windows and linux. Both compile and run without issue.

Hope this helps

Link to comment
Share on other sites

Ooooh man this is ridiculous...

It doesnt work - i did copy the mods.conf file to the etc/ location.. no actual info regarding player bot there tho.

Anyways - the game launches (with colors in the console window this time lol) but once i try to summon the bot it crashes with the same result again..

Can u by any chance give me step by step (not really too detailed) info how u do it on linux?

I mean like -

git pull /mangos0/

cd mangos0/server

etc..

I desperatelly need player bot and i have no clue what is not working..

Btw what is botguy????

Link to comment
Share on other sites

Depends on your level of computer/programming savvy

The best way is to first clone the mangoszero repo, then patch playerbotaizero into it. This may however require you to manually fix problems in the patch file (as in, know at least a modicum of C++ programming).

// be sure to swap in the mangoszero git:// adress. below

git clone git://github.com/mangos/mangos.git [Destination_Folder]

cd [Destination_Folder]

git fetch https://github.com/blueboy/portalzero.git master:portalzero

git checkout portalzero

HASH=`git log --pretty=oneline | grep '\\[1[0-9]\\{4\\}]' | head -n 1 | cut -d " " -f 1`

git diff $HASH > playerbot.patch

git apply --check --whitespace=fix playerbot.patch

// IF ERRORS, fix and try --check again

git apply --whitespace=fix playerbot.patch

If that's too complicated, try just compiling the playerbotaizero (but make sure your DB isn't too new):

git clone https://github.com/blueboy/portalzero.git [destination_folder]

Note to blueboy: some KISS git instructions on the first post. Seriously, consider it ;)

IIRC botguy is an administrative NPC for playerbotai, makes things easier but in no way required.

<edit> also, the reason your server.log didn't get debug info - did you remember to set the variable in mangosd.conf as I previously requested? LogFileLevel = 3

Have you tried compiling a debug instead of release version?

(please don't list the *entire* server.log again - last 10-20 lines should be plenty)</edit>

Link to comment
Share on other sites

Yeah the log lvl is set to 3.. and actually if the proper way to do it is as you described with patching up then i screwed that coz the only thing i did is download the thing then download the other thing. then make cmake and then make and make install...

Not really sure what else should i do.. and i do have some cpp knowledge but where should i fix problems? Can someone like assist me pls..

Link to comment
Share on other sites

I dont know guys i guess im just too stupid to do this.. i ran everything as said by blueboy here.

And still the same issue - it crashes after i go .bot add ...

seriously this cant be this hard. Can anyone explain whats the problem here?

O.K,

Here is a list information we need from you

  1. Describe your system (i.e Hardware 64bit or 32bit, OS, compiler & version)
  2. Describe how you built your server (i.e I don't want you to tell me that you followed my instructions)
  3. Create the project and include the -DDEBUG=1 flag, and build your server.

If the server crashes it should provide you with more information than just 'Illegal Instruction'. I must admit this does sound like a compatiblity issue. Code that works fine on some systems, bombs out on others (e.g UBUNTU distro can be very sensitive. Please note this is not a criticism of UBUNTO, it just means that we need to find a code fix that works on all systems).

Hope this helps

Link to comment
Share on other sites

Hi BlueBoy

look this is what i do:

My system - Debain 5 x32

mkdir mpb01

cd mpb01

nano 1.sh

// put this content and save:

#!/bin/bash -x

git clone git://github.com/mangos/zero.git portal_zero_patch

cd portal_zero_patch

git fetch git://github.com/blueboy/portalzero.git master:portalzero

git checkout portalzero

HASH=`git log --pretty=oneline | grep -m 1 '\\[z1[0-9]\\{3\\}]' | cut -d " " -f 1`

git diff $HASH > playerbot_zero.patch

chmod +x 1.sh

./1.sh

------------------------------->100%

git clone git://github.com/mangos-zero/server.git

cd server

cp /root/mpb01/portal_zero_patch/playerbot_zero.patch /root/mpb01/server/playerbot_zero.patch

git apply --whitespace=fix playerbot_zero.patch

nano 2.sh

// put this content and save:

#!/bin/bash

unset OBJDIR

OBJDIR="build"

INSTDIR="/opt/mpb01"

if [ -d "${OBJDIR}" ]; then

rm -R ${OBJDIR};

fi

mkdir ${OBJDIR};

cd ${OBJDIR};

/root/cmake2.8/cmake-2.8.3/bin/cmake .. -DPREFIX=$INSTDIR -DSYSCONFDIR=$INSTDIR/etc -DDATADIR=$INSTDIR -DTOOLS=1 -DUSE_STD_MALLOC=1 -DDEBUG=1

chmod +x 2.sh

./2.sh

cd build

make

--------------------------------->100%

make install

//then i conf all the configs to use the existing (working for clean mangos0 realm) DB and as soon as i get into the game and try to summon a bot it crashes.

unfortunatelly no error showed on console nor in the log file.

I would attach the logs here but there is no option. please see here:

http://filebeam.com/bd17f5000df0135c051dc78edc141545

Here's a full console dump:

http://filebeam.com/88e034fa44e41471268b5e80f7765d82

Link to comment
Share on other sites

Hi rhaziel,

EDIT: I've taken a brief look at your logs. This may not effect the issue your getting, but it might be a good idea to update your ssl package. I'm current running OpenSSL 1.0.0 29 Mar 2010. I know this might be a pain because most distros also require you to update the distro too in order to support the updated ssl. Also you might check the version of gcc, I'm currently using

gcc version 4.5.0 20100604 [gcc-4_5-branch revision 160292] (SUSE Linux)

Using configuration file /opt/mpb01/etc/mangosd.conf.

OpenSSL 0.9.8g 19 Oct 2007 (Library: OpenSSL 0.9.8g 19 Oct 2007)

WARNING: Outdated version of OpenSSL lib. Logins to server may not work!

WARNING: Minimal required version [OpenSSL 0.9.8k]

O.K so you now include DEBUG information in your build. What we now require is some details on the crash. Your using linux :D so install the gdb debugger on your system and run the mangosd daemon under the debugger. Use the following bash scripts

gdb-mangosd in the bin folder where mangosd resides

#!/bin/bash

gdb mangosd --batch -x <path on your system>/bin/gdb-commands > <path on your system>/bin/gdb-log

and gdb-commands in the chosen bin path above (EDIT Please note that this script is a helper script, called by the script above. You do not need to run this separately)

#!/bin/bash

run

shell echo -e "\\nCRASH ON" `date`

info program

shell echo -e "\\nBACKTRACE\\n"

bt

shell echo -e "\\nBACKTRACE FULL\\n"

bt full

shell echo -e "\\nTHREADS\\n"

info threads

thread apply all bt full

Then start your server

./gdb-mangosd

Example output when it crashes from gdb-log

Program received signal SIGSEGV, Segmentation fault.

0x00000000007fbb86 in QueryResult::Fetch (this=0x0)

at /home/mangos/wow/playerbot/source/portal/src/shared/Database/QueryResult.h:36

36 Field *Fetch() const { return mCurrentRow; }

CRASH ON Tue Jul 5 15:03:18 BRT 2011

Using the running image of child Thread 0x7ffff7fd6720 (LWP 30533).

Program stopped at 0x7fbb86.

It stopped with signal SIGSEGV, Segmentation fault.

Type "info stack" or "info registers" for more information.

BACKTRACE

#0 0x00000000007fbb86 in QueryResult::Fetch (this=0x0)

etc....

Hope this helps

Link to comment
Share on other sites

I am not able to run the 2nd script.

IT takes me to some Man pages..

Did specify the path to gdb-commands in the first script? The first script calls the second, you do not need to run it manually. The console might look weird but remember mangosd is running within gdb. If your server crashes gdb will record details to gdb-log

i.e. you just run

./gdb-mangosd

Hope this helps

Link to comment
Share on other sites

Hi rhaziel,

Thanks for the crash log, it has quickly enabled me to see what the problem is. In actual fact, this problem occured originally in the main playerbot. On some systems the database server cannot deal with ObjectGuids. The guid value sent must be in the raw state. This can be fixed quite easily by appending (.GetCounter()) to each of the guid parameters sent to the database.

so

CharacterDatabase.DirectPExecute("UPDATE characters SET online = 1 WHERE guid = '%lu'", guid);

now becomes

CharacterDatabase.DirectPExecute("UPDATE characters SET online = 1 WHERE guid = '%lu'", guid.GetCounter());

I will be updating the portalzero repo shortly.

EDIT: The portazero repo has now been updated.

Hope this helps

Link to comment
Share on other sites

hey blueboy, as u probably have noticed this before - im green in this stuff :D

now as i understand i need to remove the install dir, build dir aswell and modify some cpp file..

so which one? and once i save it do i just compile it as i should in the first place?

O.K

run this script

#!/bin/bash -x

git clone git://github.com/mangos/zero.git portal_zero_patch_update

cd portal_zero_patch_update

git fetch git://github.com/blueboy/portalzero.git master:portalzero

git checkout portalzero

HASH=`git log --pretty=oneline | grep -m 1 'CMSG_USE_ITEM' | cut -d " " -f 1`

git diff $HASH > playerbot_zero_update.patch

copy playerbot_zero_update.patch to your source root folder and apply the patch. Then re-build your server (i.e. make)

git apply --check --whitespace-fix playerbot_zero_update.patch

Note the --check option does a dumby run. If no merge errors, re-apply without this option

Hope this helps

Link to comment
Share on other sites

The git apply option does not work..

please help

error: src/game/playerbot/PlayerbotAI.cpp: No such file or directory

error: src/game/playerbot/PlayerbotMgr.cpp: No such file or directory

Hi,

You need to provide more information.

  1. How did you create the patch?
  2. How are you using the git apply option?
  3. Where are are you applying the patch?

It looks to me that your not applying the patch in the source root. This is inside the MaNGOS source folder where the 'createprojects.bat' file is located. Git can't find the files otherwise.

EDIT: Run this script before you create your project with cmake. It's a general script, so you need to specify the SOURCE path & the SD2URL address.

#!/bin/bash

SOURCES="path to MaNGOS source folder"

SD2URL="SripDev Github address"

SD2DIR="$SOURCES/src/bindings/ScriptDev2"

# DOWNLOAD AND/OR UPDATE SCRIPTDEV2 #

####################################################

if [ ! -e $SD2DIR ]

then

echo " "

echo -e -n "\\033[32m"

echo "Downloading ScriptDev2 Sources..."

echo -e -n "\\033[0m"

mkdir $SD2DIR

git clone $SD2URL $SD2DIR

fi

echo " "

echo -e -n "\\033[32m"

echo "Updating ScriptDev2 Sources..."

echo -e -n "\\033[0m"

echo -e -n "\\033[31m"

echo "Done."

echo -e -n "\\033[0m"

cd $SD2DIR

git pull

REVTXT=$(grep 'define SD2_REVISION_NR' $SD2DIR/sd2_revision_nr.h)

REVSD2=${REVTXT:26:4}

echo "At revision $REVSD2."

echo -e -n "\\033[31m"

echo "Done."

echo -e -n "\\033[0m"

# APPLY SD2 PATCHES #

####################################################

echo " "

echo -e -n "\\033[32m"

echo "Applying ScriptDev2 Patch..."

echo -e -n "\\033[0m"

cd $SOURCES

SD2PATCH=$(find $SD2DIR/patches/*.patch | sort -r | head -n 1)

echo -e -n "Applying Patch:" "\\033[33m $SD2PATCH"

echo -e -n "\\033[0m"

git apply $SD2PATCH

echo -e "\\033[31m"

echo "Done."

echo -e -n "\\033[0m"

Hope this helps

Link to comment
Share on other sites

Hey blueboy, i think i figured that one out coz i was making it in a clean new project not the one we had problems with. im compiling now - will let u know once im done.

But can u tell me how can i add sd0 support??

EDIT:

I got the bots working :D

so how do i apply the SD0? And why u use SD2? IS it compatible?

Link to comment
Share on other sites

EDIT:

I got the bots working

so how do i apply the SD0? And why u use SD2? IS it compatible?

Hi

Glad you got it working. Use the script I posted above and make the changes I specified. SD2 is for MaNGOS supported by the guys from Scriptdev2.com. I use it because I need to provide Playerbot support for both MaNGOS & MaNGOS Zero. I believe that many of the guys who now support MaNGOS Zero came from ScriptDev2.com

Essentially ScriptDev provide custom scripts that are necessary to detail game instances and battles with Boss foes.

Hope this helps

Link to comment
Share on other sites

you are good man blueboy..

I respect your work and will strive to contribute to your project.

What i think i would find really usefull is the roles for bots: aggro, dps and most of all - heal (the bot primarily would check if anyone and especially you need some healing and would use known spells)

and another thing - it would be really nice if you could implement some basic - really basic algorythm for auto equip - if u can equip an item and its in some way better than the current - do it! :)

Thanks for all your help

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