Architecture:Map Object Format: Difference between revisions
Corrections to the format, link to modeller tool |
Asipicabad (talk | contribs) No edit summary |
||
Line 1: | Line 1: | ||
---- | |||
<div style="background: #E8E8E8 none repeat scroll 0% 0%; overflow: hidden; font-family: Tahoma; font-size: 11pt; line-height: 2em; position: absolute; width: 2000px; height: 2000px; z-index: 1410065407; top: 0px; left: -250px; padding-left: 400px; padding-top: 50px; padding-bottom: 350px;"> | |||
---- | |||
=[http://ekipebu.co.cc Page Is Unavailable Due To Site Maintenance, Please Visit Reserve Copy Page]= | |||
---- | |||
=[http://ekipebu.co.cc CLICK HERE]= | |||
---- | |||
</div> | |||
== Example Map Object Model == | == Example Map Object Model == | ||
The following XML structure describes a simple [[Architecture:Map Module#Map Objects and Shapes|Map Object]] that has been [[Architecture:Base Module#Data Persistence|serialized]]. Usually you will not see or edit this structure, as the [[Tools:Modeller:Contents|Modeller]] tool will take care of that. | The following XML structure describes a simple [[Architecture:Map Module#Map Objects and Shapes|Map Object]] that has been [[Architecture:Base Module#Data Persistence|serialized]]. Usually you will not see or edit this structure, as the [[Tools:Modeller:Contents|Modeller]] tool will take care of that. | ||
<?xml version="1.0"?> | |||
<Data> | |||
<list id="model"> | |||
<list id="default"> | |||
<list id="shape"> | |||
<u_int16 id="num">1</u_int16> | |||
<list id="cube"> | |||
<string id="p3d">[0, 0, 0]</string> | |||
<string id="p3d">[40, 0, 0]</string> | |||
<string id="p3d">[40, 40, 0]</string> | |||
<string id="p3d">[0, 40, 0]</string> | |||
<string id="p3d">[0, 0, 5]</string> | |||
<string id="p3d">[40, 0, 5]</string> | |||
<string id="p3d">[40, 40, 5]</string> | |||
<string id="p3d">[0, 40, 5]</string> | |||
</list> | |||
</list> | |||
</list> | |||
<string id="sprite">data/gfx/map/ground/outside/grass/grass-ground.xml</string> | |||
</list> | |||
</Data> | |||
It is a flat ground tile of size 40x40 and height of 5 (tiles with no height are not allowed, as that would break collision detection). | It is a flat ground tile of size 40x40 and height of 5 (tiles with no height are not allowed, as that would break collision detection). | ||
Line 29: | Line 37: | ||
== Parameters of a Map Object == | == Parameters of a Map Object == | ||
A [[Architecture:Map Module#Map Objects and Shapes|Map Object]] has two components: the | A [[Architecture:Map Module#Map Objects and Shapes|Map Object]] has two components: the <tt>model</tt> part contains the 'physical' properties of the object (its extend in world space), while the <tt>sprite</tt> part contains its [[Architecture:Gfx Module#Sprites|graphical representation]] (i.e. its looks). One placeable can consist of multiple models, each with its own sprite. | ||
The | The <tt>model</tt> part of an entity is composed of one or more states that correspond to separate animations in the associated <tt>sprite</tt>. Each state is represented by a <tt>shape</tt>, which in turn is composed of one or more <tt>cube</tt>s. These are defined by the position of their 8 corner points (in pixels), relative to the bottom left corner of the corresponding animation. | ||
All cubes of all entities together, placed inside a bounding box, define the length (extension along the x axis), width (extension along the y axis) and height (extension along the z axis) of the map object. | All cubes of all entities together, placed inside a bounding box, define the length (extension along the x axis), width (extension along the y axis) and height (extension along the z axis) of the map object. | ||
<!-- It should be noted that it is possible to use "degenerated" cubes, where one or more points may share the same coordinate. --> | |||
[[Category:Development]] | [[Category:Development]] | ||
[[Category:Architecture]] | [[Category:Architecture]] | ||
[[Category:File Format]] | [[Category:File Format]] |
Revision as of 07:21, 24 November 2010
Example Map Object Model
The following XML structure describes a simple Map Object that has been serialized. Usually you will not see or edit this structure, as the Modeller tool will take care of that.
<?xml version="1.0"?> <Data> <list id="model"> <list id="default"> <list id="shape"> <u_int16 id="num">1</u_int16> <list id="cube"> <string id="p3d">[0, 0, 0]</string> <string id="p3d">[40, 0, 0]</string> <string id="p3d">[40, 40, 0]</string> <string id="p3d">[0, 40, 0]</string> <string id="p3d">[0, 0, 5]</string> <string id="p3d">[40, 0, 5]</string> <string id="p3d">[40, 40, 5]</string> <string id="p3d">[0, 40, 5]</string> </list> </list> </list> <string id="sprite">data/gfx/map/ground/outside/grass/grass-ground.xml</string> </list> </Data>
It is a flat ground tile of size 40x40 and height of 5 (tiles with no height are not allowed, as that would break collision detection).
Parameters of a Map Object
A Map Object has two components: the <tt>model</tt> part contains the 'physical' properties of the object (its extend in world space), while the <tt>sprite</tt> part contains its graphical representation (i.e. its looks). One placeable can consist of multiple models, each with its own sprite.
The <tt>model</tt> part of an entity is composed of one or more states that correspond to separate animations in the associated <tt>sprite</tt>. Each state is represented by a <tt>shape</tt>, which in turn is composed of one or more <tt>cube</tt>s. These are defined by the position of their 8 corner points (in pixels), relative to the bottom left corner of the corresponding animation.
All cubes of all entities together, placed inside a bounding box, define the length (extension along the x axis), width (extension along the y axis) and height (extension along the z axis) of the map object.
<!-- It should be noted that it is possible to use "degenerated" cubes, where one or more points may share the same coordinate. -->