Difference between revisions of "Talk:Standards:MMP"

From Mudlet
Jump to navigation Jump to search
m
m
 
(2 intermediate revisions by 2 users not shown)
Line 262: Line 262:
 
: [[File:MMP-Draft-1.png]]
 
: [[File:MMP-Draft-1.png]]
 
: --[[User:Keneanung|keneanung]] ([[User talk:Keneanung|talk]]) 14:32, 10 August 2017 (UTC)
 
: --[[User:Keneanung|keneanung]] ([[User talk:Keneanung|talk]]) 14:32, 10 August 2017 (UTC)
 +
 +
::Not sure if the "hidden" attribute is applicable to the "exit" that has it or the "room" that it goes to as you have put here.  Also I have only seen door="1" for exits - though I coded as if "0", "2" or "3" were possible and mapped hidden="1" to be the same as door="3"...  I wasn't aware of the ability to have only a portion of a map (one or more complete "areas") and Mudlet would not behave nicely with such a thing with the current XML importer (it throws away the existing map when it reads a new XML file).  IIRC Exits to rooms that are not present in the particular XML file loaded will get converted to stubs - this will be recorded both in the ''errors.txt'' log file and in a specifically crafted Room ''User Data'' entry for the starting room for the exit route. [[User:Slysven|slysven]] ([[User talk:Slysven|talk]])
 +
 +
:::You're right, the "hidden" flag should hide the exit instead of the room, my fault. I will also amend the comment the door comment to be more open and we should probably have an "implementation status/notice" page where we list which standards are implemented and where/how we derive from them. We could note the additional exit values there. The same with the single area maps: we should note this on an implementation status page.
 +
:::--[[User:Keneanung|keneanung]] ([[User talk:Keneanung|talk]]) 07:40, 15 August 2017 (UTC)

Latest revision as of 12:04, 15 August 2017

Currently the biggest item missing from the IRE samples (and the Mudlet interpreter) is handling of Special Exits.

I have added support for our door types (IRE MUDs do use a `door="1"` as an exit attribute and also a `hidden="1"`) so that door type "1" corresponds to our "open door" marking, "2" to "closed door" and "3" (and `hidden="1"`) to our "locked door".

Not documented here is that all of the official five (now four) IRE Mud XML files now include an "HTLMColor" attribute as well as a "Color" number attribute. Last time I checked four (now three) of them all had the same color number to HTMLcolor "names" (actually a 6 hex digit/24 bit "rrggbb" code that Qt can comprehend as a QColor::name if it is prefix with a '#' IIRC) but one use different shades of similar colours for a richer colour experience - e.g. swimmable water might be a different shade of blue to deep water as their HTMLColor attribute - but still had the same basic (16 colour) "Color" attribute for those different "environments". As for environments we do not currently capture the "Description" data and we map the colour "Color" codes to our "ColorID"s with a generated lookup table that is totally inaccessible and unmodifiable (but stored in the Mudlet binary map file format so it persists) by the end user!!!

slysven (talk) 04:32, 3 August 2017 (UTC)

There are some more features in the MMP files that are used by IRE right now. I have an XSD file ready that validates against the current files, but I'd like to add some more comments to it first before publishing it
keneanung (talk) 15:35, 7 August 2017 (UTC)
This is the XSD file that I came up with, what do you think?:
 <?xml version="1.0" encoding="UTF-8"?>
 <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified" attributeFormDefault="unqualified">
   <xs:element name="map">
       <xs:annotation>
           <xs:documentation>Root element for map data. This may be a complete map or a single area. If only a single area is presented by this map, the "name", "x" and "y" attributes of the map are required and the "areas" child must not be given.</xs:documentation>
       </xs:annotation>
       <xs:complexType>
           <xs:all>
               <xs:element name="areas" minOccurs="0">
                   <xs:annotation>
                       <xs:documentation>List of areas in this map. Only allowed, if no "name", "x" and "y" attributes of the root "map" tag are given.</xs:documentation>
                   </xs:annotation>
                   <xs:complexType>
                       <xs:sequence>
                           <xs:element name="area" type="area" maxOccurs="unbounded"/>
                       </xs:sequence>
                   </xs:complexType>
               </xs:element>
               <xs:element name="rooms">
                   <xs:annotation>
                       <xs:documentation>List of rooms in this map. If the map represents a single area, all rooms implicitly belong to that area.</xs:documentation>
                   </xs:annotation>
                   <xs:complexType>
                       <xs:sequence>
                           <xs:element name="room" type="room" maxOccurs="unbounded"/>
                       </xs:sequence>
                   </xs:complexType>
               </xs:element>
               <xs:element name="environments">
                   <xs:annotation>
                       <xs:documentation>List of environments in this map.</xs:documentation>
                   </xs:annotation>
                   <xs:complexType>
                       <xs:sequence>
                           <xs:element name="environment" type="environment" maxOccurs="unbounded"/>
                       </xs:sequence>
                   </xs:complexType>
               </xs:element>
           </xs:all>
           <xs:attribute name="name" type="xs:string" use="optional">
               <xs:annotation>
                   <xs:documentation>Name of the area represented by this file. Only allowed if no "areas" child of the "map" tag is given.</xs:documentation>
               </xs:annotation>
           </xs:attribute>
           <xs:attribute name="x" type="xs:int" use="optional">
               <xs:annotation>
                   <xs:documentation>x coordinate of the area represented by this file. Only allowed if no "areas" child of the "map" tag is given.</xs:documentation>
               </xs:annotation>
           </xs:attribute>
           <xs:attribute name="y" type="xs:int" use="optional">
               <xs:annotation>
                   <xs:documentation>y coordinate of the area represented by this file. Only allowed if no "areas" child of the "map" tag is given.</xs:documentation>
               </xs:annotation>
           </xs:attribute>
       </xs:complexType>
   </xs:element>
   <xs:complexType name="area">
       <xs:annotation>
           <xs:documentation>An area on the map.</xs:documentation>
       </xs:annotation>
       <xs:attribute name="id" use="required">
           <xs:annotation>
               <xs:documentation>The area ID. Needed to assign rooms to this area.</xs:documentation>
           </xs:annotation>
           <xs:simpleType>
               <xs:restriction base="xs:int">
                   <xs:minInclusive value="0"/>
               </xs:restriction>
           </xs:simpleType>
       </xs:attribute>
       <xs:attribute name="name" type="xs:string" use="required">
           <xs:annotation>
               <xs:documentation>Human readable name of the area that can be displayed to the player.</xs:documentation>
           </xs:annotation>
       </xs:attribute>
       <xs:attribute name="x" type="xs:int" use="optional">
           <xs:annotation>
               <xs:documentation>x coordinate of the area.</xs:documentation>
           </xs:annotation>
       </xs:attribute>
       <xs:attribute name="y" type="xs:int" use="optional">
           <xs:annotation>
               <xs:documentation>y coordinate of the area.</xs:documentation>
           </xs:annotation>
       </xs:attribute>
   </xs:complexType>
   <xs:complexType name="room">
       <xs:annotation>
           <xs:documentation>Data for a single room on the map.</xs:documentation>
       </xs:annotation>
       <xs:sequence>
           <xs:element name="coord" type="coord"/>
           <xs:sequence>
               <xs:element name="exit" type="exit" minOccurs="0" maxOccurs="unbounded"/>
           </xs:sequence>
       </xs:sequence>
       <xs:attribute name="id" use="required">
           <xs:annotation>
               <xs:documentation>ID of the room. Needed to link rooms via exits.</xs:documentation>
           </xs:annotation>
           <xs:simpleType>
               <xs:restriction base="xs:int">
                   <xs:minInclusive value="0"/>
               </xs:restriction>
           </xs:simpleType>
       </xs:attribute>
       <xs:attribute name="area" type="xs:positiveInteger" use="required">
           <xs:annotation>
               <xs:documentation>ID of the area the room belongs to.</xs:documentation>
           </xs:annotation>
       </xs:attribute>
       <xs:attribute name="title" type="xs:string" use="required">
           <xs:annotation>
               <xs:documentation>Title (or name) of the room.</xs:documentation>
           </xs:annotation>
       </xs:attribute>
       <xs:attribute name="environment" use="required">
           <xs:annotation>
               <xs:documentation>ID of the environment of the room.</xs:documentation>
           </xs:annotation>
           <xs:simpleType>
               <xs:restriction base="xs:int">
                   <xs:minInclusive value="0"/>
               </xs:restriction>
           </xs:simpleType>
       </xs:attribute>
       <xs:attribute name="important" type="xs:boolean" use="optional" default="0">
           <xs:annotation>
               <xs:documentation>Bolean value whether to mark the room as important. How that mark occurs is implementation dependent.</xs:documentation>
           </xs:annotation>
       </xs:attribute>
       <xs:attribute name="color" type="xs:string" use="optional">
           <xs:annotation>
               <xs:documentation>ANSI color ID, overwriting the environment color.</xs:documentation>
           </xs:annotation>
       </xs:attribute>
       <xs:attribute name="marker" type="xs:string" use="optional">
           <xs:annotation>
               <xs:documentation>String that can be displayed to the player, optionally pointing into a direction.</xs:documentation>
           </xs:annotation>
       </xs:attribute>
       <xs:attribute name="markerdir" type="xs:string" use="optional">
           <xs:annotation>
               <xs:documentation>Optional direction the marker points into.</xs:documentation>
           </xs:annotation>
       </xs:attribute>
   </xs:complexType>
   <xs:complexType name="coord">
       <xs:annotation>
           <xs:documentation>Room coordinates in an area.</xs:documentation>
       </xs:annotation>
       <xs:attribute name="x" type="xs:int" use="required">
           <xs:annotation>
               <xs:documentation>x coordinate of the room in the ara.</xs:documentation>
           </xs:annotation>
       </xs:attribute>
       <xs:attribute name="y" type="xs:int" use="required">
           <xs:annotation>
               <xs:documentation>y coordinate of the room in the ara.</xs:documentation>
           </xs:annotation>
       </xs:attribute>
       <xs:attribute name="z" type="xs:int" use="required">
           <xs:annotation>
               <xs:documentation>z coordinate of the room in the ara.</xs:documentation>
           </xs:annotation>
       </xs:attribute>
       <xs:attribute name="building" use="optional">
           <xs:annotation>
               <xs:documentation>Found in some IRE map files. Meaning unclear.</xs:documentation>
           </xs:annotation>
           <xs:simpleType>
               <xs:restriction base="xs:int">
                   <xs:minInclusive value="0"/>
               </xs:restriction>
           </xs:simpleType>
       </xs:attribute>
   </xs:complexType>
   <xs:complexType name="exit">
       <xs:annotation>
           <xs:documentation>An exit of a room, links two of them together.</xs:documentation>
       </xs:annotation>
       <xs:attribute name="direction" type="xs:string" use="required">
           <xs:annotation>
               <xs:documentation>Direction to be used to move along the exit.</xs:documentation>
           </xs:annotation>
       </xs:attribute>
       <xs:attribute name="target" type="xs:positiveInteger" use="required">
           <xs:annotation>
               <xs:documentation>The ID of the target room.</xs:documentation>
           </xs:annotation>
       </xs:attribute>
       <xs:attribute name="tgarea" type="xs:positiveInteger" use="optional">
           <xs:annotation>
               <xs:documentation>If the target room lies within another area, you may give the area of the target room here. This may be used for implementation specific optimizations.</xs:documentation>
           </xs:annotation>
       </xs:attribute>
       <xs:attribute name="hidden" type="xs:boolean" use="optional" default="0">
           <xs:annotation>
               <xs:documentation>Boolean to mark the room as "hidden".</xs:documentation>
           </xs:annotation>
       </xs:attribute>
       <xs:attribute name="door" use="optional">
           <xs:annotation>
               <xs:documentation>The exit is obstructed by a "door". The values correspond to: 0) No door (default); 1) Door, open; 2) Door, closed; 3) Door, locked</xs:documentation>
           </xs:annotation>
           <xs:simpleType>
               <xs:restriction base="xs:int">
                   <xs:minInclusive value="0"/>
               </xs:restriction>
           </xs:simpleType>
       </xs:attribute>
   </xs:complexType>
   <xs:complexType name="environment">
       <xs:annotation>
           <xs:documentation>Represents an "environment" type for rooms. Environments may have special properties to them, but their interpretation is implementation specific.</xs:documentation>
       </xs:annotation>
       <xs:attribute name="id" use="required">
           <xs:annotation>
               <xs:documentation>ID of the environment. Rooms link to environments via this ID.</xs:documentation>
           </xs:annotation>
           <xs:simpleType>
               <xs:restriction base="xs:int">
                   <xs:minInclusive value="0"/>
               </xs:restriction>
           </xs:simpleType>
       </xs:attribute>
       <xs:attribute name="name" type="xs:string" use="required">
           <xs:annotation>
               <xs:documentation>Human readable name of the environment type. Can be presented to the user.</xs:documentation>
           </xs:annotation>
       </xs:attribute>
       <xs:attribute name="color" type="xs:positiveInteger">
           <xs:annotation>
               <xs:documentation>ANSI color ID of the environment. Usage is implementation specific.</xs:documentation>
           </xs:annotation>
       </xs:attribute>
       <xs:attribute name="htmlcolor">
           <xs:annotation>
               <xs:documentation>HTML color code of the environment in the form of #RRGGBB. Allows to override the "color" attribute if supported to have a more diverse environment colorization.</xs:documentation>
           </xs:annotation>
           <xs:simpleType>
               <xs:restriction base="xs:string">
                   <xs:pattern value="#[0-9A-F]{6}"/>
               </xs:restriction>
           </xs:simpleType>
       </xs:attribute>
   </xs:complexType>
 </xs:schema>
A pictorial representation would be this:
MMP-Draft-1.png
--keneanung (talk) 14:32, 10 August 2017 (UTC)
Not sure if the "hidden" attribute is applicable to the "exit" that has it or the "room" that it goes to as you have put here. Also I have only seen door="1" for exits - though I coded as if "0", "2" or "3" were possible and mapped hidden="1" to be the same as door="3"... I wasn't aware of the ability to have only a portion of a map (one or more complete "areas") and Mudlet would not behave nicely with such a thing with the current XML importer (it throws away the existing map when it reads a new XML file). IIRC Exits to rooms that are not present in the particular XML file loaded will get converted to stubs - this will be recorded both in the errors.txt log file and in a specifically crafted Room User Data entry for the starting room for the exit route. slysven (talk)
You're right, the "hidden" flag should hide the exit instead of the room, my fault. I will also amend the comment the door comment to be more open and we should probably have an "implementation status/notice" page where we list which standards are implemented and where/how we derive from them. We could note the additional exit values there. The same with the single area maps: we should note this on an implementation status page.
--keneanung (talk) 07:40, 15 August 2017 (UTC)