Previous Contents Next

Appendix A: Building/Installing from Source

This Appendix gives information on how to build and install Knights from the source code.

Linux

For Linux a Makefile is provided. Please read the comments at the top of that file for full instructions and troubleshooting information.

Windows

Most Windows users will use the pre-packaged installer, however if you want to try building the game from source code, then read on.

I will assume that you are building with Visual Studio. (You can get the Visual Studio Community Edition for free from Microsoft.)

Before you start, note that Knights is currently using vcpkg for dependency management, so the first thing to do is install vcpkg on your local machine. Follow step 1 ("Set up vcpkg") from Microsoft's Tutorial: Install and use packages with MSBuild in Visual Studio.

Next, obtain the Knights source code, either by downloading the latest source release from the download page, or by cloning the Git repository.

Then, navigate to the "msvc" folder within the Knights source code directory, and open Knights.sln. Then simply do "Build Solution" which will build the Knights game and server executables. (The first build might take a bit longer than usual, because vcpkg will automatically download and unpack all required dependencies, such as Boost, SDL2 and Libcurl.) Both Release and Debug builds are available.

To run the game from within the IDE, you will need to do the following:

  1. Right-click on KnightsMain and choose "Set as Startup Project".
  2. Right-click on KnightsMain, choose "Properties", go to "Configuration Properties → Debugging → Command Arguments", and enter "-d $(ProjectDir)\..\..\knights_data" (without the quotes).
  3. Now you can just press F5 to run the game.

You can run the command-line server by setting KnightsSvrMain as the startup project.

If you want to build the installer you must install Inno Setup. Then open a command prompt, cd to the Knights source directory and issue the following command:

"c:\program files (x86)\inno setup 6\iscc" installer.iss

This will make an "Output" directory and build the Knights installer there.

Previous Contents Next
Running a Server Copyright and Contact Details