MG/Tileset XML

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.

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 (surface)
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.

objects
Objects are the models which will be used for objects placed on maps, such as trees, statues, or rocks. There must be exactly 10 object elements inside the objects tag, order-sensitive. The first object is a regular tree, the second is a dead tree, and so on. A complete list of objects can be found on the Tilesets page.

object
Inside the objects tag are exactly 10 object tags. These tags can store the paths to the object's models. The walkable attribute defines whether or not units can walk through the object (air units can always pass over all objects).

model
The model tag defines the path to the G3D file in the path attribute. There can be multiple model tags inside each object tag, and one will be randomly chosen each time.

particles
Particles can be set to any object. Unit particle XMLs will be used used for this, and any number of particle XMLs can be linked.

rotationAllowed
Defines whether nor not the object can be randomly rotated when placed on maps. This field is not mandatory and can be skipped complety. By default, all objects will be given a random rotation. If false, the objects will not be rotated and will be seen at the angle it appears in the G3D viewer.

day-sound
If the enabled attribute is true, a sound will be played if it is daytime. The path attribute is the relative path to the sound file. The play always attribute overrides the other sounds and plays the sound always.

night-sound
If the enabled attribute is true, a sound will be played if it is night time. The path attribute is the relative path to the sound file. The play always attribute overrides the other sounds and plays the sound always.

rain-sound
If the enabled attribute is true, a sound will be played when it is raining. The path attribute is the relative path to the sound file.

snow-sound
If the enabled attribute is true, a sound will be played when it is snowing. The path attribute is the relative path to the sound file.

day-start-sound
If the enabled attribute is true, a sound will be played once every time the day starts. The path attribute is the relative path to the sound file.

night-start-sound
If the enabled attribute is true, a sound will be played once every time the night starts. The path attribute is the relative path to the sound file.

water
If enabled, water will use your defined image sprites for the water texture. If false, water is rendered in an unrealistic plane.

texture (water)
A child tag of the water element, there are generally multiple texture tags which will be strung together to make a sprite, a series of 2D files played in a loop to create an animation. Again, this is order specific, and it is recommended to use at least four images.

fog
If fog is enabled, then it will be drawn with the tileset. The mode attribute is the OpenGL drawing method, generally "2", while density is the thickness of the fog (from 0-1). Each of the three colour attributes are used to create an RGB color. Each is a percentage of that color in decimal form (0-1).

sun-light
Sets the RGB color for daytime. Each of the three colour attributes are used to create an RGB color. Each is a percentage of that color in decimal form (0-1).

moon-light
Sets the RGB color for night time. Each of the three colour attributes are used to create an RGB color. Each is a percentage of that color in decimal form (0-1).

day-night
The value attribute is the day-night ratio: the length of the day compared to the length of the night, as a percentage in decimal form. For example, 0.5 would mean that the day is the same length as the night, 0.7 would mean that the day-night ratio would be 0.7:0.3 (if the day was 700 seconds long, the night would be 300), and so on.

weather
The weather element chooses the percentage chances of the 3 possible weather conditions: sun, rain, or snow, in decimal form (0-1).