Particles

From MegaGlest
Revision as of 05:57, 22 April 2011 by Hofmic (talk) (Created - lots to add, see the comment on the page)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search
Example of particles used to create a flame effect

Particles are a technique used to create fuzzy phenomena, which are otherwise very difficult to create with standard modelling. They could be used to create flames, magic attacks, smoke, explosions, water, dust, trails, etc. In Glest, they are most commonly used for attacks, splashes, and unit emitting. For example, a magical spell, a flaming arrow, the explosion of a projectile, a burning building, and smoke coming from a chimney are all usage of particles in Glest.

Types

Particles in Glest are defined from XML files. There are three systems of particles:

  • Particle projectile systems (such as a flaming arrow)
  • Particle Splash systems (such as an explosion)
  • Unit particle systems (such as smoke rising from a chimney) - MegaGlest and GAE only

Elements of particles

Textures

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.

Models

Models can be used in particle projectiles and splashes, but contractual to the expected, it is just one model for the attack, rather than replacing particles with models. Thus, you can set the model to be an arrow and that will be the body of the projectile. For splashes, the model appears the moment the attack starts, not when the splash begins, so it cannot be used, say, for an explosion model. Animations in the models will be ignored and the first frame will be used.

Primitive

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

Mode

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

Color

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

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.

Radius

Whereas size affects the particle's individual size, radius affects the area filled with particles. Only used for unit particle systems.

Gravity

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

Trajectory types

For particle projectile systems, the type of the trajectory, either linear (the particle moves in a straight line), parabolic (the particle moves in an arc), or spiral (the particle spins around in an arc). These are not present in other types of particle systems.

Vertical and horizontal spread

See Particles/Spread

Teamcolor

In GAE and MegaGlest, particles are able to contain teamcolor, and like the size and color, it can transition into or away from this.

Particle gallery

See Particles/Gallery

See also