|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]
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.
- 1 XML
- 2 Documentation
- 2.1 textures
- 2.2 primitive
- 2.3 mode
- 2.4 offset
- 2.5 direction
- 2.6 color and colorNoEnergy
- 2.7 size and sizeNoEnergy
- 2.8 radius
- 2.9 speed
- 2.10 gravity
- 2.11 emission-rate
- 2.12 energy-max
- 2.13 energy-var
- 2.14 fixed
- 2.15 relativeDirection
- 2.16 relative
- 2.17 teamcolorEnergy and teamcolorNoEnergy
- 2.18 static-particle-count
- 2.19 alternations
- 2.20 isVisibleAtNight
- 2.21 isVisibleAtDay
- 2.22 radiusBasedStartenergy
- 2.23 isDaylightAffected
- 2.24 particleSystemStartDelay
- 3 See Also
<!-- 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 -->
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.
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).
Particles have two modes of rendering, either normal which uses colors, or as black which allows the usage of black particles.
The offset from the center of the unit to where the center of the particle system will be, in Glest units.
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 colorNoEnergy
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 sizeNoEnergy
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.
Whereas size affects the particle's individual size, radius affects the area filled with particles.
Speed the particles will travel at. Used in combination with direction to cover that much distance over the life of the particle.
Glest has a simple gravity system which can also cause particles to sink downwards - or float upwards - over their life.
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.
The starting energy of the particles.
A variance to add or subtract from energy-max to make particles more random.
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.
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.
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 teamcolorNoEnergy
If true, color or color-no-energy will be replaced with the unit's team color.
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.
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.
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.
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.
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.
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.
This delays the start by the given number of particle system update cycles (integer). Default is 0.