+ Reply to Thread
Results 1 to 20 of 20

Thread: Non-Alpha based explosions

  1. #1

    Default Non-Alpha based explosions

    Anyone managed to do any decent explosions without resorting to alpha blending ?

    A few that came to mind is those you see in Metal Slug. Very nicely done/drawn.

    I am doing one based on a 2D particle system, basically a collection of
    animated non alpha explosions/smokes, which can then be used to make up
    other patterns/explosions.

    The easiest is to render an animated explosion but they won't look good
    without alpha. Do you guys know any good ways to generate explosions without the edges getting into the way ? I don't want to use alpha blending as this will require the 2D game to be done using 3D ways or I will have to put all bitmaps into system memory just to acomodate the software alpha blending if using pure directdraw.

    Here's mine.
    Attached Images  

  2. #2
    Senior Member
    Join Date
    Jul 2004
    Location
    Latvia
    Posts
    170

    Default

    Yours look too "whole", I think. its hard to tell from still shot, but maybe you should make them not too round, make the borders more jaggy and such. It could distract the eye and make borders less obvious. Oh, and make them short, go more for series of short, dynamic anims instead of one long. Once the eye has traced the pattern, it becomes hard to mask borders.

    Hehe, i dunno how murky it sounds to you.
    Freelance 2D artist.
    Portfolio

  3. #3
    Senior Member
    Join Date
    Jul 2004
    Posts
    377

    Default

    You can fake alpha using scattered pixels.
    Rainer Deyke - Eldwood

  4. #4
    Senior Member
    Join Date
    Jul 2004
    Posts
    1,216

    Default

    >scattered pixels

    dithering

    I suggest taking a look at older games (mega drive, snes and the like)... they had to do everything without alpha, too.

  5. #5
    Senior Member
    Join Date
    Jul 2004
    Location
    Malta
    Posts
    273

    Default

    Good point.. with 640x480 + resolutions, dithering on the transparency colour key or bit-mask should look even better than the older consoles.
    Nemesis

  6. #6
    Senior Member
    Join Date
    Jul 2004
    Posts
    1,216

    Default

    Ah... just thought about it a bit (by accident heh).

    You could render explosions the usual way (whatever that means). And then you have to do some stuff with the rendered images: pull out the alpha channel of em, convert it to 1bit (dithered), and put the image together again (rgb+your new channel). With some testing the result should look pretty good.

  7. #7

    Default

    Or you can use one big bitmap instead of several small. Just draw animation for one big picture of explosion.

  8. #8
    Senior Member
    Join Date
    Jul 2004
    Posts
    1,216

    Default

    Ye, that worked pretty ok-ish.

    http://people.freenet.de/ki_onyx/dither_ex.png ~21kb (8bit bitmasked image)

    Well, it's not perfect but I guess it's good enough for an example

  9. #9

    Thumbs up

    Onyx, wonderful!

  10. #10
    Senior Member
    Join Date
    Jul 2004
    Posts
    1,216

    Smile

    Another thing you can try out are alternating patterns for 50% transparency

    frame1:
    xoxo
    oxox

    frame2:
    oxox
    xoxo

    frame3:

    xoxo
    oxox

    etc

    This way each pixel is flashing (half animation rate) if it's fast enough it appears to be half transparent (like two alternating frames of ff0000 and 0000ff appears to be 7f007f). Older hardware (like the Sega Saturn) used this trick for emulating transparency.

    Well, let's say the animation runs at 30fps... that wouldn't look perfect, but you could for example alternate the pattern twice per animation (if your game runs at 60fps). So you get something like:
    -frame1 pattern A
    -frame1 pattern B
    -frame2 pattern A
    -frame2 pattern B
    and so on.

    However, you need to carefully think about how to do it, if you want to avoid glitches. Well, eventually you can use this trick for less tricky things (=without overlapping)

  11. #11
    Senior Member
    Join Date
    Sep 2004
    Location
    Suriname
    Posts
    148

    Default

    a simple Particles engine.

  12. #12
    Senior Member
    Join Date
    Jul 2004
    Location
    Isle of Wight, UK
    Posts
    3,773

    Default

    What's wrong with alpha-blending ?

    You can do 25,50 & 75% real quick in code. It's still read-modify-write but you should be able to get a lot done, even moreso if you dip into assembler.
    Regards,
    Paul Johnson

    [Great BIG War Game: iOS | Android] [Great Little War Game: iOS | Android] [Fruit Blitz: iOS | Android] [Yachty Deluxe: iOS | Android]

  13. #13
    Senior Member
    Join Date
    Aug 2004
    Posts
    173

    Default

    Anyone managed to do any decent explosions without resorting to alpha blending ?
    Try mixing floor clenser and aluminum foil together then throw it in the fireplace. Voiala!

  14. #14
    Administrator
    Join Date
    Aug 2004
    Location
    California
    Posts
    1,769

    Default

    For the past several years I have been using 8 bit alpha channels in my “2D” games using nothing but software blitters. (No hardware acceleration). You can do full 8 bit alpha blending in software. By “full 8 bit blending” I mean 16 bits of color + 8 bit of alpha. In other words, 256 levels of blending.

    In our older games we used a couple other approaches. One was basically a 3 bit alpha channel. We had pre-calculated tables for doing 80/20 blending, 60/40 blending, 40/60, and 20/80. The source art had 8 bit alpha channels but what the art was “processed” by our tools it was split into 5 separate RLE encoded layers. One layer was all the opaque pixels from the image, a separate “later” had all the 80% opaque pixels, another had the 60%, and so on. To draw the image we would first copy all the opaque pixels, then blend all the 80% pixels using one pre-calculated table, then bland all the 60% pixels using a different table. This worked great for anti-aliasing the edges of think like player sprites. Explosion which needed more levels of alpha blending ended up looking banded.

    Most expositions used a different method we called “black biased” blitting. It was using for explosions and other effects. It was basically variable alpha blending without an alpha channel. You just use the source pixels brightness as an alpha channel. The bright pixels are opaque or nearly opaque. The black pixels and transparent. And the dark pixels are translucent. If your art it 8 bit you can build a 64k lookup table to make this real fast. Read the source pixel and dest pixels, look them up in your pre-calculated “black biased” table and draw the result. It looked great for explosion in 8 bit games. No extra data in the art (no alpha channels at all) and no black edges around the explosions.
    Last edited by James C. Smith; 10-01-2004 at 04:57 PM.

  15. #15
    Administrator
    Join Date
    Aug 2004
    Location
    California
    Posts
    1,769

    Default

    Of course the newest game we just released (Wik) does use Open GL hardware acceleration. The software based alpha blending I was referring to was in Ricochet Lost Worlds, Ricochet Xtreme, and Lionheart

  16. #16
    Senior Member
    Join Date
    Mar 2004
    Location
    USA
    Posts
    666

    Default

    Quote Originally Posted by oNyx
    >scattered pixels

    dithering
    I apologize for being pedantic, but I think it's actually called "stippling."
    Jason McIntosh
    Otherwhere Gameworks

  17. #17
    Senior Member
    Join Date
    Jul 2004
    Posts
    2,186

    Default

    The non-alphaed explosions in games like Metal Slug do look wicked good, though. Better than most alphaed ones. Maybe even better than all alphaed ones...
    Anthony
    www.squashysoftware.com
    A slave to the ideal

  18. #18

    Default

    Quote Originally Posted by Anthony Flack
    The non-alphaed explosions in games like Metal Slug do look wicked good, though. Better than most alphaed ones. Maybe even better than all alphaed ones...
    With a bit of work you can recreate that style fairly eaisly (well a bit of work but it's mainly just going over and over it). The explosions in metal slug are basicly created using grouped spheres to give it depth.

    With his current animation above you notice how it is basicly one big sphere, with a yellow centre and increasingly darker, and more red shades to the extents of the ball of fire. Flames / explosions should have very little yellow in them at all, most of it should be an orange / red colour. As well as this you should move away from one central yellow point and have multiple sphere like shapes, simmilar to how you would draw a cloud.

    Secondally your flame / explosion has no smoke assosiated with it. When something like an explosion happens, it's going to generate some smoke around the outside of the flames. The smoke, however, is not going to be around the whole of the flame but mainly where the fire has been, eg the bottom and sides.

    With brings me to the last point, you flame should just disapate into thin air, it should billow upwards and fade out. Yours looks a little strange as it doesn't billow, it just dissapates out like mist.

    I've attached a Metal Slug explosion.

    If you have a look you'll notice how there isn't really a centre point of the flames, the billow up and smoke is produced. It's a great effect.
    Attached Images  
    Last edited by Screwball; 10-03-2004 at 02:07 PM. Reason: I hate angelfire.

  19. #19
    Senior Member
    Join Date
    Aug 2004
    Location
    Portland, Oregon, USA
    Posts
    146

    Default

    Looking at Jason's screenshot, the thing that strikes me most is the fact that all the smoke clouds are the same size. He needs to make the clouds different sizes (and have them slowly "disintegrate/dissipate"). It's an art problem, not a code problem. Lots of games make good explosions without using alpha. (like umm, every game made before 1990....) Take a look at some old arcade games (via MAME) - tons of great explosion examples with no alpha used..

    Chaster

  20. #20

    Default changes

    I've made some changes to the smoke/fire anims.

    Basically it's still a particle based system, it's meant to be a bit exaggerated
    in it's own style.

    And yes, it only looks good in animation sequence, not in a still shot. :-/
    Attached Images  

+ Reply to Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts