Getting Started - GamesBySarge/Unreal-NATS GitHub Wiki
To make it easier to get started with Unreal-NATS, this document will describe how to set up an example project in Unreal Engine which uses the plugin.
Unreal Engine Source
- 4.27
- 5.0
CMake 3.21 or greater
Visual Studio 2019 or greater
See the Unreal Engine documentation on how to build Unreal Engine.
Create the Unreal Project and add at least one C++ class if you haven't already. Even if you already have a project, I highly recommend you start with a fresh project for experimenting. You can always copy your code to your real project later.
Note: Unreal Engine has problems with long file names and with spaces in folders and project names, so it's highly recommended that you keep your projects in as close to a root folder as possible.
Install vcpkg
in an easy to remember location (i.e. C:\vcpkg
, for example
git clone https://github.com/microsoft/vcpkg.git C:\vcpkg
C:\vcpkg\bootstrap-vcpkg.bat
Note: Make sure to set
VCPKG_ROOT
environment variable to the location of vcpkg (i.e.C:\vcpkg
). Be sure this is set through theWindows Control Panel
. You may need to close and re-open all of your cmd prompts, or reboot for the changes to take place.
Using vcpkg
, install openssl
%VCPKG_ROOT%\vcpkg install openssl:x64-windows
Using vcpkg
, install protobuf
%VCPKG_ROOT%\vcpkg install protobuf:x64-windows
If you're using git
, the best way is to use the git submodule
command to import the GBSNats Git repository as a submodule within an existing repository.
In a command prompt shell, from within your project folder where the uproject
file exists do the following.
Note: It is important to make sure you are executing these commands in a
command prompt shell
and not aPowerShell
terminal. This sequence of commands will not execute correctly in aPowerShell
terminal.
mkdir Plugins
cd Plugins
git submodule add https://github.com/GamesBySarge/Unreal-NATS.git GBSNats
cd GBSNats
git checkout main
git submodule update --init --recursive
echo %VCPKG_ROOT%
Note: Make sure
VCPKG_ROOT
is set appropriately.
In the top level folder of the Unreal Engine project where the *.uproject
file exists, execute the following commands.
mkdir Plugins
git clone https://github.com/GamesBySarge/Unreal-NATS.git GBSNats
cd GBSNats
git checkout main
git submodule update --init --recursive
echo %VCPKG_ROOT%
Note: Make sure
VCPKG_ROOT
is set appropriately.
From the Unreal Engine source folder, run the following.
Engine\Build\BatchFiles\Build.bat <project> Win64 Development -Project="<project_folder>\<project>.uproject"
Engine\Build\BatchFiles\Build.bat <project>Editor Win64 Development -Project="<project_folder>\<project>.uproject"
Note: These commands will not work in
PowerShell
. Please make sure to use acommand prompt shell
to execute these commands.
From time to time if you need to update your version of GBSNats, change to that directory and run the following
cd <project_folder>\Plugins\GBSNats
git pull --recurse-submodules
To clean your project, delete the Binaries
and Intermediate
folders, as well as the Plugins\GBSNats\ThirdParty\nats\Binaries
and Plugins\GBSNats\ThirdParty\nats\Intermediate
folders.