Particles; The Homicidal Aurochs

Daniel and I are crunching a little bit this week in order to meet an internal deadline. (“El Dorado”, named after the mystical city that doesn’t really exist and has never been found; we only chose that codename because “Titanic” was apparently used for a Microsoft product.) We try to avoid it as a general rule – after Dredmor, which was released after we  crunched for about three months, non-stop, the old batteries need time to recharge – and were more or less successful doing this for the Dredmor expansion packs; however, we’re a little bit behind where we want to be and we need to do a little sprinting until the end of June in order to get everything back on track.

Daniel is hard at work on aurochs this week – killing them, and butchering them for their meat. This led to twenty-five homicidal aurochs immediately rampaging your settlement and killing everybody before you have a chance to collect your firearm.  He has subdued them… for now.

It also turns out that the singular form of “aurochs” is, actually, “aurochs”. Who knew? David, apparently.

You may recall me mentioning back in May, or so, that I’d started work on a particle system and editor for Clockwork Empires. At the end of last week, I had some of the particle system done but very little editor functionality, having promised that I’d “get to it, yes” – and then ending up doing things like, say, combat or more work on dynamics lines or any of the things that I would rather spend my time doing other than a particle system.

Finally, David started holding things hostage. FINE. Particle system. Right. Good. Editor? Writing? Blech.

Monday morning, I fixed the improperly placed oven issue noted in last week’s blog post and started in on the particle system editor in earnest. First order of business: figure out what the artists needed. This requirements document came in the form of a bunch of whiteboard work from Mr. Triolo, which was promptly turned into a JIRA ticket. The most important thing that everybody wanted, seemingly, was a curve editor that could control parameters over time. Other than that, I was given a large list of demands for emitter types, various things to control, and told to start writing.

Two days of frenetic hacking later, here we are.

shot214

Properties for particle systems are controlled by the curve controller in the lower right hand corner of the window. The X axis of the curve controller specifies time, the Y axis of the curve controller controls the value of the property (ranging from MinY to MaxY and MinX to MaxX, specified in the two boxes above the window.) You can add new nodes by clicking, and delete nodes by right-clicking. Some handy functions for setting the curve to obvious things (all zero, all one) are placed in the bottom right hand corner of the screen.

Complicated curves can be applied to things like velocities over the course of the particle system’s life span:

shot215

Here you can see some particle spray from when the system swung about. We can also support multiple emitters, and various boolean per-emitter settings including emitter type (point, sphere, cone, field, etc.), whether blending is multiplicative or additive, and whether or not particle sprites should rotate. All of the properties are modular, meaning that I can add new properties to the editor for new types of particle effects any time I choose with a minimum number of new lines of code.

Here is a multi-emitter fireball particle system featuring two emitters layered on top of each other. The first emitter provides the fire, the second emitter provides the smoke. Note, of course, that these are Programmer Particle Systems and so anything the art team makes will look much better.

shot216

Furthermore, since the importer and the particle editor run on top of the same windowing system which we use for all our windows (in-game and in tools), you can have them both open at once. The goal here is to be able to preview how particle effects will look on models and during animations.

shot218

I still have a large list of things to do before we can check off “particle systems” on the TODO list. We need things like attractors and repulsors, as well as more types of things that are ‘sort of’ particle systems (tracers and beams, for rifle fire and electrical current respectively), and we need the ability to tie particles onto key frames and key locations of a character’s animation cycle or a factory’s work. Still, it’s getting there.

Posted in Clockwork Empires, Programming | Tagged , , , , , , , , , , , , , , ,
10 Comments

10 Responses to “Particles; The Homicidal Aurochs”

  1. Wootah says:

    Amazing work.
    Still doesn’t answer the question. How on earth do you write a particle editor in TWO bloody days? Has Nicholas found the Balmer Plateau?

    { reply }
  2. William says:

    With just the right amount of alcohol, anything is possible.

    { reply }
  3. Xyvik says:

    No! Not the echidna! HAS DAVID TAKEN KNUCKLES HOSTAGE?!

    The things people will do to get a particle system…

    { reply }
  4. yatima2975 says:

    The Ballmer plateau? Isn’t that somewhere in the Mountains of Madness? Or am I confusing it with the plateau of Leng again?

    { reply }
  5. Bropocalypse says:

    So now that you have the exhaust particles and red fezzes in the system, you can start on the little cars for them to drive around in, right?

    { reply }
  6. Thomas says:

    “…key locations of a character’s animation cycle..”

    Lighting people on fire

    { reply }
  7. Iunnrais says:

    Yatima2975: See http://xkcd.com/323/

    { reply }
  8. Pingback: Dev Links: Particle Man | The Indie Game Magazine - Indie Game Reviews, Previews, News & Downloads

Leave a Reply

Your email address will not be published. Required fields are marked *