The Photon Forum
is Closed Permanently.

After many dedicated years of service, we have made the decision to retire our Forum and switch to read-only: we´ve saved the best to last! Your search result can be found below. Plus, we offer support via these channels:

Try Our
Documentation

Please check if you can find an answer in our extensive documentation on PUN.

Join Us
on Discord

Meet and talk to our staff and the entire Photon-Community via Discord.

Read More on
Stack Overflow

Find more information on Stack Overflow (for Circle members only).

Write Us
an E-Mail

Feel free to send your question directly to our developers.

Multiple rooms question

nathanj
2020-08-10 04:47:51

Hey, total beginner question but I would really appreciate some direction at the moment.

What I am hoping to do is have a lobby that allows players to enter multiple scenes, each completely unrelated to one another. Am I able to do this where each scene is run from a different client?

I guess my question is how do I facilatate giving the user multiple options for scenes to load into? If anyone can point to any documenation or examples for this I would be most grateful. I'm a bit unsure about the terminology and my searches haven't been very helpful.

Thank you in advance,
Nathan

Comments

Tobias
2020-08-10 10:48:26

Did you check out our tutorial?
https://doc.photonengine.com/en-us/pun/current/demos-and-tutorials/pun-basics-tutorial/

You should read and code-along once.

In short: Users in the same room can interact. Per room, you could load any number of scenes. PUN 2 will help you sync just one (it gets more complex and needs custom solutions once you load multiple).

Michael_Watkins
2021-02-25 02:34:29

this is the closest i have come to finding an answer on multiple scenes and it seems that you are saying photon cant handle them. Every single tutorial i have seen for photon keeps referencing a single scene game.
I've got two scenarios.
1 two players playing the same level and when it is done they advance to the next level which is another scene (cant find any info or tutorials on that)
2. two players start in the village scene. player 1 leaves the village to go to the forest scene so he is in that scene alone. player 2 leaves the village scene to go to the forest and finds player 1 there. (also no tutorials about this method either)

it seems that once you are in a room, photon view will try to sync things at all times even when you are in different scenes. I thought maybe create a room with the same name as the scene so both players enter a room named village that loads the scene village. When i leave the village i would leave the room village and load a room called forest which loads a scene called forest. This way view only syncs the players in the room. I can do a test to see if the room can be created (empty) if not then join the room (someone is already in it).
This seemed logical but i could not get it to work properly.

Tobias
2021-02-25 09:46:30

What you describe sounds a lot like doing an "MMO": Where you are, defines who you meet but there are also instances for parties (sequences of scenes).
PUN is not a good fit for a lot of players in the same place but if you are OK with sharding the locations and having only a few players in the same world as you, this can work.

The approach you describe in the previous post is something that will work, yes. Each room is for a distinct map / scene.

Back to top