Two Englishmen, alone in the desert and unfamiliar to one another, will politely discuss the weather. I will always believe this to be true.
To create the semblance of a sandstorm in our level we're going to use the Legend particle system. Particle systems are a method of representing fluid motion behaviour in the clunky and resistant world of real-time 3D polygon rendering. Basically, it works like this: a sprite is an essentially two-dimensional image that exists in the 3D environment. It is programmed to always orthographically face the player's view, so you can walk around it, jump on top of it or squat-down and look underneath it and it always looks the same. Particle systems eject a number of sprites and then modifies their movement within the game to represent anything from smoke to flames to hopefully clouds of wind-driven sand.
You might have noticed some of the plumes of volcanic smoke that rise out of the desert in the screenshots from previous Fools Rush In articles. These are created as particle systems. A 'smoky' texture is applied to the generated sprites then a complex system of rules are applied that do things like 'grow' and 'shrink' them over time, change the rate a which they are emitted from the source object, or rotate each particle slowly and by varying rates. You can fiddle with this stuff for hours, as you can imagine.
The most recent versions of the Unreal engine have the Unreal particle system in them. When Unreal 2 was made the 'official' particle system wasn't in place and Legend had long finished and implemented their own solution before that had happened.
The end result for us is that again there is next to no information on the specific foibles of the Legend particle system. In fact the only information I could find of any use to us is this short and basic tutorial by ex-Legend designer Scott Dalton written nearly two years ago. Not that I want to appear to be ungrateful, it'll certainly give us a start on figuring out what's going on.
Particles are generated during the game by objects called Particle Salamanders. Here's one:
For a sandstorm we wants lots of massive 'sand cloud' particles blowing all over the place, obscuring vision and generally being confusing. The first thing to do is locate a likely texture.
Rooting through the SpecialFX package in the Unreal Editor I found this one:

...in the 'debris' section. Following through Scott's tutorial we select the Rotating Particle template and stick the address of the 'dust cloud' texture in the sprite section. Before we leave this section we'll change the drawing style of the texture from 'STYLE_translucent' to 'STYLE_alpha'. The former renders the sprites additively, which can make them look bright and wrong for wind-blown sand whereas the latter just determines the transparency of the particle based on the images stored 'alpha channel'.
Like this:
The next thing to do is think about how we want these dust particles to emit. In the 'Particle Salamander' section of the properties we can find the parameters for emission. The spread factor defaults to 0 degrees which results in a straight line of particles so we'll change that to be 180, giving us particles emitted in a hemispherical pattern. Volume determines the number of particles this Salamander will have in play at any one time. I'm going to set this to ten, which is a bit on the low side, but the reasons for this will become apparent in a second. Let's have a look at it:
Well immediately there are a bunch of problems. Firstly, the particles are way too small for this density, secondly they blink on and off unpleasantly. Both of these we can solve by adding Forces. Forces are additional effects we can add to the particle generation to modify the way they are presented. To fix the size issues we can add a Resize Force. By setting the parameters to start the particles off large and get slightly larger we can fill the emission volume with semi transparent dustclouds. This was the reason for the low volume before. The end effect will see lots of these Salamanders dotted around the map and we only have a finite amount of processing power after all.
To stop the blinking effect as particles are born and die we add both Fade In and Fade Out forces. Just as the names suggest this means the opacity of the dust particles slowly ramp up from nothing to fully visible when they first appear and reverse the process as they time out. As an additional effect we can add a Rotation Force that will twist the texture slightly in a random manner.
Overall we get a mish-mash of particles at varying sizes, at varying degrees of rotation and varying opacities all splurged together to give us a fluid and shifting appearance all generated from the same single texture. Pretty clever.
The next phase is to transfer the effect to the game map and figure out how we're going to start and stop the sandstorm on an Event.
This turns out to be a tricky one. In the property sheet we have to find the ParticleGenerator section and change the bOn property to 'false'. But that's not all! Here at AB's Used Games Lot we don't just want you to edit one property, we want you to feel like you're getting your money's worth so we'll shuffle down to the TriggerSupport section of the property sheet and click 'false' on a property called bInitiallyOn too. Don't ask me why we have to do that, we just do. Setting the tag property to be something we can send an Event to works just the same as before but listen to this next bit closely, because this is one of those 'character-building' things that sorts out the pasty-faced, limp-wristed boys from the Real Men. You have to go to the little noticed and often-overlooked 'object' section of the property sheet and change InitialState from the innocuous 'none' to 'TriggerTimed'. Many Bothans died to bring us this information.
The 'TriggerTimed' part means that not only can we trigger the ParticleSalamander but also that once triggered we can determine the duration it will emit for, effectively determining the duration of the sandstorm.
One particle Salamander does not a sandstorm make, so we should cover the map with them. This could turn out to be an expensive operation as even with each Salamander only generating 10 particles it soon adds up. Big games companies have to account for all kinds of systems and capabilities and mostly likely do lots of testing on target machines to make sure they are within limits. That's going to be difficult for us, other than what info we can get back from a playtest but I'm counting on the fact that the Unreal 2 tech is a few years old now and at the rate hardware moves along I think we're pretty safe.
Although we determined the angle of spread of the Salamander with the Volume setting under the ParticleSalamander section of the property sheet there is also a section called EmissionOffset. Here we can define two values, a minimum and a maximum, which resolve to a random distance from the emitter that a particle can appear. Adjusting that gets us a bigger hemisphere, increasing the ground we can cover with one Salamander.
It's important to note that a lot of this work is trial and error to get the best effect. And because of the um, unpolished nature of the particle system code many trials result in errors that manifest themselves as you staring at your desktop wallpaper, wondering where your map went while your computer raises its eyebrows innocently as if to say 'what?'
OK, so we can see it works but for a bit of extra drama why don't we trigger the Salamanders in 'waves' starting with the rows furthest away from the bunker and advancing towards it. That way we might achieve the illusion that the front of the storm is coming towards us.
That's pretty simple to implement, we set up a Dispatcher to trigger three events consecutively with a short delay before each, Storm1, Storm2 and Storm3. Then we assign the event name to the salamanders in the appropriate areas. So Storm1 Salamanders fire first, then the Storm2 ones as the front advances across the map and finally the whole shebang is engulfed when Storm3 is triggered.
We set the overall Event name SandStorm to this Dispatcher and we have another Event to update on the plan.
Here's the storm on the horizon...
...ominously building in the middle distance...
...taking shelter in the bunker as the sand engulfs it.
Lucy: Did you see that? Something moved out there...
Beth: I can't see anything in this.
Lucy: Something... This'd be perfect for them. Perfect cover to flank us.
Sarah: The Spooks are too chicken to maneuvre in this shit.
Anna: They probably have biosignature imaging. It's standard issue.
Sarah: Oh, great.
Next time, we'll skip over the Izanagi events to do the Dropship coming in to land.