Fandom

Glest

XML/Unit particle

< 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

GAE and MegaGlest expand on Glest's particle system, allowing unit particles, which are particles emitted from the unit itself, rather than always on an attack. Particles have a lifecycle. They are born with energy-max and they die with when energy is zero. With every step their energy is lowered by one. A unit particle system currently can control 200 particles. If the particle system has a high emission rate and you would get more than 200 alive particles the ones with the lowest energy are recycled and used as new ones.

XMLEdit

GAE Only
GAE and MegaGlest Only
<!-- Start GAE+MG Only -->
<?xml version="1.0" standalone="yes"?>
<unit-particle-system>
	<texture value="true" path="images/particle.bmp" luminance="true" />
	<primitive value="quad" />
	<mode value="normal" />
	<offset x="0" y="-0.4" z="0.0" />
	<direction x="0" y="1" z="0" />
	<color red="1.0" green="0.0" blue="0.0" alpha="0.8" />
	<color-no-energy red="1.0" green="1.0" blue="0.3" alpha="0.6" />
	<size value="0.6" />
	<size-no-energy value="0.3" />
	<radius value="0.7" />
	<speed value="3.0" />
	<gravity value="0"/>
	<emission-rate value="10" />
	<energy-max value="30" />
	<energy-var value="0" />
	<fixed value="false" />
	<relativeDirection value="false" />
	<relative value="true" />
	<teamcolorEnergy value="false" />
	<teamcolorNoEnergy value="false" />
	<!-- End GAE+MG Only -->
	<!-- Start MG Only -->
	<static-particle-count value="4" />
        <alternations value="1" />
	<isVisibleAtNight value="false" />
	<isVisibleAtDay value="true" />
	<radiusBasedStartenergy value="false" />
	<isDaylightAffected value="false" />
	<particleSystemStartDelay value="0" />
	<!-- End MG Only -->
<!-- Start GAE+MG Only -->
</unit-particle-system>
<!-- End GAE+MG Only -->

DocumentationEdit

Luminance

Comparison of luminance on and off, using the texture at the top-right corner.

texturesEdit

Particles can use textures to shape how the particles should look. If luminance is turned on, the image file used as a texture will simply work to define the intensity of the colors. If luminance is turned off, the colors in the image file will be used in the particle.

primitiveEdit

Particles have two methods of creation: either quad (renders a set of four particles in a dot style) or line (creates solid lines). Quad is the most commonly used, as it creates the fuzzy style of particles that would be used for flames, explosions, smoke, etc, while lines are generally only used for projectiles such as an arrow. Note that you cannot have more than one particle effect linked to a projectile or splash (though you can for unit particle effects) yet, so it is not possible to mix particles (such as a line and flaming particles for a flaming arrow).

modeEdit

Particles have two modes of rendering, either normal which uses colors, or as black which allows the usage of black particles.

offsetEdit

The offset from the center of the unit to where the center of the particle system will be, in Glest units.

directionEdit

The direction for particles to move in, in Glest units. Y, for example, would be straight up, while X and Z would be the ground, as a grid.

color and colorNoEnergyEdit

If luminance is off, the colors of the texture will be used to color the particles. If luminance is on, the colors defined in the XML are used, though the intensity and shape will be defined by the texture. There are two colors values, the first which is the color at the start of the particle's life, and the second which defines the color when the particle is dead. Thus, the particles can transition in color.

size and sizeNoEnergyEdit

While the shape - and thus some degree of the size - is defined by the texture, the size is also affected by the size parameter passed into the XML, which will define the size in game units. Like the color, there are two size values that define the starting and ending sizes. As a result, the particles can seem to shrink or grow over their life.

radiusEdit

Whereas size affects the particle's individual size, radius affects the area filled with particles.

speedEdit

Speed the particles will travel at. Used in combination with direction to cover that much distance over the life of the particle.

gravityEdit

Glest has a simple gravity system which can also cause particles to sink downwards - or float upwards - over their life.

emission-rateEdit

The number of individual particles that are emitted per frame. In GAE, this is an integer (so numbers must be whole numbers) while in MegaGlest, it can be a float (decimals are allowed). If the number is a float, say, 0.1, that would mean it would be emitting one particle per ten frames.

energy-maxEdit

The starting energy of the particles.

energy-varEdit

A variance to add or subtract from energy-max to make particles more random.

fixedEdit

If true, the position of the particle system moves with the unit. If false, it could be left "behind" until it dies, such as with dust or smoke.

relativeDirectionEdit

If true, the direction changes with the unit too. Some things like smoke blowing in the wind would want this to be false, to ensure the particles always go in the same direction.

relativeEdit

If true, the position of the particles (but not the direction) will rotate with the unit. This prevents problems like smoke that comes from a chimney no longer being over the chimney when rotating buildings.

teamcolorEnergy and teamcolorNoEnergyEdit

If true, color or color-no-energy will be replaced with the unit's team color.

static-particle-countEdit

If this optional tag appears, the specified number of static particles will be used. A static particle is a particle that does not move or die. Instead, they alternate between their size and their size-no-energy and their color and color-no-energy. Because they do not move, direction, gravity, etc won't have any affect on the particles. These are mostly used for a glow effect. To "hide" the alternation of the regular and the no-energy variations, simply make the regular and no-energy values the same.

alternationsEdit

If this optional tag appears, the particles alternates n times from low energy to high energy. So it starts and ends with its low energy values.

isVisibleAtNightEdit

With this optional Tag you can tell a particle system to be shown at night. If true, will be visible at during the night, and if false, will not be visible at night. Defaults to true. Useful for making artificial lights at night.

isVisibleAtDayEdit

With this optional Tag you can tell a particle system to be shown at day. If true, will be visible at during the day, and if false, will not be visible at day. Defaults to true.

radiusBasedStartenergyEdit

If this is enabled the particles in the center start with higher energy then those which are more on the outside. This is typically used for fire effects.

isDaylightAffectedEdit

If set to true, the tilesets day/night light coloring of the current moment affects the particle colors (meant to be used with mode "black"). By this the coloring of the particles fits to the daytime. Defaults to false.

particleSystemStartDelayEdit

This delays the start by the given number of particle system update cycles (integer). Default is 0.

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.