This document is about: SERVER 4
SWITCH TO

Starting Photon in 5 Minutes

Photon is extremely easy to install and start.
The SDK includes ready-to-use binaries which can be up and running within 5 minutes.

Download And Extract

The Photon Server SDKs are available on the download page of our website.

The Server SDK comes as self-extracting executable.
This keeps included .dll files from being flagged as "untrustworthy" by some unzip tools.

You can extract the server package to any place - preferably an empty folder which you prepared beforehand.
The extraction creates several folders.

The "deploy" folder contains the binaries.
This is what you need at least to run Photon.
The folders doc, lib and src-server (applications) are for development.

Starting PhotonControl

In the "deploy" folder you will find a folder per application (see: Basic Concepts) and some folders starting with "bin".
Open one of these two:

  • bin_Win32: Windows Vista and up
  • bin_Win64: 64 bit Windows Vista and up

In either folder, you will find the actual Photon executable.
You can start this with command-line arguments or you can use PhotonControl.

Start PhotonControl.exe and confirm the admin rights for this application.
They are needed for the option to setup Photon as a Service.

Look out for the tray-bar icon (bottom right by default).
Click the white/grey icon to open a menu which controls Photon.

It might take several seconds until Photon is ready to use, depending on the applications it is running. Exiting Photon Control won't shutdown the server.

Read more about PhotonControl.

LoadBalancing Instance

Photon is designed to run "Applications" as game logic.
They define what a client can do or can't (e.g. for matchmaking).
Applications run cooperatively for different tasks.

Out of the box, Photon comes with two distinct application configurations:

  • LoadBalancing (MyCloud) is the preferred setup and compatible with the Photon Cloud and PUN.
  • MMO Demo is an application that exposes a simple MMO solution based on Photon. Read more about "MMO Demo".

Starting LoadBalancing (MyCloud) is the way to go for clients done with PUN, Photon Voice or Photon Realtime (also known as the "LoadBalancing Client API").

Actually, this setup will start two separate Photon Applications: Master Server and Game Server.
When a new room gets created, the Master Server will forward the client to the Game Server.

By default, only clients on the same machine can reach a Game Server. Other clients won't be able to create a room and will fail without prior "Game Server IP Config".

Game Server IP Config

In the PhotonControl menu select "Game Server IP Config".
The IP addresses of the host machine will be listed, marked as "public" or "local".
Select one.

The entry "Autodetect public" makes the server detect a public internet IP when Photon starts.

Using a local IP means that only clients in the same local network can connect.
You need to use a public IP, if players from the internet should be able to connect and join games.

If your server is in a LAN but your clients use WiFi, they might be in distinct networks.
If your client can't reach the server, check if your router allows connections between WiFi and LAN.
Check if all devices are in the same IP range.

Keep in mind, public IPs are subject to change unless you have a static one.

No matter if you choose a local network IP or a public one, you also have to setup your firewalls, routers and switches.
Sadly, we can't help here, due to the amount of different hardware and software. In the easiest setup, multiple test machines are connected by the same switch/router.

The Game Server IP Address is saved in a file called "Photon.LoadBalancing.dll.config".
It can be edited manually, too.

Starting LoadBalancing

Pick LoadBalancing (MyCloud) from the Photon Instances and "Start as Application".
Now you have started Photon.

Photon Server Screenshot: Photon Control
Photon Control: Start "LoadBalancing (MyCloud)" as application

Starting the Test Client

The server SDK includes a test client to simulate multiple clients and to generate some load.

If you run the test client and notice some failures to connect or "Game does not exist" errors this might be explained by the fact that created Photon peers are trying to connect to the server or join rooms too soon. The solution to this "server-client race condition" is to delay the startup of the test peers using "StartupInterval" setting from "deploy\bin_tools\stardust.client\Photon.StarDust.Client.exe.config".

You can start it from the PhotonControl menu.
It's the last menu item for the application setup you started: "Run test client".

The test client is a simple console application which will simulate client sessions and games with a few players each.

Photon Server Screenshot: Test Client
Photon Server Screenshot: Test Client

License Info

Until you apply a license file, Photon will be limited to 20 concurrent connections.

PhotonControl will read some values from your .license file on start.
Select the "License Info" item in the menu to check the CCU, expiry date and more from the menu.
If you replace the .license file, you should restart PhotonControl to get the new values.

The server log will also contain essential values of your license.

See Licenses page for more information and follow this guide for adding a new one.

Back to top