Skip to main content

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:

  1. Creation: Room is created with specific parameters
  2. Auto-Matching: Players are automatically matched (if enabled)
  3. Connection: All players connect to the room
  4. Active Gameplay: Room is active for the game duration
  5. Completion: Room ends when players leave or the game concludes

Core Methods​

Standard Rooms provide these essential methods:

  • createstandardroom() - Create a new room
  • joinstandardroominvcode() - Join with invitation code
  • leavestandardroom() - Leave the current room
  • standardmessagetoall() - Send messages to all players
  • standardmessage() - Send messages to specific players
  • standardmessagetogameserver() - 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 created
  • onJoinedRoom - Successfully joined a room
  • onMessageReceived - Incoming message from another player
  • onPeerJoined - New player joined the room
  • onPeerLeft - Player left the room
  • onLeftRoom - 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.