Author Topic: [Howto] compile & configure & run ghost++ on linux 2014  (Read 6798 times)

gosp

  • Newbie
  • *
  • Posts: 1
  • Karma: +0/-4
    • View Profile
[Howto] compile & configure & run ghost++ on linux 2014
« on: September 03, 2014, 01:21:57 pm »
Some days ago I tried to compile ghost++ on linux and I faced some annoying problems. Acutally it isn't hard to make ghost++ work but I must admit that the documentation is outdated, most of posts about this subjects are too old and so on... So I decided to explain how I manage to compile ghost++ on linux server ubuntu 14.04_LTS-server (64BITS), install ghost++ and run it. I will also share my own configuration and all necessary files.

(Sorry for my sorry for my approximate english, this is not my native language). I'll also edit this post to upload my own files and I will put links.

COMPILE GHOST++

1 - Download ghost++ latest version

From SVN
Code: [Select]
svn checkout http://ghostplusplus.googlecode.com/svn/trunk/ ghost
or
Code: [Select]
cd ~/warcraft/
wget [url]https://ghostplusplus.googlecode.com/files/ghostplusplus_17.1.zip[/url]

2 - extract content (with your version)
Code: [Select]
unzip ghostplusplus_17.1.zip
It creates a directory names ghost with extracted files (go here : cd ghost). Now I assume you are here : /YOUR_HOME_PATH/warcraft/ghost/

3 - Compile Bncsutil

Code: [Select]
cd bncsutil/src/bncsutil/
make
make install

4 - Compile stormlib

Now go back here :
Code: [Select]
cd ../../../StormLib/stormlib
or from ghost directory :
Code: [Select]
cd StormLib/stormlib
compile stormlib :
Code: [Select]
make
make install

5 - Check & install libboost

check your current version of libboost
Code: [Select]
dpkg -s libboost-dev | grep 'Version'
if it is lower than 1.46 upgrade it or if you don't have it install it :
Code: [Select]
apt-get install libboost-dev
6 - compile ghost++

Now go back here :
Code: [Select]
cd ../../ghost or from ghost directory :
Code: [Select]
cd ghost/
edit the Makefile :
Code: [Select]
nano Makefile
at line 7 you should see :
Code: [Select]
LFLAGS = -L. -L../bncsutil/src/bncsutil/ -L../StormLib/stormlib/ -lbncsutil -lpthread -ldl -lz -lStorm -lmysqlclient_r -lboost_date_time-mt -lboost_thread-mt -lboost_system-mt -lboost_filesystem-mt
replace this line by this one  (added -lgm and removed *-rt extension)
Code: [Select]
LFLAGS = -L. -L../bncsutil/src/bncsutil/ -L../StormLib/stormlib/ -lbncsutil -lpthread -ldl -lz -lStorm -lmysqlclient_r -lboost_date_time -lboost_thread -lboost_system -lboost_filesystem -lgmp
save this file (CTRL+X then PRESS Y and ENTER)

compile ghost++ :
Code: [Select]
make
It should take around 30 seconds and if everything worked you should see a file 'ghost++' and no errors

If you have got errors like :

Code: [Select]
bnet.cpp:1666:31: error: ‘class boost::filesystem::directory_entry’ has no member named ‘filename’
          string FileName = i->filename( );
                               ^
bnet.cpp:1667:41: error: conversion from ‘boost::filesystem::path’ to non-scalar type ‘std::string {aka std::basic_string<char>}’ requested
          string Stem = i->path( ).stem( );
                                         ^
bnet.cpp:1677:33: error: ‘class boost::filesystem::directory_entry’ has no member named ‘filename’
            FoundMapConfigs = i->filename( );
                                 ^
bnet.cpp:1679:41: error: ‘class boost::filesystem::directory_entry’ has no member named ‘filename’
            FoundMapConfigs += ", " + i->filename( );
                                         ^
bnet.cpp:1695:44: error: conversion from ‘boost::filesystem::path’ to non-scalar type ‘std::string {aka std::basic_string<char>}’ requested
          string File = LastMatch.filename( );
                                            ^
bnet.cpp:1777:31: error: ‘class boost::filesystem::directory_entry’ has no member named ‘filename’
          string FileName = i->filename( );
                               ^
bnet.cpp:1778:41: error: conversion from ‘boost::filesystem::path’ to non-scalar type ‘std::string {aka std::basic_string<char>}’ requested
          string Stem = i->path( ).stem( );
                                         ^
bnet.cpp:1788:27: error: ‘class boost::filesystem::directory_entry’ has no member named ‘filename’
            FoundMaps = i->filename( );
                           ^
bnet.cpp:1790:35: error: ‘class boost::filesystem::directory_entry’ has no member named ‘filename’
            FoundMaps += ", " + i->filename( );
                                   ^
bnet.cpp:1806:44: error: conversion from ‘boost::filesystem::path’ to non-scalar type ‘std::string {aka std::basic_string<char>}’ requested
          string File = LastMatch.filename( );

then you'll have to fix each lines by applying this patch : <TODO : find link>
or just replace bnet.cpp and game_admin.cpp by theses :

<LINKS bnet.cpp & game_admin.cpp>

and retry compiling :
Code: [Select]
make clean
make install

Now it should work. If not make sure you have libboost installed or download the latest version of ghost++ (wiki link is deprecated) here : https://code.google.com/p/ghostplusplus/downloads/list

INSTALL GHOST++ FOLDERS AND NEEDED FILES

Now we just have to create folders for ghost++ to store configurations, maps, replays, ...

1 - Install bot folders

Create main directory for your bot (maps, replays, configurations, ...) on desktop or home for example :
Code: [Select]
mkdir ~/ghost++/
Go to your previous compiled ghost++ and copy theses folders :
Code: [Select]
cd ~/warcraft/ghost/
cp -R maps/ mapcfgs/ replays/ savegames/ ~/ghost++/
cp ghost/ghost++ default.cfg ~/ghost++/
cp gameloaded.txt gameover.txt ipblacklist.txt ~/ghost++/
cp ip-to-country.csv ~/ghost++/

2 - Download required files :

In order to run this bot you need 3 files :
  • Storm.dll
  • game.dll
  • war3.exe

download them here : <TODO LINK>
or just copy them from warcraft III installation folder.

Else you also need two files for calculate maps size, caracteristics, ... :

Take care of their version ! some does not work.
  • blizzard.j
  • common.j

You can get them and install them in two ways :

download them here : <TODO LINK>
or extract them from the War3Patch.mpq you can find in your warcraft III installation folder
then place them here :
Code: [Select]
~/ghost++/mapcfgs/
Second method (easier)

Lets ghost++ extract these two files himeself from the War3Patch.mpq.
Obviously you need these archive : War3Patch.mpq.
Download it there or get it from your Warcraft III installation folder
then place it here :
Code: [Select]
~/ghost++/
CONFIGURE GHOST++

1 - Create ghost++ config file :

From previous steps you should have the file "default.cfg" in your own installation of ghost++. Create file config :
Code: [Select]
cd ~/ghost++/
>cp default.cfg ghost.cfg

2 - Configure bot

You can simply set those variables in the ghost.cgf newly created or just download my version of ghost.cfg here :

<LINK ghost.cfg>

Beware all path config variables must end end in your system's path seperator (i.e. "\" on Windows or "/" on Linux). For me it's /
Following variables references folders previously created (~/ghost++/)
Code: [Select]
bot_war3path = ./
bot_mapcfgpath = ../mapcfgs/
bot_savegamepath = ../savegames/
bot_mappath = ../maps/
bot_replaypath = ../replays/

Other variables

Code: [Select]
bot_allowdownloads = 1 // allow download
bot_latency = 20 // set latency
bot_hostport = 6112  // on which port games will be hosted (must be opened in router)
bnet_server = europe.battle.net // which server ? (possibilities :
bnet_cdkeyroc = XXXXXXXXXXXXXXX // your ROC key (must be valid) with no space no dashes
bnet_cdkeytft = XXXXXXXXXXXXXXX // your TFT KEY (only needed if you use TFT) thus ROC key also needed. No space no dashes
bnet_username = myboname // account must be created before
bnet_password = mypassword // password of previous created account
bnet_firstchannel = clan SliD // which channel to join by default
bnet_rootadmin = winnertony // your bnet account (not bot account)
bnet_custom_war3version = 26 // current version of the game
bot_tft = 0 // Setting bot game 1 = TFT 0 = ROC

3 - Start the bot :

run in console :
place yourself in the ghost++ main directory (cd ~/ghost++/)
Code: [Select]
./ghost++
now ghost++ should running. verify it here :
Code: [Select]
ps- axl | grep "ghost"
run in background :

Code: [Select]
nohup ./ghost++ &
or :

Code: [Select]
screen -d -m ./ghost++
TROUBLESHOOTING :

<TODO>

I hope it will help.


« Last Edit: September 03, 2014, 01:29:30 pm by gosp »

Grief-Code

  • Guest
Re: [Howto] compile & configure & run ghost++ on linux 2014
« Reply #1 on: September 04, 2014, 10:39:32 am »
that wasnt required...

Because if you look deeper there isnt actually all outdated.

https://github.com/OHSystem/ohsystem/wiki/Installation---UNIX

Just as example from my source.
The default ghost++ is also outdated.
There still users for it but many people doesnt use it anymore, its featureless.
A lot of private bots with modifications are out there and they know how to compile.

Or open sourced modification as I have, and i'm building currently up our API Page, since we plan new features.

Actually we can face the simple thing, who develope here still and open sourced?
Afaik really develope can be seen only by me for bots,
uakf.b is also here no doubt, but its more maintain instead of including new ideas.

But thanks for your effort and your time.
I will sticky your topic.

hakersoft

  • Newbie
  • *
  • Posts: 47
  • Karma: +12/-27
    • View Profile
Re: [Howto] compile & configure & run ghost++ on linux 2014
« Reply #2 on: November 13, 2014, 03:08:23 am »
then you'll have to fix each lines by applying this patch : <TODO : find link>
or just replace bnet.cpp and game_admin.cpp by theses :

<LINKS bnet.cpp & game_admin.cpp>

Fix links please, i have this errors and dont know what to do next

Grief-Code

  • Average Member
  • ***
  • Posts: 149
  • Karma: +25/-8
    • View Profile
Re: [Howto] compile & configure & run ghost++ on linux 2014
« Reply #3 on: November 13, 2014, 03:34:27 am »
Which bot are you trying to compile? Default ghost++?

If yes, there is an incompatible problem with boost which is 1.46+.
You can fix this by applying these commands.

Code: [Select]
find . -name "*.cpp" -print | xargs sed -i 's/i->filename( );/i->path( ).filename( ).string( );/g'
find . -name "*.cpp" -print | xargs sed -i 's/LastMatch.filename( );/LastMatch.filename( ).string( );/g'
find . -name "*.cpp" -print | xargs sed -i 's/i->path( ).stem( );/i->path( ).stem( ).string( );/g'

hakersoft

  • Newbie
  • *
  • Posts: 47
  • Karma: +12/-27
    • View Profile
Re: [Howto] compile & configure & run ghost++ on linux 2014
« Reply #4 on: November 13, 2014, 03:42:25 am »
Thanks. It works!
Yes, default ghost++ 17.1
But at final  i have errors
/usr/bin/ld: cannot find -lboost_date_time
/usr/bin/ld: cannot find -lboost_thread, system, filesystem
but i installed boost with command apt-get install libboost-dev

« Last Edit: November 13, 2014, 03:53:53 am by hakersoft »

Grief-Code

  • Average Member
  • ***
  • Posts: 149
  • Karma: +25/-8
    • View Profile
Re: [Howto] compile & configure & run ghost++ on linux 2014
« Reply #5 on: November 13, 2014, 04:20:03 am »
You need to install at its best all boost-parts from the packet, try using:
Code: [Select]
apt-get install libboost-all-dev
What OS are you using, keep in mind that systems like Debian may doesnt have this in their packets. You are good if you are using Ubunutu 14.04.

Since it doesnt seems that the guy is updating this guide, i will create a new one which is probably complete.
« Last Edit: November 13, 2014, 04:21:51 am by Grief-Code »

hakersoft

  • Newbie
  • *
  • Posts: 47
  • Karma: +12/-27
    • View Profile
Re: [Howto] compile & configure & run ghost++ on linux 2014
« Reply #6 on: November 13, 2014, 04:45:01 am »
Thanks, it works.
I`m using latest ubuntu.
Quote
Since it doesnt seems that the guy is updating this guide, i will create a new one which is probably complete.
It will be great :)
And will be good, if someone find way to run iccup without launcher, or run launcher without wine
« Last Edit: November 13, 2014, 05:04:38 am by hakersoft »

eviltosen

  • Newbie
  • *
  • Posts: 5
  • Karma: +0/-2
    • View Profile
Re: [Howto] compile & configure & run ghost++ on linux 2014
« Reply #7 on: July 24, 2015, 02:13:39 am »
Hi, can you help me? When i try to compile ghost i got the below error. I am using ubuntu-14.04


g++ -o csvparser.o  -O3 -DGHOST_MYSQL -I. -I../bncsutil/src/ -I../StormLib/ -c csvparser.cpp
g++ -o game.o  -O3 -DGHOST_MYSQL -I. -I../bncsutil/src/ -I../StormLib/ -c game.cpp
g++ -o game_admin.o  -O3 -DGHOST_MYSQL -I. -I../bncsutil/src/ -I../StormLib/ -c game_admin.cpp
game_admin.cpp: In constructor â?~CAdminGame::CAdminGame(CGHost*, CMap*, CSaveGame*, uint16_t, unsigned char, std::strin
g, std::string)â?T:
game_admin.cpp:52:9: error: â?~m_EntryKeyâ?T was not declared in this scope
         m_EntryKey = 0;
         ^
make: *** [game_admin.o] Error 1
« Last Edit: July 24, 2015, 02:16:02 am by eviltosen »

Grief-Code

  • Average Member
  • ***
  • Posts: 149
  • Karma: +25/-8
    • View Profile
Re: [Howto] compile & configure & run ghost++ on linux 2014
« Reply #8 on: July 24, 2015, 06:31:02 am »
Please link the source you used.

eviltosen

  • Newbie
  • *
  • Posts: 5
  • Karma: +0/-2
    • View Profile
Re: [Howto] compile & configure & run ghost++ on linux 2014
« Reply #9 on: July 24, 2015, 07:55:08 pm »
Please link the source you used.

Thanks for your reply, but i manage to fix it.
I was using libboost patch version of game_admin.cpp file. I comment out this variable and now its working fine.