Frequently Asked Questions

Contents

Which Photon Product Is The Right One For Me?

This is a difficult question to answer as it depends on the game you are making and the specifics of your project. However we can recommend the following:

Feel free to reach out to us if you still have questions.

Back To Top

What Is The Difference Between Photon Realtime And PUN?

Photon Realtime wraps up all generic features needed for the load balancing of Photon. It is a product as much as a defined workflow to use Name Server, Master Server and Game Servers. Photon Realtime (a.k.a. LoadBalancing) is the basis for many games using Photon.

While Photon Realtime is independent from Unity, PUN adds many comfortable features for Unity and makes Realtime (the lower level) even easier to use.

Both products share the same backend, same server applications, same low-level stuff, same core concepts. At first PUN was meant to be a better UNet (old Unity Networking): preserve a similar API with a more solid backend and rich features. Then it slowly diverged and became the number 1 solution for multiplayer on Unity.

While we do have a Photon Realtime Unity SDK, PUN has more high level out-of-the-box features like:

  • Magic Unity callbacks
  • Extra Unity components that serialize and sync. networked objects for you: most important one PhotonView
  • PunRPC
  • Offline mode
  • ...

Read more here.

However, while PUN supports webhooks and persisting room states, it is still not 100% able to restitute networked objects' state in the scene(s) when loading a saved game. Read more here.

Back To Top

What Is The Difference Between LoadBalancing API And Photon Realtime?

LoadBalancing API and Photon Realtime can be two different names for the same thing. The LoadBalancing API or the LoadBalancing Client API is the programming interface available in the client SDKs we provide for the Photon Realtime product.

Back To Top

Photon Cloud

Is Photon Cloud Down?

You can check Photon Cloud status here or follow @exitgames on twitter to get notified about status updates.

Back To Top

What Is The Default Photon Region?

Clients should be able to connect to Photon Cloud as long as at least one region is available. So to guarantee this, a default value is configured or is used when the developer does not explicitly set one or choose "Best Region" option. The default value could vary by client SDK. In native SDKs, it is the value at index 0 of the region list returned by server in OpGetRegions. On Unity and DotNet SDKs, the default region should be "EU".

Back To Top

Is It Possible To Disable Some Regions?

Yes. It works in the other way around by defining a list of allowed regions. Read more about the "Dashboard Regions Filtering".

Back To Top

Photon Bolt

What Is The Strict Comparison?

Strict comparison does (a.x != b.x) || (a.y != b.y) || (a.z != b.z) instead of using the built in a != b comparison for vectors which does an approximate. It is useful if you have very small changes that you need replicated.

Back To Top

Is There A Way To Make A Redistributable Bolt Server Build?

Yes, Bolt support the creation of headless servers, so you will be able to run it on any computer you want. If you are using Bolt Free, that uses Photon Cloud, this will just publish a room so other players can join, if you are using Bolt Pro, you can still run it locally or on any cloud service, just need a way to transmit to other players on which IP to connect to.

We also have a simple Headless server sample available here.

Back To Top

Do I Need To Lag Compensate Projectiles Like Rockets?

For weapons that fire projectiles, lag compensation is more problematic. For instance, if the projectile lives autonomously on the server, then what time space should the projectile live in? Does every other player need to be "moved backward" every time the projectile is ready to be simulated and moved by the server? If so, how far backward in time should the other players be moved? These are interesting questions to consider. In Half-Life, we avoided them; we simply don't lag compensate projectile objects (that's not to say that we don't predict the sound of you firing the projectile on the client, just that the actual projectile is not lag compensated in any way). More info here

Back To Top

How To Clear All Bolt Assets On A Project?

All Bolt assets are serialized into the project.json file, so to clear out:

  1. Close Unity;
  2. Delete the <Project Folder>/Assets/Photon/PhotonBolt/project.json file;
  3. Open Unity;
  4. Compile Bolt, Bolt/Compile Assembly menu;

Back To Top

What Is The Recommended Configuration For Using Bolt Free For Headless Servers On EC2?

>Firewall Configuration
Firewall Configuration.

Back To Top

Snippets

Here is a list of small pieces of code that can help you to develop your game.

Back To Top

How To Teleport?

By default, Bolt will automatically interpolate/extrapolate an entity when the distance it moves is less than the Teleport Threshold specified in the entity. Anything over this it forces a teleport which skips smoothing, and this happens automatically. You can force a teleport with Bolt.IState.SetTeleport(NetworkTransform transform) which essentially queues up a request for the next position update sent to the client to force a teleport regardless of settings (for one send tick - the flag gets set back to false after it is sent).

void Teleport(Vector3 newPosition)
{
    state.SetTeleport(state.transform);
    player.transform.position = newPosition
}

Back To Top

How Do You Know If There Are No Sessions When Searching If SessionListUpdated Does Not Get Called In That Case?

For example, before 1.2.9, if you’ve set the room list update to 5 seconds, you would need to wait for 5 seconds to receive the callback. Then you will know that there are no sessions available. Now, starting on Photon Bolt 1.2.9, you can just start a coroutine process when you’ve connected to wait the same 5 seconds.

We've included an example implementation on the basic menu script that comes with the Getting Started sample. Here is a the main parts:

public class Menu : Bolt.GlobalEventListener
{
    private Coroutine _timerRoutine;

    // ...

    public override void BoltStartDone()
    {
        // ...

        if (BoltNetwork.IsClient)
        {
            // This will start a server after 10secs of wait if no server was found
            _timerRoutine = StartCoroutine(ShutdownAndStartServer());
        }
    }

    public override void BoltShutdownBegin(AddCallback registerDoneCallback)
    {
        registerDoneCallback(() =>
        {
            BoltLauncher.StartServer();
        });
    }

    public override void SessionListUpdated(Map<Guid, UdpSession> sessionList)
    {
        // Stop background routine if a server was found
        if (_timerRoutine != null)
        {
            StopCoroutine(_timerRoutine);
            _timerRoutine = null;
        }
    }
}

Back To Top

How To Set A Specific Port When Starting A Game Server?

When running a Photon Bolt instance as a Game Server, you are able to configure which IP/port the peer will try to bind. This is useful if you are hosting your game on Cloud Service, for example, and have a limited range of ports to use.

By default, Bolt will let the Operating System elect a port to bound the internal socket, but this can be overwritten by calling the right overload of BoltLauncher.StartServer, as shown below:

public static class BoltLauncher
{
// ...
    public static void StartServer(int port = -1);
    public static void StartServer(UdpEndPoint endpoint, string scene = null);
    public static void StartServer(UdpEndPoint endpoint, BoltConfig config, string scene = null);
// ...
}

So, you could start your server this way:

void StartBoltServer()
{
    // Custom Port number
    BoltLauncher.StartServer(<custom port>);

    // OR

    // Custom IP and Port number
    BoltLauncher.StartServer(new UdpEndPoint(UdpIPv4Address.Parse("<custom IP>"), <custom port>))
}

Back To Top

Billing

Do You Have Special Offers For Students, Hobbyists Or Indies?

All our products have a free tier and a one-off entry-plan. We also usually take part in Unity's asset store sales and occasionally give vouchers to lucky ones.

Back To Top

Can I Combine More Than One 100 CCU Plan For A Single Photon Application?

No. The 100 CCU plans are not stackable and can be applied only once per AppId. If you purchase multiple PUN+ asset seats then you must redeem each 100 free CCU for a separate AppId. If you need more CCU for a single app, the next higher plan is the 500 CCU one. If you subscribe to a monthly or yearly plan, then you will still keep the 100 CCUs for 60 months on top of / in addition to the CCU from your monthly/yearly plan.

To Document Top