Package Project and Test #

Goal: In this section, we’ll build and package our game server and client.

Include maps in packaged build #

Ensure that our GameServerLevel is included when we package our standalone dedicated server.

  1. In the Unreal Editor Project Settings, under Packaging, locate the List of maps to include in a packaged build section.
  2. Include both the GameServerLevel and the map where you built the login and party screens (e.g., MainMenuLevel).

Package the server and client #

  1. In Unreal Editor, select the Platforms dropdown and Windows.
  2. Under the Build Target section, select the project server radio button (in our case, UnrealTutorialServer).

Unreal server package

  1. Under the Content Management section, select Package Project. Choose a directory to store the server executable. Unreal begins the server packaging process.
  2. When the build finishes, go back to the Platforms dropdown, Windows, Build Target section and select the game client radio button (in our case, UnrealTutorial).

Unreal client package

  1. Under Content Management, select Package Project. Choose the same directory as the server executable to store the client executable. Unreal begins the client packaging process.
  2. When this build finishes, you should have standalone client (UnrealTutorial.ext) and server (UnrealTutorialServer.exe) executables built and packaged.

Set plugin and executable path #

In this tutorial, we want to use the Pragma-provided LocalProcessGameServerProviderPlugin, which instructs Pragma to allocate game servers on the local machine.

In your local-dev.yml file, ensure the following GameInstanceService.gameServerProviderPlugin settings are specified. Update the serverExecutablePath to where your game server executable is built:

game:
  pluginConfigs:
    GameInstanceService.gameServerProviderPlugin:
      class: "pragma.gameinstance.LocalProcessGameServerProviderPlugin"
      config:
        serverExecutablePath: "C:/path/to/game/server/executable.exe"
        serverLogDirectory: "."

Get in game #

  1. If pragma-engine is currently running, stop and restart it.
  2. Launch two copies of the game client executable (e.g., UnrealTutorial.exe).
  3. Log into each client with test01 and test02.
  4. Proceed through the party screen then start matchmaking on both clients.
  5. After matchmaking succeeds, the Pragma Engine backend launches the game server. Based on the code developed in this tutorial, connection details are sent to the game clients, which then connect to the game server to play the game.