Skip to content

rocketsciencegg/mp-unreal-sdk-test-project

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

859 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Unreal TestBed

Unofficial Sample for manual testing UGS + Multiplay for Unreal Engine. Based on: https://docs.unrealengine.com/4.27/en-US/InteractiveExperiences/Networking/HowTo/DedicatedServers/

This sample was built and tested with a source build of Unreal Engine (5.1.1).

The project is configured part in C++ and BP. The main files are the TestBedGameMode.h/cpp, EntryMenu (BP) & TestBedGameMode_BP.

Features

  • Client & Server Application (Build Targets are TestBed & TestBedServer).
  • Can be used locally to demo networking.
  • Uses Anonymous Auth Login with Matchmaking on Multiplay.
  • Supports Direct Connection via IP address to Multiplay DGS.
  • Matchmaker Backfill enabled.
  • Supports up to 4 players drop-in drop-out.
  • Server auto shutdown when all clients disconnect, 5 mins shutdown if no players connect.

Requirements

  1. Source Build of Unreal Engine (Version 5.1.1) - Github, How-To
  2. Windows 10/11 or Ubuntu/Debian Operating System.
  3. Visual Studio 2022 (Required modules listed in appendix).
  4. Unreal Engine Linux Cross-Compilation Toolchain: If building the Linux Server from Windows for UE 5.1.1, you must install the v20_clang-13.0.1 toolchain. Newer versions (like v21/Clang 15) will fail to compile.

Setting up the TestBed Sample (Windows)

  1. Right-click TestBed.uproject -> Switch Unreal Engine Version (change to your 5.1.1 source build).
  2. Right-click TestBed.uproject -> 'Generate Visual Studio Project files'
  3. Open the .sln file in Visual Studio 2022.
  4. Right-click on the project 'TestBed' in Solution Explorer window. Select 'Build'.
  5. Once done, double-click TestBed.uproject to open the Editor.
  6. Set your Unity Dashboard Project ID & Environment Name in Edit -> Project Settings -> Search for 'Unity'.
  7. Provide the region for client QOS result, open Content/UI/EntryMenu BP and set the 'Make QoSResult Node Region' value to the fleet region value. (if you can't find the node, use Ctrl-F search for 'Make QoS')

Running the TestBed Sample

Build the Executables

Build the executables for both the client & server. The first iteration of these builds with a source build of Unreal can take a few hours depending on machine spec.

Unreal Engine 5.1

  • To build Client: Platforms -> Platform of your OS (Windows (64-bit) or Linux) -> Ensure the following options are selected: Binary Configuration = Development, Build Target = TestBed -> Package Project.
  • To build Server: Platforms -> Linux -> Ensure the following options are selected: Binary Configuration = Development, Build Target = TestBedServer -> Package Project.

(Note: Included .bat scripts using AutomationTool / BuildCookRun can also be used to automate this process).

Configure Multiplay

Launch Parameters: Create a build configuration for the build with the following launch parameters (build requires up to 5 mins to sync first). * ⚠️ IMPORTANT: Ensure there are absolutely no spaces between the flags and their values (e.g., use -port=$$port$$, NOT -port $$port$$). Unreal Engine will ignore the port assignment if spaces are used, defaulting to 7777 and causing the server to appear unresponsive.

-nosound -nullrhi -port=$$port$$ -queryport=$$query_port$$ -queryType=$$query_type$$ -LOG=../../../../$$log_dir$$/$$serverid$$.log

Create a fleet for this Build Configuration in your local region.

Create a Matchmaker queue & pool for this build configuration:

  1. Name the queue default-queue, set timeout duration to 180s & max players per ticket to 4.
  2. Create a new pool using the JSON in the appendix of this readme.

Client Test

Run one or more client applications and click the "Start Matchmaking" button to matchmake. If everything is set up properly, the client will matchmake then transition from the menu to the demo level.

(Note: Matchmaking testing requires a valid server.json file injected by the Multiplay orchestrator. If testing locally in the Editor without a Multiplay cloud deployment, the SDK will fall back to attempting a local Centrifuge connection on localhost:8086).

Appendix

Required Visual Studio Modules for UE 5.1 (VS 2022)

- Microsoft.VisualStudio.Component.VC.Tools.x86.x64
- Microsoft.VisualStudio.Workload.ManagedDesktop
- Microsoft.VisualStudio.Workload.NativeDesktop
- Microsoft.VisualStudio.Workload.NativeGame
- Microsoft.Component.MSBuild
- Microsoft.NetCore.Component.Runtime.6.0
- Microsoft.Net.Component.4.8.TargetingPack
- Microsoft.VisualStudio.Component.VC.DiagnosticTools
- Microsoft.VisualStudio.Component.VC.ASAN
- Microsoft.VisualStudio.Component.Windows10SDK.19041 (or Windows 11 SDK)
- Component.Unreal

Default Matchmaking Pool JSON

{
  "Name": "default",
  "BackfillEnabled": true,
  "MatchDefinition": {
    "Teams": [
      {
        "Name": "Default",
        "TeamCount": {
          "Min": 1,
          "Max": 1
        },
        "PlayerCount": {
          "Min": 1,
          "Max": 4
        }
      }
    ]
  }
}

About

No description, website, or topics provided.

Resources

License

Stars

1 star

Watchers

1 watching

Forks

Packages

 
 
 

Contributors