Photon Server Setup and Tutorial

Hi,

I have previously used photon unity networking cloud to create a real time multiplayer game. I used photon cloud for that. Now, I am thinking of creating another game similar to agar.io.

Now for that I know I need a server which is online and can manage clients on multiple rooms with bots. I want all calculations of the movement for each client (which will be using Unity) should be done on the server side so that everything is synced. I was thinking of using photon server and was hoping to run the server on the machine and i will be able write the code to manage my requirements but I cannot seem to find the example of server side code and setup. Can anyone help me in this regard.

Comments

  • Ok, thats definitely a start. I want to have some general info regarding the photon server.

    1. How many CCU it supports on a server ?
    2. How much messages per second can be send and received from the clients. For example, If I am planing to have a game similar to agar.io and 500 users connected to the server in each room. It must require large number of messages per second.
    3. How does photon going to handle server disconnection. For example if I am using photon server, and large number of clients are connected right now and server disconnects. I do have another server. how i would be handled ?
  • 1. this depends on your game - for a few hints see http://doc.photonengine.com/en-us/onpremise/current/performance/performance-tests
    2. Photon is designed for room based games for up to 16 (maybe 32) players per room. If you need more players in a room, you usually need interest management. This is mainly because otherwise clients can not cope with the amount of data they receive and not so much a server limitation.
    3. If one of your Photon game servers crashes, the games on it are usually lost. When going with Photon Server, you will have to handle all operations topics. You might also want to look at http://doc.photonengine.com/en-us/onpremise/current/applications/loadbalancing/application#oorlb
  • hi.i'm new on photon for unity.i have a Game project that i have to set the logic for that game in server side and the server handle that logic, not Client.so i switched from PUN to Photon server and now i have these questions:
    1-is it possible to make methods with photon server?or develop the photon server??
    2-should i have to use PUN for unity??for connecting to photon server.i think i have to.because i had try that.just for sure i asked;
    3-i am using Unity for my project.so i have read these articles that show unity security is in low level.
    https://www.alanzucconi.com/2015/09/02/a-practical-tutorial-to-hack-and-protect-unity-games/
    http://devxdevelopment.com/
    so how can i for example handle my game logic in server that no one can't see or reach that even they changed my unity project source code??(this is my main question)
  • JohnTube
    JohnTube ✭✭✭✭✭
    Hi @Aidin0181,

    Thank you for choosing Photon!

    1. yes it is possible to:
    a. have serve app from scratch: this is for self-hosted only and require making your own client.
    b. extend LoadBalancing server app: this is for self-hosted only (may require changing our client SDKs accordingly).
    c. use Plugins (recommended): this is for self-hosted or Enterprise Cloud only
    2. it is up to you, we have 2 SDKs for Unity compatible with Photon Server or Photon Cloud: PUN/PUN+ and Photon Realtime.
    3. you need authoritative server-side logic that checks if user input is ok and allows or disallow events or actions incoming from clients and propagates only correct info in sync.

    So we recommend plugins as it makes workflow easier and faster.
  • hey @JohnTube .tnx a lot.i'll try to use photon plugins.
  • drust_taib
    edited January 2019
    @Markus I have two questions 1- can I create a messaging system, sending gifts, or sending news between clients, or I as the server send information for a specific user?
    2- I can't find tutorials on youtube about photon server in unity, do you have any source?
  • 1 - sure - however, your question is a bit vague about what exactly you want to achieve.

    2 - we do not do much video tutorials, instead we suggest to go through the docs starting at https://doc.photonengine.com/en-us/server/current/getting-started/photon-server-intro
  • I know this is an old thread, but unfortunately all documentation for setting up an on-premise Photon server seems to have been pulled. All sites l've found either on this thread or through a simple Google search give 404 errors. Has this documentation been moved, and to where?

  • hi, @jnhyatt

    this is some kind of bug. It will be fixed soon. Sorry for inconvenience


    best,

    ilya

  • @jnhyatt the issue is fixed. docs for server side are accessible here: https://doc.photonengine.com/en-us/server/current/getting-started/photon-server-in-5min


    best,

    ilya