Skip to content

edgegap/netcode-sample-photon-fusion-2

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Photon Fusion 2 sample project

This guide will help you create a headless server on Edgegap for a Unity project using Photon Fusion 2 as its networking solution. You will need an account with both Edgegap and Photon for this.

We will use the sample project Asteroid Simple (Host) from Photon Fusion as an example.

Tutorial

To test this sample:

  • Clone the repo via the git clone [URL] command;
  • In the Unity editor, set these values with your own:
    • In PhotonAppSettings.asset: App Id Fusion;
  • Make sure both scenes under Assets/Asteroids-Host-Simple/Scenes are included in the build settings.
  • Build & containerize your server then create a new app verison with the Edgegap plugin.
  • Add app version port mapping with name gameport, internal port 7777, and protocol UDP.
  • Start a new deployment via the Edgegap dashboard/plugin.
  • Before launching the client:
    • Enter the Photon region that corresponds to the server's deployed location in PhotonAppSettings.asset: Fixed Region. If left empty, it will by default use the Photon region with the lowest ping.
  • Launch the game in the editor:
    • For room name, input your deployment's Host URL as shown in dashboard, in format {request_id}.pr.edgegap.net.
    • Click on Start Edgegap.

The game will search for an available room with the specified name. After a short moment, the client should successfully connect to the server.

Troubleshooting

  • If the client is unable to connect to the specified room name with an error code of Game Does Not Exist (32758) but the server is up and running correctly, it's possible that the region used by the client does not correspond to the same region that the server is in. You can double-check the server's location using the deployment map on the Edgegap dashboard, and compare it to the region code set in PhotonAppSettings.asset: Fixed Region.

You can see the full documentation here.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 2

  •  
  •