Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

"True Explosions!" framework for ray based explosios. [Published. Free]

Discussion in 'Works In Progress - Archive' started by marserMD, Aug 30, 2014.

  1. marserMD

    marserMD

    Joined:
    Aug 29, 2014
    Posts:
    191
    Check out the teaser:


    AssetStore link

    Hi!
    My name is Michael Panin (aka @marsermd) and I am making a unity plugin for creating physical realistic explosions. I've watched official tutorials and I've looked into asset store and I am terrified.
    The most popular way to emulate an explosion effect is to apply an explosion force to all objects in some radius, which is nice and easy, but not accurate.
    For example if there is a wall between explosion center and some object, explosion force will be applied to this object though it shouldn't.
    I introduce ray based approach for explosions simulation. It doesn't include complicated physics emulation, so it is not accurate as well. But it is much better than using OverlapSphere.
    So. Let's check out situations where ray based approach could be useful.
    1. explosion on the one side of the wall and object on the other side. Check out my masterpiece:
    2. explosion impact through reflection
    3. explosion force which affects only part of an object

    Okay. Now you know that I can.. khem.. Draw. But I have something done as well. Check out this video.


    So I am creating a free explosion pack and I'd like to know: what do you think about it, guys? Should I add something? Maybe my particle effects suck (yes, they do ): ) Maybe I should add something?
    In a few days I'm going to publish following pack:
    1) explosion script itself and an API to add effects onto it
    2) particle and light effects
    3) volumetric explosion graphics (pseudo, according to this article http://stevencraeynest.wordpress.com/2013/03/29/easy-volumetric-explosion-in-unity3d/) (half-baked)
    4) volumetric explosion, based on particles, fair calculated based on raycast info.(in plans)
    5) 2d explosions and 2d effects.

    UPD 30.08: added volumetric explosions


    UPD 02.09: have made an alpha version of a heatwave generation. It was harder than i thought.


    UPD 12.09: finished the job and made a teaser;)

    UPD 23.09: Released! Wow. http://u3d.as/9jR

    You can follow me on twitter to stay tuned: @marsermd
     
    Last edited: Sep 23, 2014
    Firlefanz73 and hopeful like this.
  2. hopeful

    hopeful

    Joined:
    Nov 20, 2013
    Posts:
    5,676
    What if your walls (floor, ceiling) can absorb some energy before becoming damaged themselves and passing energy through?

    Many of us use destructible items.

    Next: what if a section of wall is already damaged (by an earlier explosion or other thing) and only has a little resistance left?
     
  3. marserMD

    marserMD

    Joined:
    Aug 29, 2014
    Posts:
    191
    H
    HI, hopeful. Thank you for your reply.
    Obviously, behaviour of my algorythm depends only on colliders, not meshes, so it will behave depending on colliders generation. AND my algorythm spreads explosion over time(as in real world). So if the wall is destructed/damaged in fixedTimeStep number n, explosion will affect objects behind the wall and generated wall parts in fixedTimeStep number n+1. I don't have destructable items, so I can't make an appropriate demo scene, but you'll have the ability to play around after the release. The code will be included and won't be obfuscated.
    The energy absorbation is easy to implement because after the ray hits the surface, a new ray is emitted. At this place we could change the energy of emitted ray if necessary. But, I guess, the absorbation should differ based on some surface parameters. That's what i don't whant to implement because it'll slow down the hole algorythm(every hit should get some info about components of the hitted mesh. It doesn't sound like a fast thing). But, as i said, it is easy to implement.
     
    Last edited: Aug 30, 2014
  4. marserMD

    marserMD

    Joined:
    Aug 29, 2014
    Posts:
    191
    Update: added volumetric explosions
     
  5. marserMD

    marserMD

    Joined:
    Aug 29, 2014
    Posts:
    191
    Update: have made an alpha version of a heatwave generation. It was harder than i thought.
     
  6. marserMD

    marserMD

    Joined:
    Aug 29, 2014
    Posts:
    191
    Sorry for the delay, guys. I'm in a hospital right now, so the work doesn't go really fast)
     
  7. Kirbyrawr

    Kirbyrawr

    Joined:
    Jul 23, 2012
    Posts:
    945
    Get better :S, by the way good work!
     
    marserMD likes this.
  8. marserMD

    marserMD

    Joined:
    Aug 29, 2014
    Posts:
    191
    Thanks)
     
  9. marserMD

    marserMD

    Joined:
    Aug 29, 2014
    Posts:
    191
    Wow. That was hard. I'm standing on my own two feet again. I'm releasing a teaser video tommorow and trying to release my asset. Wish me luck)
     
    Kirbyrawr and hopeful like this.
  10. pottyscotty

    pottyscotty

    Joined:
    Nov 22, 2013
    Posts:
    5
    Can't wait, this is looking amazing so far and will be a great edition to a Game im making which needs realistic explosion's! So glad I came across this :)
     
    marserMD likes this.
  11. marserMD

    marserMD

    Joined:
    Aug 29, 2014
    Posts:
    191
    UPD: Teaser is ready!
     
  12. pottyscotty

    pottyscotty

    Joined:
    Nov 22, 2013
    Posts:
    5
    Love it! Can't wait for the release, one thing, how well is it optimized?
     
    marserMD likes this.
  13. marserMD

    marserMD

    Joined:
    Aug 29, 2014
    Posts:
    191
    Thank you very much)
    Your qustion is not so easy to answer.
    Speed of my physics implementation algorythm depends greatly on raycasting speed. And it depends on count of colliders in neighbourhood of the exploding body. There is no problem to explode about 500 explosives in a box at once though.
    Moreover. The explosion is spread over time(as in real life), so the cpu consuming operations are well dispersed.
    3d heatwave generation is an expensive operation, wich lacks speed. But it is well tweakable, so may be optimized in cost of it's realistics.
    2d heatwave is very fast.
    Pseudo volumetric explosion is about 20 spheres that are scaled over time. With special shaders attached of course. It is as fast as moving 20 mid resolution objects around.
    Particle effects are pretty basic and work really fast.
     
  14. pottyscotty

    pottyscotty

    Joined:
    Nov 22, 2013
    Posts:
    5
    Thanks, that really helps :)
     
  15. marserMD

    marserMD

    Joined:
    Aug 29, 2014
    Posts:
    191
    judah4, John-G and hopeful like this.
  16. crag

    crag

    Joined:
    Dec 13, 2013
    Posts:
    145
    FREE?!?!?! Friggin' awesome work.
     
  17. marserMD

    marserMD

    Joined:
    Aug 29, 2014
    Posts:
    191
    Thanks;) Yes, it's free. It's my habit. When I join a community, I create something free and useful and check out the reaction.
    P.S.
    I'd love to see your review after you have used my plugin)
     
  18. nasos_333

    nasos_333

    Joined:
    Feb 13, 2013
    Posts:
    13,288
    Thanks for this, looks amazing

    The volumetric addition is also stunning looking
     
    John-G, marserMD and shkar-noori like this.
  19. marserMD

    marserMD

    Joined:
    Aug 29, 2014
    Posts:
    191
    Thanks. I hope you enjoy using it)
     
  20. crag

    crag

    Joined:
    Dec 13, 2013
    Posts:
    145
    4.3.4 here (gonna stay that way until after my next release ... the coming month)
     
  21. rxmarccall

    rxmarccall

    Joined:
    Oct 13, 2011
    Posts:
    353
    Looks great, appreciate your hard work and can't wait to try this out.
     
    marserMD likes this.
  22. marserMD

    marserMD

    Joined:
    Aug 29, 2014
    Posts:
    191
    Thanks. What holds you back from trying? Old unity version?
    I guess, i should have thought about that, but it just didn't came into my mind(
     
  23. LorcanG

    LorcanG

    Joined:
    Mar 23, 2020
    Posts:
    1
    Alright I haven't tried this as I'm not at my pc yet but, I was thinking of ways to get a realistic shock wave effect, and how should I go about doing this. So I watched clips on youtube To see the effects of shockwaves in open environments and the one thing every game misses out is the fact that explosions kick up dust from the ground. Here is one that shows what I'm talking about


    Anyway my idea is, when raycast of the shockwave collide they spawn an effect. to make it look smooth in terms of scale, I was thinking of finding the time or distance it takes for a raycast to spawn and then collide and using that as a reference it would Change the scale of the effect.

    It's 2:20 am and I've been in bed since 11pm thinking about this so sorry for any grammar mistakes, I'm sorta new to coding so I'm really asking if this would work.
     
  24. Firlefanz73

    Firlefanz73

    Joined:
    Apr 2, 2015
    Posts:
    1,314
    I have to try this, thanks a lot! :D