PUN game self hosted with photon server

Options
Am i correct in my realisation that my PUN game can be connected to my own photon server - with such benefits as persistent rooms and webhooks to save player data??? Ive been trying to work around PUN to save player data but realised the limitations are due to cloud hosting per se not actually PUN itself.
Is that all i have to do, create the game with unity/PUN, and set up my own custom hosting server to handle load balancing, lobby, saving and authentication????

Comments

  • JohnTube
    JohnTube ✭✭✭✭✭
    Options
    Hi @carcer,

    Photon does not offer data persistence but it tries to facilitate it using webhooks and webRPC.
    You can save and load player data outside of Photon using an HTTP based service.
  • carcer
    Options
    I know I can save data via webhooks and webRPC in Realtime, but PUN doesn't allow persistent rooms, and rejoining games. I assumed it was because of a photon cloud limitation. If I configure my own photon server with it's own webhooks, and room persistence, I can use that to host PUN clients?
    or am I misunderstanding the difference between PUN and Realtime?
  • JohnTube
    JohnTube ✭✭✭✭✭
    Options
    I will try to explain why we make distinction between PUN and Realtime Unity SDK when it comes to persisting room state.

    Here is why PUN is still not 100% persistence friendly:

    In theory room persistence is done in the same way in both as PUN has some extra stuff on top of Realtime.
    PUN uses special predefined events to achieve some advanced features (e.g. Scene objects, PhotonViews, ViewID, networked objects, ownership transfer, etc.) out of the box unlike the Realtime Unity SDK which does not have that.
    The room state can save cached events (e.g. buffered PunRPCs) but the cache size can grow too big and the behavior of some PUN events are still not fully tested and adapted to the situation when they are loaded at once on room creation.
    So developers may think that they can completely restore the room state in a PUN way using webhooks and ends up with some broken PUN features because the situation is new and still not handled in a good manner which could take time.

    That being said, you can use PUN with some limitations. Those limitations are enumerated in this page.
  • carcer
    Options
    Ah ha, ok. So the best one could do is use custom properties and events, and reload a partial game state. More or less for proper persistence it would be more efficient learning how to use the realtime unity sdk than trying to work/hack around PUN. The good thing is, after all the reading ive been doing, that option seems a lot more achievable now that ive got PUN basics nailed. Thanks for your help!