This document describes the X-Plane 11 particle system.
Introduction to the Parts of the Particle System
The X-Plane 11 particle system follows a fairly standard game-industry design:
- A particle system consists of a collection of emitters and particles. There can be many particle systems running in X-Plane at the same time, and they do not interact with each other.
- A particle system’s behavior is controlled by a particle system definition text file. More than one particle system can use the same definition file at a time.
Every particle in a particle system has a type, and the definition file defines the behavior of every particle type. Typically you will have a small number of types per definition file. For example, a definition file that contains “smoke and fire effects” might contain three types of particles: a flame particle, a white smoke particle, and a black smoke particle.
The particle type definition controls the appearance and behavior of the particle over time, including what textures it uses and how it grows/shrinks and fades over time.
Every particle that is created in a particle system has a finite lifetime (measured in seconds) before it disappears. The particle definition file defines how the particle type is drawn over that lifetime. For example, a typical behavior is to make the opacity of the particle fade from 100% to 0% over the life time of the particle, so that the particle slowly disappears.
All properties of the particle type that can be key-framed are key-framed over the lifetime of that particle.
An emitter creates particles; every emitter has a type, and the emitter type definition defines how the emitter creates particles.
The emitter always creates the same type of particles, but it can control the particle’s initial properties, including its initial size, its initial opacity, and how long it lives for.
Emitters are used in the simulator by attaching them to objects or aircraft. The emitter would be attached at a particular location on an OBJ with a particular direction; if the object is on an airplane, the emitter moves with the airplane. For example, you might put an emitter of smoke puffs on the exhaust pipe of an aircraft.
Emitters have a single input, a “volume control” that turns the emitter up or down. The actual volume of an emitter in X-Plane will depend on what the emitter is attached to; for example, the emitter’s volume might come from a dataref, or from the throttle of the airplane.
The various properties of the emitter (number of particles created per second, initial velocity, etc.) are key-framed based on the emitter’s volume. So you can specify that an emitter makes more particles (or faster particles, or bigger particles) as its volume is turned up. In this way, an emitter can dynamically change its stream of created particles based on inputs from X-Plane.
Many parameters of the emitter type definition have a ‘randomization’ factor that controls how much the emitter randomly varies its properties. Randomization lets you avoid a particle system where every particle is the same size or looks the same.
Randomization values are typically given as a percentage, where 0% means the emitter runs exactly as it is set up and 100% means the various emitter properties can change by up to 100% of their value. For example, an initial velocity of 10 (meters/second) and a variance of 100% would mean particles are spawned with an initial velocity anywhere from 0 to 20 m/sec.
The randomization values of an emitter are keyframed, just like its main properties. So you can build an emitter that increases (or decreases) the randomization of its output based on situations in the simulator. For example, you could make an exhaust port for an airplane that spawns puffs in a random direction at idle, but all in the same direction at full throttle by key framing the initial direction variance of the emitter from 100% randomization at 0% volume down to 0% randomization at 100% volume.
Emitters are attached to parts of the X-Plane world (scenery objects, airplane objects, etc) and run continuously based on their volume. This is good for continuous sources of particles like a smoke stack, but it is not good for a finite event, like an explosion.
An effect is a collected sequence of key-framed emitter locations and values. An effect is something that happens over a time and start location. For example, an explosion effect might contain instructions to run a fire emitter for 10 seconds.
The properties of an effect are key-framed to the time of the effect; the effect has a finite total duration. Thus for an effect you can create a smoke emitter that creates a lot of smoke and then have the smoke level slowly die down.
Effects cannot be attached to objects; rather X-Plane uses effects directly at specific times, e.g. when a bomb hits the ground or when the airplane crashes.