XML/Tileset

Back to XML Overview

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
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. Please note that objects are randomly rotated when placed on the map, so should be created with that in mind.

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.

anim-speed is a value which denotes the model is animated and should be played at the corresponding speed.

smoothTwoFrameAnim is a switch which smoothes 2 frame animations with a sin curve for the animation speed. This is good for animated trees (example: see tileset birch forest).

rotationAllowed defines whether nor not the object can be randomly rotated when placed on maps. 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.

randomPositionEnabled defines whether nor not the object can be randomly placed on maps. By default, all objects will be given a random position within the field. If false, the objects will be placed at the center of the field.

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.

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 effects are enabled, land-units will make splash effects when they walk through water.

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

air-height
Optional attribute to set a higher flying height for air units. This is needed when a tileset has very high trees or bigrocks for example. By this you can make the air units fly higher. If its smaller then the default (5) its ignored. Syntax is: 