Source Revisions
Working Directory
Install Tools
Download Source Code
Compile the Code
Get the Server Running (optional)
Get the NPC Server Running
Mini Scripts (optional)
Get the Client Running
Common problems / Troubleshooting
Getting Help
Credits
Here is a basic Mac guide based on the linux guide, for more specifics refer to PSDocs, a user maintained guide.
Currently compatible with Laanx:
CAL3D SVN revision: CAL3D_SOURCE_REV
CS SVN revision: CS_SOURCE_REV
+ for windows only manually apply 39918 as patch to fix startup crashes
Currently compatible with Laanx:
CAL3D SVN revision: CAL3D_SOURCE_REV
CS SVN revision: CS_SOURCE_REV
+ for windows only manually apply 39918 as patch to fix startup crashes
Planeshift Stable revision: PS_Laanx
Currently compatible with trunk of PS:
CAL3D SVN revision: CAL3D_SOURCE_REV_HEAD
CS SVN revision: CS_SOURCE_REV_HEAD
+ for windows only manually apply 39918 as patch to fix startup crashes
The first step is to create your development directory. If you want to choose a specific directory, you can do that, however this guide will assume you use:
$HOME/development/
Many people get confused here because they copy and paste commands which contain this path. $HOME is a system environment variable that will always point to your users home directory.$HOME/development/
Many people get confused here because they copy and paste commands which contain this path. $HOME is a system environment variable that will always point to your users home directory.C:\development\
$HOME/development
$HOME is a system environment variable that will always point to your users home directory./c/development/
MSVS Community edition can be obtained from visualstudio.com It requires an account, but you can make a new one for free during installation. C++ is not a standard option in MSVS anymore, so be sure to select it during "custom" setup, or you'll need to add it later.
The MinGW package contains the compiler, header and lib files.
The MSYS package contains the shell and make utility.
The MSYSDTK package contains autoconf, automake, libtool, autogen, guile, SVN,
openssl, openssh, inetutils, perl and vim.
Because autoconf and automake will be outdated, we will manually update them.
Also, With MinGW version 4.1.0.0, some of the BinUtils included are broken by default so we're fixing that.
First, we'll get MinGW and a few necessary dependencies.
Note: These are the minimum required packages for the MinGW build.
Go here: http://prdownloads.sourceforge.net/mingw/ and fetch:
MinGW [bin] MinGW-5.1.4.exe
MSYS [bin] MSYS-1.0.10.exe
MSYS DTK [bin] msysDTK-1.0.1.exe
GDB [bin] gdb-5.2.1-1.exe (Optional)
MSYS Autoconf [bin] msys-autoconf-2.59.tar.bz2
MSYS Automake [bin] msys-automake-1.8.2.tar.bz2
BinUtils [bin] binutils-2.17.50-20060824-1.tar.gz
Run the exe files in the order they were downloaded to install the compiler. Select 'Full' type for the MinGW installation.
The installation program should also add an icon for MSYS to your start menu.
Click the "MSYS" icon and it should open up a shell window. Type "exit" to close the shell window again.
Unzip the conf/make utilities in c:\msys\1.0\, then unzip the BinUtils to the c:\mingw directory as follows:
Unzipping the tar.bz2 archives needs to be done through the MSYS
command-line by changing directory with the cd command to where you
downloaded the files. Then, run the following commands:
The input listed by the mingwPORT.sh script assumes that there is a file
called wget-1.9.1.tar.gz in /usr/src, but the file you do have is
wget-1.9.1-mingwPORT.tar.bz2.
There seems to be two solutions to this problem, you can choose the one your prefer the most:
1)Download the file from
here and put it in
/usr/src before running the mingwPORT.sh script
2)Just copy the prebuilt wget instead of compiling it instead of
typing "mingwPORT.sh" (see the command list below) to run the script type "cp wget.exe /mingw/bin" and then
continue as indicated.
Right-Click My Computer on your desktop and choose Properties. Under Advanced choose Environmental Variables. Click New under either User (this user only) or System (set variable for all users of this computer) variables depending on how you want it setup. If you choose System, you will have to log off to make the changes.
Variable Name: CRYSTAL (all caps)
Variable Value: C:\development\cs
Before compiling each time in MinGW, you will also need to enter at the MSYS prompt:
On linux only there is the possibility to enable a spellchecker, which will highlight the words he cannot find in the dictionary when you type in the chat. Please note this plugin will be compiled only if you have hunspell installed on your system. The build program checks for hunspell and if present it adds the spellchecker plugin to the build.
To configure the solutions before compilation you will need Autoconf and Libtool. You can find those in your package manager.
To compile the sources you will need gcc and g++. You can find those in your package manager.
You will need a tool called Jam. Jam is a replacement for make. It's a bit easier to maintain and create custom builds. If you do not already have Jam, you can find it at ftp://ftp.perforce.com/jam/ - install it system wide. You can also use your distro's package manager to install it.
To build the updater, you need the libcURL library. This is library that is used for HTTP protocol. It is what the updater application uses to update the client. It can be obtained at http://curl.haxx.se/. You can also use your distro's package manager to install it.
CS and PlaneShift use SVN for their source repositories, so you'll need that too.
You can find the software at: http://subversion.tigris.org/
A GUI is available at: http://esvn.umputun.com/ You can also use your distro's package manger to install it.
You will need a tool called Jam. Jam is a replacement for make. It's a bit easier to maintain and create custom builds. If you do not already have Jam, you can find it at ftp://ftp.perforce.com/jam/ - install it system wide. You can also use FreeBSD ports to install it.
CS and PlaneShift use SVN for their source repositories, so you'll need that too.
You can find the software at: http://subversion.tigris.org/
A GUI is available at: http://esvn.umputun.com/ You can also use FreeBSD ports to install it.
If you want to download the updates from the server, this is required.
To build the updater, you will need to build cURL first, as MinGW does not have a compatible libcURL library available for download.
This is the library that is used for the HTTP protocol. It is what the updater application uses to update the client.
It can be obtained at http://curl.haxx.se/.
Since you are building cURL, go ahead and get the latest version available.
Do not get a binary. For this example, we will be using curl-7.15.5.tar.bz2. Place the file in /usr/src.
Make sure to read all the available support options available for cURL.
The updater only uses a small subset of them, but feel free to install
more if you have other uses for it.
curl version: 7.15.5
Host setup: i686-pc-mingw32
Install prefix: /usr/local
Compiler: gcc
SSL support: no (--with-ssl / --with-gnutls)
zlib support: enabled
krb4 support: no (--with-krb4*)
GSSAPI support: no (--with-gssapi)
SPNEGO support: no (--with-spnego)
c-ares support: no (--enable-ares)
ipv6 support: no (--enable-ipv6)
IDN support: no (--with-libidn)
Build libcurl: Shared=yes, Static=yes
Built-in manual: no (--enable-manual)
Verbose errors: enabled (--disable-verbose)
SSPI support: no (--enable-sspi)
ca cert path: no
To build the updater (and thus pslaunch), you need the libcURL library. This is the library that is used for the HTTP
protocol which the updater application uses to connect to a repository for updating the client.
Get curl from: curl.haxx.se, pick the Source Archive, not any package. (curl-7.48.0.zip)
Unzip it in your development folder, (in a folder called curl-7.48.0 or something similar) and find the "winbuild" folder.
From Visual Studio click in the menu on Tools -> Visual Studio Command Prompt.
If you cannot find the command prompt there, check this msdn article to find it.
Change the prompt to your winbuild folder using cd c:\development\curl-7.48.0\winbuild
Then type: nmake /f Makefile.vc mode=dll (add MACHINE=x64 as parameter to compile in 64bit instead of 32.)
Your output should be in a folder called "curl-7.48.0\builds\libcurl-vc-x86-release-dll-ipv6-sspi-winssl" (exact name may vary).
Copy the contents of that folder (the \lib \bin and \include folders) into a newly made folder in your development folder called: curl (c:\development\curl).
PS, CS and CAL3d use SVN for their source repositories, so you will need an SVN client.
The SVN client for Windows is TortoiseSVN. Pick 32 or 64 bit depending on what CPU/OS you
currently have, this is not depending on wether you are compiling planeshift on 32 or 64 bits.
Note: This section is incomplete and untested, but contains the Gentoo specific build information that was previously in the manual.
Due to the number of dependencies needed, if you wish to read the homepage listing, or dependency description please select Linux's generic dropdown selection.
via portage:Note: This section is incomplete and untested, but contains the Slackware specific build information that was previously in the manual.
Due to the number of dependencies needed, if you wish to read the homepage listing, or dependency description please select Linux's generic dropdown selection.
BOTH of these above commands are assuming you do not need a server, if you do please follow directions in the mysql section for installing other required packages before moving on to building to save you time.Note: This section is incomplete and untested.
Due to the number of dependencies needed, if you wish to read the homepage listing, or dependency description please select Linux's generic dropdown selection.
libtool may need to be installed via
yast install libtool
BOTH of these above commands are assuming you do not need a server, if you do please follow directions in the mysql section for installing other required packages before moving on to building to save you time. Make sure the universe repository is enabled.
Fetch all the required packages using the following command:
# sudo apt-get --assume-yes install libjpeg-dev x11proto-gl-dev autoconf jam bison flex-old automake1.9 libcurl4-openssl-dev libmng-dev libmikmod2-dev libogg-dev libvorbis-dev zlib1g-dev libpng12-dev build-essential libtool libglu1-mesa-dev xserver-xorg-dev libxt-dev libopenal1 libopenal-dev subversion zlibc libfreetype6-dev libfreetype6 libasound2-dev alsa-oss libxxf86vm-dev libxext-dev x11proto-xext-dev libspeex-dev libxcursor-dev
In case you are using intrepid, we can fetch all the required packages using the following command:# sudo apt-get --assume-yes install libjpeg-dev x11proto-gl-dev autoconf jam bison flex-old automake1.9 libcurl4-openssl-dev libmng-dev libmikmod2-dev libogg-dev libvorbis-dev zlib1g-dev libpng12-dev build-essential libtool libglu1-mesa-dev xserver-xorg-dev libxt-dev libopenal1 libopenal-dev subversion zlibc libfreetype6-dev libfreetype6 libasound2-dev alsa-oss libxxf86vm-dev libxext-dev x11proto-xext-dev libspeex-dev libxcursor-dev
ALL of these above commands are assuming you do not need a server if you do please follow directions in the mysql section for installing other required packagesNote: This section is incomplete and untested, but contains the Debian specific build information that was previously in the manual.
Due to the number of dependencies needed, if you wish to read the homepage listing, or dependency description please select Linux's generic dropdown selection.
via apt-get: #apt-get install libcurl3-dev
via apt-get: #apt-get install jam subversion build-essential libfreetype6-dev libasound2-dev
If you are using Debian testing (which uses X.Org), then you need xlibmesa-gl-dev instead of xlibmesa-glu-dev.
Debian: #apt-get install xlibmesa-glu-dev
Testing: #apt-get install xlibmesa-gl-dev
Also, if you have flex, bison or automake other than automake1.8 installed, they should be uninstalled. They would conflict with the older versions flex-old, bison1.35 and automake1.8 needed to compile PlaneShift.
#apt-get install libtool bison-1.35 flex-old autoconf automake1.8
#apt-get install libmng-dev libmikmod2-dev libogg-dev libvorbis-dev zlib1g-dev libpng12-dev libjpeg62-dev python2.6-dev libspeex-dev BOTH of these above commands are assuming you do not need a server if you do please follow directions in the mysql section for installing other required packagesSince Crystal Space needs it (independently from your graphic card, so even if you have an ATI card), you should download from www.nvidia.com the nvidia-toolkit. Download the appropriate version for your architecture—either x86 or x86-64. Make sure to use the appropriate file based on your chipset. To install the file, place it in the root directory and use the following commands, then delete the tar.gz file.
If you are a x86_64 system do the following
# sudo apt-get install nvidia-cg-toolkit
Otherwise you MUST do this
If you are a x86_64 system do the following if the apt-get line above did not work
Via portage: # emerge nvidia-cg-toolkit
Password: OK, I'll ask you some questions and update the configuration file in '/sw/etc/fink.conf'. In what additional directory should Fink look for downloaded tarballs? [] Which directory should Fink use to build packages? (If you don't know what this means, it is safe to leave it at its default.) [] Should Fink try to download pre-compiled packages from the binary distribution if available? [y/N] n (1) Quiet (do not show download statistics) (2) Low (do not show tarballs being expanded) (3) Medium (will show almost everything) (4) High (will show everything) How verbose should Fink be? [4] 4 Proxy/Firewall settings Enter the URL of the HTTP proxy to use, or 'none' for no proxy. The URL should start with http:// and may contain username, password, and/or port specifications. Note that this value will be visible to all users on your computer. Example, http://username:password@hostname:port Your proxy: [none] Enter the URL of the FTP proxy to use, or 'none' for no proxy. The URL should start with http:// and may contain username, password, and/or port specifications. Note that this value will be visible to all users on your computer. Example, http://username:password@hostname:port Your proxy: [none] Use passive mode FTP transfers (to get through a firewall)? [Y/n] y Mirror selection All mirrors are set. Do you want to change them? [y/N] n Writing updated configuration to '/sw/etc/fink.conf'...
For your distro install the mysql package and the -dev package, It might be named mysql-dev or libmysqlclient-dev or something similar.
If after building if you see that mysql was not found when running the server and you get the following error:
WARNING: could not load plugin 'planeshift.database.mysql'
make sure you have the dev package installed, if it was not installed, ./autogen.sh, ./configure, and recompile the server again, according to the documentation below.
for Hardy (ubuntu version 8 or better) via apt-get: # sudo apt-get --assume-yes install libdbd-mysql-perl libdbi-perl libnet-daemon-perl libplrpc-perl mysql-client-5.5 mysql-server-5.5 libmysqlclient-dev
If after building if you see that mysql was not found when running the server and you get the following error:
WARNING: could not load plugin 'planeshift.database.mysql'
make sure you have libmysqlclient-dev installed, if it was not installed, ./autogen.sh, ./configure, and recompile the server again, according to the documentation below.
via portage: #emerge mysql
If after building if you see that mysql was not found when running the server and you get the following error:
WARNING: could not load plugin 'planeshift.database.mysql'
make sure you have libmysqlclient-dev installed, if it was not installed, ./autogen.sh, ./configure, and recompile the server again, according to the documentation below.
Note: This section is incomplete and untested, but contains the FreeBSD specific build information.
From the download page, select the Community Server option. You will end up in another page where you should select one of the available Windows downloads between Windows (x86) ZIP/Setup.EXE and the Without Installer version. Notice that if you are trying to compile on 64 bit, you will need the 64 zip/installer. It is recommend to select the "Without Installer version", since you only have to unzip the file in c:\ and rename the folder (which should resemble mysql-5.5.xx) to simply mysql. At the end of these steps, you should have: c:\mysql\
Also, we need to create MinGW compatible libraries from the standard
Microsoft compatible libraries that ship with MySQL. Read the
FAQ for mingw32
under the section "How can an MSVC program call a MinGW DLL, and vice versa?"
You will find reimp here: http://wyw.dcweb.cn/reimp_new.zip
You will have to compile it as an exe is not provided anymore, create and extract the contents of the zip into C:\msys\1.0\src\reimp, open an msys prompt then do the following:
cd /usr/src/reimp/src
make
cp reimp.exe /c/mingw/bin
cd /c/mysql/lib/debug
reimp -d libmysql.lib
dlltool -k -d LIBMYSQL.def -l libmysqlclient.a
rm LIBMYSQL.def
mv libmysqlclient.a ..
We need to build cal3d from source before we can start on Crystal Space. Cal3d is a library that is used for handling skeleton systems. This is a very nice system and can allow for fluid transformations between animations. This needs to be built/installed first because when we configure Crystal Space it has to find the cal3d libraries so it can know to build the sprcal3d plugin.
$HOME/development$ svn co -r CAL3D_SOURCE_REV svn://svn.gna.org/svn/cal3d/trunk/cal3d cal3d
Crystal Space 3D SDK is the engine that we use for rendering and sound.
$HOME/development$ svn co -r CS_SOURCE_REV http://svn.code.sf.net/p/crystal/code/CS/trunk cs
$HOME/development$ svn co -r CS_SOURCE_REV_HEAD http://svn.code.sf.net/p/crystal/code/CS/trunk cs
Lastly, download our source:
$HOME/development$ svn co https://svn.code.sf.net/p/planeshift/code/trunk planeshift
$HOME/development$ svn co https://svn.code.sf.net/p/planeshift/code/trunk planeshift
From time to time, newer PlaneShift revisions will require you to upgrade your cal3d and CS repositories to a newer revision as well. To update your supporting libraries, always be certain that you use the "-r" option keep from updating to the latest revision:
If you want to update to a new revision replace REVISION with the number of the revision you want to use:
$HOME/development/cal3d$ svn update -r REVISION
$HOME/development/cs$ svn update -r REVISION
Unlike the supporting libraries, you will generally want to use the latest PlaneShift source (or the HEAD) rather than an intermediate revision. In this case, you will omit the "-r" option like so: $HOME/development/planeshift$ svn update
$HOME/development/cal3d$ svn update -r HEAD
$HOME/development/cs$ svn update -r HEAD
$HOME/development/planeshift$ jam clean
$HOME/development/planeshift$ jam -aq
We need to build cal3d from source before we can start on Crystal Space. Cal3d is a library that is used for handling skeleton systems. This is a very nice system and can allow for fluid transformations between animations. This needs to be built/installed first because when we configure Crystal Space it has to find the cal3d libraries so it can know to build the sprcal3d plugin. Cal3D doesn't change much, so just download latest stable or checkout latest from svn:
$HOME/development$ svn co -r CAL3D_SOURCE_REV svn://svn.gna.org/svn/cal3d/trunk/cal3d cal3d
In case of a slow download use the following command:
$HOME/development$ svn co -r CAL3D_SOURCE_REV http://svn.gna.org/svn/cal3d/trunk/cal3d cal3d
Crystal Space 3D SDK is the engine that we use for rendering and sound.
$HOME/development$ svn co -r CS_SOURCE_REV http://svn.code.sf.net/p/crystal/code/CS/trunk
$HOME/development$ svn co -r CS_SOURCE_REV_HEAD http://svn.code.sf.net/p/crystal/code/CS/trunk
Lastly, download our source:
$HOME/development$ svn co https://svn.code.sf.net/p/planeshift/code/trunk planeshift
$HOME/development$ svn co https://svn.code.sf.net/p/planeshift/code/trunk planeshift
From time to time, newer PlaneShift revisions will require you to upgrade your cal3d and CS repositories to a newer revision as well. To update your supporting libraries, always be certain that you use the "-r" option keep from updating to the latest revision:
If you want to update to a new revision replace REVISION with the number of the revision you want to use:
$HOME/development/cal3d$ svn update -r REVISION
$HOME/development/cs$ svn update -r REVISION
Unlike the supporting libraries, you will generally want to use the latest PlaneShift source (or the HEAD) rather than an intermediate revision. In this case, you will omit the "-r" option like so: $HOME/development/planeshift$ svn update
$HOME/development/cal3d$ svn update -r HEAD
$HOME/development/cs$ svn update -r HEAD
$HOME/development/planeshift$ jam clean
$HOME/development/planeshift$ jam -aq
Crystal Space is the 3D Software Development Kit (SDK) that is used in PlaneShift mainly for rendering and sound.
http://svn.code.sf.net/p/crystal/code/CS/trunk
Verify the checkout directory is "C:\development\CS", select "Revision", and paste the current CS revision number: CS_SOURCE_REVNext, to apply patch 39918: Find cs\include\csutil\csuctransform.h and open it in visual studio, go to line #497 and replace the
text if ((srcSize == 0) || (source == 0)) \ with if (source == 0) \
Then open: cs\includes\cstype.h and comment out line #191 (change typedef wchar_t wint_t; into
//typedef wchar_t wint_t;)
To show line numbers in Visual Studio, click on tools -> options in the menu, and then go to "text editor" -> "all languages"
and check "line numbers", leave the menu by clicking "ok".
Rather than having to install CS dependant components manually, Microsoft Visual C++, MinGW/MSYS and Cygwin users can download a single package which contains all common headers, pre-built library files, and dynamic link libraries in pre-compiled form from the Crystal Space website, http://www.crystalspace3d.org/.
Run the program and install the libraries. The Default name is fine.
Run the program and install the libraries in C:\CSLibs.
You should now copy your CS Win Libs DLLs over to your new CS directory, if you haven't done that earlier, during the installation of the CS Winlibs. Goto the start menu, go to Programs and then to CrystalSpace Win32 libraries. Select "Copy DLLs to a CS directory". Set the directory to C:\development\CS when prompted. Next, copy CrystalSpaceLibs MinGW directory into a new generic directory.
Cal3d is a library that is used for handling skeleton systems.
Create a subdirectory in development called "cal3d". Right-click on the cal3d directory and select "SVN Checkout". Specify the URL as:svn://svn.gna.org/svn/cal3d/trunk/cal3d
Verify the checkout directory is "C:\development\cal3d", select "Revision", and enter 507.
Open (in the cal3d directory) cal3d.sln in Visual Studio and if asked to convert/updgrade, do so.
If the Solution Explorer does not show on the left side of your screen, select from the menu: View -> Solution Explorer.
Set build config to release (in the menu at the top) and right-click on the CAL3D project in the Solution Explorer, then click on "build" to build the Cal3D project.
Notice that if you are building 64 bit, you will also need to make a new "solution platform" (x64, you can copy the rest from the 32 version).
After building, rename cal3d\bin\Release\Cal3D.dll to "libcal3d-csvc10.dll" and copy it to the CS directory (overwriting the file there).
If you are making a debug build, you will need to do the same for the following file. Additionally, in case of debug/static builds, the exact file name differs.
cal3d\bin\debug\Cal3D.pdb, rename it to "libcal3d-csvc10.pdb" and copy it to the CS directory as well (debug build only).
Lastly, download PlaneShift source code:
https://svn.code.sf.net/p/planeshift/code/trunk
If in the future you have the intentions to updatePS because the team has decided to use another revision or because you feel like you want to update it, instead of doing a checkout you have simply to update. Please, remember that CS must be the exact revision specified above, while PS can be newer.
PlaneShift
Right-click on the PlaneShift folder and click "SVN Update".
We need to build cal3d from source before we can start on Crystal Space. Cal3d is a library that is used for handling skeleton systems. This is a very nice system and can allow for fluid transformations between animations. This needs to be built/installed first because when we configure Crystal Space it has to find the cal3d libraries so it can know to build the sprcal3d plugin. Cal3D doesn't change much, so just download latest stable or checkout latest from svn:
In case of a slow download use the following command:
Crystal Space 3D SDK is the engine that we use for rendering and sound.
$HOME/development$ svn co -r CS_SOURCE_REV http://svn.code.sf.net/p/crystal/code/CS/trunk
$HOME/development$ svn co -r CS_SOURCE_REV_HEAD http://svn.code.sf.net/p/crystal/code/CS/trunk
Lastly, download our source:
$HOME/development$ svn co https://svn.code.sf.net/p/planeshift/code/trunk planeshift
$HOME/development$ svn co https://svn.code.sf.net/p/planeshift/code/trunk planeshift
From time to time, newer PlaneShift revisions will require you to upgrade your cal3d and CS repositories to a newer revision as well. To update your supporting libraries, always be certain that you use the "-r" option keep from updating to the latest revision:
If you want to update to a new revision replace REVISION with the number of the revision you want to use:
$HOME/development/cal3d$ svn update -r REVISION
$HOME/development/cs$ svn update -r REVISION
Unlike the supporting libraries, you will generally want to use the latest PlaneShift source (or the HEAD) rather than an intermediate revision. In this case, you will omit the "-r" option like so: $HOME/development/planeshift$ svn update
$HOME/development/cal3d$ svn update -r HEAD
$HOME/development/cs$ svn update -r HEAD
$HOME/development/planeshift$ jam clean
$HOME/development/planeshift$ jam -aq
If you have a dual core or better processor then you can take advantage of parallel make or jam by adding -j3 after the command. You can replace 3 with the number of jobs you want to run in parallel.
Since cal3d is a library in development we probably don't want to 'install' this one as root since there is a good possibility it will change in the future. Instead we will 'install' it into our working directory. This is done by using the --prefix option when we configure it.
Using a text editor open configure.in and remove the lineAM_USE_UNITTESTCPP
Then you can build cal3d
$HOME/development/cal3d$ autoreconf --install --force
$HOME/development/cal3d$ ./configure --prefix=$HOME/development/cal3d
$HOME/development/cal3d$ make
$HOME/development/cal3d$ make install
Because we did not install cal3d we need to make sure other things can find it. This is done using the LD_LIBRARY_PATH:
Using a text editor open $HOME/.cshrc and add the line:
setenv LD_LIBRARY_PATH /home/development/cal3d/lib/:/home/development/cs/ (need user relog)
If you have a dual core or better processor then you can take advantage of parallel make or jam by adding -j3 after the command. You can replace 3 with the number of jobs you want to run in parallel.
Since cal3d is a library in development we probably don't want to 'install' this one as root since there is a good possibility it will change in the future. Instead we will 'install' it into our working directory. This is done by using the --prefix option when we configure it.
AM_USE_UNITTESTCPP
Or you can use the following sed command
sed -i 's/AM_USE_UNITTESTCPP/#\ AM_USE_UNITTESTCPP/' configure.in
Then you can build cal3d
$HOME/development/cal3d$ autoreconf --install --force
$HOME/development/cal3d$ ./configure --prefix=$HOME/development/cal3d
$HOME/development/cal3d$ make
$HOME/development/cal3d$ make install
export LD_LIBRARY_PATH=$HOME/development/cal3d/src/cal3d/.libs/:$LD_LIBRARY_PATH
Now we can build it and use the configure line to tell it where we installed the cal3d libraries. To do this, use the prefix line that was used for Cal3d above.
Now we can build it and use the configure line to tell it where we installed the cal3d libraries. To do this, use the prefix line that was used for Cal3d above.
We should export the CRYSTAL environment variable so applications outside the Crystal Space
tree know where to find the .so's.
Using a text editor open $HOME/.cshrc and add the line:
setenv CRYSTAL /home/development/cs/ (need user relog)
$HOME/development/planeshift$ jam -aq server
$HOME/development/planeshift$ jam -aq staticplugins server_static
If your psclient has no skin you are used to seeing launch pssetup after you have copied your art over and select a new skin
If you wish for your psclient to not use the same user files as your other build/install you may run ps with the following command
You can also edit this in the psclient.cfg file under the game section uncomment the appropriate line and edit the path.
export CRYSTAL=$HOME/development/cs
$HOME/development/planeshift$ jam -aq server
$HOME/development/planeshift$ jam -aq staticplugins server_static
Before launching any PS app you need to tell PS where to find CS as we did not install it globally
If your psclient has no skin you are used to seeing launch pssetup after you have copied your art over and select a new skin
If you wish for your psclient to not use the same user files as your other build/install you may run ps with the following command
You can also edit this in the psclient.cfg file under the game section uncomment the appropriate line and edit the path.
If you have a dual core or better processor then you can take advantage of parallel make or jam by adding -j3 after the command. You can replace 3 with the number of jobs you want to run in parallel.
Since cal3d is a library in development we probably don't want to 'install' this one as root since there is a good possibility it will change in the future. Instead we will 'install' it into our working directory. This is done by using the --prefix option when we configure it.
AM_USE_UNITTESTCPP
Or you can use the following sed command
mv configure.in configure-old.in
sed 's/AM_USE_UNITTESTCPP/# AM_USE_UNITTESTCPP/' configure-old.in > configure.in
Then you can build cal3d
$HOME/development/cal3d$ autoreconf --install --force
$HOME/development/cal3d$ ./configure --prefix=$HOME/development/cal3d
$HOME/development/cal3d$ make
$HOME/development/cal3d$ make install
Now we can build it and use the configure line to tell it where we installed the cal3d libraries. To do this, use the prefix line that was used for Cal3d above.
export CRYSTAL=$HOME/development/cs
$HOME/development/planeshift$ ./autogen.sh
$HOME/development/planeshift$ ./configure --disable-universal-binary --with-cal3d=$HOME/development/cal3d
$HOME/development/planeshift$ ./configure --disable-universal-binary --enable-debug --with-cal3d=$HOME/development/cal3d
$HOME/development/planeshift$ jam -aq client
there is no Mac static build guide at this time
$HOME/development/planeshift$ jam -aq server
If your psclient has no skin you are used to seeing launch pssetup after you have copied your art over and select a new skin
If you wish for your psclient to not use the same user files as your other build/install you may run ps with the following command
$HOME/development/planeshift$ ./psclient.app/Contents/MacOS/psclient -cfgset=PlaneShift.UserConfigPath=$HOME/Library/Application Support/PlaneShift2You can also edit this in the psclient.cfg file under the game section uncomment the appropriate line and edit the path.
Run MSYS from the start menu to open the shell. Be aware that if you have MSYS opened already, you need to restart the console, otherwise many things won't be found during the build process. Make sure you run the export commands to set the environment variables again
Switch to the Crystal Space source dir using 'cd /c/development/cs'. Configure to debug mode and jam. (if you wish to build in optimized mode, just run configure without --enable-debug). On Mac OS X, there is an issue with ptmalloc crashing on exit so append the flag --disable-ptmalloc
Change your working directory to PS's, and do:
./autogen.sh
./configure --with-mysqlclient=/c/mysql
./autogen.sh
./configure --enable-debug --with-mysqlclient=/c/mysql
jam -aq server
jam -aq staticplugins server_static
If you want to build the extra tools, just do "jam -a".
This should compile PlaneShift.
If your psclient has no skin you are used to seeing launch pssetup after you have copied your art over and select a new skin
If you wish for your psclient to not use the same user files as your other build/install you may run ps with the following command
You can also edit this in the psclient.cfg file under the game section uncomment the appropriate line and edit the path.
Make sure that the 'msvc10' folder has the 'read only' box unchecked (right click on the folder and select Properties, 'read only' is one of the attributes in the General tab) before continuing.
Open C:\development\CS\mk\msvc10\wkstypical.sln
Open C:\development\CS\mk\msvc10\wksstatic.sln
For any version other than 2010, Visual Studio will ask you to upgrade the project, do so.
If the Solution Explorer does not show on the left side of your screen, select from the menu: View -> Solution Explorer.
Right click on the solution and select 'Build Solution'. To test the build of CS, run walktest.exe in C:\development\CS.
In any Visual Studio version other than 2010, 5 of the 238 projects will fail due to dlls not being made for your version of Visual Studio.
This can be ignored, since we do not need those 5 for planeshift.
If you encounter any errors, check you have done everything correctly, and then if the problem persists, you can
ask for help in the CS IRC channel:
irc.freenode.net #crystalspace
Copy the following 3 files (crystalspace-2.1-vc10.dll libcal3d-csvc10.dll and libz-cs.dll) from your CS directory to your planeshift directory.
Note that the exact name of the first two dlls may vary, depending on you building static, debug or normal. This guide assumes you are making a normal user version.
Then copy libcurl.dll from your curl\bin directory into your planeshift directory.
If you are compiling the server as well, you will need to copy libmysql.dll from c:\mysql\lib to your planeshift folder as well.
If the Solution Explorer does not show on the left side of your screen, select from the menu: View -> Solution Explorer.
We will need to edit a few of the projects before they can compile. To open a properties menu of a specific project, right click on the project
name and select properties. To change a property (like include directories, or additional dependencies, click on the property, and at the far
right of it, a small arrow will appear, click on that and select "edit". These instructions are implied throughout this section.
plgsoundmngr:
Needs libpsmusic.lib and libpsutil.lib added in properties -> linker -> input -> additional dependencies
Needs c:\development\planeshift\out\release10\libs added in properties -> vcc++ directories -> library directories
apppsclient:
Needs c:\development\planeshift\out\release10\libs and c:\development\cs\out\release10\libs added in properties -> vcc++ directories -> library directories.
apppslaunch:
Needs c:\development\curl\include added in properties -> vcc++ directories -> include directories
Needs c:\development\curl\lib added in properties -> vcc++ directories -> library directories
plgdbmysql:
You can skip this one if you only want the client.
Needs libpsutil.lib added in properties -> linker -> input -> additional dependencies:
Needs C:\mysql\include added in properties -> vcc directories -> include directories
Needs C:\mysql\lib and c:\development\planeshift\out\release10\libs added in properties -> vcc directories -> library directories
If you are only interested in the client,
right-click the apppsclient project in the solution explorer window and select Build (you may also need to manually build plgsoundmngr for sound support);
else, Build solution.
Notice that both plgsoundmngr and plgdbmysql fail the first time you build the whole solution, because libpsutil.lib does not exist yet. Just click "build" a second
time and they will work just fine.
Also notice that before running the client, you will need to get the art files (see the next chapter).
Now before you can debug the programs, you need to change some properties of the project.
For each application you are interested in debugging (e.g. apppsclient):
Right-Click on the project.
Under properties->debugging change:
Command to: C:\development\planeshift\(name).exe
Working directory to: C:\development\planeshift\
You should be good to go now.
$HOME/development/planeshift$ svn co https://svn.code.sf.net/p/planeshift/code/art
$HOME/development/planeshift$ svn co https://svn.code.sf.net/p/planeshift/code/art
$HOME/development/planeshift$ svn co https://svn.code.sf.net/p/planeshift/code/art
https://svn.code.sf.net/p/planeshift/code/art
If you want your compiled client to have all art (icons, skins, characters, ...) then you need to get the art from an official released client.
If you have previously downloaded a release package, you can use it to get the needed files. The files are in the "art" and
"data" directories. However you should keep the following folders in data because the contents from the SVN are
usually more recent and updated: gui, shader, shader-snippets and renderlayers.
For those who seek to only build the client, this is all you need. Start the client, and go enjoy the game.
Notice: you will also need this art to run the (SVN) server.
# chmod 755 /etc/rc.d/rc.mysqld
# chmod 755 /etc/rc.d/rc.mysqld
# /etc/rc.d/rc.mysqld start
# sudo service mysql start
# /etc/rc.d/rc.mysqld start
# /etc/rc.d/rc.mysqld start
# /etc/init.d/mysql start
Then login to the MySQL client using (default username with no password):$ mysql -u username -ppassword
The default username is root with no password.mysql_enable="YES"
then use# /usr/local/etc/rc.d/mysql.sh start
to start the mysql server.$ mysql -u username -ppassword
The default username is root with no password.C:\mysql\bin\mysqld --console
Start another command prompt and then login to the MySQL client using (the default username is root with no password):C:\mysql\bin\mysql -u root
mysql> create database planeshift;
mysql> GRANT ALL PRIVILEGES ON planeshift.* TO planeshift@localhost IDENTIFIED BY 'planeshift';
mysql> quit
$ cd home/development/planeshift/src/server/database/mysql/
home/development/planeshift/src/server/database/mysql/$ mysql -u planeshift -pplaneshift
$ cd home/development/planeshift/src/server/database/mysql/
home/development/planeshift/src/server/database/mysql/$ mysql -u planeshift -pplaneshift
cd c:\development\planeshift\src\server\database\mysql\
C:\mysql\bin\mysql -u planeshift -pplaneshift
$ cd $HOME/development/planeshift/src/server/database/mysql/
home/development/planeshift/src/server/database/mysql/$ mysql -u planeshift -pplaneshift
mysql> use planeshift;
mysql> source create_all.sql;
mysql> quit
Sometimes it is convenient to use another database name, user or password for development. In this case the file psserver.cfg has to be updated with the changed values. To change the database name the file create_all.sql also has to be modified.
If you have not installed mysql as a service, you need to start it manual each time before running the server.
Start a command prompt (Start->Run and then type "cmd") and type:
C:\mysql\bin\mysqld --console
Note: If you get any problems with psserver, make sure you have the latest version of MySQL 5.5 and that your libMySQL.dll file in windows\system32 (if any) is the same as the one in mysql\lib.
PS Server: loadmap npcroom1
PS Server: loadmap npcroom2
PS Server: loadmap npcroom_corr
PS Server: loadmap podium
PS Server: spawn
PS Server: ready
Additional maps can be listed with the "maplist" command, and loaded via the "loadmap" command. To see a list of all available psserver commands, type "help". You can shut down the server with "quit".
You should now be able to start psclient and log in. The server is localhost on port 13331, if your server is located somewhere else or you want to connect to somebody's else server, you need to modify the servers list.
Username | Password | Access Group |
---|---|---|
vengeance | keith | full GM (30) |
acraig | andrew | normal (0) |
guest | guest | full GM (30) |
dev1 | andrew | full GM (30) |
dev2 | andrew | full GM (30) |
gm1 | andrew | GM2 (22) |
gm2 | andrew | GM6 (26) |
admin1 | planeshift | Admin (50) |
admin2 | planeshift | Admin (50) |
player1 | andrew | normal (0) |
player2 | andrew | normal (0) |
player3 | andrew | normal (0) |
player4 | andrew | normal (0) |
To perform server actions you just have to log in as a GM character. If you want a list of commands available execute the /admin command. You will be given the list of available commands for your account's security group. When logged in with this account, you can view the in-game help to obtain the full list of available commands and syntax. If you loaded any maps other than the test map "npcroom", you may teleport to them by using the command: "/teleport me map [mapname]"
jam navgen
./navgen
./psnpcclient
You might want to create some script so that you don't have to manually type in the environment variables every time. In this way you can also have multiple versions of CS coexisting peacefully.
Make a file "PlaneShiftserver.sh" in the $HOME/development folder, and copy/past the following script in it:
#!/bin/sh
export LD_LIBRARY_PATH=$PWD/cal3d/src/cal3d/.libs/:$PWD/cs/:$LD_LIBRARY_PATH
export CRYSTAL=$PWD/cs/
cd $PWD/planeshift
./psserver $@
Next make a file called "PlaneShiftclient.sh" in the same directory, and put the following script in it:
#!/bin/sh
export LD_LIBRARY_PATH=$PWD/cal3d/src/cal3d/.libs/:$PWD/cs/:$LD_LIBRARY_PATH
export CRYSTAL=$PWD/cs/
cd $PWD/planeshift/
./psclient $@
Finally we need to set the right permissions on the scripts:
$ chmod +x PlaneShiftserver.sh
$ chmod +x PlaneShiftclient.sh
To have the client running you need at least two parts, described in the next chapters:
- ensure you are using the Crystal Space base configuration files
- ensure you are using some client art, better if the released art.
Note: If you just want to run the client and use it to connect to the main server, you can copy/paste the /art and the /data folder from the release client, and skip the rest of this section.
VFS.Mount.config = $@data$/config-plugins$/
by adding the path to your crystal space configuration files, example:VFS.Mount.config = $@data$/config-plugins$/,$/development$/CS$/data$/config-plugins$/
On Windows VFS.Mount.config = $@data$/config-plugins$/,c:$/development$/CS$/
1) Open up the vfs.cfg file in the PlaneShift dir. Find the list of mount points (VFS.Mount.* lines) and add a mount for each custom dir you wish to use. For this example, I will mount a pre-installed package. Using the VFS syntax key at the top, add a mount as follows:
VFS.Mount.bins = $/development$/PSbins$/
On Windows VFS.Mount.bins = c:$/development$/PSbins$/ will be equivalent to C:\development\PSbins\
VFS.Mount.planeshift/materials = $/development$/PSbins$/art/materials.zip
VFS.Mount.planeshift/meshes = $/development$/PSbins$/art/meshes.zip
VFS.Mount.planeshift/world = $/development$/PSbins$/art/world.zip
2) Open psclient.cfg (or the cfg file of the PS application you want to use a mount). To continue the above example, I can set the SVN build client to use the installed package's maps by editing the following in psclient.cfg:
Planeshift.GUI.Skin.Base = /bins/art/skins/base/client_base.zip
PlaneShift.GUI.Skin.Dir = /bins/art/skins/
PlaneShift.GUI.Skin.Selected = elves.zip
If you wish the server and NPC client to use these as well, modify/add that line to their cfg files too.
Note: PS mounts such as Planeshift.GUI.Skin.Base take a VFS path to a ZIP file, as opposed to a dir. If you wish to mount from an uncompressed dir, you need to add a slash to the end of the path:
Planeshift.GUI.Skin.Base = /svn/planeshift/art/skins/base/client_base.zip/
Planeshift.GUI.Skin.Base = /svn/planeshift/art/skins/base/client_base.zip/
Planeshift.GUI.Skin.Base = /svn/planeshift/art/skins/base/client_base.zip/
To have your client connect to your local server, you just need to modify /planeshift/data/servers.xml adding one line like:
<server name="Localhost" description="Local test server" ip="localhost" port="13331" />
If sounds does not work: change to Open AL in pslaunch.
If you get errors about art/skins/default.zip, change it to elves.zip in psclient.cfg. (there is no default.zip in the production art.
If your client crashes right after loading, or when looking at spells/effects being cast, add: Video.OpenGL.UseExtension.GL_ARB_vertex_buffer_object = true to your psclient.cfg (notice that sometimes a client prefers to take the file located in %appdata%) It seems some graphics cards cannot handle fancy effects without it. You can also set this by starting the launcher and clicking options. (Notice this also applies to ATI cards, ignore what pslaunch says about them.)
Problem: You are getting this error:
/home/luke/ps/planeshift/./out/linux/debug/src/client/static/_cs_static_use_CRYSTAL.cpp:44: undefined reference to `csStaticPluginInit::glshader_cg::glshader_cg()'If you have trouble getting any of this to work, please feel free to contact us and we will do our best to help.
There is an IRC channel dedicated to providing help with building PlaneShift:
Server: irc.freenode.net
Channel: #PlaneShift-build