Search Unity

Ultimate Fracturing Destruction editor extension for Unity 3D

Discussion in 'Assets and Asset Store' started by UGTools, May 30, 2013.

  1. Nanako

    Nanako

    Joined:
    Sep 24, 2014
    Posts:
    1,047
    what is the bCancelCollisionEvent parameter all about? I can't find any place where it's set to true
     
  2. UGTools

    UGTools

    Joined:
    Oct 10, 2012
    Posts:
    738
    How about making them kinematic, but with colliders marked as "Is Trigger"? That would avoid collisions, and when enabling the chunks you would have collisions against dynamic rigidbodies and not kinematic rigidbodies.

    Not exactly. I wanted to give full control. Maybe a bullet may have the same energy as a bigger object going at slower speed, but a bullet would go through and not detach a big chunk like the bigger object would do. It is a way to have 2 different thresholds instead of one, even if both combined give you the energy.
     
    Jaqal likes this.
  3. UGTools

    UGTools

    Joined:
    Oct 10, 2012
    Posts:
    738
    It is for your own purposes. If for some reason you want to cancel the fracturing events that follow a collision that should trigger them, you can set this parameter to true in your callback.
     
  4. Sir-Spunky

    Sir-Spunky

    Joined:
    Apr 7, 2013
    Posts:
    132
    Hi. I'm very impressed by this plugin, it's high on my wishlist.

    If I have some procedurally generated objects, such as buildings, could these be divided into chunks dynamically on-demand during runtime, only when they're destroyed? I understand if this is not possible performance wise. If I have to divide them in advance, I assume this would increase the polygon count?

    The reason I ask is because I'm trying to evaluate how many objects could realistically be made destructible in a large procedural world.
     
  5. Nanako

    Nanako

    Joined:
    Sep 24, 2014
    Posts:
    1,047
    That's just not what F&D does. It's a pre-fracturing toolset.

    Personally i do plan to implement dynamic runtime fracturing too, but you'll need another package for that. I plan to get this one: https://www.assetstore.unity3d.com/en/#!/content/9771

    In any case, i'm going to use BOTH, and frankenstein them together into something greater than the sum of its parts. They both have their uses, and F&D is definitely more efficient.

    Also, re: polycount. My personal plan is to have only a few pre-fractured, ready to break objects in the scene at a time, and keep another few hidden outside the map in a pool,. and i'll dynamically swap them into place in exchange for static walls, whenever those walls look likely to be broken. I think having a million unbroken fragments sitting in the scene is not scaleable, you need to employ smart performance tricks with this sort of thing.
     
    Arkade likes this.
  6. Sir-Spunky

    Sir-Spunky

    Joined:
    Apr 7, 2013
    Posts:
    132
    Thanks for the tip! I'll check that out as well. They likely both have their uses, like you say.
     
  7. Nanako

    Nanako

    Joined:
    Sep 24, 2014
    Posts:
    1,047
    your code for calculating the volume of fragments seems very basic and inaccurate. it's only using the bounds of the collider, which will always result in a higher number than the actual volume, sometimes MUCH higher for elongated/shard shaped chunks

    since this can be calculated at authortime, where , i see no reason not to do it properly, and accurately calculate the volume of the mesh collider: http://answers.unity3d.com/questions/52664/how-would-one-calculate-a-3d-mesh-volume-in-unity.html
     
    red2blue likes this.
  8. Nanako

    Nanako

    Joined:
    Sep 24, 2014
    Posts:
    1,047
    hi. I've been examining the meshes of produced chunks, and i note with a lot of concern, that their vertex/polygon counts are pointlessly high. There's a lot of unnecessary vertices added into what are simply straight edges, and as a result a section that could easily be a two-triangle square is often a mess of squashed triangles.

    see here for examples: http://forum.unity3d.com/threads/odd-results-trying-to-get-a-meshs-vertex-count.284100/

    Are you planning to do anything about this? i can't see any use or purpose for all that redundant geometry
     
    Jaqal likes this.
  9. Jaqal

    Jaqal

    Joined:
    Jul 3, 2014
    Posts:
    288
    How efficient is this system fir many objects on scene. I see that it only supports pre fracturing so I am worried.

    For instance I have many rocks in my game and currently pre fracture then before importing, attach colliders and rigidbodies to each fractured piece. When I hit them they fall apart to simulate mining. My concern with your system is having all those prefractured objects on scene at once. This can easily be solved by only having one and swapping it out as mentioned above. The problem hee is what if I mine only half a rock. Then it would be in that fractured state the rest of the game eating up resources.
     
  10. UGTools

    UGTools

    Joined:
    Oct 10, 2012
    Posts:
    738
    There is no redundant geometry there, you can see (although very small in that example) the faces the planar intersections have created. Each time a section is made through geometry you need to cap it using triangulation. Also if you have different materials for inner faces you need to duplicate those vertices as well :)
     
  11. UGTools

    UGTools

    Joined:
    Oct 10, 2012
    Posts:
    738
    The swapping system is used already. All pre-fractured objects use a single object until they get fractured. There is no way to have different versions of the fractured object so that the remaining part still renders as a single object, unless you have a full dynamic non-prefractured system of course.
    From my experience there is a lot of batching going on. Usually the bottleneck happens on the physics side, not on the graphics side. Fortunately with Unity 5 the new physics system improves these computations by a huge factor thanks to physx 3.x with multithreaded support and rewritten code.
    All our future versions will in some way or another all be related to improve performance :)

     
  12. Jaqal

    Jaqal

    Joined:
    Jul 3, 2014
    Posts:
    288
    Cool thanks for the quick reply. One more question if you don't mind! I am wondering if this would work for cutting down trees? I know that may be pushing it but has anyone gotten this to work effectively?
     
  13. nwsx

    nwsx

    Joined:
    Apr 12, 2013
    Posts:
    11
    Hi. I have troubles with fracturing multiple materials mesh.

    http://i.gyazo.com/9ae4bfd0c603fe724198368e4519833b.png

    Those two pillars using same FracturedObject settings.
    It's works fine with one material, but with two materials, it's always looks messy, whatever settings I use.
     
  14. Danirey

    Danirey

    Joined:
    Apr 3, 2013
    Posts:
    548
    Hi there,

    Any standard way to make the chunks kinematic after a while(fully static, even removing the rigidbody component)?
    I can delete the chunks after some time, but i prefer to keep them but making them static.

    Thanks !
     
  15. Nanako

    Nanako

    Joined:
    Sep 24, 2014
    Posts:
    1,047
    I think we may have misunderstood each other on that point.
    The swapping system you currently have in place is just covering up all the hundreds of chunks with a single visible object. The chunks are still there, just not visible. This helps with rendering load, but doesn't do anything to alleviate the memory, code and physics overhead of having all those hundreds of objects still there.

    What i'm talking about, and working on implementing, is a system where all those chunks are not present by default. I'll keep a few copies of each fracturable object in a pool offscreen, and have it swapped in for any eligible single object when it gets hit (or is about to be hit)
    What this means is rather than having a thousand pre-fractured walls, i have a thousand walls made of ordinary cubes with a very simple script attached, and five or so pre-fractured walls offscreen in a pool, which will be put into place when a wall is getting destroyed (and then another will be instantiated and put in the pool to keep it topped up).

    This will mean that on an average 80-chunk wall, i'll have 400 chunks in the scene at the start rather than 80,000, which will do a lot for various types of performance.

    I'm also combining that with a custom culling manager that i've half-written to keep the number of active chunks down
     
  16. UGTools

    UGTools

    Joined:
    Oct 10, 2012
    Posts:
    738
    Do you mean dynamically? Objects are pre-fractured so if you want to cut a tree or a branch on a specific point you probably won't be able to. It is more oriented towards structures like buildings, rocks, etc.

     
  17. UGTools

    UGTools

    Joined:
    Oct 10, 2012
    Posts:
    738
    With two materials do you mean using a different material on the "Interior Material" parameter than on the object, or the object itself has 2 different materials?

     
  18. UGTools

    UGTools

    Joined:
    Oct 10, 2012
    Posts:
    738
    Not right now, but probably will have that feature on the next update. We still need to finetune some things like detecting cases where a chunk got stuck or did not get completely to the ground :)

     
    Danirey likes this.
  19. super-cypher

    super-cypher

    Joined:
    May 10, 2014
    Posts:
    117
    hi

    does this have playmaker support? if not can you do the actions?

    such a cool asset!
     
  20. Danirey

    Danirey

    Joined:
    Apr 3, 2013
    Posts:
    548
    That's Great! :D

    It will be a huge preformance saving without having to delete the chunks.

    Thanks a lot!
     
  21. red2blue

    red2blue

    Joined:
    Feb 26, 2013
    Posts:
    200
    Hi there, i am proud owner of this asset. I got one question. Will you move this asset over to Unity 5 with its new Physics engine? That would be awsome! Thanks
     
  22. blueivy

    blueivy

    Joined:
    Mar 4, 2013
    Posts:
    633
    Hi, is gpu rigidbodies something that will be possible with Unity 5 using physx 3.3?
     
  23. Arkade

    Arkade

    Joined:
    Oct 11, 2012
    Posts:
    655
    Hi,
    Is there any regression with Unity 4.6(.1) when using fracturedObject.CollapseChunks() ?

    My fractured objects have stopped collapsing properly when shot (I'm triggering from API). Specifically, they're on a slope (it's a snow mesh created with Snowify). Previously, they'd slide off beautifully. Now (I've only recently noticed), they sit still until timeout. Oddly, when I move a piece before CollapseChunks(), it stays frozen. When I move it after, it obeys physics. My git history showed it worked on 19'th Dec and nothing particularly relevant has changed ... apart from upgrading from 4.5.x to 4.6.1. I really don't want to downgrade Unity and checkout a clean/old version :-\

    I'm reading backwards through the thread in case this is already asked and answered but thought to ask in case not.
    Thanks (and happy Christmas eve to all fellow indies ;-) )

    EDIT: p.s. Just switched from CollapseChunks() to Explode() and that seems to work so fear it's some optimization that something going from kinematic to not without force is assumed 'resting' (or somesuch). Possible?
     
    Last edited: Dec 24, 2014
  24. Arkade

    Arkade

    Joined:
    Oct 11, 2012
    Posts:
    655
  25. UGTools

    UGTools

    Joined:
    Oct 10, 2012
    Posts:
    738
    Yep, should be included in the next update :)

     
  26. UGTools

    UGTools

    Joined:
    Oct 10, 2012
    Posts:
    738
    Yes, I've tried it already and it currently works out of the box. I'm going to upload a couple changes though, as some of the example scenes work differently mostly because an improper mass value assignation. Also a sky texture doesn't display correctly, but other than that it works fine.

     
  27. UGTools

    UGTools

    Joined:
    Oct 10, 2012
    Posts:
    738
    I wish it had GPURB support but physx 3.3 still doesn't have it. On the other hand, they've greatly improved performance on multicore cpus and generally it performs way faster so that's really good news :)

     
  28. UGTools

    UGTools

    Joined:
    Oct 10, 2012
    Posts:
    738
    Yes, it looks like it has something to do with objects starting with zero velocity and immediately going to rest. Maybe I should assign them an initially velocity over the threshold...

     
    Arkade likes this.
  29. Arkade

    Arkade

    Joined:
    Oct 11, 2012
    Posts:
    655
    Oh few! That's kind'a a relief (i.e. I'm not going totally bonkers from an OD of Christmas food ;-) ). I'll do a temporary workaround my end and look for a fix in a future version (fair?).
    Thanks! (and happy <insert greeting subject here> :) )
     
  30. Jaqal

    Jaqal

    Joined:
    Jul 3, 2014
    Posts:
    288
    Can this be used with any shader or does it require a unique set? I am using PBS so it is very important.
     
  31. Pulov

    Pulov

    Joined:
    Feb 20, 2010
    Posts:
    824
    Is the Mlow modification implamented or being implemented? that second breack after parts arrive to flor would be aaawesome.
     
  32. Arkade

    Arkade

    Joined:
    Oct 11, 2012
    Posts:
    655
    Quick reply from another customer:
    any shader will work fine (95% confident).
     
  33. Jaqal

    Jaqal

    Joined:
    Jul 3, 2014
    Posts:
    288
    Thanks Arkade. I bought this last night and am trying to get this to work with UFPS melee weapons for a mining system in my game. Having no luck so far. I can't seem to figure out the easiest way to even fracture anything with my own weapon system lol. Seems like a powerful tool but is almost too complex for me.
     
  34. Jaqal

    Jaqal

    Joined:
    Jul 3, 2014
    Posts:
    288
    Does anyone have a suggestion for my problem above. What would be the simplest way to go about simulating mining with this. For example I hit a rock with my pickaxe and a piece falls off etc.
     
  35. Pulov

    Pulov

    Joined:
    Feb 20, 2010
    Posts:
    824
    Anyone tested with a multi storey building with pillars and wall? Send a test object to the autor but received no asnwer.
     
  36. Arkade

    Arkade

    Joined:
    Oct 11, 2012
    Posts:
    655
    EDIT: @Jaqal !

    A few quick thoughts...

    They're are a few parts to this question.
    1. How to make something that fractures
    2. How to affect it in game at all
    3. How to only affect part of a larger fractured object
    (1) See UGT's "Help page" -- at the top "Creating a fractured object is easy".

    (2) Try one of two easy tests: Physics or Code.

    - Physics: Position a nice heavy sphere over your fractured object. Hit Play! (HULK SMASH!)

    - Code: Get a reference to your FracturedObject and call CollapseChunks()!
    (note: if using Unity 4.6 seems to have a tiny bug that @UGTools is aware of -- it may not collapse due to being switched from isStatic true to false without any extra forces applied. (see above))

    (3) There are 2 obvious ways. Physics or Code. For a pick-axe, physics might be better (whereas a lazer might be code).

    - For the physics approach, you'd have a collider on your pick-axe and move it through the swing you perform. It if hits the fractured object, the physics impact will prompt appropriate collapse (if it's set up right).

    - For the code approach, have a look at the section "FracturedChunk methods:", specifically "ChunkRaycast()". It explains how to get the right one.

    HTH!
     
  37. UGTools

    UGTools

    Joined:
    Oct 10, 2012
    Posts:
    738
    It can be used with any shader. You can specify whatever material you want for the inside of the object as well.

     
  38. UGTools

    UGTools

    Joined:
    Oct 10, 2012
    Posts:
    738
    Jaqal, what you normally do is:

    1) Perform a raycast with:

    Code (csharp):
    1.  
    2. RayCastHit hitInfo;
    3. FracturedChunk chunkHit = FracturedChunk.ChunkRaycast(WeaponPos, WeaponDir, out hitInfo)
    4.  
    This will cast a ray and test if it hit a fracturable chunk.

    2) If the above call returned a chunkHit != null, then notify an impact on that chunk that was hit;

    Code (csharp):
    1.  
    2. chunkHit.Impact(hitInfo.point, ExplosionForce, ExplosionRadius, false);
    3.  
    That's all :)

    This is the way to do it for a gun/missle, but you can use the same method for an axe just by testing if the hitInfo.point was in the way of your axe trajectory path.
     
  39. UGTools

    UGTools

    Joined:
    Oct 10, 2012
    Posts:
    738
    Saw it, will do today and send you the results :)

     
  40. UGTools

    UGTools

    Joined:
    Oct 10, 2012
    Posts:
    738
    And by the way, thanks for the support Arkade! :)
     
  41. super-cypher

    super-cypher

    Joined:
    May 10, 2014
    Posts:
    117
    hi
    is the latest version of this unity5 ready? if not is it far off?

    thanks
     
  42. UGTools

    UGTools

    Joined:
    Oct 10, 2012
    Posts:
    738
    I tested it and right now it is 99.99% ready except for:
    1-The sky texture looks a bit weird by default
    2-The second scene needs heavier mass set in the bricks. I tried 100 instead of 1 and worked like a charm.

    Everything else works out of the box and faster than ever!

     
  43. red2blue

    red2blue

    Joined:
    Feb 26, 2013
    Posts:
    200
    Thanks for making it compatible with Unity 5. Could you make a benchmark of the performance between Unity 4 and 5. There should be a performance boost due to the new Physic engine. That would be awsome!
     
    hopeful likes this.
  44. UGTools

    UGTools

    Joined:
    Oct 10, 2012
    Posts:
    738
    Sure, that would be interesting. It will take me some days though, I'm currently finishing our new plugin and it is taking a bit more than expected :)
     
    red2blue likes this.
  45. mkgame

    mkgame

    Joined:
    Feb 24, 2014
    Posts:
    592
    Hi UGTools,

    this fragment destruction asset looks amazing but im afraid that it causes too much CPU/GPU load. In my case i write an AAA RTS game and i would like to use it as damage animation for buildings. I have hit points for buildings and depends on that the buildings should show the destruction strength. What i need is to have about 4 stages (0%, 25%, 50% 75% HP) where i need a destruction animation.
    Your tool seems to be capable for that, so i could save the time to animate the destruction levels in Blender or Maya. Some of the buildings can be repaired, there i would need to revert these animations. This process would be really valuable, but back to reality:

    What i need is to have the possibility to create fast destructions (with bigger fragments) and the destruction should be HP dependent and not one shot and destroy the object. The destruction initiator should not be a physical force, it should be HP driven. That then the fragments fly around is okay with physics.

    I want to achive to have a process with i can destroy non player buildings without animating them in tools, probably the destruction itself must not be HP dependent, so i just destroy the fragment i hit.

    Probably you could clarify me about what i could use for an RTS game.

    Thanks in advance
     
  46. tynew

    tynew

    Joined:
    Sep 25, 2013
    Posts:
    122
    Is there an expected ETA for the release of this tool with Unity 5?
     
  47. UGTools

    UGTools

    Joined:
    Oct 10, 2012
    Posts:
    738
    Hello!
    It currently works with Unity 5, I just need to reconfigure the second scene a little bit (adjusting the total mass) and check the sky texture. Other than that, it works 100%
     
  48. jluhman

    jluhman

    Joined:
    Mar 8, 2014
    Posts:
    2
    Is the Fracturing Destruction component supported for use in Windows 8/Windows Phone apps?
     
  49. SpaceRay

    SpaceRay

    Joined:
    Feb 26, 2014
    Posts:
    455
    I have bought this and think that this is really great and amazing and gives very good fracturing and destruction, and seems to be very well done and I want to make some questions

    As this is a long post I give you my thanks for all your attention and time for reading and I appreciate if you can be so kind to be able to answer this and think would also be useful for others that would be interested to buy this.

    You can take your time and do it when you can and if you want, is not urgent.

    1 UPDATE? - Since the last update is of 10 December 2013 and we are now on 24 February 2015 (more than 2 years after), is it going to be further updated and there will be no more newer features?

    I wish and hope that this is kept alive and you can continue updating it.

    Very good to know that is compatible with Unity 5.0

    2 - UPDATE TO BE ABLE TO BREAK FURTHERMORE ALREADY GENERATED BROKEN PARTS?

    From the demos shown, once the broken parts are generated, they can´t be broken again in smaller pieces, and I think that it would be really much more realistic, cool, awesome and great to be able to make them breakable too so continue breaking them if hit again, at least once or two times more.

    3 - COMPATIBLE WITH MODERN NEW MOBILE DEVICES?

    How does this work with mobile devices and how compatible is?
    Or can be only used for desktop computer or consoles?

    Now there are new much more powerful mobile devices that have just recently be released, so I understand that older devices are not powerful enough, but could work well with newer ones

    4 - ARE THE GENERATED BROKEN PARTS MERGED TO AVOID DRAW CALLS?


    Are the generated broken parts merged and combined automatically to avoid having to many draw calls?

    5 - DO YOU HAVE TO FRACTURE THE OBJECTS INDIVIDUALLY PREVIOUSLY TO BE ABLE TO USE AND BREAK THEM?

    With this you can make 3D objects breakable and fractured and DOES NOT NEED A PREPARED READY MADE FRACTURED OBJECT making them breakable first in an external 3D software.

    The main reason and most interesting part of I am interested in this is that it seems that it allows you to fracture , slice and explode meshes into shards WITHOUT having it fractured previously externally in an 3D software and import afterward.

    Although of course you can import you own fractured objects externally and use them too.

    But the question is if BEFORE building your scene with the different 3D objects you have to fracture them each one individually, one by one, before using them inside the scene to be able to make them break?
    Or does it do it at runtime without having to prepare each single object before?

    6 - IS THERE ANY LIMIT TO WHAT CAN BE BROKEN ?

    I wonder if there could some limitations of what can be broken, and if it can be ANYTHING that has convex meshes, or there could be some things some possible limitation in some way.

    7 - WHAT ABOUT MATERIALS AND SHADERS?

    Can it be any kind of materials or there is any limitation?
    What happens with shaders? Are they applied also to the 3D generated parts in the same way?
    Can the original material be changed to a new one when the fracture is made?

    8 - HOW DOES THE IMPACT FORCE AFFECT THE BREAKING OF THE OBJECTS?

    What happens when the same 3D object gets impacts with different forces from different objects?

    If you have to break the 3D object with this software previously before using it and considering and knowing that this 3D object could be broken by different impacting objects HOW does the breaking done?

    Would the generated broken shards be created the same size, or would be bigger with a low force and smaller with a higher powerful force?

    I mean that is not the same force applied to be hit by a bullet, from a car crashing to the object, or from a missile.
    Would the size of the broken part of the object be bigger according to the power of the impact? For example, would make a bigger hole in a wall.

    Would the broken objects generated have the same size with different forces?
    Would be possible to break the 3D objects depending of the impact force?

    9 - HOW DOES THE SIZE OF THE OBJECT THAT IMPACTS MODIFY THE DESTRUCTION?


    For example if you have a wall, and make it fractured, how would the size of the object modify the behaviour of the destruction?

    Because is not the same to fire a bullet, throw with force a big rock, have a missile impact, crash a car into the wall, or even an elephant hits the wall, how these different sizes of the impacting objects modify the creation of the destruction?
    Would them all have the same size and destruction style?

    10 - COULD GENERATED SHARDS BREAK OTHER NEARBY OBJECTS?

    If you break a stone ball that is near a window, could the stone broken parts reach and break the glass of the window at the same time?

    -----------------------------------------------------------

    As said first, Thanks very much for all your attention and time for reading and I appreciate if you can be so kind to be able to answer this.

    I wish you the best and that you can sell a lot
     
    Last edited: Feb 24, 2015
  50. Cool_Flow

    Cool_Flow

    Joined:
    Apr 14, 2013
    Posts:
    21
    First off, I just wanted to say your Fracturing addon is amazing. I bought it a week ago and already love it.

    Question. Since you haven't updated the asset store version v1.11 since Dec. 10, 2013, I'm just wondering if you plan on updating it in the future? I read all the posts seeing what people have been asking for since you placed this on the asset store. Just kind of curious on what improvements will be coming? Reducing drawcalls or something like that would be great.