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:

  1. Create an Unreal level for our game server (GameServerLevel)
  2. Customize our MyGameModeBase class to allow the game server to connect to Pragma
  3. Customize our MyPlayerController class to allow player clients to connect to the game server
  4. Package the Unreal project
  5. 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 #

TopicDescription
Create Server Level and Game Mode BaseCreate the required server level and game mode base
Link Game Server and Game InstanceLink the game server to the game instance
Connect Players to the ServerConnect players to the server running their game instance.
End a GameEnd a game instance and shutdown the game server.
Package Project and TestPackaging the game server and game clients, getting through a party and matchmaking flow, and seeing the game clients connect to a running game server.