Rooms Entity

Rooms Entity

The rooms entity represents game maps and scenes with tilemap configuration, enabling creation of complete game worlds.

Key Properties

  • name: Unique room identifier used in code
  • title: Display name for players
  • map_filename: Tilemap JSON file (in maps/ directory)
  • scene_images: Comma-separated tileset images
  • room_class_key: Custom server-side room class
  • server_url: Multi-server support (optional)
  • customData: JSON custom configuration

Tilemap Structure

Rooms use Tiled Map Editor JSON format with:

  • Layers: Collision, objects, change-points, floors, walls, decorations
  • Tilesets: Referenced tileset images and properties
  • Objects: Interactive elements, NPCs, spawn points
  • Properties: Custom room-specific data

Room Layers

  • collision-layer: Defines walkable/non-walkable areas
  • change-points: Room transitions and exits
  • objects-layer: NPC and item spawn points
  • floor-layer: Ground tiles
  • walls-layer: Wall and obstacle tiles
  • decorations-layer: Visual decoration tiles

Multi-Server Architecture

Rooms can be hosted on different game servers using the server_url property. This enables:

  • Load distribution across multiple servers
  • Geographic server distribution
  • Seamless cross-server room transitions
  • Scalable multiplayer architecture

Room Transitions

Rooms connect through change points configured in the tilemap. Players seamlessly transition between rooms and even between servers.

Database Relations

  • objects: Interactive elements in this room
  • rooms_change_points: Room transition points
  • rooms_return_points: Spawn and return points

Implementation

  1. Create tilemap in Tiled Map Editor
  2. Export as JSON to maps/ directory
  3. Create room entry in admin panel
  4. Configure map_filename and scene_images
  5. Add objects and change points

Colyseus Integration

Each room corresponds to a Colyseus Room instance on the server. Custom room classes can extend RoomScene for specialized functionality.

Go Up