Devlog #4 - Room Options
While developing the lobby system, I introduced customisation options for players when creating a room. Players can now choose whether their room is public or private. Private rooms are intended for groups of friends - players can join these rooms by manually entering the room name.
After setting up the room configuration options, I implemented a "ready up" system. Once all players have indicated they are ready, the host gains the ability to start the game.
Room Options
For the lobby system, I wanted players to have the ability to customise their room settings when creating a game. To achieve this, I used Photon PUN and worked with the RoomOptions class to define how each room behaves based on the player's preferences.
Players can customise two main settings when creating a room:

- Privacy Settings (Private / Public)
I added a toggle that lets players choose whether the room is public or private. Public rooms are visible to everyone in the lobby and can be joined freely. Private rooms, on the other hand, are hidden from the public lobby listing. To join a private room, players must manually enter the room name in the "Enter Code" text field. This allows friends to play together without random players joining.
- Maximum Players:
I also implemented a control system where players can adjust the maximum number of players allowed in their room. I used arrow buttons to let players increment or decrement the player limit within a defined range (2-4). This value is then passed into RoomOptions.MaxPlayers when creating the room, ensuring that the room enforces the desired player cap.
Both settings are applied dynamically when the player clicks "Create". The information is bundled into a RoomOptions object and passed to Photon's room settings to create a room that reflects the player's chosen settings.
CreateRoomMenu.cs

OnCreateRoom() gets called when the create button has been clicked:
- Toggle for Private / Public
- privateToggle.isOn determines if the room should be visible to others. If the toggle is on (private), IsVisible is set to false, hiding the room from the public list.
- Max Players
- Players can click arrows to increase or decrease the maxPlayers value within a range between 2 and 4.
- This value is assigned to RoomOptions.MaxPlayers when the room is created.
- Create Room
- When players click on the Create button, a room is made with the selected privacy setting and maximum player limit using PhotonNetwork.CreateRoom().
Ready Up System
To make the lobby experience more organised, I developed a ready-up system that allows players to indicate when they are ready to start the game.
PlayerItem.cs
Each player can toggle their ready state and this information is stored using Photon's custom properties. When a player clicks the "Ready" button, I update their custom properties with a simple Hashtable, like so:

Checks when the player clicks on the "Ready" button.
- READY is a key that I use to track whether the player is ready (true) or not (false).
- isReady is a local boolean that changes when the player presses the ready button.
By using Photon's SetCustomProperties, the ready state is automatically synchronised across the network, allowing clients (including the Master Client) to see the up-to-date status of every player.
Start Game Flow
Once all players in the room have marked themselves as ready, the Master Client (host of the room) is given access to a Start Game button. This button only becomes visible when the system detects that every player's READY property is set to true.
Checks if the all players are ready and to display the start button to the Master Client.
When the Master Client clicks the Start Game button:
- The game triggers a scene change for all players.
- Everyone is then loaded into the Game Scene simultaneously, ensuring a smooth transition from the lobby.

Shows the players selecting the ready button and the Master Client being presented with the "Start" button.
Why This Approach?
Using custom properties for the ready system makes it efficient and reliable:
- Automatic Updates: Photon PUN automatically notifies all clients when a player's properties change, so no need for manual refreshes.
- Master Control: Keeping the "Start" button limited to the Master Client ensures a clean, authoritative start to the match.
Milestones Met
The implementation of the Create Room settings successfully met the expected outcomes and objectives set for this stage of development.
Room Creation Settings
- Players can now create rooms with custom settings, including naming the room, choosing whether it is private or public and setting the maximum number of players. This provides the customisation options originally targeted.
Private Room System
- By setting a room to private, it is hidden from the public room list and friends can join directly via the room name. This caters to users who want to play exclusively with friends.
Ready Up System
- Once in a room, the ready-up system properly tracks each player's status and controls the game start flow through the Master Client.
Conclusions and Next Steps...
During this week, I learned how Photon PUN handles room updates and player properties (e.g. custom properties for ready states). This provided a much deeper understanding of how to synchronise data effectively across players.
Moving forward, I plan to integrate PlayFab into the project to handle user authentication. This will allow players to register and log in with their own accounts, adding a layer of personalisation to the game.
By linking PlayFab accounts, I'll be able to:
- Save player data such as usernames, email and customisation settings.
- Support secure login and account management features.
- Potentially introduce features like leaderboards in the future.
References
Photonengine. Setup and Connect (Version PUN 2). Available at: https://doc.photonengine.com/pun/current/getting-started/initial-setup (Accessed: 10th February 2025).
Photonengine. Introduction (Version PUN 2). Available at: https://doc.photonengine.com/pun/current/getting-started/pun-intro(Accessed: 10th February 2025).
Dice & Domination
A high-stakes multiplayer strategy game with domination and combat
Status | In development |
Author | Shivani |
Genre | Strategy |
More posts
- Devlog #7 - Leaderboards6 hours ago
- Devlog #6 - Character Customisation5 days ago
- Devlog #5 - User Authentication with PlayFab25 days ago
- Devlog #3 - Lobby System50 days ago
- Devlog #2 - Multiplayer with Photon64 days ago
- Devlog #1 - Programming Architecture81 days ago
Leave a comment
Log in with itch.io to leave a comment.