Photon Fusion 2
Explore how to host Unity projects on Edgegap using techniques from the Fusion 2 Asteroids Sample.
βοΈ Preparation
Before we start, you will need:
Unity 6 - download using Unity Hub,
Fusion 2 Asteroids Sample project (modified for Edgegap) - download from GitHub.
β‘ Deploy and Connect
1. Deploy a Server on Edgegap
βοΈ To get started, you'll need to create a free account with Edgegap. No credit card required.
βοΈ Create a new app version for your application, choose Fusion 2 Asteroids Sample.
βοΈ Open your new project in Unity.
βοΈ Navigate to Tools / Edgegap Hosting, then to step 6. Deploy a Server on Edgegap.
βοΈ Press Deploy to cloud and open your new deployment's details.
βοΈ Find your deployment's unique, one-time connection details:
Host URL in format
780aa4260e83.pr.edgegap.net
.
β You may now proceed to the next step.
2. Connect from Editor
βοΈ Open your new project in Unity.
βοΈ Press the βΆοΈ Play button to start your game client.
βοΈ Input Host URL (connection details from previous step) as room name.
βοΈ Press Start Edgegap button to connect to your server.
βοΈ Connect a second virtual Player with Multiplayer Play Mode or ParrelSync.
π Congratulations on your first Deployment on Edgegap!
βοΈ Customize Server Build
See Getting Started - Servers for Unity to learn how to build and customize servers.
Create an App on Photon
βοΈ Create a free account with Photon.
βοΈ Create an Application on Photon:
Multiplayer Game
,Fusion
Photon SDK,Fusion 2
SDK version.
βοΈ Find your Application ID in format 85314a99-56fc-4ab3-ba26-50efca09f303
.
βοΈ Input your ID in Photon Settings under Tools / Fusion / Fusion Hub (Alt + F).
Integrate Fusion 2 Project with Edgegap
See EdgegapServerManager.cs
script for an example integration of Fusion 2 with Edgegap.
Game clients will connect to game servers through Photon Fusion 2 Session (room) feature.
Your game server needs to register it's IP address and external port with the Session name, when calling _runnerInstance.StartGame(StartGameArgs args)
:
use
NetAddress.CreateFromIpPort
method from Fusion,provide server's IP address:
Environment.GetEnvironmentVariable("ARBITRIUM_PUBLIC_IP")
provide server's external port:
Environment.GetEnvironmentVariable("ARBITRIUM_PORT_GAMEPORT_EXTERNAL")
this is the default port mapping name if you use our Unity plugin to package your server.
Use Edgegap Deployment Host URL as a Session name:
in game server, get it with
$"{Environment.GetEnvironmentVariable("ARBITRIUM_REQUEST_ID")}.pr.edgegap.net"
when testing game client, get it from dashboard - deployment details page / Host URL
create deployments for testing from our quickstart hosting plugin,
when live in game client, get it from matchmaking / ticket assignment / fqdn:
see also getting started with Matchmaking.
Troubleshooting
Last updated
Was this helpful?