XML/Tileset

From MegaGlest
Revision as of 20:56, 12 April 2011 by Hofmic (talk)
Jump to: navigation, search
This Article is Undergoing a Major Edit!

To prevent edit conflicts, please do not edit this article until the editor has removed this tag. If you wish to know who is editing and when the editing began, please see the page history.

Tilesets are structures which define how to render a map. Its XML explains which surface textures to use, which object models, day/night lighting, fog, weather, and water.

Complete XML

<?xml version="1.0"?>

<tileset>

 <surfaces>
   <surface>
     <texture path="textures/surface.bmp" prob="1.0" />
   </surface>
 </surfaces>
 <objects>
   <object walkable="false">
     <model path="models/tree.g3d" />
   </object>
 </objects>
 <ambient-sounds>
   <day-sound enabled="true" path="sounds/day.ogg" play-always="false" />
   <night-sound enabled="true" path="sounds/night.ogg" play-always="false" />
   <rain-sound enabled="true" path="sounds/rain.ogg" />
   <snow-sound enabled="true" path="sounds/rain.ogg" />
   <day-start-sound enabled="true" path="sounds/chicken.wav" />
   <night-start-sound enabled="true" path="sounds/wolf.wav" />
 </ambient-sounds>
 <parameters>
   <water effects="true">
     <texture path="textures/water.tga" />
   </water>
   <fog enabled="true" mode="2" density="0.010" color-red="0.3" color-green="0.3" color-blue="0.3" />
   <sun-light red="1" green="1" blue="1" />
   <moon-light red="0.3" green="0.3" blue="0.4" />
   <day-night value="0.7" />
   <weather sun="0.5" rain="0.4" snow="0.1" />
 </parameters>

</tileset>

Documentation

surfaces

Surfaces are the textures used for the ground. There must be at least 5 surface elements in each tileset, one for each surface type. A 6th surface can be defined for cliffs as well (MegaGlest only, but backwards compatible).

surface

Inside the surfaces element is the individual surface elements. These elements each define the surface for different types, and order is important. The first element will be surface 1 (generally grass), the second will be surface 2 (grass 2), and so on... Standard tilesets only need 5 surface tags, but a 6th optional one may be defined for custom cliff textures in MegaGlest.

texture

The texture tag is inside the surface tags, and there can be multiple texture tags. These are numerous images that will make up the surface of that cell. When multiple textures are listed, Glest will choose one based on its prob attribute, which is the percentage probability (in decimal form, 0 - 1) of that texture being used. The path attribute is the relative path to the texture. The prob attributes must all add up to 1.

See Also