The Glest Wiki
Advertisement
Engines_icons.png This article documents Glest, GAE, and MegaGlest

This is noted in the colored backgrounds, which denote lines as being engine specific. See the key below.[Editing help]

v  d  e


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.

XML

GAE Only
GAE and MegaGlest Only
<?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" <!-- Start MG Only -->anim-speed="150" smoothTwoFrameAnim="false"<!-- End MG Only -->>
				<!-- Start MG Only -->
				<particles value="true">
					<particle-file path="models/tree_particles.xml" />
				</particles>
				<rotationAllowed value="true" />
				<!-- End MG Only -->
			</model>
		</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/snow.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.

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 MegaGlest only value which denotes the model is animated and should be played at the corresponding speed.

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

particles

A MegaGlest only feature, 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

A MegaGlest only feature, 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.

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

See Also

Advertisement