Standard Rooms Overview
Standard Rooms provide a structured multiplayer experience for games with a fixed number of players. These rooms are ideal for turn-based games, competitive matches, or any game mode where the player count is predetermined and doesn't change during gameplay.
Key Features
- Fixed Player Count: Rooms maintain a consistent number of players throughout the game session
- Auto-Matching: Automatically match players based on skill level and availability
- Private Rooms: Create invitation-only rooms for friends or private matches
- Structured Gameplay: Perfect for games with defined start/end phases
- Reliable Communication: Built-in message reliability options for game-critical data
When to Use Standard Rooms
Standard Rooms are ideal for:
- Turn-based games (chess, checkers, card games)
- Competitive matches (1v1, 2v2, 4-player free-for-all)
- Tournament games with fixed brackets
- Co-op games requiring specific team sizes
- Games with defined phases (lobby → playing → results)
Room Lifecycle
Standard Rooms follow a predictable lifecycle:
- Creation: Room is created with specific parameters
- Auto-Matching: Players are automatically matched (if enabled)
- Connection: All players connect to the room
- Active Gameplay: Room is active for the game duration
- Completion: Room ends when players leave or the game concludes
Core Methods
Standard Rooms provide these essential methods:
createstandardroom()- Create a new roomjoinstandardroominvcode()- Join with invitation codeleavestandardroom()- Leave the current roomstandardmessagetoall()- Send messages to all playersstandardmessage()- Send messages to specific playersstandardmessagetogameserver()- Send messages to the game server
Room Configuration
When creating a Standard Room, you can configure:
- Player Limits: Minimum and maximum auto-match players
- Room Variants: Different game modes or rule sets
- Privacy Settings: Public (auto-match) or private (invitation-only)
- Custom Data: Game-specific configuration data
Message Types
Standard Rooms support different message types:
- Reliable Messages: Guaranteed delivery for critical game data
- Unreliable Messages: Fast delivery for real-time updates
- Broadcast Messages: Send to all players simultaneously
- Direct Messages: Send to specific players
- Server Messages: Communicate with the game server
Callbacks and Events
Monitor room activity with comprehensive callbacks:
onRoomCreated- Room successfully createdonJoinedRoom- Successfully joined a roomonMessageReceived- Incoming message from another playeronPeerJoined- New player joined the roomonPeerLeft- Player left the roomonLeftRoom- You left the room
Next Steps
tip
Standard Rooms are perfect for games where the player count should remain constant throughout the match. For games with dynamic player counts, consider Endless Rooms.