Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. Dismiss Notice

Destructible mesh system?

Discussion in 'General Discussion' started by Velo222, Oct 17, 2014.

  1. Velo222

    Velo222

    Joined:
    Apr 29, 2012
    Posts:
    1,437
    I was wondering, since with Unity 5.0 they are looking to update the PhysX version (which is great), if anyone had heard any information on if the Unity team is planning to make an integrated destructible mesh system of some sort -- preferably in the near future?

    I'm guessing "NO" right now. Because I have not heard anything on it. However, I just wanted to throw this out there to maybe get people thinking about it. And hopefully a Unity team member or two lol.

    I know there's a few assets on the asset store that do this -- but who knows how well they perform or how well they implement it? Usually having an integrated system is just simpler -- and it's done by professionals (I'm guessing).

    Basically, I think a destructible mesh system is long overdue for Unity, and it's a feature that is much desired and sorely needed. I think the biggest thing is, it would just be freaking so much fun to play with :)

    Does anyone else want this as a feature?
     
  2. Tomnnn

    Tomnnn

    Joined:
    May 23, 2013
    Posts:
    4,148
    Do you want to cut your meshes up or deform your meshes? Unity has a free example for deforming meshes. The example is sculpting with mouse clicks on a sphere and it works kinda like ray casting at the object, getting the point that hits the mesh, getting all of the vertices that are within a certain distance of that point and then raising them.

    It's cool for how simple it is to deform meshes in unity. As for breaking and cutting your meshes, that's probably more difficult to implement.
     
  3. Velo222

    Velo222

    Joined:
    Apr 29, 2012
    Posts:
    1,437
    Ya just breaking and cutting them actually. For instance, a pot/kettle you can pre-break into pieces with say a voronoi algorithm, and then have it shatter during runtime. Things like that.

    Again, I know there are assets that do this on the store, but integrated would be nicer. I'm already doing this in my game actually using a Blender --> Unity workflow, but an integrated system would be the best, save lots of time, and probably perform better most things on the asset store currently.
     
  4. Deon-Cadme

    Deon-Cadme

    Joined:
    Sep 10, 2013
    Posts:
    288
    It could be nice to have some day but I have too many other features that I would love to see in the engine before something like this.

    I would rather see something like Unity implementing their own Shader Forge, get the new UI system done and maybe out of the box support for voxel systems and much more...
     
    Ryiah likes this.
  5. Velo222

    Velo222

    Joined:
    Apr 29, 2012
    Posts:
    1,437
    Ya I know what you mean Deon. Everyone has their priorities pertaining to the game they want to make. I guess, Unity has to decide which ones they think are most important too.

    But, still, I kind of just wanted to discuss destructible systems. For instance, does anyone know what the best destruction system is currently (i.e. the industry gold standard currently)? Is it the Apex destruction system?

    Anyways, I do want to see a destruction system implemented at some point. Hopefully sooner rather than later.
     
  6. ippdev

    ippdev

    Joined:
    Feb 7, 2010
    Posts:
    3,789
    I have seen mesh cutting and hole stitching systems about since 3.5.x. Fruit Ninja (I think that was it's name) used one of them.
     
    dogzerx2 likes this.
  7. Deon-Cadme

    Deon-Cadme

    Joined:
    Sep 10, 2013
    Posts:
    288
    It was less about my personal project and more about features that most people would benefit form or features with really large possibilities.

    I am not sure if a single destruction system has been crowned as the best, interest have been to low from what I have seen but I can at least say that voxel based systems outperform traditional mesh based system in real-time destruction because they know what is on the inside of the object. The most advanced systems even keep track of structures integrity, physical abilities and so on...

    For traditional mesh based solutions, most I have seen so far were developed in-house. Some originated from another system in the beginning but was later modified in different ways. Especially the texture part of the system was often modified to meet needs and requirements of the titles.
    They typically have a solid object to represent its stated before it gets destroyed. Then throw in some particle effects while they swap the model for another one that is pre-cut into pieces (some have several pre-cut versions to avoid that the same blocks appear every time). The way the blocks fall to the ground is physically based but it gets different here depending on the system... some leave the objects lying there for the remaineded of the level in case they are not worried about object counts. Others constrained the physics so that blocks land within a certain radius, add more particles when the pieces hit the ground and then replace these pieces with a single model that represents the pile of rubble. Some even skipped the physics and just animated the pieces instead, they knew exactly where they would land and had a third model prepared that is better optimized with the rubble at the bottom...
    There are many systems for this stuff... the most important thing is that your system looks good, is realistic enough to fool the player and fit the style of the game.

    Oh, and there is the budget version :) Some do not allow you to destroy the whole object, they got decals with normal maps instead that they place on the object to fake the damage.

    Especially FPS games are very careful with destructible objects because they can otherwise get odd situations. Take the armament (or whatever it is called) inside concrete pillars... natural destruction would make those metal rods point in every direction but that would make the collision mesh pass the budget restrictions... You can't make a simplified collision mesh because a sniper might be aiming through an opening at the opponent behind the object and it would feel incredibly strange if the bullet cannot pass. Likewise, the object might look strange if you do not bend these metal rods... there is just a lot of things to think on and weigh against each other...

    Again... voxels solves this by the nature of the voxel system... if there isn't a voxel there... then the bullet can pass and this is therefor not a problem. The problem with voxel systems on the other hand is that they have problems with creating super realistic environments. This is because the voxels would consume a lot more memory then Santa eats porridge during Christmas... and we all know he eats a lot while he flies around the world ;)
     
  8. Myhijim

    Myhijim

    Joined:
    Jun 15, 2012
    Posts:
    1,148
    Honestly, for me, I don't know about y'all rest of you, I'm more concerned about getting my hands on a 64-bit version of Unity. It's about time. And it comes first on my list.

    You can write your own destruction systems, you can't write your own 64-bit Unity :p
     
  9. hippocoder

    hippocoder

    Digital Ape Moderator

    Joined:
    Apr 11, 2010
    Posts:
    29,723
    Unity is planning enhancements to Physx 3.x in the future (later than 5.0 release) but not for release. 5.0 will be about getting it running with the same feature set as 4.x - but with better everything. No new features. This is sensible for a first release.

    In future, more could be added but this won't really be disclosed until they're ready and this will be after 5.0 is out.
     
  10. ippdev

    ippdev

    Joined:
    Feb 7, 2010
    Posts:
    3,789
    64 bit is here. Voxels will not give realistic results. Most 3D plugins work with voroni noise..which would not be that hard to implement. You generate a 3D noise field and place the breakage separations along the darkest pixel curve lines. You can even set the sample distance so it won't lag and still keep a semblance of voroni based breakage. Or implement a distance based sample and piece extraction system where the father away the pieces are larger.
     
  11. Velo222

    Velo222

    Joined:
    Apr 29, 2012
    Posts:
    1,437
    Ya that's pretty much what I expected Hippo. Would love to see a destruction system happen during the 5.x release cycle though.



    I honestly would have no idea how to code that or implement that myself ippdev :eek: I'd have to have someone teach me step by step, or rely on someone else to do it for me currently. It's cool to see the process by which you do it broken down though :)
     
  12. Tomnnn

    Tomnnn

    Joined:
    May 23, 2013
    Posts:
    4,148
    Nice, it's awesome to know it's been done that well already. I'm curious about it but not enough to be motivated since I can't think of any projects I would use it in. Definitely cool though.
     
  13. Aiursrage2k

    Aiursrage2k

    Joined:
    Nov 1, 2009
    Posts:
    4,835
    I was using one of them from the asset store but it kept crashing unity for some reason when it was generating the physics shapes (the error message was always the same something about convex shapes). Seemed to happen sporadically but made unity unusable.