Tag Archive: Particles


Making Sparks with Caromble! Engine

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!

Particle Animations

On the art side I can slowly move towards polishing, as at least the industrial set is basically finished. One thing that I really want to tidy up are the effects. My thinking is that if they are in style, then the whole look will come together much more.

The effects were so far really soft – and somewhat realistic. Which doesn’t fit to the more comic-outline style of the textures. The explosion for example is done via an animation. So I redid the thing and animated it in a more cartoonish style:

Here is a smaller hit animation – that will show up when boxes are damaged (that effect is not yet in the game):

hit particle

A smaller hit.

It would be combined with smoke, and also sparks. Here is the animation for it, which would only really work in motion.

Spark animation

A spark – supposed to be many that fly around.

And here is the explosion.

particle explosion

Explosion!

Here are some screenshots of the explosion in action.

Juicy Particles

A few weeks ago I attended the Control Conference in Amsterdam and saw two very interesting presentations. One was by Martin Jonasson (Rymdkapsel) & Petri Purho (Crayon Physics) called Juice It or Lose It. They demonstrated some techniques for making your game more alive, or responsive and their presentation showed how much more fun a game becomes when you add more and more feedback to the player about what’s happening.

The second one was by Jan Willem Nijman from Vlambeer (Ridiculous Fishing) called The Art of Screenshake. Here, Jan Willem shows how adding ‘small’ details like recoil and screenshake can turn a game from being kind of boring to an awesome bullet fest.

These presentations inspired me to do some extra Juicing myself (no pun intended), to make Caromble! more alive. As our game is getting more and more complete, we are looking for ways to make the gaming experience of Caromble! more engaging. One of the ways to do this is by adding more feedback to the player. Show what is happening ALL the time! Show the relations between objects and actions. Show that some things are about to happen or that they have just happened. To improve our communication with the player, I have created 3 particle systems. For the third particle system, I will also explain what it does in detail, but words will probably be less impressive than seeing it in action.

In Caromble!, each level is divided in multiple subareas. To reach the next one, the player needs to activate a portal. This is often done by destroying x amount of objects in that subarea. After an object was destroyed, the portal would magically fill with red portal goo. This sounds like something that could use some extra communication. With the new particle system, each destroyed object spawns particles that are shooting towards the portal. Now the magic filling of the portal makes more sense, plus it looks pretty.

In the later chapters of the game, we introduce switches. Switches can do all kinds of things when hit by a ball. They can open a door, lower a ramp or activate another switch. The player can see the causal connection between the two, because the effect happens immediately. However, it is so much nicer (and improves the anticipatory feeling) if the switch shoots some particles to the object that is influenced. Adding this effect makes particle system number 2.

The third particle system is the one that looks the best in my opinion. Previously, our powerups would just… well… appear out of thin air. The ball hit a powerup, then it was gone, but a few seconds later: Poof! a new one was back again. Now, we have a particle system that precedes the spawning of the powerup. Niceness!

Let me explain how this last effect works in detail. I created 6 emitters that each spawn around 100 particles a second. A maximum of 50 particles can be alive per system, so older ones are removed by newly created ones. The particles have a varying lifetime between 0.1 and 0.4 seconds and have a start and end size between it linearly interpolates. Perlin noise forces are added to the particles to give them some randomness.
Initially, I position these particles at the bottom of where the powerup will be spawned. These emitters are distributed evenly at a radius r (= halfwidth of the powerup). The particles will get the color of the corresponding powerup (for now they are green).
Then for the first 1.5 seconds, the particles will rotate around the circle defined by r and will move up till they reach the top of where the powerup will be spawned. During this movement, the circle over which the emitters rotate will linearly transform to a circle with a radius of 0.2 * r. Now, for 0.5 second the particles will stay at their place and become white.
Finally, for the last 0.3 seconds the particles will move down (without rotating over the circle), but the radius of the circle will linearly grow back to again. Stir all of these ingredients well, put it in the oven for 30-45 minutes and voila, a particle effect for spawning a powerup has been created.

To see all of this new juiciness, please check it out below. Disclaimer: Thomas Schmall is currently working on a funky ass model for the powerup, so for now we have to make do with a green cube.

Furthermore, we wish everyone a wonderful and sparkling 2014, the year Crimson Owl Studios will bring Caromble! to your PC, Mac and Linux.

 

Particle Improvements

soft_particlesSince the release of Caromble! is getting closer and closer, we spend more and more time juicing things up. Basically this means adding lots of special effects in places where a player expect feedback from the game. For example, showing sparks and smoke when the ball hits an object.
A lot of these effects are implemented through particle systems: you blend lots of 2D textures on top of each other to get a nice volumetric effect. This Friday we added some improvements in the rendering of particles.

The first problem you have with these flat particles is that you get creases where the particle intersects with the other scenery (see the ‘disabled’ image). Luckily, these artifacts are pretty easy to clean up. Since we already have the distance from every pixel towards the camera, we can easily fade the particles near the intersections. As you can see in the ‘enabled’ image, no artifacts!

The second issue we had is that some of our particles have very high velocities. A particle traveling with a high speed might cross the whole width of the computer screen within just a few rendered frames. This causes the particle movement to look choppy. But why does a ingame particle rendered at around 60fps looks choppy while a moving ball in a movie (typically 24fps) seems to move smooth? The answer is simple: Motion Blur.
For a good example about the importance of motion blur, check this website.

While I would love to add full scene motion blur, we would have to change too much of the rendering pipeline to get it to work (and it would strain slower hardware too much as well). Therefore, we chose to only fake motion blur for particles. Doing this is very easy, we simply stretch the particle in the direction it is moving in (screen space) and fade it depending on its speed. This will make the particle movement seem a lot smoother.