Tech Note: Payload Types for Messaging System in MUD Game - wwestlake/Labyrinth GitHub Wiki
Tech Note: Payload Types for Messaging System in MUD Game
In designing the messaging system for our MUD game, it is crucial to define the different types of payloads that will be exchanged between players, NPCs, system actors, and admin actors. Each payload type has distinct characteristics and serves specific purposes within the game's communication architecture. Below is a categorized list of potential payload types and their common characteristics.
Payload Types
1. PlainLanguage
- Description: Natural language messages intended for direct communication between players and NPCs or between players themselves.
- Common Characteristics:
- Free-form text.
- May include contextual hints or prompts for the receiver to interpret.
- Not structured; requires NLP processing for any automated understanding or response.
2. Command
- Description: Specific instructions or commands issued by players, Admins, or other actors that require action.
- Common Characteristics:
- Structured text or JSON format.
- Contains command type (e.g., "Move", "Attack", "Build").
- May include parameters or arguments relevant to the command (e.g., coordinates for "Move", target ID for "Attack").
3. Information
- Description: Data packets containing relevant information or updates about the game state, NPC status, or player status.
- Common Characteristics:
- Typically JSON formatted.
- Includes data like health status, inventory lists, quest updates, etc.
- Read-only; does not usually prompt direct action.
4. Event
- Description: Notifications about specific events happening in the game world, such as item drops, level completions, or combat encounters.
- Common Characteristics:
- JSON formatted with event details (type, location, participants).
- Triggers automatic or manual responses from actors or players.
- Time-sensitive; may include a timestamp to indicate when the event occurred.
5. Notification
- Description: System messages meant to inform players or actors about system-wide announcements, maintenance, or game-wide changes.
- Common Characteristics:
- Simple text or JSON formatted.
- May include metadata about the type and urgency of the notification.
- Non-interactive; meant for information dissemination only.
6. AdminCommand
- Description: Commands specifically issued by game administrators or owners to control game mechanics, manage player behavior, or modify game settings.
- Common Characteristics:
- High-priority, JSON formatted.
- Contains security credentials or tokens for authorization.
- Often includes action type and target identifiers (e.g., "BanPlayer", "SpawnNPC").
7. Dialogue
- Description: Pre-defined conversation scripts between players and NPCs or among NPCs.
- Common Characteristics:
- Structured text or JSON formatted.
- Includes dialogue lines, speaker identifiers, and optional branching paths for different responses.
- Facilitates interactive storytelling or quest progression.
8. DataRequest
- Description: Requests for specific data or state information from the game server or another actor.
- Common Characteristics:
- JSON formatted with query parameters.
- May specify the type of data required (e.g., "PlayerStats", "WorldState").
- Used for both client-side updates and server-side logic.
9. DataResponse
- Description: Responses to DataRequest payloads containing the requested data.
- Common Characteristics:
- JSON formatted with the data payload.
- Includes a status code or message indicating success or failure.
- Read-only; provides data for client-side display or further processing.
10. Error
- Description: Messages indicating that an error has occurred, either in processing a command, executing an action, or retrieving data.
- Common Characteristics:
- JSON formatted with error code and message.
- May include additional debugging information or corrective actions.
- High priority; requires immediate attention for resolution.
11. GameplayMechanics
- Description: Messages related to the core gameplay mechanics such as physics updates, damage calculations, or environmental changes.
- Common Characteristics:
- JSON formatted with specific data points.
- Includes details necessary for game physics or logic (e.g., velocity, force, environmental variables).
- Typically processed by the game engine or a dedicated mechanics actor.
By defining these payload types, we can ensure that our messaging system is robust, efficient, and tailored to the needs of the game environment, allowing for clear communication and effective interaction among all entities in the game.