Skip to content

Latest commit

 

History

History
41 lines (31 loc) · 1.96 KB

BUILDING.md

File metadata and controls

41 lines (31 loc) · 1.96 KB

Building

To build mandarina from source, you need a C++11 compiler and cmake. Additionally, you need the following libraries

Any recent version of the first three libraries should work. For GameNetworkingSockets, it is recommended that you use this version (from December 2019).

Linux

To build using CMakeLists.txt, you need to set the include/lib paths to the previous libraries. To do this, modify CMakeLists.txt to define them. For example, if I had installed SFML in ~/Libraries/SFML, then I would have to write

set(PATH_SFML_include "~/Libraries/SFML/include")
set(PATH_SFML_lib     "~/Libraries/SFML/lib")

Note that both rapidjson and cpp-httplib don't need to be built, so only their include variable has to be set. Once all dependencies are installed, the building process is straightforward.

mkdir build_debug
cmake -DCMAKE_BUILD_TYPE=Debug ..
make

You can of course set -DCMAKE_BUILD_TYPE=Release for release mode. Note that MANDARINA_DEBUG is defined on debug mode. To test that the executable works simply run it like so:

./mandarina --local-connection

You can run the game in client/server mode doing

./mandarina --client
./mandarina --server

You can set different client/server options (like framerate, snapshot rate, etc) in client_config.json and server_config.json respectively. If you want to run the game for multiple clients, you need to make sure that the ip/port set in all client config files match the one in the server.

Other platforms

I don't have time to test the building process on other platforms, but it should work as long as the libraries are installed.