A couple of weeks ago Thomas Schmall posted an article about the new particle systems he was working on. I finally got around implementing the last system, the spark particles.

I would like to show you two ways we can use this particle system, and give a brief insight in how the Caromble! Editor can be used to place and tweak it.

The first way of using the system is to emulate sparks generated by something like welding. They spray out in a coherent beam.

timer

Timer trigger that triggers every 2-5 seconds and send the trigger to a particle system

This effect works best if the sparks aren’t spawned all the time, so I’ve used a timer to spawn a spray of  particles every couple of seconds. In the screenshot to the right you see this timer. I’ve set it to send an event every 2-5 seconds.

Now we just need to place the actual spark particle system itself, and fiddle with the parameters a bit to get the effect we want.

I’ve included a screenshot of the relevant bit of the editor screen below. Five properties are important for this effect.

First of, it is important to set the release rate (very) high. The release rate is the amount of particles we’ll spawn per second, and since we’ll only spawn particles every once in a while, we need to spawn a lot of them in this small period of time.

A less obvious parameter is the “ContinuousParticles” property, which is ticked of to indicate that we’ll provide external triggers for the particle system.

The important settings for the spark particle system.

Next to that is the “PulseDuration”, which determines how long we’ll spawn particles after every trigger.

The collision object property determines which objects the particles will bounce of. For performance reasons we won’t bother the physics engine with all particles, so you’ll have to provide a list of objects with which the sparks can interact.

Finally the “MaxAngleRadian” property determines in what direction the particles will be spawned. Since this is meant to be a coherent spray, I’ve set the angle fairly low.

Alternatively the spark particle system can be used in a more continuous way, as shown below.

 

To use the sparks in this way, you don’t need an external trigger, the particles will continuously spawn, and Perlin noise is used to control the release rate of the particles.

Again I’ve highlighted some important properties for this system.

The upper triplet of properties control the release rate animation in a somewhat mysterious manner. The “FractionOff” number corresponds to the fraction of time that there should be very little particles (the lower bound of the release rate). The “ReleaseRateAnimationSpeed” determines how fast the animation over the release rate is running.

The other five highlighted properties determine the way the particles look. The “MaxAngle” is much higher than it was in the beam example, it now corresponds to a halve sphere. The “StartSpeed” and the “Gravity” property together control how the particles will act after they have been released. They have to be tweaked together to achieve the desired effect.

Finally the “MinLifeTime” and “MaxLifeTime” parameters dictate how long the individual sparks will exist on this planet.

With that I’ll conclude this post. I was hoping to provide a small peek into the daily live of us Caromble! developers, and about the tools we have made to work with. We might release the editor with the game (or at a later stage) so you might get a chance to tinker with it too.

Also, if you have any questions or suggestions, please don’t hesitate to ask!

« »