MUD Hybrid Room System Architecture - wwestlake/Labyrinth GitHub Wiki
MUD Hybrid Room System Architecture
1. Overview
This document outlines the architecture of a hybrid room system for a MUD (Multi-User Dungeon). The system will utilize a grid-based approach for standard rooms, allowing movement in six directions: North, South, East, West, Up, and Down. Additionally, the system will support special teleportation doors and player-created Guild Rooms under specific conditions.
2. Room System Components
2.1 Grid-Based Room System
- Grid Coordinates: Each room will be assigned a unique
(x, y, z)
coordinate in a 3D grid. This will allow for simple and predictable room placement and navigation. - Standard Exits: Each room can have up to six standard exits: North, South, East, West, Up, and Down. These exits correspond to movement along the grid:
- North:
(x, y+1, z)
- South:
(x, y-1, z)
- East:
(x+1, y, z)
- West:
(x-1, y, z)
- Up:
(x, y, z+1)
- Down:
(x, y, z-1)
- North:
2.2 Special Teleportation Doors
- Teleportation Exits: Some rooms will contain special doors that, instead of following the grid, will teleport players to non-adjacent or even non-grid rooms.
- Teleportation Mechanism: Each teleportation exit will have a target room ID, allowing for flexible and creative room connections.
- Scripted Events: Teleportation may also be tied to specific events, such as solving puzzles or defeating enemies.
2.3 Room Types
- Admin-Created Rooms: The majority of the MUD’s rooms will be created and managed by administrators. These rooms include all key areas, such as starting zones, towns, dungeons, and special event areas.
- Player-Created Guild Rooms: Players can create rooms under certain conditions:
- Guild Creation: Players may form a guild by meeting the required number of members (configurable, e.g., 5 members).
- Guild Room Creation: Once a guild is formed, the guild leader may create a Guild Room. This room will be linked to the main grid but will have the following features:
- Customization: Guild members can customize the room’s description, furniture, and other elements within predefined limits.
- Access Control: Only guild members or invited players can enter the Guild Room.
- Expansion: Guild Rooms can be expanded as the guild grows, with additional rooms linked to the main Guild Room.
2.4 Room Attributes
Each room will have the following attributes:
- Room ID: A unique identifier for the room.
- Coordinates: The
(x, y, z)
location on the grid. - Description: A text description of the room, visible to players.
- Exits: A list of standard exits (North, South, East, West, Up, Down).
- Special Exits: A list of teleportation exits, if any.
- Owner: The owner of the room (Admin, Guild, etc.).
- Permissions: Controls who can enter, modify, or interact with the room.
- Items/Objects: List of items or objects present in the room.
- Scripts/Triggers: Any scripts or triggers associated with the room, such as environmental effects or NPC behaviors.
3. Room Creation and Management
3.1 Admin Room Creation
- Tools: Admins will use a dedicated room editor tool to create and link rooms. This tool will allow setting all attributes, exits, and special features.
- Batch Creation: Admins can create multiple rooms in batches to streamline world-building, especially for large areas like dungeons or towns.
3.2 Player Guild Room Creation
- Guild Formation: A guild must meet the minimum member requirement to qualify for a Guild Room.
- /guildroom Command: The guild leader can use a command such as
/guildroom create
to initiate the creation of a Guild Room.- Customization Menu: Once created, the guild leader will have access to a customization menu to set the room's description, objects, and initial layout.
- Room Expansion: As the guild grows, additional commands like
/guildroom add [direction]
can be used to create adjacent rooms.
3.3 Room Linking and Navigation
- Room Linking: Standard rooms will be linked via their grid-based coordinates. Special rooms or non-grid locations will use teleportation exits.
- Pathfinding: The system will support pathfinding algorithms to help players navigate complex areas, especially those involving teleportation or non-standard exits.
4. Security and Access Control
- Room Permissions: Each room will have a set of permissions defining who can enter, modify, or interact with the room. Admins will have full control, while guild leaders manage permissions for their Guild Rooms.
- Locking Mechanisms: Certain rooms can be locked, requiring keys or solving puzzles to enter. This feature adds an additional layer of security and gameplay depth.
5. Expansion and Flexibility
- Future-Proofing: The architecture is designed to be flexible, allowing for future expansion of both the grid system and teleportation mechanics.
- Scriptable Events: Admins can easily add scripted events, such as secret doors or dynamic room changes, to enhance gameplay.
- Room Merging: In special cases, rooms can be merged or divided to form larger or more complex environments.
6. Conclusion
The hybrid room system outlined here provides a robust and flexible architecture for the MUD, balancing the simplicity of a grid-based system with the creative possibilities of teleportation and player-driven content. By allowing both admin-controlled and player-created rooms, the system supports a dynamic and engaging game world that can evolve over time.