From The Mana World
Line 77: Line 77:
Demonstrates the use of nested emitters for pulsating effects using the nomads pipe as an example
Demonstrates the use of nested emitters for pulsating effects using the nomads pipe as an example


*fade-in
*fade-out
*Negative minimum output for irregular output
*Negative minimum output for irregular output
*Using nested emitters for timing purpose
*Using nested emitters for timing purpose

Revision as of 06:17, 3 June 2008

This will become a tutorial for creating particle effects. Still in the conceptualisation phase.

Basics

  • how does the engine work
  • where are the files for what purpose
  • how can particle effects be added to maps
  • how can particle effects be added to NPCs

Blinking

Particle-tutorial-blinking.png

Basic particle effect which creates a box of blinking particles.

  • Basic emitters
  • position-x, position-y, position-z
  • lifetime
  • output
  • image
 <?xml version="1.0"?>
 <effect>
  <particle> 
   <emitter>
    <property name="output" value= "1" />                              <!-- We want one new particle per game tick -->
    <property name="lifetime" value= "10" />                           <!-- we want each particle to survive for 3 game ticks -->
    <property name="image" value="graphics/particles/star-medium.png"/><!-- We want the particles to look like white stars. -->
    <property name="position-x" min="0" max="32" />                    <!-- We want the particles to be spawned in an area 32 pixels wide...-->
    <property name="position-y" min="0" max="32" />                    <!-- ...32 pixels deep and...-->
    <property name="position-z" min="0" max="32" />                    <!-- ...32 pixels high.  -->
   </emitter>
  </particle>
 </effect>

Exercise: Make a box with the double size and with a different particle:

Particle-tutorial-blinking-exercise.png

Water Fountain

Particle-tutorial-fountain.png

Moving particles with physics.

  • horizontal- and vertical-angle
  • power
  • gravity
  • Killed by floor contact
 <?xml version="1.0"?>
 <effect>
  <particle> 
   <emitter>
    <!-- no position-bla this time - all particles are spawned at the same point. -->
    <property name="output" value= "4" />                  <!-- This time we need some more particles-->           
    <property name="horizontal-angle" min="0" max="360" /> <!-- launched in a full horizontal circle -->
    <property name="vertical-angle" value="45" />          <!-- launched in a fixed vertical angle -->
    <property name="power" value="3" />                    <!-- Initial speed of 3 pixels per tick -->
    <property name="gravity" value="0.1" />                <!-- Accelerated by 0.1 pixels per game tick to the ground -->
    <property name="image" value="graphics/particles/orb-medium.png"/><!-- This time we use the orb sprite. -->
   </emitter>
  </particle>
 </effect>

Exercise: Make a "Firehose" which launches the particles in a narrow stream:

Particle-tutorial-fountain-exercise.png

Fireball Fountain

  • Nested emitters
  • bounce
  • animation

Orbiting Spheres

  • acceleration
  • momentum
  • die-distance
  • dyeing

Smoke puffs

Demonstrates the use of nested emitters for pulsating effects using the nomads pipe as an example

  • fade-in
  • fade-out
  • Negative minimum output for irregular output
  • Using nested emitters for timing purpose

Triangle in circle

  • Using nested emitter for circular and linear effects
  • Using trigonometrical calculations for creating geometric shapes.