Ryzom Core for Windows tutorial

In this tutorial you will get, build and run a local Ryzom server and use a pre-built client to test the newbieland map which is freely available and part of the source. You will also be able to have a peak at the server administration website at http://localhost/ once you're done. You will not be able to let others connect to your server using this tutorial alone.

Assumptions for this tutorial

The folder C:\ryzom is used as a base for all Ryzom related files (you may change it, but be consistent). This tutorial was written using a Windows 7 64-bit system and the free Microsoft Visual Studio C++ 2008 Express Edition to build a 32-bit Ryzom Core. You will probably also be able to follow this tutorial on an updated XP, Vista or Windows 7 system that is either 32-bit or 64-bit (you will need to pick software versions available to your system). Each application download instruction has the name of the setup file used for this tutorial listed (for Win7 x64 at the moment of writing), all applications are set to use English for the purpose of this tutorial. Using the command line is avoided as much as possible in this tutorial, using a graphical user interface is preferred.

Getting Source

Download latest TortoiseHg for Windows (tortoisehg-2.4.2-hg-2.2.3-x64.msi) from http://tortoisehg.bitbucket.org/download/ and install fully.
Start TortoiseHg Workbench from start menu, open the File menu and choose Clone Repository... then enter the following paths and click Clone (takes a while).

Building Ryzom Core including NeL with CMake under Windows

Download latest DirectX Software Development Kit (DXSDK_Jun10.exe) from http://www.microsoft.com/en-us/download/details.aspx?id=6812 and install fully.
Download latest CMake installer for Windows (cmake-2.8.8-win32-x86.exe) from http://www.cmake.org/cmake/resources/software.html and install fully.
Download latest 7-Zip (7z920-x64.msi) for Windows from http://www.7-zip.org/download.html and install.
Download latest Microsoft Visual C++ 2008 Express (vcsetup.exe SP1 8/11/2008) from http://www.microsoft.com/en-us/download/details.aspx?id=14597 and install.
Download third party libraries from http://sourceforge.net/projects/ryzom/files/external_vc9.7z/download and extract to C:\ryzom\ryzom\external
After that, you can delete all downloaded installers and external_vc9.7z

Launch Start Menu > CMake > CMake (cmake-gui), fill in the following paths:
  • Where is the source code: C:/ryzom/ryzom/code
  • Where to build the binaries: C:/ryzom/ryzom/code/build

Click Configure, select Visual Studio 9 2008 as the generator and click Finish.
Check for errors (text in red) in the text area at the bottom and try to fix if any occur. If there are no errors, click Configure once more, followed by Generate.

This is also where you may set build options. More info: http://dev.ryzom.com/projects/ryzom/wiki/CMakeOptions
When you change settings you need to click Configure and Generate again.
The file RyzomCore.sln in C:\ryzom\ryzom\code\build\ will be generated. Double-click RyzomCore.sln to open in Visual C++ and press F7 to compile all projects (takes a while)

For connecting to a running game-server you have to install Apache and MySQL, to keep things simple this tutorial uses XAMPP Lite for Windows.
Download XAMPP USB Lite (xampp-win32-1.8.0-usb-lite.7z) from http://www.apachefriends.org/en/xampp-windows.html
Extract XAMPP USB Lite to C:\ and install by running C:\xampp\setup_xampp.bat (registry and system variables won't be changed, to delete XAMPP later just delete the folder).

Launch C:\xampp\xampp_start.exe and keep it running to start Apache and MySQL (you probably need to allow those in firewall upon first run).
To stop XAMPP later you need to run C:\xampp\xampp_stop.exe
Open your browser and go to http://localhost/ to open the XAMPP first-run page where you may select a language.

If you can't connect to localhost and you are using Windows Vista or 7, remove # from the line "127.0.0.1 localhost" in the file "c:\windows\system32\drivers\etc\hosts" (save as "hosts" without .txt) and retry (no restart needed).
(If your are not logged in with an Administrator account, you will have to run your text editor using right click "run as Administrator" to edit the file.)

Click the link to Security in the menu to the left to open the XAMPP security panel.
Find the link to "Make XAMPP more safe.." and set the root/admin user for XAMPP and MySQL (use only a-z,A-Z,0-9 here to prevent problems later on - make sure to remember or write them down)
NOTE: You need to set a username for the XAMPP Control Panel and two passwords. You can't change the MySQL username here, this will be "root".

Close the pages/browser and launch C:\xampp\xampp_stop.exe

Open C:\xampp\apache\conf\extra\httpd-vhosts.conf in a text editor and add the following to the bottom:

Listen 40916
<VirtualHost *:40916>
  <Directory "C:/ryzom/ryzom/code/ryzom/tools/server">
     Options -Indexes +FollowSymLinks +MultiViews
     IndexOptions FancyIndexing FoldersFirst NameWidth=*
     AllowOverride All
     Order allow,deny
     Allow from all

     AddType text/html .php .phps
     AddHandler application/x-httpd-php .php
     AddHandler application/x-httpd-php-source .phps
  </Directory> 
  ServerAdmin admin@localhost
  DocumentRoot "C:/ryzom/ryzom/code/ryzom/tools/server/www" 
  ServerName localhost
</VirtualHost>
<VirtualHost *:80>
  <Directory "C:/ryzom/ryzom/code/ryzom/tools/server/">
     Options -Indexes +FollowSymLinks +MultiViews
     IndexOptions FancyIndexing FoldersFirst NameWidth=*
     AllowOverride All
     Order allow,deny
     Allow from all

     AddType text/html .php .phps
     AddHandler application/x-httpd-php .php
     AddHandler application/x-httpd-php-source .phps
  </Directory> 
  ServerAdmin admin@localhost
  DocumentRoot "C:/ryzom/ryzom/code/ryzom/tools/server/admin" 
  ServerName localhost
</VirtualHost>

Save the file and open C:\ryzom\ryzom\code\ryzom\tools\server\admin\config.php with your text editor

Change: define('NELTOOL_SITEBASE','http://open.ryzom.com/');
To: define('NELTOOL_SITEBASE','http://localhost/');

Change: define('NELTOOL_SYSTEMBASE','/home/nevrax/hg/code/ryzom/tools/server/admin/');
To: define('NELTOOL_SYSTEMBASE','C:/ryzom/ryzom/code/ryzom/tools/server/admin/')

Save the file and create folder "rrd_graphs" in C:\ryzom\ryzom\code\ryzom\server\save_shard
Set $LogRelativePath to 'logs/' in C:\ryzom\ryzom\code\ryzom\tools\server\www\login\config.php
(NOTE: log directory has to be writeable by webserver and it's not wise to give it write access to the directory where script is).
Create folder "logs" in C:\ryzom\ryzom\code\ryzom\tools\server\www\login

Now start XAMPP again by launching (and keep running) C:\xampp\xampp_start.exe
In your browser, go to http://localhost/phpmyadmin/ and log in with the MySQL account you created earlier in the XAMPP Security panel.
Select Databases from the top create a new database called "nel" (without quotes). Create two more databases called "nel_tool" and "ring_open".
Next, you will need to create a user for your new databases and grant that user privileges on all tables for each database: nel, nel_tool, and ring_open.
The configuration files in code/ryzom/server expect your user to be named 'shard' with NO PASSWORD.
If you decide to use a different name for your MySQL user, or assign it a password, you will need to go through the .cfg files and change these values from 'shard' and "" wherever they appear.(they appear in several of the .cfg files)
To create a new user, go to SQL at the top and enter the following lines, then click Go

GRANT ALL ON nel.* TO shard@localhost;
GRANT ALL ON nel_tool.* TO shard@localhost;
GRANT ALL ON ring_open.* TO shard@localhost;

The result window will show "# MySQL returned an empty result set (i.e. zero rows)." this is not an error.
Go to the Users tab this time and click "reload the privileges" in the note at the bottom.
Open the folder C:\ryzom\ryzom\code\ryzom\tools\server\sql and open ryzom_admin_default_data.sql in a text editor.
Search for /home/nevrax/ and replace it with C:/ryzom/ryzom/
Save this file and open ryzom_default_data.sql in a text editor.
Change all occurrences of open.ryzom.com to localhost, but remember to keep the ports (:4999 etc.) untouched.
Go to C:\ryzom\ryzom\code\ryzom\tools\server\admin\templates and copy contents of folder "default" to folder "default_c".

Reopen your browser with PhpMyAdmin (http://localhost/phpmyadmin) select the nel database to the left and go to the Import tab in the navigation bar along the top.
  • Browse your computer: C:\ryzom\ryzom\code\ryzom\tools\server\sql\ryzom_tables.sql and click Go.
    You should see at the top: Import has been successfully finished, 65 queries executed. (ryzom_tables.sql)
    Again, select the nel database to the left and go to the Import tab.
  • Browse your computer: C:\ryzom\ryzom\code\ryzom\tools\server\sql\ryzom_default_data.sql and click Go.
    You should see at the top: Import has been successfully finished, 25 queries executed. (ryzom_default_data.sql)
    This time, select the nel_tool database to the left and go to the Import tab.
  • Browse your computer: C:\ryzom\ryzom\code\ryzom\tools\server\sql\ryzom_admin_default_data.sql and click Go.
    You should see at the top: Import has been successfully finished, 61 queries executed. (ryzom_admin_default_data.sql)

Once you have imported these files, you need to make a change to some of the data in your new databases.
Open the SQL tab (top of the page in PhpMyAdmin) and enter the following line, followed by clicking Go

UPDATE `nel_tool`.`neltool_domains` SET `domain_as_host` = 'localhost' WHERE `neltool_domains`.`domain_id` =12;

Open C:\ryzom\ryzom\code\ryzom\server\frontend_service.cfg in a text editor and set FSListenHost to "localhost" (with quotes).
Save the file, open C:\ryzom\ryzom\code\ryzom\server\shard_start_cmake.bat in a text editor and change
MODE=..\..\build\bin\Release to MODE=..\..\build\bin\Debug depending on your CMake settings.
Save the file, open C:\ryzom\ryzom\code\ryzom\server\shard_stop_cmake.bat in a text editor and change
ryzom_session_browser_server.exe to ryzom_session_browser_service.exe and save this file as well.

At this point, you should be able to start the server using the shard_start_cmake.bat file in the C:\ryzom\ryzom\code\ryzom\server folder.

Several console windows will open up. Accept any requests for services to be allowed by firewall.
Give everything a few minutes to start, then you should be able to start your client and connect to your new server using the Client.

To stop the services launch C:\ryzom\ryzom\code\ryzom\server\shard_stop_cmake.bat
Several debug windows might pop-up. Tick "Don't sent the report" if possible and click Ignore on all of them. Change the build to Release instead of Debug to prevent the debug windows from appearing. This is done in CMake.

Running Ryzom Client

If you are using your own shard, you may want to use a pre-built client executable file to confirm whether your shard is okay. Then if your client has problems, you can know it isn't your shard's fault.
You can find pre-built Windows binaries here: http://dev.ryzom.com/projects/ryzom/wiki/WindowsBinaries
At the moment of writing this tutorial, this is the latest pre-built client available:
  • Molator's Downloads
    Client - Platform: Win x86 Stlport - Date: 2011-09-20 - Version: 0.8.0.1785 - Size: 616MB

Extract to e.g. C:\ryzom\client and start ryzom_client_r.exe in there (after starting XAMPP and Ryzom server).
Enter an account name and password and click Connect four times (don't use any of the other buttons besides Exit, you may change resolution and level of detail though).
Next, click Create New and customize your character - don't worry about this too much, only you will be able to connect to this server.
When done, click Finish and pick the Open community (your local shard). Select your preferred key binds and pick a name for your character.
Finally, click Play and wait for your client to load. You should now appear in the Ranger camp of the newbieland map.
Have fun doing tests, tweaking and hacking the source code :)

More instructions on running/building the client found here: http://dev.ryzom.com/projects/ryzom/wiki/RunClientOnWindows
If your client gives you error messages on connect, check http://dev.ryzom.com/projects/ryzom/wiki/ClientConnectErrors

How to Restart EGS / Entities Service

Create and a file called entities_restart.bat with the following contents:

@echo off
set MODE=C:\ryzom\ryzom\code\build\bin\Debug
ping -n 2 127.0.0.1 > NUL 2>&1
start %MODE%\ryzom_entities_game_service --writepid

Run this file in order to restart the entities service (when it crashes).
Again, when you've changed the CMake build to Release you have to replace Debug with that.

Known problems

CMake: Compiler not found

When clicking Configure in CMake these errors (or similar) show up in red:

The CXX compiler identification is unknown
The C compiler identification is unknown
Check for working CXX compiler: bcc32
CMake Error: your CXX compiler: "bcc32" was not found. Please set CMAKE_CXX_COMPILER to a valid compiler path or name.
...

You have selected the wrong compiler for CMake
Please make sure you have downloaded the latest Microsoft Visual C++ 2008 Express (vcsetup.exe SP1 8/11/2008) from http://www.microsoft.com/en-us/download/details.aspx?id=14597 and installed it.
Then start CMake (cmake-gui) and select Delete Cache from the File menu.
Now click Configure and make sure to select Visual Studio 9 2008 as the generator.
Check for errors (text in red) in the text area at the bottom and try to fix if any occur. If there are no errors, click Configure once more, followed by Generate.

No bin folder

Have you configured and generated the build files using CMake?
Have you compiled the binaries with the following step?
The file RyzomCore.sln in C:\ryzom\ryzom\code\build\ will be generated. Double-click RyzomCore.sln to open in Visual C++ and press F7 to compile all projects (takes a while)

Questions/errors?

Feel free to edit and update this wiki page if you know the answer.
If not, join #ryzom on irc.freenode.net and ask one of the developers.

Originally written by Edwin "Mamoru" Miltenburg () with use of other articles on this wiki.