Thursday, July 14, 2011

I dreamed of the JADE SFX & animation system...

By which I mean the system required in order to visualize spell effects (bolts, missiles, explosions) and other missiles. JADE currently does not yet have any code infrastructure for that but tonight I really envisioned it while sleeping. Sometimes I am amazed - I love my subconscious for doing my work while I rest ;-). Here we go with some details:

  • Internally JADE uses a time based queue filled with so called actors that make things happen.
  • Basically every 1000 ticks (the smallest time unit) something happens although this is differentiated by individual speed.
  • Now a missile - or an explosion or a bolt for that - is just a specialized actor that happens extremely often (e.g. once every tick or three) and implements the animation and the resulting effects on the environment.
  • E.g. a fireball would at first fly to the target location once every tick and then the explosion would increase its radius by one for every tick until the maximum extend is reached.
The benefits of this are:

  • a great integration into the existing action system,
  • a rather trivial implementation and
  • an animation infrastructure that allows for a tiny chance for beings to act at least once before an animation is finished. Thus on very rare occasions beings might be able to get out of the way of a bolt or an explosion. 
As beings move much slower than the animations this will be rare but IMHO it adds a wonderful new dimension to the whole system.

Ok, enough for today - back to work.


  1. Magics! This is the one feature i've really been looking forward to for JADE.

    Will your new magic animation system be able to do multi line graphics. like -
    Magic missile:

    @----- g

    Multiline blast:


    (sorry if this looks jumbled, as the comment preview doesn't seem to be monospaced)

    Sorry about the rant. Ever since being inspired by ADOM's spell gfx i've always drempt of multiline versions for my own projects.

  2. Very, very cool idea.

    You will probably need some threading trickery so that animations are slow enough to be seen, though. Currently a turn is instantaneous, and you say it spans 1000 time units. So I guess you will need some kind of extra flag indicating that an animation is playing so the world simulation should sleep X milliseconds per time unit, right?

    An extra-hard achievement for pro players would be to get so much speed (eating loads of quickling corpses or something) that they would move as fast as the animations :)

  3. Another advantage that you haven't mentioned in the post is that this system allows you to easily add interactions between spells and missiles. For example, a fire bolt and an ice bolt meeting in the air could cancel each other, or even cooler, a bolt meeting a thrown potion could make it break in the air instead on when hitting the target, etc.

  4. It's really cool how one awesome idea inspires more awesome ideas. :)

    I'd wager on it being easier to escape a projectile coming from afar if the character has a high movement speed and low energy cost for doing so?

  5. I am imagining a world where projectiles move at different speeds, and I throw a potion, then draw a bow and shoot it before it hits anything.

  6. Class powers that slow missiles so you can escape!

    Spells and skills that shift direction of things in midair!