Particle Emitters 2

Particle Emitters 2

This SD Magos'-centric thread attempts to document Particle Emitters 2.
Orientation axes are Warcraft 3's.
X - Forward
Y - Rightward
Z - Upward

Required: A pre-1.29 copy of the game containing the old MPQs that Magos' Editor can navigate.


* = Not observable in Magos', and will have to be tested in-game.




Visibility
Toggle: 0 turns off emission, while values over 0 turn it on.

Emission
The amount of particles generated per second. The interval between emissions is capped at ~0.05s (?). Going past this threshold will emit those excess particles in bulk.

Speed
By default, causes the particle to move towards its Z. This direction can be changed through emitter or parent rotation.
Animated changes in speed will only affect newly emitted particles; thus gravity is the only way to accelerate.

Variation
The percentage of randomness with which the particle can deviate from its base speed. 1 means speed can go down to zero, or double; and 2 means it can go -1x negative*, or triple.

High variation can lead to bottleneck emission when used with Latitude.

Latitude
Angles to which the particles will fly, deviating from the emitter's facing direction. A value of 90 means the particles will go towards a semi-sphere area, while 180 removes angular restrictions.

Latitude-90.gif
Latitude-180.gif
90 Latitude
180 Latitude

Width - Along the X Axis (frontward/backward)

Length - Along the Y Axis (left/right)

Width and Length determine the rectangular field in which particles are spawned. Magos' Editor displays these properly with MDXs, but not so with MDLs, where they are reversed.

W.gif
L.gif
100 Width; 10 Length
100 Length; 10 Width
Gravity
An accelerating force that points downwards in the absence of Model Space rotations. Negative values will make the particles go up.



Flags




Unshaded* - Will be unaffected by the game's lights. Generally always on for effects.

The 'sun' comes from the south west by default.

Unfogged* - Will not be tinted or shrouded by fog effects, including the fog of war.

Line Emitter* - Whether or not the particles will fly towards two axes instead of three. By default, checking this means the particles will fly YZ.

With Latitude, the angles will expand sideways.

Example usage in Thunder Clap, where it's used with an emitter rotation to make the particles fly XY.
Rotation: { 0, -0.707107, 0, 0.707107 }

Sort Primitives Far Z* - Supposedly whether or not the game will take into account Z when deciding which particle is shown on top.

Model Space* - Whether or not the particle moves and rotates with its parent nodes and the model.

Model Space sees extensive use in Radiance.

XY Quad - Whether or not the particle will be rendered as a flat, one-sided plane facing the Z axis. Requires non-zero Latitude, and Speed over 0.99 or below -0.99.

XY Quads will rotate to XY angles within Latitude.*
With Model Space, they will change facing according to the node's rotation.*

XY Quads see extensive use in Void Disc.

Squirt* - Creates all the particles indicated by the emission rate at the first keyframe available per animation, instead of over time. If the opening frame of the animation is not set to 0, it will ignore your frame settings and squirt when the animation begins.

Used by War Stomp and Thunder Clap.



Head - The default. When rendering an emitter without Head nor Tail settings, the game will consider it a Head emitter. Leaving the Head box unchecked will hide the particles in Magos' only.

Tail* - Whether or not the particle will be followed by a tail facing its flying direction. Tails consider the texture's left as their front.

In MDL, mdlvis saves the head setting properly, while changing tails to heads. If both are checked, it saves them both properly. If neither are checked, it checks heads.
In MDX, mdlvis saves both settings properly.

Tail emitters see extensive use in Piercing Thrust.



Segments



Each particle from this emitter will fade through the three colors, sizes, and visibilities (alphas), with each segment's duration decided by <Time>.




Misc




Rows & Columns - Used to indicate what's displayed for sprite textures, starting from the upper left.

Textures\Sparkle_Anim.blp
ReplaceableTextures\Weather\Clouds8x8.blp
Sparkle_Anim.png
Clouds8x8.png
4x4 sprite; 4 rows & 4 columns
8x8 sprite

Sprite Example.png
Layout for a 4x4 texture

Head (Life Span & Decay) - Animates sprite textures, starting from 0.
Repeat - How many times the component repeats its run during the particle's lifespan.

Clouds-Static.gif
Clouds-Sprite.gif
Head Span Blank.png
Head Span.png
Inputting 0 in all fields will only display the first image in the sprite.
Set this way, ReplaceableTextures\Weather\Clouds8x8.blp will fade through its first and last state throughout the particle's life.

Life Span - Time before the particle disappears and expires.

Tail Length* - Segment size only determines width for tails. This is the length; influenced by distance covered with regards to velocity (speed, variation, and gravity).

Priority Plane* - Used to layer/manually determine which particles are displayed on top of each other.

Unlike its Material counterpart, Magos' will not save this field in MDL; only in MDX. Adding it to an MDL through other means will make the model unopenable in Magos'.

Like its Material counterpart, mdlvis will erase its data.

Replaceable ID* - Inputting the following values will replace the TextureID:

1 - Team Color
2 - Team Glow
11 - Cliff
31 - Lordaeron Tree
32 - Ashenvale Tree
33 - Barrens Tree
34 - Northrend Tree
35 - Mushroom Tree
36 - Sunken Ruins Tree
37 - Outland Tree

Example usage in the Wisp, which uses Team Glow tails.

Time - The time allotted to each particle segment.

Time lower than 33% of Life Span will decrease the transition time between Segments 1 & 2, while increasing that for Segments 2 & 3.



Filter Modes


Filter ModeBehaviourCan be used in material layersCan be used in particle emittersOpacity (Alpha)Draw orderDepth setSort order errors with its own geoset

None (aka Opaque)
The geoset draws as solid, with no blend to the frame buffer.YesNoFixedOpaque queueOnNo

Transparent (aka 2 Color Alpha)
The geoset draws as solid except for regions over which the texture map alpha channel is black, where the geoset is completely transparent. The cutoff from transparent to solid is 75% white in the alpha channel.YesNoFixed or animatedOpaque queueOnNo

Blend
Standard filter mode using an 8-bit alpha channel texture and/or opacity channel. New pixel color and the current frame buffer pixel color are blended together using the new pixel alpha value as a blending factor.YesYesFixed or animatedTransparent queueOffYes

Additive
The geoset adds its RGB color values to the frame buffer (saturating at pure white),
causing a ghost-like glowing effect. Most spells use this to make glowing effects.
YesYesFixed or animatedTransparent queueOffNo

AddAlpha
Behaves the same as Additive, but cannot be used in particle emitters.YesNoFixed or animatedTransparent queueOffNo

Modulate
Pixels' color values are multiplied together; The geoset multiplies its RGB values to the
frame buffer, making a semi-transparent darkening of the background.
YesYesFixedTransparent queueOffNo

Modulate2x
The geoset first doubles its initial RGB values, then multiplies them against the frame
buffer. This technique causes both brightening and darkening in one pass.
YesYesFixedTransparent queueOffNo

AlphaKey (aka 2 Bit Alpha)
Behaves the same as Transparent, but cannot be used in material layers.NoYesFixed or animatedTransparent queueOff

Some filter modes that can be selected from the drop-down list in particle emitters cannot actually be used for particles; they only work in material layers.

Alpha Key was mistakenly designed by Magos as a particle emitter flag, even though it is actually a filter mode for particles; as a result, the flag is lost after saving MDX files; it remains when MDL files are saved, but the checkmark will not be visible when the model is reopened.

Modulate2x filter mode cannot be chosen anywhere and has to be added by editing the MDL file with a text editor, e.g. Notepad. MDL files with this filter mode cannot be opened by War3 Model Editor, while MDX files can be opened, but Modulate2x is converted to None after saving.

MDLX Converter can convert models that use Modulate2x in material layers, but only Retera's Matrix Eater and Model Studio can open and convert models with particle emitters that use this filter mode.


Some textures with alpha channels can be used with Blend, while certain black ones are fitted for Modulate. Most of the rest are only viable with Additive; with Add(itive) Alpha producing lethargic, or sometimes invisible, and generally erroneous results.



Blend removes the transparent parts. It is a staple of blood spurts, dark glows, and black smoke.

Additive removes the black parts, and lightens the texture. It 'adds' to what's in the background. The darker/the more colored an additive particle becomes, the weaker it is. Additive is a staple of light glows.

Modulate removes the white parts, and is used for GenericGlowModX.blp, among others. Cannot fade.
Blends are incompatible with other particles for the most part, and will flicker through each other in-game, if not in the Model Editor as well. This can be circumvented through the use of Priority Planes.

Flare.blp is a comparatively smooth and versatile light, and can be used with Blend in addition to Additive, as opposed to other glows.



Tips

  • Black and white colors are useful to prevent your effect from looking monotone, whatever your primary hue is. Use darker particles as cushions below the other particles, or colder colors as outliers, and lighter, warmer ones for the centers. For segment colors, it's recommended to go from light to dark as particles fade.
  • Use color variation to your advantage. Fade an emitter to a nearby color over its lifetime.
  • It is oftentimes better not to have constant particle size. For sparks, consider having their scaling at 0 for the third segment, while retaining high alpha. On the inverse, dust clouds look better when they fade to 0 alpha in bigger sizes.
  • Glows, glows, glows. Use them to give your effect atmosphere. Use smooth glows such as flare.blp for generic light, and thicker ones such as LavaLump2.blp for sparks. Some of the default colored glows are weaker and unsuitable for sparks, so consider using custom ones when necessary.
 
Things to Know

  • Individual particles cannot rotate independently, apart from tails forced to turn by gravity.
  • Particles will not scale with the models they're attached to, even if they're Model Space. Scale will still affect emitters' spawn field and velocity.
  • Using MDL/X Converter will remove Billboard settings for Particle Emitters.

In-Game Discrepancies
  • Gravity and Speed are calculated differently
  • Particles and their movement are rendered smoother in-game
Testing in-game/in-editor often is integral to effects, and modeling at large. Back up often. Good luck, have fun!
 
Last edited:
Level 14
Joined
Nov 17, 2010
Messages
1,267
This is incredibly useful. Understanding what each of those fields actually means is really helpful when it comes to making and manipulating existing particles.

nice job on this.
 

Retera

Tool Reviewer
Level 27
Joined
Apr 19, 2008
Messages
1,179
For any further reading I also recommend reading the code that powers open source rendering of WC3 particle emitters in replica technologies (below is written by Ghostwolf):

flowtsohg/mdx-m3-viewer

I've been working with a desktop game port of the code above on the LibGDX engine and it looks very War3-alike:

To me, it really shows how hard this guy worked researching not just how to edit the format, but exhaustively how to display it in a technical sense.
 
Last edited:
An update on current tutorial is much appreciated, I don't really understand the effect of the XY Quad even by reading the description you provided, most likely because I am not used with this context, haven't toyed enough with particle emitter, maybe add an example, e.g "This is usually checked for projectile effect".
Edited the description and added an example.
 

Kyrbi0

Arena Moderator
Level 35
Joined
Jul 29, 2008
Messages
8,720
This is fantastic. I don't know how we went so many years as a community without attempting to codify & understand such an integral part of an integral part of the community's tool-base.

The only thing this needs now, in my mind, is a copious amount of pictures (providing examples, both with in-game/standard SFX & perhaps a single "dummy SFX" that showcases each change), and a test map with a bunch of custom 'dummy SFX' to showcase stuff as well.
 
Level 18
Joined
May 29, 2013
Messages
1,536
Good job; it's about time someone made this.

You might want to explain the Rows and Columns (that are used when the particles are using sections of the texture at a time) and update the list of replaceable textures since it is incomplete; Replaceable ID 36 is used by sunken ruins trees (Doodads\Terrain\RuinsTree) and Replaceable ID 37 is used by outland mushroom trees (Doodads\Terrain\OutlandMushroomTree).

I suggest going a bit more into detail about filter modes; at least mention all of them that can be used in particle emitters.

Filter ModeBehaviourCan be used in material layersCan be used in particle emitters
Opacity (Alpha)Draw orderDepth setSort order errors with its own geoset

None (aka Opaque)
The geoset draws as solid, with no blend to the frame buffer.YesNoFixedOpaque queueOnNo

Transparent (aka 2 Color Alpha)
The geoset draws as solid except for regions over which the texture map alpha channel is black, where the geoset is completely transparent. The cutoff from transparent to solid is 75% white in the alpha channel.YesNoFixed or animatedOpaque queueOnNo

Blend
Standard filter mode using an 8-bit alpha channel texture and/or opacity channel. New pixel color and the current frame buffer pixel color are blended together using the new pixel alpha value as a blending factor.YesYesFixed or animatedTransparent queueOffYes

Additive
The geoset adds its RGB color values to the frame buffer (saturating at pure white),
causing a ghost-like glowing effect. Most spells use this to make glowing effects.
YesYesFixed or animatedTransparent queueOffNo

AddAlpha
Behaves the same as Additive, but cannot be used in particle emitters.YesNoFixed or animatedTransparent queueOffNo

Modulate
Pixels' color values are multiplied together; The geoset multiplies its RGB values to the
frame buffer, making a semi-transparent darkening of the background.
YesYesFixedTransparent queueOffNo

Modulate2x
The geoset first doubles its initial RGB values, then multiplies them against the frame
buffer. This technique causes both brightening and darkening in one pass.
YesYesFixedTransparent queueOffNo

AlphaKey (aka 2 Bit Alpha)
Behaves the same as Transparent, but cannot be used in material layers.NoYesFixed or animatedTransparent queueOff

Some filter modes that can be selected from the drop-down list in particle emitters cannot actually be used for particles; they only work in material layers.

Alpha Key was mistakenly designed by Magos as a particle emitter flag, even though it is actually a filter mode for particles; as a result, the flag is lost after saving MDX files; it remains when MDL files are saved, but the checkmark will not be visible when the model is reopened.

Modulate2x filter mode cannot be chosen anywhere and has to be added by editing the MDL file with a text editor, e.g. Notepad. MDL files with this filter mode cannot be opened by War3 Model Editor, while MDX files can be opened, but Modulate2x is converted to None after saving.

MDLX Converter can convert models that use Modulate2x in material layers, but only Retera's Matrix Eater and Model Studio can open and convert models with particle emitters that use this filter mode.
 
Last edited:

Kyrbi0

Arena Moderator
Level 35
Joined
Jul 29, 2008
Messages
8,720
Lovin' the pics.

Just a minor note: very good of you to credit & link back to Hermit's contribution, but may I suggest not doing the whole "giant quote" thing? Not only does it mess with the formatting a bit (tries to squeeze that whole table into a Quote block), but it italicizes everything which is weird.

Instead, you can just quote it directly (BBCode & text & such), with a bit at the top crediting Hermit (hyperlinked to his comment).
 

Retera

Tool Reviewer
Level 27
Joined
Apr 19, 2008
Messages
1,179
Priority Plane* - Used to layer/manually determine which particles are displayed on top of each other.

Unlike its Material counterpart, Magos' will not save this field in MDL; only in MDX. Adding it to an MDL through other means will make the model unopenable in Magos'.

Like its Material counterpart, mdlvis will erase its data.

if you know this, just go and fix them, okay??? it's our civic duty

Edit: or do you want us to suffer?
 

Attachments

  • War3ModelEditorSource.7z
    158.8 KB · Views: 14
  • visSRC.rar
    528 KB · Views: 11
Top