Gamasutra: The Art & Business of Making Gamesspacer
Tutorial: Simple, High-Performance Particles for Mobile
View All     RSS
August 15, 2018
arrowPress Releases
August 15, 2018
Games Press
View All     RSS
  • Editor-In-Chief:
    Kris Graft
  • Editor:
    Alex Wawro
  • Contributors:
    Chris Kerr
    Alissa McAloon
    Emma Kidwell
    Bryant Francis
    Katherine Cross
  • Advertising:
    Libby Kruse






If you enjoy reading this site, you might also want to check out these UBM Tech sites:


 

Tutorial: Simple, High-Performance Particles for Mobile


May 20, 2013 Article Start Page 1 of 4 Next
 

When it comes to game development, is there really a silver bullet?  Perhaps, but from what I've found, you have to shoot a lot of bullets and shoot 'em fast.

 We all know that the current mobile casual-gaming world poses many challenges for developers. It's tempting to imagine the game we're working on as the next Angry Birds or Cut the Rope, but that's more like winning to lottery -- we can't really count on it. Managing your investment and risk is distributed among many smaller titles can be a key strategy in determining success.  To do that, we need our game development process to be as efficient as possible.

One of the areas where cost can be managed is graphics. There is no arguing that beautiful results can be achieved in 3D, but that doesn't mean "2D sucks." In many aspects, developing 2D is quicker than 3D: Assets and game engines are quicker to develop, while with a good artistic eye we don't have to settle on "coolness" and the value-to-player.

During my experience at Playscape (formerly MoMinis), we've implemented 2D effects with the most basic building blocks that every 2D engine should offer. But before we go into those, some background:

The Playscape Platform started as a rapid game development platform for J2ME, before the "iPhonedroid" revolution. At the time, the engine was limited to MIDP's capabilities, which included simple bitmap sprites and right-angle rotation.

When the platform was ported to Android (and OpenGL) we decided to preserve simplicity for our game developers, and limit the Android renderer by the same constraints imposed by J2ME.

This was a long time ago.  Since then, J2ME almost disappeared from Playscape's target markets and OpenGL ES became a standard for mobile games.

But even though we ditched J2ME for some time now, we were still bound by the MIDP limitations. This happened mostly due to more pressing business concerning our game development pipeline (we were releasing a new game every two to three weeks).

Eventually, we came to the conclusion we cannot just stop everything to modernize the platform. Instead, we decided on a very limited set of features that every 2D engine should have:

  • Free rotation around a pivot point (with angular speed and acceleration)
  • Free scaling around the same pivot;
  • And color "tinting" -- application of an RGBA color to a texture with MULTIPLY combiner

For portability reasons, these features are implemented on-top OpenGL ES 1.1. Apparently, this is enough for some nice looking particle effects.

Now, let's take a look at some specifics:

Particle Systems

In 3D and 2D, particle systems are used extensively to simulate a variety of physical phenomena and special effects, such as: Fire, smoke, blood, magic, sparks, rain, water, grass and many more.

A particle system is essentially an emitter object, which has shape and size, which creates particles according to certain rules. Each particle that's created receives a variety of attributes form the emitter and environment, such as speed, color progression, direction, rotation and time-to-live.

The idea is to combine and blend many of these basic particles in a way that create pretty and complex effects:

(The above is a single emitter which emits about 40 particles a second, each with a random fade duration, grow, speed and angular speed. Particles fade from opaque-red to transparent-black as their end-of-life approaches. The smoke textures are grayscale, so any smoke color can be generated with the same assets as we MULTIPLY the texture's color).

Illumination and Occlusion

If we keep it simple, a pixel blended to the pixel buffer can either occlude the existing pixel, or illuminate it.

Smoke or blood occludes the scene, while sparks, flames and flares illuminate it. However, a particle system isn't limited to one of these -- consider a torch particle system -- A particle starts as an illuminating particle (flame) but as time progresses it transforms to an occluding particle (smoke). Therefore, we need to support both effects, sometimes in the same particle at the same time. 


Article Start Page 1 of 4 Next

Related Jobs

Velan Studios
Velan Studios — Troy, New York, United States
[08.14.18]

Lead Producer
Crystal Dynamics
Crystal Dynamics — Redwood City, California, United States
[08.13.18]

External Lead Producer
Bohemia Interactive
Bohemia Interactive — Mníšek pod Brdy, Prague, Czech Republic
[08.10.18]

Project Lead
Deep Silver Volition
Deep Silver Volition — Champaign, Illinois, United States
[08.09.18]

Associate Producer





Loading Comments

loader image