MG/Unit Particle XML

From MegaGlest
Revision as of 07:16, 22 April 2011 by Hofmic (talk) (Linked particles)
Jump to: navigation, search

MegaGlest expands 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 energy=0. 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.

XML Definition

<?xml version="1.0" standalone="yes"?>
<unit-particle-system>
    	<texture value="true" path="images/particle.bmp" luminance="true"/>
	<mode value="normal"/>                                              <!-- currently supported is normal and black. -->
                                                                            <!-- its the way the particle colors are calculated by the renderer -->
	<primitive value="quad"/>                                           <!-- line qorks too, but its not really useful -->
	<offset x="0" y="-0.4" z="0.0"/>                                    <!-- position of the particle system -->
	<direction x="0" y="1" z="0"/>                                      <!-- starting direction(and speed) of the particles -->
	<color red="1.0" green="0.0" blue="0.0" alpha="0.8" />              <!-- particles are born with this color -->
	<color-no-energy red="1.0" green="1.0" blue="0.3" alpha="0.6" />    <!-- particles die with this color (if they are not recycled!) -->
    	<radius value="0.7" />                                              <!-- size of the region where the particles are emitted -->
    	<size value="0.6" />                                                <!-- particles are born with this particle size -->
    	<size-no-energy value="0.3" />                  <!-- particles die with this particle size (if they are not recycled!)-->
    	<speed value="3.0" />                           <!-- speed of the particle systems ( used in combination with direction ) -->
	<gravity value="0"/>                            <!-- basic kind of gravity. The speed in y direction is lowered by this value in every step -->

    	<emission-rate value="10" />                    <!-- number of particles that are emitted in every step -->
                                                        <!-- the emission rate is a float value, so you can give an emissionrate of 0.2 for slow emission too! -->

    	<energy-max value="30" />                       <!-- the starting energy for new born particles -->
    	<energy-var value="0" />                        <!-- a variability for new particles --> 
    	<fixed value="false" />                         <!--  if the position of the particle system moves with the unit -->
        <relativeDirection value="false" />             <!-- if the direction of the particle system will rotate with the unit. 
                                                        <!--    For example smoke always has same direction ( wind ) -->
    	<relative value="true" />                       <!--  if the position of the particle system rotates with the unit -->
    	<teamcolorNoEnergy value="false" />             <!-- if teamcolor should be used instead of <color-no-energy> -->
    	<teamcolorEnergy value="false" />               <!-- if teamcolor should be used instead of <color> -->

        <static-particle-count value="4" />             <!-- You can have a static number of particles in a particle system now -->
                                                        <!-- if this is set their energy is always alternating up and down, but they don't dissapear.--> 
                                                        <!-- ( make noEnergy / Energy the same if you don't want this alternating thing ) -->
                                                        <!-- And if this is set the particles have no more movement! So speed, gravity and direction doesn't matter. -->
                                                        <!-- Its meant for glow effects for examples ( look at the persian genies for an example ) -->


</unit-particle-system>

See Also