This page is a work in progress and could be pending updates.

Multiplay

Level Advanced

Overview

Multiplay is the Unity Hosting Service solution, built with Dedicated Server Orchestration in mind, that also provides a lot more features, like server health tracking and zero downtime updates. More information can be found on the official Multiplay website here.

This page describes the necessary setup on the Photon Fusion SDK in order to deploy and run a Dedicated Server using Multiplay.

Back To Top

External Links

  • Multiplay - Get started: https://docs.unity.com/game-server-hosting/guides/get-started.html
  • Multiplay - Integration Requirements: https://docs.unity.com/game-server-hosting/concepts/integration-requirements.html
  • Fusion Dedicated Server Sample

Back To Top

How To Run

Running Fusion as a Dedicated Server on Multiplay is really straightforward as the only main requirement is that the peer binds to a specific port when started.

The two interest points network-wise for Fusion are the Dynamic IP address and Dynamic port number topics described on the link above. It is required that any peer running on the Multiplay hosts binds to IP 0.0.0.0 (extra info) and to a port passed either via command-line arguments or a configuration file. Check the Launch parameters page for more info.

Another important aspect of running a Dedicated Server on a global cloud hosting service, is the geographic location where this server will be in execution. Considering that a Fusion Server must be connected to a Photon Cloud Region, selecting the best Region for your Server is mandatory. Check the Region Reference Mapping below.

Once the port and region values are passed to the executable, Fusion can be started as shown below:

private Task<StartGameResult> StartSimulation(
  NetworkRunner runner,
  string SessionName,
  ushort port,
  string customRegion,
) {

  // Build Custom Photon Config
  var photonSettings = PhotonAppSettings.Instance.AppSettings.GetCopy();

  if (string.IsNullOrEmpty(customRegion) == false) {
    photonSettings.FixedRegion = customRegion.ToLower();
  }

  // Start Runner
  return runner.StartGame(new StartGameArgs() {
    SessionName = SessionName,                  // Custom Session Name
    GameMode = GameMode.Server,                 // Game mode always set to Server
    Address = NetAddress.Any(port),             // EndPoint to bind: 0.0.0.0:port
    CustomPhotonAppSettings = photonSettings,   // Custom Photon App Settings
    // other arguments
  });
}

Back To Top

Extra Information

Region Reference Mapping

Multiplay Region Photon Region
US West US
US East US
US Central US
Europe EU
Russia EU
North East Asia (Japan/Korea) JP
South East Asia (Singapore) ASIA
Australia / Oceania ASIA
India ASIA
South America SA
China CN


To Document Top