Particle Effects

From BiaSDK
Jump to: navigation, search

In this next section we will be going over the basics for using BIA EIB's Particle System Editor to create some black smoke plumes during the bomb explosions.

The Particle System Editor can be accessed by going up to Tools and then selecting Particle System Editor. A new window will pop up which is used for editing all the attributes of your Emitters. Emitters can also be edited through the Property Inspector, but the Particle System Editor really makes things much more manageable to work with.

First we need to add a new Emitter to our level, this is done like any other Actor, in the Actor Class Browser scroll down in the right column and find Emitter, then right click and add one into the level somewhere visible around the explosion triggers.

Then change it's Tag from Emitter to PFX_Smoke_01. Now we can begin creating our Particle Effect, the first thing to do is turn on the real-time preview in our 3d view, click on the joystick on the toolbar related to the 3d view, or hit P.

Make sure the Emitter is selected, then open the Particle System Editor. Click the Add New Emitter button, its the second one from the left. There is also an option to use the Particle Effect Wizard, which is very useful, but for tutorial purposes we will do this step by step.

After clicking Add New Emitter, you will be prompted to select the type of emitter, along with a name. Just keep it as Sprite Emitter and name it "smoke".

Once this is done, a new Tab will have appeared, labeled, smoke, and in our level there should be some type of bright blob where our emitter was placed.

Step 1 - Changing the texture

Click on Texture, located under General in the Particle System Editor, we can browse textures using the Texture Browser, the most useful package is t_effect, using the Particle category. The texture to use for this is t_effect.Particle.smoke_lit_a you can simply copy and paste that into the field for Texture, or find it in the texture browser and click the Use button in the Particle System Editor.

After changing the texture, our bright blob will have changed into 4 bright blobs.. this is due to the texture having 4 frames, but lets first set the Draw Style to Alpha Blend (currently set to Translucent). The various Draw Styles have plenty of uses, it's all up to your creativity and needs.

Right under the Draw Style drop down list, there are 2 fields for the Number of U and V subdivisions.. currently set to 0, lets change these both to '2', since our smoke texture has 2 frames across and 2 frames down.

You will now notice that our smoke is 1 blob, and animating crudely in the level. Wouldn't it be much nicer if the frames blended together, randomly, even Simply put a checkmark in Blend Between Subdivisions and Use Random Subdivision. If this were an actual animation in a special order, you would define the Subdivision Start and End.

Step 2 - Movement

Ok, we are done with the Texture section, lets get these particles moving.. Click on Movement, further down the list. This is where things may seem overwhelming, as there are a lot of variables that affect our particle's behavior.

What we are interested in is the Start Velocity section, this controls how fast our particles will move along the X Y Z axis. We know that smoke rises, and that is along the Z axis with how things are currently setup. So lets first change the Z Max to 100. Once that is changed, our particles will begin moving up, at different speeds.. using 0 as the minimum and 100 as the max. If we set Z Min to -100, some of the particles will be moving downward also...

You can also control this by clicking the Lego-Block buttons... Blue and Red use the Min to Max format, Blue and Blue just use a set number, and so all particles move at the same speed, Red and Red use mirrored numbers.. so if it was 120 on the Max, the Min would be set to -120 automatically.

Also, if you click the checkmarks along the right side, the same numbers will be used, ex: if the X axis had a checkmark, and the Z did also, Z would be linked to X, and using X's settings.

For now though, use these settings: X min -20, X max 20 Y min -20, Y max 20 Z min 50, Z max 100

So we have our smoke moving up... but its kind of popping in and out of view strangely.. plus it should be lasting a lot longer.. Click on Time, and set the LifeTime to 30. Cool, our smoke will stick around longer.. but now its very sparse.. Click back on general, and change the Max Number of Particles to 64, that solved that problem.

Now if you click on Color/Fading, we can adjust how our particles fade in and out over time. There is a slider for Fade-In End Time, aka the time at which our particle will be fully faded in (to the opacity %), and there is also a slider for Fade-Out Start Time, aka the time our particle will begin fading out to 0%.

Lets set the Fade-In time to about 2 seconds, and the fade out start time to roughly 20 seconds. Our popping problem is fixed, but since our smoke has the choice of moving in both directions along X and Y, its getting more and more spread out towards the end, it would be nice to have the smoke particles increase in size, wouldn't it?

To do this, just click on Size. Under Start Size, click the lego-blocks to change them into Min & Max, set the Min to 100, and the Max to 300.. now our Smoke particles will start in that range.. The next thing we want to adjust is Size Scale.

Put a checkmark in Use Size Scale, then uncheck Shrink Particles Exponentially. After doing that, click the Insert button, underneath Size Scale, twice.

You may have to scroll down a bit now, we have two new sliders, move the second one all the way to 100%, now set the Relative Size of the first to 1, and the Relative Size of the second to 3. This is telling our particle to start at a scale of 1x, and end at a scale of 3x.

The next thing we can do is give each particle a random rotation and slow spin. Click on Rotation, put a checkmark in Spin Particles, set the Start Spin Min to 0, and the Max to 1, now the particles will randomly pick a rotation and not look so orderly.

Next thing to change is Spins Per Second, it needs to be slow, so set the Max to 0.05.

The rest of the options in Rotation can drastically effect how your Particles effects look, and are worth experimenting with.

But for now, lets give our smoke particles some constant acceleration over time, so they aren't all just going vertically. Click on Movement again, and under Acceleration, change x to -5, and y to -10

Our smoke will now start accelerating off gradually, as if it was blowing in the wind.

It still looks a bit odd, so we should probably tweak the Color and Fading some more.

Drop the Opacity slider down to 50%, that looks better already! Lets try messing with the Color Scale, put a checkmark in Use Color Scale. This works similar to the Size scale, except with colors.. For now we will just use the two preset colors.. double-click on the starting color to use the color picker.. a dark, low-saturation reddish-brown will look good. Pick one yourself, or use these values R: 50, G: 45, B: 40, A: 255

We are going to leave the ending color white, as it helps with making the smoke look like it is dissipating in the air as it fades out.

I'd say that just about does it for our smoke, but before closing the Particle System Editor, click on General, we want to put a checkmark in Disable, so that our smoke won't start when the level loads.. but when we trigger it!

Then you might want to move the Emitter to somewhere else, I ended up moving mine off beyond a hedge, so it looks like some of the explosions caught something on fire, but in an area inaccessible by the player. You can also easily duplicate the Emitter (ctrl w) and create multiple plumes of smoke, just be sure to label their Tags differently.

Now, in our TS_P47_Scene script, add a line to Trigger the smoke, I placed mine just after the bird animations play.:


Back to Main Page