-
Notifications
You must be signed in to change notification settings - Fork 41
Building From Source
#development
branch is stable but also experimental! You will have the latest and greatest code
Watch the youtube tutorial to build, compile, and play the game!
Note: You now need to run vcpkg install fluidsynth:x64-windows
before running cmake (1/3/2022)
Build and install vcpkg. Make sure it is in your system PATH.
vcpkg install poco fluidsynth lua
Then install the following:
apt-get install cmake-qt-gui
apt-get install libvorbis-dev
apt-get install libopenal-dev
apt-get install libfreetype-dev
apt-get install libflac++-dev
Use cmake-gui to build the source code. Be sure to set CMAKE_TOOLCHAIN_FILE
to the vcpkg's cmake script.
Mine is located at vcpkg/scripts/buildsystems/vcpkg.cmake
If you're having trouble with the GUI, you can use cmake from CLI to create a build folder:
mkdir build
cd build
cmake .. -DCMAKE_TOOLCHAIN_FILE=[path to vcpkg]/scripts/buildsystems/vcpkg.cmake
From the build folder you can use make
to compile the project.
I have had a good experience with CodeBlocks as the IDE using Makefile generator.
Configure, Generate, then Build, and finally Run!
In the root directory of the repo there is a makefile. Run make clean && make
to build the engine. It will output an executable to the /Debug
folder. All the executable needs is the /resources
folder. You can move this executable anywhere and copy the /resources
folder next to it.
Before you can run, you need to let the executable know where the dynamic libraries are. In the root directory, open your terminal and type
export LD_LIBRARY_PATH=`pwd`/extern/libs
This tells the system to look for the dynamic libs in the provided extern folder. Check to make sure it is set with
echo $LD_LIBRARY_PATH
Now you can play BattleNetwork:
./battlenetwork
Compiling on mac is almost identical to Linux with one extra step: you must have the SFML Framework dependencies installed in Library/Framework
on your mac. See here for help. Follow the same steps for Linux, running make, providing the /resources
folder, and set your LD_LIBRARY_PATH
variable.
Then run
./battlenetwork
This project is open source so that anyone can contribute art, ideas, and code. This is a big undertaking and the foundation is nearly complete. Please refer to the following links to see the state of the engine and how you can help.