Setting up levels/chat rooms

ktweedy1 ✭✭
edited August 2010 in Photon Server
I am working on a virtual world for nurse training. We have one main area where you go when you first enter the world and from there you click a sign to take you to the lesson. Each student can run their own copy of the lesson and they can invite others into their lesson. While in that lesson only the students in the same instance will talk to each other.

So I have some questions on how to best do this. I see it pretty much like chat rooms.

1. A student starts a new scene so I have to on the server start a new chat room.
2. Student can invite others to the room. So they need to be able to see the list of all students to send the invite.
3. While in the room, when they talk, only people in the room see what they are talking about.

So how is best to do this with Photon?

1. I see their is a lobby example, do I make a new lobby when I start a new instance of the lesson?
2. How does radar work with this? I don't really need radar, but i do need to filter events so only people in the same instance/chat room see each others events.
3. Thinking to use RaiseGenericEvent to send chat, you recommend a another way? I saw the lobby has some kind of message object but wasn't sure what it is.

So in summary
1. I need to be able to get a list of everyone logged in.
2. I need a way to start a new room and invite others into the room.
3. Chat and events is only shared with everyone in the room.

Don't need private chat or group chat, etc. for now.


  • It seems you are looking at the MMO Demo while all you need is in the Lite Lobby application.

    The Lite Lobby uses rooms to let player groups communicate. It does not matter if it's chat messages or positions: you can send what you want per room.
    The "lobby" functionality in it means that there is a list of games currently running. By this list, you can easily join any open room. Lobbies and rooms are defined by the client side on the fly: you create a room "a" and tell it to use some lobby "l". Players getting into room "l" will see a list of games (lobby) while players getting into "a" from that list, will get the events other players send via OpRaiseEvent() in that room.

    You will have to add a list of all players (and their names) yourself. Photon's Lite Lobby does not have a complete player list but if you use the list of rooms as example, you can probably do it quickly.
  • Starting to make more since.

    Is there a Unity3d example of any client example of usng the LiteLobby application?
  • No, currently you would have to use the DotNet SDK's Lobby Sample. The code you would use is identical but we did not yet build the UI in Unity.
  • Making a little more progress. Thanks for the help.

    Couple questions.

    In the LiteLobby form you connect to Game and then you connect to LobbyHandler. There is nothing preventing me from connecting to the LobbyHandler first and then starting a game?

    If my game is a MMO instance, you see any complications in using the Game from the MMO demo project? Or what may be easier is adding the Lobby stuff to the MMO demo. Any thoughts no this?

    In my application I have spaces thare are virtual worlds where people interact and walk around and then I have spaces that are more like rooms where training class functionality is. But my rooms are more like MMO in that I have players and items and I need to share movement of players and items. Just that in the room the area of interest if everything and when in the virtual world spaces your area of interest could be less than the whole space.
  • I would say it's even more likely that a player will first join a lobby, select a room and then join that. It's just for the demonstration that we join a room first, then go into a lobby. Otherwise, there would be nothing to list in most cases.

    As far as I know, we did not try to merge both applications and use them as one. In your case, it should be possible to either join a world OR join a room. The LiteLobby rooms are already a "single area of interest", so you could use them for your smaller spaces.
    It should be easier then to merge the relative small set of operations into the MMO demo.
  • if you want to use the mmo stuff you could create a world with a single region for every chat room.
    Because of the single region every player will always see everyone else.
    you can then send chat messages through the avatar event channel, and yes you can use raise generic event.
    to send invitations to players that are in another world you need a central dictionary where all peers register.
    the radar you were looking at is such a dictionary, it just looks more complicated because we used fibers for to avoid concurrency issues instead of a simple lock. Using this dictionary you can access the remote player's peer, and then send events directly to him.
  • Yeah, think I am going to switch back to MmoDemo base code.

    Seems like I just need to add a WorldHandler, kind of like a LobbyHandler. In the WorldHadler deal with world wide stuff, list of available regions, list of all players connected, invites and chat across regions (games).
  • I have different levels for players to play.First player come and select the level then he join or create the room but I want that only those players who have selected the same levels can join the room.How can I do that?

  • hi, @zunaira

    what is the level?



  • @chvetsov Its actually the Environment where player plays.I have all the envirment in one scene and I want the envirment that is selected by master client also loads on other sides.

  • hi, @zunaira

    well, it looks like Games is what you are looking for

    Id of scene to load can be put in game properties. and once players join that get room properties and can load scene



  • Thanks @chvetsov .

    Sorry, But i Have another problem my rooms list is not visible to other players. I am using OnRoomListUpdate like this but i don't know why i can,t see the room list for other players.

     public override void OnRoomListUpdate(List<RoomInfo> roomList) {

        foreach(RoomInfo info in roomList) {

          if (info.RemovedFromList) {

            int index = _listing.FindIndex(x => x.RoomInfo.Name == info.Name);

              if (index != -1) {




          } else {

            RoomListing listing = Instantiate(_roomListing, _content);

            if (listing != null) {








  • Hi, @zunaira

    1. Please create new topic for your questions
    2. this question is about PUN, please ask in corresponding forum section



  • I created new one. Thanks @chvetsov.