Getting Started with EdgeMultiplay

Last Modified: 04/02/2021

Edge Multiplay is a solution to make building a multiplayer game in Unity open and transparent, especially for real time games that need lower latency. Have questions or suggestions to make this solution even better? Join the EdgeXR Community Discord!

The NodeJS Docker Server Code is Avaliable and Open Sourced on Github.

The Unity Client for this Docker Server is also open source and integrated with our EdgeXR SDK. We have provided a few sample servers that are deployed globally on the EdgeXR Edge-Cloud platform. In this guide, we will walk you through how to setup and connect to these sample servers using the EdgeXR Unity SDK. For more documentation on the EdgeXR Edge Multiplay client, please refer to our API documentation.

Prerequisites

Adding EdgeMultiplay to your Unity project

From a new Unity project, import the EdgeXR Unity SDK. To do this, open the Package Manager under the Window Menu Window/Package Manager.

Open Unity Package Manager
Open Unity Package Manager

Next, click the + icon and Import Using Git URL. Copy and paste this URL : https://github.com/mobiledgex/edge-cloud-sdk-unity.git

Add EdgeXR Package using git url
Add EdgeXR Package using git url

Once the EdgeXR SDK has finished installing, there will now be a new EdgeXR Menu. From the EdgeXR Menu Import EdgeMultiplay, select EdgeXR/Examples/EdgeMultiplay

Add EdgeMultiplay from EdgeXR Menu
Add EdgeMultiplay from EdgeXR Menu

Connect to EdgeMultiplay Server sample

Once EdgeMultiplay is installed in your Project Assets, we need to provide application credentials to the EdgeXR SDK to find the closest EdgeMultiplay Server.

From EdgeXR Menu go to EdgeXR/Setup

EdgeXR Menu
EdgeXR Menu

Edge Multiplay Credentials

Add the following credentials:

  • Organization Name : EdgeXR-Samples
  • App Name : EdgeMultiplay
  • App Version : 1.3

EdgeMultiplay Application Definition
EdgeMultiplay Application Definition

Then click Setup

Now you are all set to connect to an Edge Multiplay Game Server!

Testing Edge Multiplay with Ping Pong

To test Edge Multiplay, we have provided an example implementation of Ping Pong with Edge Multiplay. In Your Projects folder, under EdgeMultiplay/Examples, there is a PingPongExample.unitypackage file. Double click it to import that example into your assets.

Connected to Edge Multiplay Server
Connected to Edge Multiplay Server

Import PingPong to your project
Import PingPong to your project

Once the import finishes, you will now have PingPongGame as a folder under your Assets. Under PingPongGame/Scenes, there will be a PingPongScene. Open that scene and click Run.

If you see the following text, you have successfully connected to an instance of the server. To play the Ping Pong Sample, you will need to Build and Run another instance of the client.

Connected to Edge Multiplay Server
Connected to Edge Multiplay Server