Fandom

Glest

XML/Tileset

< XML

275pages on
this wiki
Add New Page
Talk0 Share
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.

XMLEdit

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" anim-speed="150" smoothTwoFrameAnim="false" rotationAllowed="true" randomPositionEnabled="true">
				<!-- 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>

DocumentationEdit

surfacesEdit

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

surfaceEdit

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.

textureEdit

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.

objectsEdit

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.

objectEdit

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

modelEdit

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 sin curve for the animation speed. This is good for animated trees (example: see tileset birch forest).

[ MegaGlest >= 3.8.0-beta1 (+r4514) ] rotationAllowed is a MegaGlest only switch which 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.

[ MegaGlest >=3.8.0-dev+r4598 ] randomPositionEnabled is a MegaGlest only switch which 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.


particlesEdit

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.

rotationAllowedEdit

deprecated since 3.8.0, use the attribute rotationAllowed of the model instead.

day-soundEdit

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-soundEdit

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-soundEdit

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-soundEdit

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-soundEdit

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-soundEdit

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.

waterEdit

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

texture (water)Edit

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.

fogEdit

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-lightEdit

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-lightEdit

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-nightEdit

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.

weatherEdit

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

See AlsoEdit

Ad blocker interference detected!


Wikia is a free-to-use site that makes money from advertising. We have a modified experience for viewers using ad blockers

Wikia is not accessible if you’ve made further modifications. Remove the custom ad blocker rule(s) and the page will load as expected.