Unreal Game Server Tutorial #
This tutorial uses Unreal Engine 5.3 and Pragma Engine version 0.4.0.
This tutorial provides a simplified walkthrough of linking a local game server to a game instance and connecting players to the server. Specifically, we will:
- Create an Unreal level for our game server (GameServerLevel)
- Customize our MyGameModeBase class to allow the game server to connect to Pragma
- Customize our MyPlayerController class to allow player clients to connect to the game server
- Package the Unreal project
- Configure the Pragma
LocalProcessGameServerProviderPlugin
implementation of the GameServerProviderPlugin to define a dedicated server
Prerequisites #
Required files #
This tutorial assumes you have completed the Parties and Matchmaking tutorials. In this tutorial, we’ll work with the MyPlayerController.h
, MyPlayerController.cpp
, MyGameModeBase.h
, and MyGameModeBase.cpp
files created in the Unreal: Setup tutorial tutorial.
Build Unreal Engine from source #
Building a dedicated game server executable requires an Unreal Engine source build.
If you’ve already started building your game against Unreal Editor from the Epic Games Store:
- Right click on your game project’s
.uproject
file, then select Switch Unreal Engine Version… - In the dialog box that appears, select the source build. This ensures that you’re using Unreal Editor built from source, enabling you to build and package your dedicated server.
In this section #
Topic | Description |
---|---|
Create Server Level and Game Mode Base | Create the required server level and game mode base |
Link Game Server and Game Instance | Link the game server to the game instance |
Connect Players to the Server | Connect players to the server running their game instance. |
End a Game | End a game instance and shutdown the game server. |
Package Project and Test | Packaging the game server and game clients, getting through a party and matchmaking flow, and seeing the game clients connect to a running game server. |