Guide: Photon Server for LAN



  • This guide explains how to download/install and configure the Photon Server SDK for your own LAN.

    Table of Contents

    1. Problem description
    2. Download and installation
    3. Server configuration
    4. Connection test

    1.  Problem description

    When using Unity Networking (UNET) in Tanks Multiplayer, playing over a private, local area network (LAN) is already possible and we greatly reduce your effort by providing LAN discovery for detecting open matches and joining them automatically - basically it just works. With Photon however, you need a dedicated server running in your LAN and enter its IP address in-game so others are able to connect to that.

    2.  Download and installation

    Head over to the Photon Server SDK page and download the latest Server SDK (should be on the left side, requires Windows). You don't need to register right now. After you've extracted the files somewhere on your harddrive, navigate to its "control center", found under deploy > bin_WinXX. Start up PhotonControl.exe.

    3.  Server configuration

    If you start up PhotonControl, you will receive a message that your server currently supports 20 CCUs. If you want more than that, sign up on the Photon website and download your 100 CCU license - for free. Move it into the folder where your PhotonControl executable is located and restart it to take effect.

    Now, click on the PhotonControl icon in the tray bar and select 'Game Server IP Config'. Here you have to choose how your server should be reached. You can choose between your private IP within your LAN, or a public IP. Note that if you want to have players connected from a different network, you have to set a public IP that does not change i.e. a static IP. However for simple LAN setups, you would use a local IP - therefore click on 'Set Local IP'.

    Lastly start the LoadBalancing application as shown below, which contains all necessary game logic for running Photon PUN clients with Unity.

    https://doc.photonengine.com/Docs/img/onpremise-v4/PhotonControl/PhotonControl-03-v4.png

    4.  Connection test

    Fire up the Unity Editor with Tanks Multiplayer configured for Photon. Open the 'Intro' scene and press play. Click on the settings button in order to select the NetworkMode LAN, which makes an additional field for the server IP visible. Replace "127.0.0.1" with the local or public IP you have chosen under PhotonControl's 'Game Server IP Config'.

    https://www.rebound-games.com/wp-content/uploads/TanksMultiplayer-PhotonLAN-.png

    Close the settings window and press play - you should now be playing on your own server!

    For more information, please refer to the official getting started guide on the Photon website.


Log in to reply