XML/Splash particle

From MegaGlest
Revision as of 02:32, 25 September 2009 by Daniel Santos (talk) (Add info for new <blend-mode/> tag)
Jump to: navigation, search

Splash particle systems are most commonly used to create special effects from a unit being attacked.

<?xml version="1.0" standalone="yes"?>
<splash-particle-system>

<!-- GAE Only  -->

    <blend-mode src="mode" dest="mode"/>  <!-- (Optional) Available in 0.2.13. Sets the blend mode for the particle
                                               system.  For details, see the OpenGL reference for the glBlendFunc()
                                               function.  Legal values are:
                                                   zero
                                                   one
                                                   src_color
                                                   one_minus_src_color
                                                   dst_color
                                                   one_minus_dst_color
                                                   src_alpha
                                                   one_minus_src_alpha
                                                   dst_alpha
                                                   one_minus_dst_alpha
                                                   constant_color
                                                   one_minus_constant_color
                                                   constant_alpha
                                                   one_minus_constant_alpha
                                                   src_alpha_saturate.
                                               Note that dest may not be set to src_alpha_saturate.  If not specified,
                                               the default is the same as classic Glest behavior, equivalent to

                                                   <blend-mode src="src_alpha" dest="one"/>

                                               However, to enable particles to contain dark colors (and not have the
                                               brightness used as an alpha value), you should use

                                                   <blend-mode src="src_alpha" dest="one_minus_src_alpha"/>

                                           -->

<!-- /GAE Only  -->
                                     <!-- An optional texture used for each particle (what does luminance do exactly?) -->
    <texture value="true|false" path=".../texture_name.bmp" luminance="true"/>
                                     <!-- An optional model can be used. -->
    <model value="true|false" path=".../model_name.g3d"/>
    <primitive value="quad|line"/>   <!-- This shows the shape of the particle.  Line is like a line, quad is like a
                                          circle. -->
    <offset x="0" y="0" z="0"/>      <!-- This can offset the entire splash from directly in front of the end of the
                                          projection where it would normally end. -->
                                     <!-- Colors at epicentre (specifically of a particle when it's first created) -->
    <color red="0.0" green="0.0" blue="1.0" alpha="0.5" />
                                     <!-- Colors at edge (specifically, the color the particle will become when it runs
                                          out of energy) -->
    <color-no-energy red="1.0" green="1.0" blue="1.0" alpha="0.0" />
    <size value="1" />               <!-- Particle start size (center) -->
    <size-no-energy value="2" />     <!-- Ending particle size -->
    <speed value="5" />              <!-- The Maximum Radius of the explosion -->
    <gravity value="0"/>             <!-- Gravity effects -->
    <emission-rate value="20" />     <!-- How many particles are emitted -->
    <energy-max value="30" />        <!-- Energy -->
    <energy-var value="10" />        <!-- Variation -->
    <emission-rate-fade value="1"/>  <!-- Particles last longer with a lower number / disappear quicker with a higher
                                          number -->
    <vertical-spread a="0" b="0"/>   <!-- Direction splash goes after hitting -->
    <horizontal-spread a="1" b="0"/> <!-- Direction splash goes after hitting -->
</splash-particle-system>

Clarifications: The energy value is actually the number of server frames (40 per second) the particle will be "alive." As the particle reaches it's end of life, the color will transition from the value specified by <color> to the value specified by <color-no-energy>. Similarly, the size of each particle starts out the value specified by <size> and gradually decreases to <size-no-energy> as it runs out of energy. (And please do correct any of this if you find it to be inaccurate.)

Back to XML_Definitions