Search Unity

Third Party What to upload to photon server to play your game

Discussion in 'Multiplayer' started by ebenknot, Jan 23, 2019.

  1. ebenknot

    ebenknot

    Joined:
    Dec 26, 2013
    Posts:
    90
    What is what you upload to server photon or photon cloud(i dont know diference between those) that is needed to play your game if your game is multiplayer. Imagine that in your game there are rooms with 5 players. what is in the cloud ffor 1 player be able to start a game and then 4 more players..........and then 1 more player in a new room? thanks so mucho in advance.
     
  2. Munchy2007

    Munchy2007

    Joined:
    Jun 16, 2013
    Posts:
    1,735
    You don't need to upload anything as such. Photon cloud acts as a relay allowing players to connect with each other without worrying about firewalls and NAT.

    You set the number of players for your game in code using room options and then either create a new room or join an existing one, the easiest method being JoinOrCreateRoom();

    For your example above using JoinOrCreateRoom(), when you run your game, it will check for any rooms with available spaces, and if it finds one it will join it, otherwise it will automatically create a new room, and then other players can join that.
     
  3. ebenknot

    ebenknot

    Joined:
    Dec 26, 2013
    Posts:
    90
    so the point to creates rooms is inside the programming in the game. Because for us,now, one executable creates one match(room).So its necesary to execute 10 executables to creates 10 rooms. Obviously we have to change that when we change from unet to photon with JoinOrCreateRoom ()
     
  4. Munchy2007

    Munchy2007

    Joined:
    Jun 16, 2013
    Posts:
    1,735
    Yes, you can make it so that any player can create a room (host the game) or join existing games up to the room limit.

    Also another thing that you might find to be a benefit is that if the original host leaves, the room doesn't close; Another existing client is automatically assigned as the host instead and everything continues. The room only closes after all clients leave, and even that can be configured to have a delay before it closes.
     
  5. ebenknot

    ebenknot

    Joined:
    Dec 26, 2013
    Posts:
    90
    Thank you very much for the help :) Do you know about the plans of photon? do you think PUN is ok for an .io game?
     
  6. Munchy2007

    Munchy2007

    Joined:
    Jun 16, 2013
    Posts:
    1,735
    I don't know about the future plans of Photon PUN in any more detail than anything they make public. However, it has been around a long time, is constantly updated and well supported and seems to be quite popular, so it's likely to be around long term.

    Assuming you're using .io to define the game as something where you kill players or eat things to grow or similar to that, then yes, I would say it's suitable for that purpose.