Opensoldat is a unique 2D (side-view) multiplayer action game. It has been influenced by the best of games such as Liero, Worms, Quake, Counter-Strike, and provides a fast-paced gaming experience with tons of blood and flesh.
This repository contains the source code of the so-called 1.8 version. Compared to the original version, the code has undergone many changes but is not in a finished state. We hope that by open-sourcing Soldat we can empower our community to improve the game at a faster pace.
Dependencies
- FreePascal 3.0.4
- SDL 2.0.12
- OpenAL
- FreeType 2.6.1
- PhysFS 3.0.2
- GameNetworkingSockets v1.4.0
Building opensoldat
Opensoldat compiles on Windows, Linux and macOS.
Compilation using CMake
This approach automates some build steps. Opensoldat's assets will be downloaded for you, and you will not have to worry about downloading pre-built libraries. This is the simplest way to build opensoldat for Linux.
CMake 3.14+ is required.
Build steps for Linux (Ubuntu)
sudo apt-get install build-essential g++ cmake git fpc libprotobuf-dev protobuf-compiler libssl-dev libsdl2-dev libopenal-dev libphysfs-dev libfreetype6mkdir build && cd buildcmake ..make
Build steps for Windows
- Install freepascal 3.0.4 (install
fpc-3.0.4.i386-win32.exefirst, and thenfpc-3.0.4.i386-win32.cross.x86_64-win64.exe) - Install Visual Studio with C++ compiler/build tools and vcpkg
- Open Developer command prompt for Visual Studio
vcpkg.exe --triplet x64-windows install sdl2 physfs openssl protobuf freetype openal-softset PATH=%PATH%;C:\fpc\3.0.4\bin\i386-win32set OPENSSL_ROOT_DIR=C:\vcpkg\installed\x64-windowsset PHYSFSDIR=C:\vcpkg\installed\x64-windowsmkdir buildcd buildcmake -G "NMake Makefiles" -DCROSS_WINDOWS_64=1 -DCMAKE_TOOLCHAIN_FILE="C:\vcpkg\scripts\buildsystems\vcpkg.cmake" -DSDL2_BUILDING_LIBRARY=1 ..nmake
Build steps for macOS
brew install openssl@1.1 protobuf fpc cmake sdl2 physfs freetype2mkdir build && cd buildexport PKG_CONFIG_PATH=$PKG_CONFIG_PATH:/usr/local/opt/openssl@1.1/lib/pkgconfigcmake -DOPENSSL_ROOT_DIR=$(brew --prefix openssl@1.1) ..make
Available flags
The build can be customized by passing flags to cmake command. For example, you can choose whether you want to build the client, the server, or both. You can decide if you want to include opensoldat's assets in the build. There are also options for cross-compilation.
Check the CMakeLists.txt files in this repository to see the available options and their default values.
Example: cmake .. -DCMAKE_BUILD_TYPE=Release -DADD_ASSETS=1 -DBUILD_CLIENT=0 to get a release build of the server with opensoldat's assets
Compilation using other methods
If you decide to follow the approaches below, you will have to download opensoldat's assets and pre-built libraries for the game to work.
- Download pre-built libraries. The best way would probably be to download libraries from the latest build of opensoldat (from Github Actions, or Releases). You can download latest from here (includes libraries for 3 platforms - pick the ones you need) 2. Copy libraries to
client/buildandserver/build - Get soldat.smod file from base repository. You can either download the file from the latest release (recommended), or generate the .smod file yourself following the provided instructions
- Copy
soldat.smodfile toclient/buildandserver/build - Download
play-regular.ttffile from base repository, either from the latest release or frombase/clientfolder - Copy
play-regular.ttffile toclient/build
Compilation using Lazarus IDE
- Install Lazarus IDE
- Open
server/soldatserver.lpiwith Lazarus, press CTRL + F9 to compile the server - Open
client/soldat.lpiwith Lazarus, press CTRL + F9 to compile the game client
Running opensoldat
You need to start the server first, and then join the game with client.
- Run
soldatserver - Run
soldat -join 127.0.0.1 23073(more generically-join ip port)
