Categories & Tags
Archive

Summer of Code: Detonator Framework Released!

September 17, 2009 in Community, Company News and Info, Events by

This blog post is written by Ben Throop who has been working on a Detonator framework to generate great-looking explosions in Unity games. The project was one of the four selected projects that were selected for the Unity Summer of Code and the first to be wrapped up and released.

Detonator Logo

Explosions are a really common element in games, but they can be difficult to create. Starting from scratch can be time consuming and requires expertise with particle systems, lighting, texturing, and animation. Tweaking existing effects to fit a game can also be a challenge because its difficult to change the size or color of a set of particle emitters in unison. Making explosions should be fun, fast, and rewarding instead. That’s why Detonator was created.

 

httpvhd://www.youtube.com/watch?v=wh-vctBPRxc 


Detonator for Unity makes incorporating good explosions easier for all types of developers. At its most basic level, Detonator is a component that can be attached to any GameObject. At runtime it then creates an explosion with configurable color, size, duration, detail, and sub-elements like sparks, smoke, and shockwaves. For those that want to dig in a bit, Detonator is an explosion framework. Customize each sub-component or create new ones if you want to write a bit of code. Tweak detail levels with a single parameter and save your favorites to prefabs… or dynamically link color to damage type and size to damage amount!

Test out the explosions generated with Detonator for yourself below. Click to start the webplayer:

[WP_UnityObject altimage="http://blogs.unity3d.com/wp-content/uploads/2009/09/Detonator_Webplayer_Alt_Image.png" src="http://blogs.unity3d.com/wp-content/uploads/2009/09/Detonator.unity3d" width="640" height="360" css="http://unity3d.com/u3d.css" /]

If you’re doing explosions in your Unity game, Detonator can probably help you create good looking, scalable effects in less time!

Get the Detonator Parametric Explosion Framework from our Resources section and populate your own game with spectacular explosions. If you’d like to follow the continued development, check out Ben’s site at http://variancetheory.com.

Share this post

Comments (32)

Comments are closed.

17 Sep 2009, 2:29 pm

Congrats, awesome stuff Ben!!!

Chaos
17 Sep 2009, 3:19 pm

The sample scene does not work when built, and crashes unity when i try to run it. I’m on Windows

17 Sep 2009, 3:23 pm

Drat! There is some sort of error with the package, it won’t download into my project!!!! :-(
Please fix this!!!!

17 Sep 2009, 3:24 pm

Oops! Fixed the problem.

17 Sep 2009, 3:36 pm

@Chaos – Detonator was actually developed on Windows so it works on at least 1 machine. :)

What are your system specs and Unity version?

Mike S.
17 Sep 2009, 3:56 pm

Should this work on the Mac? When I try to play the test scene, I get a series of NullReferenceExceptions for any explosions I try to make? I’m on the latest rev of Unity Indie.

17 Sep 2009, 4:43 pm

@MikeS – Yep, does work on Mac (I also tested on a Macbook). However, the default explosion in the test scene Detonator-Insanity creates a Heatwave which uses a shader that I believe is Unity Pro only. That might be what’s doing that. The Heatwave is the only thing that is Pro only… everything else should work with Indie.

If you create a Detonator from scratch it won’t use the heatwave, and I’d guess that the NullRef asserts won’t show up.

17 Sep 2009, 4:44 pm

Works on Unity Pro Mac here. Nice job Ben!

17 Sep 2009, 5:03 pm

Yeah if anyone has issues and needs immediate attention, hit me up on Twitter… @benimaru

Vasco C,
17 Sep 2009, 8:56 pm

Fantastic work!

I really appreciate that this works great with Indie too – as long as you remember to get rid of the heatwave in import :)

Thanks!

mongol
17 Sep 2009, 9:39 pm

Really nice stuff, at least in your video :(
I am sure it will get fixed, and then it will bring endless and mindless joy to all the explosion fanatics out there.

It crashes on my Unity 2.5 Indie on Windows.
The scene loads and there are few errors, 2 related to the shader you mentioned, and the rest to some deprecated function calls.
Everything then crashes after I click in the scene.

— at lines 47, 48, 57, 65 ———————————————–
Assets/Textures/Standard Assets/Camera Scripts/MouseLook.cs(47,61): warning CS0618: `UnityEngine.Quaternion.AxisAngle(UnityEngine.Vector3, float)’ is obsolete: `Use Quaternion.AngleAxis instead. This function was deprecated because it uses radians instad of degrees’

— at line 33 ———————————————–
Assets/Textures/Standard Assets/Camera Scripts/MouseOrbit.js(33,35): BCW0012: WARNING: ‘UnityEngine.Quaternion.EulerAngles(float, float, float)’ is obsolete. Use Quaternion.Euler instead. This function was deprecated because it uses radians instad of degrees

— at line 47 ———————————————–
Assets/Textures/Standard Assets/Camera Scripts/SmoothFollow.js(47,38): BCW0012: WARNING: ‘UnityEngine.Quaternion.EulerAngles(float, float, float)’ is obsolete. Use Quaternion.Euler instead. This function was deprecated because it uses radians instad of degrees

17 Sep 2009, 9:41 pm

My first test worked, but with all the other projects I added the package to, it wouldn’t work! Even in the test scene! I click, and there isn’t an explosion. And when I create my own, the same thing happens!!!

17 Sep 2009, 9:44 pm

DetonatorSound.Update () (at Assets/Detonator/System/DetonatorSound.cs:27)
That is what’s stopping my console.

18 Sep 2009, 4:02 am

OK thanks to all for the bug reports and apologies for difficulties with Unity Indie… I’ll get it worked out and we’ll repost a package with fixes.

Chuck B
18 Sep 2009, 7:58 am

Looks cool. Will it work in Unity IPhone?

Daniel Hughes
18 Sep 2009, 12:04 pm

I would live to play with this if only it worked on linux…..

18 Sep 2009, 1:03 pm

Please tell us when you’ll repost that package! I’m anxious to us your explosions in my game! :-)

18 Sep 2009, 6:25 pm

+1: does it work on iPhone? (no generics)
If yes, how fast is it? If not, do you think it’s realistic to port it? (in terms of performance)
Kudos btw, looks awesome!

19 Sep 2009, 7:29 pm

Phenomenal work!
I especially enjoy the MushroomCloud.
Thanks for all your hard work.
We won’t even need to change out our character placeholders, with explosions like that, who cares.

Kev
20 Sep 2009, 9:16 pm

Doesnt work….

21 Sep 2009, 3:27 pm

It was not designed for iPhone and I haven’t tried it myself. Way too many draw calls to be usable most of the time, but it’s possible that the Detonator-Simple prefab might work alright since it’s only one texture for all pieces.

To make it iPhone friendly in the future, I want to add a feature to Detonator where it will render its explosion to an animated texture in some kind of wizard or editor. If anyone wants to help with that, drop me a line.

24 Sep 2009, 3:38 pm

http://unity3d.com/support/resources/unity-extensions/explosion-framework

Now has v1.02 with all Indie issues resolved. Feel free to post here if you find any others.

Ashkan
27 Sep 2009, 8:12 pm

hi ben
you did a really nice job

3 Oct 2009, 4:58 pm

Whoa. It works! Now if i can just get a good explosion…

Brendang
15 Oct 2009, 8:20 pm

What happened to the projects selected for Summer of Code? Actually I thought I asked this 2 weeks ago here. Somehow my post seemed to vanish… Curious.

17 Oct 2009, 1:47 pm

I think they are doing it but they are going to but all the others in the new Unity, instead of a package. So that may take some time. They are also probably slacking off a little now because the deadline is out there and they just have to stick it in the new Unity, which won’t becoming for a couple of months. *-)

Justin
14 Apr 2010, 6:27 pm

where is the documentation as to how to use this? I have seen the Unity3d file on your website but no clue as to how to use this.

Jarod
30 Apr 2010, 10:23 pm

I would like to know how to make the explosions look like that. My detonator explsions all look really fake and are seperated in squares and stufF. if you could send my the instructions for each detonator explosion that would be great!

Willy
24 Oct 2010, 10:14 pm

ITS not work on my unity I got this message: Assets/Detonator/System/Detonator.cs(48,29): error CS0106: The modifier `virtual’ is not valid for this item. Wats wrong????

cpt.ahab
14 Nov 2010, 9:27 am

same failure here!
Assets/Detonator/System/Detonator.cs(48,29): error CS0106: The modifier `virtual’ is not valid for this item

Barak
2 Mar 2011, 5:44 am

There’s a bug when one calls Explode() instead of using explode on start. If you play for a long time (more than 1000 seconds), there is a code in Update which deletes the detonator after that time. The code:

private float _lastExplosionTime = 1000f;
void Update ()
{
if (destroyTime > 0f)
{
if (_lastExplosionTime + destroyTime 0)
{
Invoke(“KillDetonator”, destroyTime);
}
}

void KillDetonator()
{
Destroy(gameObject);
}

Barak
2 Mar 2011, 5:50 am

Disregard the last comment, for some reason it wasn’t posted correctly, I’ll try again:
There’s a bug when one calls Explode() instead of using explode on start. If you play for a long time (more than 1000 seconds), there is a code in Update which deletes the detonator after that time. The code:

private float _lastExplosionTime = 1000f;
void Update ()
{
if (destroyTime > 0f)
{
if (_lastExplosionTime + destroyTime 0)
{
Invoke(“KillDetonator”, destroyTime);
}
}

void KillDetonator()
{
Destroy(gameObject);
}

Leave a Reply

Comments are closed.