How to run a persistent room?

So I made a shooter game with the master client structure and everything works fine, but now I'm trying to create a dedicated server where all clients simply join without anyone being the master client. So basically the server creates a persisten room and everyone else can join and leave.

I downloaded the server SDK and got it to run self hosted, but that's still no client-server structure.
I've been reading the docs but honestly I have no clue.
I'm not sure if I have to code all the server logic or if I can convert my current master client game to a dedicated server somehow?

Can't I just make a unity build which is the master client that creates the room without spawning a player etc, and client builds that simply join a hard coded room name aka the master client's room?

Comments

  • hi, @Lejean

    Thank you for being with us.

    As far as i know you may create headless unity build and use it but it does not scale. I would say that best way to go for you is your own plugin. Then you do not need to know about server internals (which are huge) much, and you may concentrate on logic and checks.

    second note, in cloud empty game does not live more then 5 mintes if i remember right. but for sure not more then 30 minutes. So you have to update this part too

    best,
    ilya
  • Hey, thanks for replying
    chvetsov said:


    but it does not scale

    What does this mean exactly?

    Also if I really wanted to make a dedicated server the correct way for example for an MMO, would I actually have to code everything the current photon cloud servers do for PUN as it were? Its not like I could use my PUN game and convert it in a couple minutes to work on a server?
  • Hi, @Lejean

    it does not scale, becase you need one unity headless process per game. it takes too much resources
    >...would I actually have to code everything the current photon cloud servers do for PUN as it were?
    Everything what cloud server does for PUN there is in SDK. you do not have to add anything.

    >Its not like I could use my PUN game and convert it in a couple minutes to work on a server?
    it is not like that.
    Logic on server totaly different. on client you just send/receive, on server you should broadcast.
    What you could/should do is extract game logic to classes which can be reused by server code, next step would be write your plugin, which will use your game logic

    best,
    ilya
Sign In or Register to comment.