Effects Editor

From Mod Wiki

The Effects Editor (editEffects) is the tool used to set up all kinds of particle effects for use in ETQW. These can include muzzle flashes, explosions, smoke, sparks etc.

Overview

The Effects Editor can be started from the console with the editEffects command. The effects data is stored as .effect files in the folder base/effects.

Using the Effects Editor

Save, Save, Save

Save your work often! There are a huge amount of settings, and some extreme combinations can occasionally cause the Effects Editor to crash, so it is recommended to save as often as possible to avoid losing work.

Consistent Workflow

In order for your workflow within the Effects Editor to be consistent, character/vehicle/weapon bones/joints need to be considered with a bit of common sense. For example, when creating a weapons bones to use in animation, make sure the bones joints are consistent across all weapons (have an axis face the same direction for all weapons - the muzzle of a weapon) otherwise when setting up effects the parameters will be different for each joint with axis facing a different direction. Eg Forward may be Left, Left may be Up, Down may be right, etc. It can become very confusing if the joints are not consistent across similar assets.

Min/Max values

In the Effects Editor, most parameters have two values that define the minimum and maximum of a range. If you click the little button between them you can set both of these fields. Every time a particle is spawned a value between min and max will be randomly chosen.

Start/End Values

Most parameters also have start/end values, by using these values together with a lookup table you can animate the value over time. The lookup table defines the percentage of blending between the start and end values.

Example

Say we have a "Size parameter", this defines the size of the particle. We start by setting the min max values to min(50) max(60), particles spawned with these settings will be between 50 and 60 units large and stay the same size their whole lifetime. Now if we set the end sizes to min(100) max(110) and the table to a linear increase, the size of the particle will slowly grow from a value between 50-60 to a value between 100-110. Setting a more complex table will cause the particle size to oscillate a few times between those two values (or whatever the table is set to)

Segment Types

When you right click in the segment list (the central part of the editor GUI) you can add new segments to the effect. A segment is one or more objects that follow the same rules. There are several types of segments, the following list gives a short description of every type.

  • Sprite: The standard particle system effect, a quad that always faces the camera.
  • Oriented Sprite: Quads along the effect normal, not rotated to the camera at all (parallel to the floor raising polygons).
  • Model: Spawns models instead of particles. For example, a vehicle exploding with parts flying off that have physics.
  • Line: Sprites with rotate towards the camera but also constrained to an axis (the axis seems to be the effect normal)
  • Linked Line: The individual particles spawned don't define an individual object for every particle but a segment in a single connected line. Most materials used in a Linked Line particle effect should be Two Sided otherwise the backface is culled.
  • Oriented Linked Line: Same as the Linked Line, except with the option of orienting it along an axis.
  • Decal: Spawns a quad on a surface, defined by the axis. Used for things such as scorch marks from grenade explosions.
  • Electricity: A crude lightning bolt effect, similar to a line but with a jagged instead of a straight line.
  • Sound: Plays a sound, with the ability to randomize volume and pitch.
  • Light: Spawns a light source. This segment is heavily limited.
  • Debris: Spawns actual entities instead of particles.
  • Effect: Play another effect (referenced), the only parameter is the time at which the other effects starts playing relative to this effect.
  • Vision: A few simple effects such and double vision.
  • Delay: Used to add pauses at any point of an effect, used for effects such as explosions which build up over time.

Segment tabs

When editing a certain segment tabs appear on the right hand side of the editor. The following lists the function of the tabs. Note that not all tabs are always available, the available tabs are dependent on the segment type.

Emitter Tab

The origin tab specified where the particles are spawned this defines when and how many particles are spawned. Some of these settings only make sense when there are multiple segments in a single effect.

  • Start Time: Time to start opposed to the global effect time (So you can have different segments start at different times)
  • Count: Maximum number of particles alive in this segment (so even if effect is playing but some particles are still spawning, no new ones will spawn.)
  • Duration: Amount of time the effect playing (spawning new particles)
  • Spawn simultaneously: This ignored the Duration and spawns all the particles (amount defined in Count) at the same time, instead of one after the other.
  • Locked: This will cause the particles to always spawn from where the effect is playing. This is useful for effects such as muzzle flashes (so the effect is not left behind when the playing is moving), or smoke particles (so the effect will continuously spill out of a vehicle as it moves, instead of starting at one location and not moving until the effect stops).
  • Use count as density: The number of particles spawned depends on the volume or the origin box instead of an absolute number.
  • Persist particles upon effect stop: When the effect is done (maximum duration of any segment) don't delete the particles but let them die naturally. (based on their lifetime parameters)

Attenuation

  • Distance: Min parameter determines at what distance (in units) the effect starts to apply either Count, Size, Alpha or Length properties. Max parameter determines at what distance the properties are applied to its full. The greater the gap (in units) between Min and Max, the more subtle the changes over time. The invert option for the 4 properties will reverse the option, ie: the effect will not be visible close up, but when the distance between the player and effect becomes greater, the particles will apply the properties (increase in count, size or alpha)
  • Apply to Count: This property will reduce/increase the amount of particles spawned over distance.
  • Apply to Size: This property will reduce/increase the size of particles over distance.
  • Apply to Alpha: This property will reduce/increase the alpha/opacity of particles spawned over distance.
  • Apply to Length: This property will reduce/increase the length of LINE particles spawned over distance.

Scalability

  • Cutoff Distance: This parameter is for performance reasons. Setting a cutoff distance (in units) will stop effects playing prematurely when moving outside of the range. Effects will not start if outside of this range.

Sprite Tab

  • Live Forever: Keeps effects around forever; ignores Duration. This option can only be selected if the particles are 'spawning simultaneously'.
  • Lifetime: The amount of time each individual particle stays around. Use this to randomise particle lifetimes for effects such as smoke, to make them appear nob-linear.
  • Material: The material of the effects you would like to use.
  • Death Effects: Plays an effects when the current effect stops playing. For example, if a flare effect is playing, you can give it a death effect to play an effect of it 'fizzing out' at the end.
  • Use random animation frame: This option is for materials that consist of an number of images along a strip. Check the box and type in the number of frames the image uses so it select a random image along the strip. Useful for particles such as flying debris.

Origin Tab

This defines the origin of individual particles spawned.

Forward/Left/Up: Defines a box in 3D space where the particles are spawned within. For example, to create a square box for particles to spawn within, you would use parameters such as:

  • Forward: -10, 10
  • Left: -10, 10
  • Up: -10, 10

It is also possible have particles spawn within a number of shapes, using the distribution.

Distribution

  • Linear: Particles are spawned along a line between the min/max points
  • Box: In the box defined by the min/max points.
  • Sphere: A sphere defined inside the box defined by the min/max points.
  • Cylinder: A cylinder inside the box (axis along normal).
  • Cone: A cone (axis along the normal)
  • Spiral: Spawn on a spiral, this is a bit trickier than the normal box-like origins. The forward/left/up parameters are used in a special way described below.
    • Forward: The axis of the spiral goes from min to max
    • Left: Deviation of the spawned particles of the spiral line perpendicular to the spiral axis. (so say 50 - 60 will have a spiral with radius 55 and 5 units random offset at both sides)
    • Up: Deviation of the spawned particles of the spiral line parallel to the spiral (so you can create some sort of membranes by setting a small radius change (say 50 - 60) with a larger parallel radius say -40 - 40 while radii that are identical give more of a tube with particles)
    • Spiral parameter: The amount of units before the spiral repeats (higher values have "wider" spirals)
  • Model: Spawn the model based on the specified model's vertexes. The model's bounding box is squashed into the mins/maxs so the aspect ratio of the model may change. You should set mins/maxs to the model bounds to get an exact match.

Options

  • Spawn on surface: Spawn the particles on the bounding volume's surface (Eg; On the sphere's surface instead of inside the sphere volume) (Disabled for spiral/model distributions)
  • Use End Origin: Spawns particles from the end origin of the effect, instead of the beginning. For example, if you have and Oriented Linked Line with this enabled, the line will start from the end origin and work its way back.
  • Distribute Evenly: Without this, particles will spawn randomly within the defined shape. With this option ticked, the distribution within the shape will be more uniform.

Size Tab

Min and Max sizes (for randomizing) of particles. Size also affects other Segments like electricity and lines, determining how 'thick' they are.

Envelope

When the Envelope is set to a certain table the "End" section becomes enabled. The envelope then defines the blend between the start and the end sizes.

  • Offset: Offsets the entire table left or right (-1 to 1)
  • Rate: Determines the speed of th e table. For example, to increase the speed of a flickering light, you would increase the Rate value.

Motion Tab

The Velocity determines the speed at which particles move along each axis.

Wind

Wind parameters are affected by wind properties within the atmosphere editor. A maps atmosphere should be finalized before these parameters within the Effects Editor should be touched, as changing values at a later date can radically alter the results.

  • Angle Deviation: The angle/direction at which the wind is heading.
  • Strength: The strength at which the wind is blowing. Set the Min and Max will produce more natural, random results.

Acceleration

  • Gravity: The amount a particle is pulled back down to earth once it is in the air. For example, if you have bunch of sprites spurt up into the air (debris), you would give it a Gravity value of something like '0.1' to eventually pull it back down to earth. The values can also Min/Max for randomized results.
  • Forward, Left, Up: These parameters work together with the Velocity. Velocity determines the speed, and Acceleration determines at which rate the particle speeds up.

Friction

  • Forward, Left, Up: These parameters work together with the Velocity. Velocity determines the speed, Acceleration determines at which rate the particle speeds up, and Friction determines the speed at which the particle slows down.

Use Emitter's Velocity

The particles will inherit the motion and speed of the motion of the origin of the effect playing. This parameter is used for effects such as (in some cases) smoke on vehicles, resulting in the smoke moving along with the vehicle, then when the vehicle comes to a sudden stop the smoke would keep the motion and continue on for a few moments before straightening back up with the station effect origin.

Offset Tab

The parameters within this tab work the same as the parameters within the Origin Tab. Where the Origin Tab affects where individual particles are spawned within a defined shape, the Offset tab defines where the effects will play from within a defined shape.

The Offset Tab includes an 'End Offset', so the effect can start at a certain location and end at another, or randomise between them using the same table setup as in the Size Tab.

The Offset and Origin can be used in two ways:

  • Origin to define where the effects plays from, with the Offset defining where individual particles spawn from (always from the location of the Origin)
  • Offset to define where the effects plays from, with the Origin defining where individual particles spawn from (always from the location of the Offset)

Orbit Tab

Used to rotate an entire effect, instead of individual particles. Start and End use conventional Roll, Yaw and Pitch (-360 to 360, or further if required) to define the rotation direction of the effect.

Envelope

When the Envelope is set to a certain table the "End" section becomes enabled. The envelope then defines the blend between the start and the end rotation angles.

  • Offset: Offsets the entire table left or right (-1 to 1)
  • Rate: Determines the speed of the table.

Physics Tab

Add the ability to add bouncing particles.

  • Bounce on Impact: Factor determines how 'bouncy' a particle is.
  • Remove on Impact: When a particle touches a surface it will be removed.
  • Impact Effects: You can select another pre-made effect to play when a particles touches a surface. For example, large debris bounces on the ground it can kick up a dust effect.

Color Tab

Used to color particles (material must have 'vertexColor'). Start and End define the colors from which the particle start as, to the end color. Speed, random color changes etc can be defined using a table.

Envelope

When the Envelope is set to a certain table the "End" section becomes enabled. The envelope then defines the blend between the start and the end colors.

  • Offset: Offsets the entire table left or right (-1 to 1)
  • Rate: Determines the speed of the table.

Alpha Tab

Used to alter the opacity of particles (material must have 'vertexColor'). Start and End define the opacity from which the particle start as, to the end opacity. Speed, random opacity changes etc can be defined using a table.

Envelope

When the Envelope is set to a certain table the "End" section becomes enabled. The envelope then defines the blend between the start and the end opacity.

  • Offset: Offsets the entire table left or right (-1 to 1)
  • Rate: Determines the speed of the table.

Rotate Tab

Used to rotate the individual particles. Start and End define the rotation angle from which the particle start as, to the end rotation. Speed changes etc can be defined using a table.

  • End Relative To start: If you set end to say 360 and start between 0-20 and you get for a certain particle 15 it will rotate between 15 and 375 instead of between 15 and 360. So a full rotation can still be achieved.

Envelope

When the Envelope is set to a certain table the "End" section becomes enabled. The envelope then defines the blend between the start and the end colors.

  • Offset: Offsets the entire table left or right (-1 to 1)
  • Rate: Determines the speed of the table.

Trail Tab

This is used to produce a 'trail' behind individual particles

  • Motion: Inherits the color and alpha setting of the particle.
  • Burn:
  • Particle: Spawns another effect behind each particle. For example, you could have a debris particle with a fire effect used for this parameter to produce a flame trailing behind.
  • Horizontal Repeats: Defines how 'thick' the trail is. The higher the number, the more particles will trail behind the emitting particle.

Length Tab

These parameters are available to Segments such and Lines. The values in this tab define the length and the direction of the line. Start-end again allow you to specify a changing value based on a table.

Envelope

When the Envelope is set to a certain table the "End" section becomes enabled. The envelope then defines the blend between the start and the end length.

  • Offset: Offsets the entire table left or right (-1 to 1)
  • Rate: Determines the speed of the table.

Line Tab

Very similar to Sprite but offers the material to be tiled along the length of the line.

  • Live Forever: Keeps effects around forever; ignores Duration. This option can only be selected if the particles are 'spawning simultaneously'.
  • Lifetime: The amount of time each individual particle stays around. Use this to randomize particle lifetimes for effects such as smoke, to make them appear nob-linear.
  • Material: The material of the effects you would like to use.
  • Tile Material: Defines how many times the effect tiles between the start and end origin.
  • Death Effects: Plays an effects when the current effect stops playing. For example, if a flare effect is playing, you can give it a death effect to play an effect of it 'fizzing out' at the end.
  • Use random animation frame: This option is for materials that consist of an number of images along a strip. Check the box and type in the number of frames the image uses so it select a random image along the strip. Useful for particles such as flying debris.

Model Tab

  • Live Forever: Keeps effects around forever; ignores Duration. This option can only be selected if the particles are 'spawning simultaneously'.
  • Lifetime: The amount of time each individual particle stays around. Use this to randomize particle lifetimes for effects such as smoke, to make them appear non-linear.
  • Model: The model you would like to use.
  • Death Effects: Plays an effects when the current effect stops playing. For example, if the model is a piece of vehicle debris, you can have a fizzle effect play when it decays.

Decal Tab

Use to spawn a quad on surfaces (for grenade scorch marks for example)

  • Start Time: Defines when the decal spawns within the time-frame of the effect.
  • Material: The material/image you would like to use as the decal.
  • Projection: The axis on which the decal spawns on the surface.
  • Detail Factor: Defines how far from the effect the player needs to be before the effect stops playing/being visible.

Electricity Tab

Electricity acts very much like a line.

  • Live Forever: Keeps electricity around forever; ignores Duration. This option can only be selected if the particles are 'spawning simultaneously'.
  • Lifetime: The amount of time each electricity line stays around.
  • Material: The material of the electricity image you would like to use.
  • Tile Material: Defines how many times the electricity tiles between the start and end origin.
  • Forks: Defines how many times the electricity splits off into other lines.
  • Jitter
    • Table: Select a table to define how 'violent' and random the electricity moves about.
    • Jitter Rate: Defines how fast the electricity flicks about.
    • Jitter Rate: Defines how extreme the electricity flickering is.
  • Death Effects: Plays an effects when the current effect stops playing. For example, if a flare effect is playing, you can give it a death effect to play an effect of it 'fizzing out' at the end.

Sound Tab

  • Start Time: Defines the time at which the sound plays, within the time-frame of the effect.
  • Sound: Sound shader to use (does not support WAV)
  • Volume: Used to randomize the volume. Try not to exceed a value of 6. If the sound is too quiet, alter its volume in the source file, or the sound material shader.
  • Freq Shift: < 1 gives lower & longer sounds, > 1 giver higher faster sounds.

Light Tab

  • Live Forever: Keeps the light around forever; ignores Duration.
  • Start Time: Defines when the light spawns, within the time-frame of the effect.
  • Lifetime: The amount of time the light stays around. Use this to randomize particle lifetimes for effects such as smoke, to make them appear nob-linear.
  • Locked: Selecting this will ensure the light always spawns from the effects origin, for effects such as muzzle flashes. Keep in mind that although it 'locked', the light will still stay in the spot it spawns in its 'lifetime' runs out, so if it is being locked to an effect such as a muzzle flash (which is always on the move) you will need to make the lifetime very short (0.2 for example)
  • Cast Shadows: Each spawning light will cast shadows, projecting out from its origin.
  • Cast Specular: Each spawning light will cast specular on surrounding surfaces within the lights size.
  • Material: The material/image to use for the light. A default light to use is 'lights/round'
  • Death Effects: Plays an effects when the current effect stops playing. For example, if the model is a piece of vehicle debris, you can have a fizzle effect play when it decays.
  • Detail Factor: Defines how far from the effect the player needs to be before the light stops playing/being visible.

Debris Tab

  • Lifetime: The amount of time the debris stays around.
  • Entity Def: The entity you would like to use as the debris.

Effect Tab

Used to reference other effects in an effect.

  • Start Time: Defines when the effect spawns, within the time-frame of the effect.
  • Effect: The pre-made effect you would like to reference.

Vision Tabs

  • Start Time: The time at which the effect happens, within the time-frame of the effect.
  • Duration: The amount of time the effect stays around.
  • Scale: Defines the intensity of the effect.
  • Attenuate: Max defines how far from the effects origin the player needs to be in order to 'see' the effect. Min defines the distance to the effects origin at which the effect is at its strongest.

Delay Tab

  • Start Time: The time at which the delay occurs, within the time-frame of the effect.
  • Duration: The amount of time the delay occurs.

Writing Materials

The materials you use on the particles need to have some special setup in order to work properly.

Colors and alpha

You need to put "vertexColor" in your stages to have the colors & alphas set in the effects editor to show up. The alpha and colors are used with the following blend modes:

  • blend blend: The alpha will be used to fade the objects to transparent and the color will be multiplied with the sprite's color.
  • blend add The alpha will be ignored by the shader, to fade out your particle setup the color so it fades to black. (Since additive blending of zero gives whatever was there already.)

Animation frames

Pack your sprites into a single texture (on the x-axis) and then use the following template in the stage to animate them:

 useTemplate templates/materials/animate< numFrames, durationInSeconds >

(Only numFrames = {4, 8, 12, 16, 32} are supported at the moment but we can add more when they would be needed.)

Note: The animation will only start playing from the first frame properly if you use the "Play Effect" menu command in the effects editor, not the "Play Looping Effect". Or if you see the effect on the actual game entity. Also it will only start from the first frame if the sprites are spawned at the same time as the effect is spawned. This means you can't use "Start time" and should use "Spawn simultaneously".