Difference between revisions of "Standards:MUD Client Media Protocol"
m (→Client.Media) |
|||
Line 41: | Line 41: | ||
* Guidance: For games that automatically download media files, perform a Client.Media GMCP event once upon player login. | * Guidance: For games that automatically download media files, perform a Client.Media GMCP event once upon player login. | ||
* Body: <syntaxhighlight lang="json">Client.Media {"url": "hxxps://www.example.com/media/"}</syntaxhighlight> | * Body: <syntaxhighlight lang="json">Client.Media {"url": "hxxps://www.example.com/media/"}</syntaxhighlight> | ||
− | + | ||
+ | Usage: | ||
{| class="wikitable" | {| class="wikitable" | ||
! Required | ! Required |
Revision as of 00:46, 2 December 2019
MUD Client Media Protocol (MCMP)
A Standard for Loading, Playing and Stopping Media Files with MUD Clients over GMCP
Status of this Memo
This memo describes the addition of a standardized namespace of the Generic Mud Communication Protocol (GMCP) telnet sub-negotiation protocol (201) that provides syntax and usage guidance for sending JSON formatted messages from game servers to text-based game clients to load, play and stop media files.
Overview and Rationale
With renewed interest in the MUD genre of gaming, expectations are high to provide sight and sound content that competes for audience with other gaming platforms. The purpose of the MUD Client Media Protocol (MCMP) is to establish a method of delivering media, such as game sounds, background music and video snippets, to text-based game clients via their widely accepted messaging platform, GMCP, which uses JSON as its data-interchange format. The intended return for introducing this protocol is to improve the MUD gaming experience and accessibility through standardized messaging between game servers and game clients. MUD Client Media Protocol (MCMP) is inspired by its predecessor Mud Sound Protocol (MSP).
Overview of the GMCP (201) Sub-negotiation Protocol
To recap, the GMCP protocol is a bidirectional telnet sub-negotiation protocol (See RFC 854) which fulfills the following conditions:
- GMCP is separated into several ‘namespaces’, which may be enabled or disabled by the client at any time. The ‘Core’ namespace is always enabled and may not be disabled. Namespaces should consist of case-insensitive alphabetical characters and stop characters (. - ASCII 46/0x2E), representable as [A-Za-z.].
- GMCP messages consist of the namespace and a command (case insensitive alpha characters) delineated by a stop character, and optionally a space character and JSON-encoded payload.
- GMCP messages may be sent by both the client or server at any time with no warning.
Update to namespace: Client.* for Client.Media
We are proposing an addition to the Client.* meta-namespace for Client.Media. This serves the purpose of reserving this namespace for handling game client media operations and supporting future expansion and integration.
Specification for Client.Media
The Client.Media family of GMCP packages provide a way for games to send sound, music and video events. GMCP media events are sent in one direction: from game server to to game client. Media files may be downloaded manually by the user and/or automatically via the game client. Game clients should advertise to servers that Client.Media is supported with a Core.Supports message from game client to server.
Core.Supports.Set ["Client.Media 1", ...]
Note: Presenting game sound and music media content is the current focus. Presenting video content was also successfully tested with this specification.
Commands - Server
Client.Media
- Package: Client.Media
- Purpose: Identify to the game client a default URL directory to load media files an external resource.
- Guidance: For games that automatically download media files, perform a Client.Media GMCP event once upon player login.
- Body:
Client.Media {"url": "hxxps://www.example.com/media/"}
Usage:
Required | Key | Value | Purpose |
---|---|---|---|
Yes | "url" | <url> |
|
Note: Some examples are shown here.
Client.Media.Load
- Package: Client.Media.Load
- Purpose: Load media files from an external source.
- Guidance: For games that automatically download media files and have the capability to cache with the game client.
- Body:
Client.Media.Load { "name": "sword1.wav", "url": "hxxps://www.example.com/media/", "tag": "combat" }
- Usage:
Required | Key | Value | Purpose |
---|---|---|---|
Yes | "name" | <file name> |
|
Maybe | "url" | <url> |
|
No | "tag" | <tag> |
|
Note: Some examples are shown here.
Client.Media.Play
- Package: Client.Media.Play
- Purpose: Play media files.
- Guidance: Game clients could choose whether to play only one media file at one time or multiple files at one time.
- Body:
Client.Media.Play { "name": "city.mp3", "url": "hxxps://www.example.com/media/", "type": "music", "tag": "environment", "volume": 25, "loops": 3, "priority": 60, "continue": true, "key": "area-background-music", }
- Usage:
Required | Key | Value | Default | Purpose |
---|---|---|---|---|
Yes | "name" | <file name> |
| |
Maybe | "url" | <url> |
| |
No | "type" | "sound", "music" or "video" | "sound" |
|
No | "tag" | <tag> |
| |
No | "volume" | 1 to 100 | 50 |
|
No | "loops" | -1, or >= 1 | 1 |
|
No | "priority" | 1 to 100 |
| |
No | "continue" | true or false | true |
|
No | "key" | <key> |
|
Note: Some examples are shown here.
Client.Media.Stop
- Package: Client.Media.Stop
- Purpose: Stop playing media files.
- Guidance: An empty body will stop all media.
- Body:
Client.Media.Stop { "name": "city.mp3", "type": "music", "tag": "environment", "priority": 60, "key": "area-background-music", }
- Usage:
Required | Key | Value | Purpose |
---|---|---|---|
No | "name" | <file name> |
|
No | "type" | "sound", "music" or "video" |
|
No | "tag" | <tag> |
|
No | "priority" | 1 to 100 |
|
No | "key" | <key> |
|
Note: Some examples are shown here.
Authors
- Mike Conley (Co-Administrator at StickMUD and Mudlet contributor) sousesider[at]gmail.com
- E--- O------- (Developer of ExVenture and Grapevine) e---[at]o-------.org
Notes
- Known clients implementing this specification:
- Mudlet version 4.4+. See documentation.