How to Add Multiplayer to a Unity Project using MobiledgeX Edge Multiplay

February 3rd, 2021

Headshot for Vasanth Mohan

Vasanth Mohan

Developer Advocate

Among the developers we work with at MobiledgeX, gaming, especially multiplayer gaming, has been a use case that sparks considerable interest. To support developers with use cases in multiplayer gaming, MobiledgeX has open sourced a multiplayer message relay game server called Edge Multiplay.

Additionally, to make it extremely simple to integrate this solution into existing Unity games, MobiledgeX has also created an open source Unity client with simple prefabs and function calls. These function calls are designed to make it simple to connect players to the closest Edge Multiplay Server and communicate game-specific events among players.

To make it easy to integrate Edge Multiplay into your existing games, we provide you documentation on using the various Edge Multiplay features. We have also created a series of videos to help you start developing with Edge Multiplay. Below, you can watch each of these videos, which will explain how you can start from an empty Unity project to a simple multiplayer networked game. 

If you are interested in learning more about Edge Multiplay, join our Discord to ask questions and chat with the team on how you can best integrate Edge Multiplay into your own game. 

Getting Started

A step-by-step guide on installing  the MobiledgeX Unity SDK and importing the Edge Multiplay Client. In this video, we will also show you how to test Edge Multiplay using our Ping Pong example and connect to one of our sample servers. 

Avatar Selection

Starting from a project where you have just imported Edge Multiplay, this video will walk you through setting up your scene with the correct scripts and prefabs to integrate with Edge Multiplay. Once setup, we will walk you through instantiating a player selected avatar when your game starts. 

Events & Callbacks

To help each player keep track of the state of other players that are connected to the server, Edge Multiplay provides many different types of events with callbacks that developers can listen for. For example, there are events for when your player joins a room, when other players join the same room, and when the room is full and the game can begin. In this video, we will go over some of these events and how you can listen for them to best serve the game you are building. 

Sending Data & Messages

Finally, the most critical aspect we offer is how game-specific data can be sent using Edge Multiplay across all your players during the game’s duration. In this video, we will go over two specific ways you can integrate Edge Multiplay into your game: using Edge Multiplay Observer and by Sending Messages with the Edge Manager. The Edge Multiplay Observer is a drag and drop Unity component that can be applied to player avatars or to any other game object within your scene in order to easily sync position or rotation of a game object. If you have more custom messages or data that needs to be sent, you can use the Edge Manager to send those specific messages to all other players connected to the room. 

What is Next?

If you are interested in trying out Edge Multiplay, we encourage you to follow this series to try it yourself. We look forward to seeing what amazing multiplayer games the community can build using Edge Multiplay.

If you are interested in other solutions that leverage the edge, we encourage you to reach out on Discord for Early Access to the MobiledgeX Edge-Cloud platform.

We also encourage you to follow us on Twitter for the latest updates from MobiledgeX.