/Strife.MultiplayerDemo

A sample multiplayer game using the Strife Engine.

Primary LanguageC++OtherNOASSERTION

Strife.MultiplayerDemo

MadeWithStrifeEngine_BG

Sample multi-player game built using the Strife Engine feel free to use this as a template if you're interested in using the Strife.Engine for your game / machine-learning project. This starter project is provided under a modified UIUC/NCSA license.

Join us on Discord!

Setup

These instructions are written in mind to be used with the CLion IDE. The underlying build system is CMake so any build environment will suffice.

Prerequisites

Getting Started

Clone the repo (replace the repo url below with your own if you're mirroring the repo):

git clone --recurse-submodules -j8 git@github.com:Strife-AI/Strife.MultiplayerDemo.git

Run git lfs and fetch assets

git lfs install && git lfs fetch --all

If you haven't done so already, unzip libtorch and store the unarchived files someplace useful.

  • If you're on Windows, set up environment variables (How to access them in Windows 10) named TORCH_DEBUG_DIR and TORCH_RELEASE_DIR which point to the root directory of the debug and release versions of libtorch.
    • Once these are set, restart Windows to ensure the changes take place.

Generating Makefiles

Our team uses CLion, we can guarantee that the engine and the demo game build successfully with it. That being said, CMake is used as the buildsystem, so any IDE with CMake support should suffice.

Using CMake in the command line

Create a build directory:

mkdir build && cd build

Generate makefiles:

cmake .. -DCMAKE_TOOLCHAIN_FILE={Path/To/Vcpkg}/scripts/buildsystems/vcpkg.cmake
 -DCMAKE_PREFIX_PATH={Path/To/Libtorch}/share/cmake/Torch/
  • Add a -G flag followed by a supported project generator, for example. If generating an Xcode project, do:
cmake -G Xcode .. <CMAKE_VARIABLES>

Build project:

make

Using CLion

Open the root CMakeLists.txt as a project in CLion, then navigate to CLion settings (File → Settings or CLion → Preferences on Mac).

Under Build Execution & Deployment, select CMake. Set the CMake Options field to the CMake variables:

-DCMAKE_TOOLCHAIN_FILE={Path/To/Vcpkg}/scripts/buildsystems/vcpkg.cmake
-DCMAKE_PREFIX_PATH={Path/To/Libtorch}/share/cmake/Torch/

Once updated, CLion will automatically attempt to generate the CMakeCache files.


After that, the game should successfully compile!

Feel free to join our engine discussion on Discord if you have any questions or feedback.