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

[Released] Mesh Destruction "Piecemaker"

Discussion in 'Assets and Asset Store' started by Marrrk, May 29, 2011.

  1. Marrrk

    Marrrk

    Joined:
    Mar 21, 2011
    Posts:
    1,032
    Hello,

    finally I released Piecemaker. With Piecemaker you will be able to destroy meshs into pieces and even destroy these pieces into even more pieces.

    Piecemaker is an Unity editor Extension written in C# which will pre calculate the destructed meshs based upon a mother/father mesh and various user options.

    You can extend or change almost every aspect of Piecemaker. You want to use a prefab for every piece? No problem just add it. You want to add custom behavior without using a prefab? No problem, just extend a special baseclass. You want an other destructable Component and not the one Piecemaker provides? No problem, just extend the same special baseclass as in the last sentence.

    Its even capable to destroy without precalculation. How is this possible? Piecemaker delivers a Tools class which is perfectly capable to be used by any script you will or want to use.

    Want to see a little demonstration?

    Asset Store: http://u3d.as/content/marrrk/piecemaker-mesh-destruction/1RP
    Introduction video: http://www.youtube.com/watch?v=I9n9SwHQxQA
    An older sample video: http://www.youtube.com/watch?v=lQ1pziX9_so
    Webplayer demo for the Slicer Component (dynamic destruction): http://www.dras.biz/Slicer/WebPlayer.html

    The original showcase thread: http://forum.unity3d.com/threads/82715-Piecemaker-(Destruction-Creator)

    Questions, comments or reports, are welcome.

    ---

    Some small guideline:

    Dont go atomic, dont use too many destruction levels, if you split your initial mesh in 16 fragments and this generated fragments again in 9 fragments and these again into 4 fragments you create up to 736 fragments, even on a good PC, this is a serious performance impact.

    A better way here is to keep the desctruction level low and use particles for the destruction of the smallest fragments, they will spawn faster and Unity is able to update these particles more efficient.

    Prebreak if possible, you want to destroy a building, with a complex roof, many walls, eg.? Better separate the walls into an extra mesh and destroy the mesh parts, you receive a better control over the destruction process (Walls break differently than a roof) and you can control the destruction levels way better than destroying the whole house mesh. Also colliders will dont pose a threat to you and your environment.

    Keep it simple, you want to destroy a dragon figure with wings, tail, horns and many legs. Well its perfectly possible, but Piecemaker works faster and better with low polygon meshs. Many polygons will result in a big memory footprint (the generated meshs need to be loaded from and saved to the harddisc) which increases the overall memory consumption of your application.

    Also a fragmented high poly model will result in many triangles which need to be rendered, keep this in mind.

    Mesh collider are fine but also very hard to calculate, try different collider settings to see what performes best in your environment. Even if piecemaker uses mesh colliders as default colliders, a box collider may be enough to satisfy your needs. Also its much faster on mobile plattforms.

    Open world is nice, but keep your meshs closed.
     
    Last edited: Jun 9, 2011
    Gozdek likes this.
  2. jrdata2k

    jrdata2k

    Joined:
    Oct 6, 2008
    Posts:
    27
    Hey... congrats on releasing the package!!

    We just grabbed a copy and thought I'd shoot through some immediate feedback. It was no biggy, but when I first opened Piecemaker the panel was obscured by unity's application bar. It might be some kind of dual monitor issue?? I'm running my main unity project window on my left monitor (which is my secondary monitor attached to my mac book pro), and have my dock running on my right (mac book pro screen), hence why the unity application bar is on the right screen. I'll attach a screen grab from my macbook pro monitor so you can see what I mean.

    Anyway, all that was need was to grab the bottom right corner to resize the panel and the whole panel snapped into view... now on to breaking stuff!!! Cheers!

    Jason

     
  3. c-Row

    c-Row

    Joined:
    Nov 10, 2009
    Posts:
    847
    Hello Marrrk,

    sorry if I am just too decaffeinated to properly get this part, but - does this only work on primitive meshes or can I destruct a "complex" hand-made (e.g. imported from Cheetah) and finished prefab as well?
     
  4. Marrrk

    Marrrk

    Joined:
    Mar 21, 2011
    Posts:
    1,032
    Hello, thanks for your feedback.

    @jrdata2k:
    Thank you, I will have a look into this, I even have a slight idea what the problem may be.

    @c-Row:
    Yes, you can destroy complex objects, Iam sorry that this was not visible in the introduction video. But there are certain limitations:
    - currently no Bone data is supported -> these data will be ignored, but everything else will work, so you can break it
    - meshs like a tube may cause problem with the calculation of the slice/cut area, in my test cases it was never a problem but theoretical it could happen. They will be destructable but you may see some strange triangles
     
  5. AzraelKans

    AzraelKans

    Joined:
    Oct 29, 2009
    Posts:
    135
    wow this is awesome and just what I was looking for, however I did noticed there are no particles after breaking objects, is it possible to add particle effects to the destruction event?
     
  6. Marrrk

    Marrrk

    Joined:
    Mar 21, 2011
    Posts:
    1,032
    Sure, but this needs some preparation, you can either create an own Prefab which you want to use as a template for every destructable/shard/piece or you could add an own Applicator class which will be called for every shard/piece, in this applicator you are able to add particle effekcts or whatever you want :)
     
  7. jrdata2k

    jrdata2k

    Joined:
    Oct 6, 2008
    Posts:
    27
    Hey Marrrk,


    Getting some great results so far, but after having a bit of a play (and being a software coder) I thought I might offer some hopefully constructive reports/feedback:

    • is there anyway that the load/save preset functionality can remember the previous folder that a save or load occurred in?
    • if closing piecemaker could it produce a temporary preset, so that reopening it immediately reloads the same settings?
    • I'm finding that after loading a preset it doesn't always reload the correct mesh, it sometimes loads the next mesh in my list... if it's any help, my fbx had two mesh objects, I had one previously selected, but the other is selected when reloading the preset.
    • Also, reloading Material 2 seems to act a little strange... sometimes it doesn't reload at all, it just says None with no material selected, but other times it says None but upon clicking the search icon I find that my material is actually selected, but remains saying None after selecting my material and closing the selection panel.
    • would it be possible to optionally pass a prefab reference instead of just a mesh?
    • I'm finding that only the first material on my mesh comes through, if you could add prefabs it might help adding multiple materials seeing as most prefabs generated from importing an fbx should have a mesh renderer with the array of materials assign to the mesh. At the moment I'm having to go in and reassign my second missing material to all of my shards
    • Some of the explanations for the options/parameters in the piecemaker interface are little abstract, perhaps some examples might help with what they do or how they affect the end result -- for instance the prefab template instruction talks about LevelPropertiyApplicators of which I've no idea what it refers to (also the word Property has a superfluous 'i' in its name).
    • On the same note as above; After playing around I now understand perfectly what 'levels' mean... but at first it was not overly apparent what it meant... I think it was just a first impression thing.
    • I'm still not sure what 'search and split' means??
    • how does the prefab template work? Does it simply instantiate the prefab and add the created shard mesh to the instance? I'm sure I will figure it out, but again it's not apparent how this will work without trying it first.
    • is there a reason why the collider selection is MeshOrBox? I'm guessing the logic makes a smart decision about which is more appropriate, but could there be an absolute mesh setting, at least to use on level 1 shards.
    • I'm finding that the uv's generated for the cut material are applied nicely on one axis, but stretch on another.... =) hehe, I just read your note re: how should uv's be applied... lol ... a set of cube, atlas, spherical uv mapping to add to the plane setting would be brilliant. However I have no idea about how to code this.
    • when shards are generated is it possible to add an optional transform parent? I can see that adding them to the parent object they are generated from might cause undesired physics behaviours... but some way of organising them in the heirarchy view would be great.


    Hopefully my tone wasn't read as being rude, it's hard to get that across in text.. I hope it's all constructive. Anyway, well done, I think with a bit of polishing it will be an even greater tool!! I might post more feedback after using it some more if you'd be interested.

    Cheers!!

    Jason


    ps: I have got a couple of crashes, nothing too bad, but had one during a process calculation (I've only had around a 100 shards being generated).. another during a runtime test, which I think was after hitting stop then play pretty soon after.
     
    Last edited: May 31, 2011
  8. jrdata2k

    jrdata2k

    Joined:
    Oct 6, 2008
    Posts:
    27
    Hey Marrrk,

    One more for now:

    • I find that I commonly need to regenerate a broken mesh until I get a 'stable' mesh.. ie. for the ones that don't work, I drop the level 0 prefab into the scene to see how it will hold up and some generated shard stacks must have several overlapping physics bodies and the entire mesh explodes... whereas after re-generating a couple of times I'll end up with a more stable mesh. I know it must be difficult, but is there some way to ensure non-overlapping shards, perhaps a post calculation process.
     
  9. Marrrk

    Marrrk

    Joined:
    Mar 21, 2011
    Posts:
    1,032
    Hello jrdata2k, thank you for your very very good and helpful reply.

    I can save the folder and use the last used directory, its possible and I will add this into the next version.

    I will add this feature, good idea.

    Thats very strange, do both meshs share the same name or something like this? I will open a bug entry for this and investigate this problem.

    Do you mean the second Mesh Material or the Cut Area Material, both cases are bad, I will investigate this.

    I could use this prefab as prefab for each level and extract the mesh from the meshfilter for the Piecemaker processing step, is this ok?

    This is a bug, a very strange one as I tested this feature, after selecting a mesh for every submesh a material slot will be created, do you mean you want a variable count of material slots? I can add this.

    I will review the descriptions and create a document with more explainations and samples.
    LevelPropertyApplicators are for example the "Default" thingy you can check or uncheck on the right side of the Piecemaker Window, its a script class which will apply something for every shard, a coder/scripter can enhance this by inheriting from the base applicator class to do some custom stufff which is not covered by the default applicator I distribute with Piecemaker.

    I will enhance the description of this, but I find it hard to explain more than currently.

    If your mesh is build of for example 2 spheres, which do not touch each other, this option will create out of these both spheres 2 separate meshs, if you slice a castle horizontally and the upper part will consist of non connected towers, these option will create a separate meshs out of each of those towers.

    Exactly as you describe it :)

    I dont understand this, could you elaborate this any further? MeshOrBox means that a meshcollider will be used, but when this fails for some reason a fallback box collider will be used.

    I will have a look into this, at least its easy to create other UV mapping methods :)

    I see the benefit of this, I can add this feature, should not be too hard.

    Yeah its very difficult as Unity does not provide any usable collider vs collider methods (aside from Bounds tests). One way could be to shrink the collider meshs, I wonder why this even occours, do you use MeshCollider (MeshOrBox) for this?


    Mark
     
  10. jrdata2k

    jrdata2k

    Joined:
    Oct 6, 2008
    Posts:
    27
    Hey Marrk,

    I should have some time this evening to reply the above, however I have a more pressing issue at the moment. It seems that I can't compile while the Piecemaker code is living with in my Project.

    When I use Piecemaker to generate my destruction prefabs it works without errors (excluding any issues mentioned above). I can run the scene and it still all holds up. However when I try to do a build it fails (I'll list the errors below). Which is odd, because:
    • I don't have the piecemaker window open while compiling
    • all of my shards objects that I've generated don't use any classes at all associated with piecemaker (I have my custom implementation of how the shards are to be used). I'm just using the mesh objects.

    There should be nothing in my scene or project that is running or using piecemaker, which I would have thought would mean that those classes would not even be compiled into the build.

    However it could be because I've added Piecemaker into the Assets/Plugins folder which makes the compiler treat the files differently. I'll try moving the files. If the errors still occur I'll be able to just use the piecemaker files in a 'create destruction project' that I bring the prefabs across into a production project, but I guess that does seem unnecessary. I'll let you know on the outcome here.

    ^^^ After all of the above I just found this note on the EditorWindow doc page:
    Note: This is an editor class. To use it you have to place your script in Assets/Editor inside your project folder. Editor classes are in the UnityEditor namespace so for C# scripts you need to add "using UnityEditor;" at the beginning of the script.
    http://unity3d.com/support/documentation/ScriptReference/EditorWindow.html

    This would probably explain the errors that I've received seeing as piecemaker scrips are mostly editor only scripts. I'll try moving it into Assets/Editor folder. Here's the errors (the one at the bottom of the list was received first):

     
  11. jrdata2k

    jrdata2k

    Joined:
    Oct 6, 2008
    Posts:
    27
    Just to follow up to the above script location problem. I've tried moving the files around and it hasn't really helped.

    After purchasing PieceMaker, the import package dialog appeared and without changing anything (all items were selected), I confirmed the import. This added all of the packages files to this location:

    Assets\PieceMaker\
    (with the package contents underneath the above folder)
    - Editor
    - PieceMakerSample
    - Scripts

    I'm thought perhaps the extra root PieceMaker folder isn't meant to be there. So that the editor scripts end up in Assets\Editor - or is there something that makes all subfolders called Editor live within the UnityEditor namespace?

    I originally moved the files under Plugin because I'm mostly coding in unity javascript and wanted to make sure the c sharp scripts were compiled before js and didn't know that editor scripts needed to be in a particular folder.

    Anyway, after moving the files around and compiling again, I got almost the same 4 errors, except the last one was now this one instead:

    )

    It seems you need to add using UnityEditor to scripts maybe??

    I've tried simply removing all piecemaker scripts to compile, but then all of the prefab shards that are generated from piecemaker have ShardContainer, DestroyWhenNotVisible PiecePureDestructable components added on the original prefabs which causes all other kinds of problems. I'll need to write a script to run through and remove all of those components and update the prefabs.
     
    Last edited: Jun 1, 2011
  12. jrdata2k

    jrdata2k

    Joined:
    Oct 6, 2008
    Posts:
    27
    Also to confirm:

    • because I am coding in Javascript I do actually need to put the non-editor clases (the piecemaker files found in the Scripts folder) into Assets/Plugins so that they are compiled before JS is

    ALSO ... a note for anyone else reading this. Don't let this turn you off Piecemaker -- Marrrk has created a really great little tool. These are really just teething issues. It's pretty great seeing some huge model you've created be totally destructed into tiny pieces!!!
     
  13. PolyMad

    PolyMad

    Joined:
    Mar 19, 2009
    Posts:
    2,350
    I can confirm that blasting models is quite satisfactory and creating a game making use of this tool surely will add a great deal of interaction and visual richness!

    I can recommend it to everybody, also because it's completely scalable and useable practically in any situation.

    Great job!
     
  14. Marrrk

    Marrrk

    Joined:
    Mar 21, 2011
    Posts:
    1,032
    @jrdata2k: I will review this this evening and I hope to give you a solution for your problem. Its very strange that the UnityEditor namespace could not be found. At least it worked for me, but i understand the meaning of the errors. Maybe I need to rewrite some Base Classes for this, should not be hard, its only annoying.
     
    Last edited: Jun 1, 2011
  15. Marrrk

    Marrrk

    Joined:
    Mar 21, 2011
    Posts:
    1,032
    Ok, I found the solution and I am terribly sorry for this kind of mistake. I have send you the updated version which includes some other improvements. As fast as the AssetStore Team reviews the fixed version it will be available to everyone else.

    This was a very very bad mistake from my side, I missed to test something and now this happens.
     
  16. jrdata2k

    jrdata2k

    Joined:
    Oct 6, 2008
    Posts:
    27
    Thanks Marrrk!! I understand the process and it's pretty hard to be on top of all things that can go wrong. Thanks for looking into it!

    I'll still get around to responding to the first big feedback reply as soon as I can find a moment, cheers!!

    Jason
     
  17. ddesmond

    ddesmond

    Joined:
    Feb 9, 2010
    Posts:
    163
    I was building something like this myself, but ran into issues and sidelined it, looks like another purchase for me.
     
  18. VeganApps

    VeganApps

    Joined:
    Jun 30, 2006
    Posts:
    263
    It should always fail.. :p
    Mesh colliders are really slow and you should not use them for moving objects with a rigidbody.. ;) --Did you run a test to find out how much slower the mesh colliders are compared to a optimized compound collider which behaves basically the same ? :) Why don´t you use compound colliders ?

    Would be a nice improvement for version 2.x of your asset.. :D
     
  19. Marrrk

    Marrrk

    Joined:
    Mar 21, 2011
    Posts:
    1,032
    Hi DynamicHead, the MeshCollider is optional, so you dont need to use this :)

    I know its slower than any other collider type, but for big shards (like a whole wall) it provides the best results. But I thank you for the idea with the compound colliders, I will make some experiments as soon as I can.

    @ddesmond: What kind of issues?



    Also here a little preview of something I will provide with the next version:
    http://www.dras.biz/Slicer/WebPlayer.html

    Its kind of buggy right now, but I think it shows something you might be interested in :)
     
    Last edited: Jun 2, 2011
  20. jrdata2k

    jrdata2k

    Joined:
    Oct 6, 2008
    Posts:
    27
    ^^^ definitely, now it's heading in the realms of Wii Sports Resort Fruit Ninja, nice one!
     
  21. jrdata2k

    jrdata2k

    Joined:
    Oct 6, 2008
    Posts:
    27
    Hello jrdata2k, thank you for your very very good and helpful reply.

    • is there anyway that the load/save preset functionality can remember the previous folder that a save or load occurred in?
    I can save the folder and use the last used directory, its possible and I will add this into the next version.
    Sounds great!

    • if closing piecemaker could it produce a temporary preset, so that reopening it immediately reloads the same settings?
    I will add this feature, good idea.
    cool

    • I'm finding that after loading a preset it doesn't always reload the correct mesh, it sometimes loads the next mesh in my list... if it's any help, my fbx had two mesh objects, I had one previously selected, but the other is selected when reloading the preset.
    Thats very strange, do both meshs share the same name or something like this? I will open a bug entry for this and investigate this problem.
    They share a prefix in their name, I have an fbx file that produces a prefab structured like this:
    LHD (prefab top level)
    - LHD:LHD_Body (seems to have the same prefab icon as the top level, and carries the mesh filter, mesh renderer etc.)
    - LHD:LHD_Base (seems to have the same prefab icon as the top level, and carries the mesh filter, mesh renderer etc.)
    - LHD:LHD_Base (mesh)
    - LHD:LHD_Body (mesh)

    So I save a preset with the LHD_Body mesh selected, but the it's always reloaded with LHD_Base selected.


    • Also, reloading Material 2 seems to act a little strange... sometimes it doesn't reload at all, it just says None with no material selected, but other times it says None but upon clicking the search icon I find that my material is actually selected, but remains saying None after selecting my material and closing the selection panel.
    Do you mean the second Mesh Material or the Cut Area Material, both cases are bad, I will investigate this.
    I mean Mesh Material, but this property seems to be named 'Material 2' ??, Cut Area Material always works as expected, the other acts as described.

    • would it be possible to optionally pass a prefab reference instead of just a mesh?
    I could use this prefab as prefab for each level and extract the mesh from the meshfilter for the Piecemaker processing step, is this ok?
    It would be great, because at the moment when you only use a raw mesh source you get no transformations like scale come through on the destruction prefab.

    • I'm finding that only the first material on my mesh comes through, if you could add prefabs it might help adding multiple materials seeing as most prefabs generated from importing an fbx should have a mesh renderer with the array of materials assign to the mesh. At the moment I'm having to go in and reassign my second missing material to all of my shards
    This is a bug, a very strange one as I tested this feature, after selecting a mesh for every submesh a material slot will be created, do you mean you want a variable count of material slots? I can add this.
    Ideally you wouldn't need to have a material array, a prefab defines what materials the mesh would use. However I guess a user could replicate the array of materials that they know their mesh uses.

    • Some of the explanations for the options/parameters in the piecemaker interface are little abstract, perhaps some examples might help with what they do or how they affect the end result -- for instance the prefab template instruction talks about LevelPropertiyApplicators of which I've no idea what it refers to (also the word Property has a superfluous 'i' in its name).
    I will review the descriptions and create a document with more explainations and samples.
    LevelPropertyApplicators are for example the "Default" thingy you can check or uncheck on the right side of the Piecemaker Window, its a script class which will apply something for every shard, a coder/scripter can enhance this by inheriting from the base applicator class to do some custom stufff which is not covered by the default applicator I distribute with Piecemaker.
    thanks

    • On the same note as above; After playing around I now understand perfectly what 'levels' mean... but at first it was not overly apparent what it meant... I think it was just a first impression thing.
    I will enhance the description of this, but I find it hard to explain more than currently.
    yea it's a hard one... I'm not sure..

    • I'm still not sure what 'search and split' means??
    If your mesh is build of for example 2 spheres, which do not touch each other, this option will create out of these both spheres 2 separate meshs, if you slice a castle horizontally and the upper part will consist of non connected towers, these option will create a separate meshs out of each of those towers.

    • how does the prefab template work? Does it simply instantiate the prefab and add the created shard mesh to the instance? I'm sure I will figure it out, but again it's not apparent how this will work without trying it first.
    Exactly as you describe it

    • is there a reason why the collider selection is MeshOrBox? I'm guessing the logic makes a smart decision about which is more appropriate, but could there be an absolute mesh setting, at least to use on level 1 shards.
    I dont understand this, could you elaborate this any further? MeshOrBox means that a meshcollider will be used, but when this fails for some reason a fallback box collider will be used.
    for the above few - thanks

    • I'm finding that the uv's generated for the cut material are applied nicely on one axis, but stretch on another.... =) hehe, I just read your note re: how should uv's be applied... lol ... a set of cube, atlas, spherical uv mapping to add to the plane setting would be brilliant. However I have no idea about how to code this.
    I will have a look into this, at least its easy to create other UV mapping methods
    sounds great

    • when shards are generated is it possible to add an optional transform parent? I can see that adding them to the parent object they are generated from might cause undesired physics behaviours... but some way of organising them in the heirarchy view would be great.
    I see the benefit of this, I can add this feature, should not be too hard.

    • I find that I commonly need to regenerate a broken mesh until I get a 'stable' mesh.. ie. for the ones that don't work, I drop the level 0 prefab into the scene to see how it will hold up and some generated shard stacks must have several overlapping physics bodies and the entire mesh explodes... whereas after re-generating a couple of times I'll end up with a more stable mesh. I know it must be difficult, but is there some way to ensure non-overlapping shards, perhaps a post calculation process.
    Yeah its very difficult as Unity does not provide any usable collider vs collider methods (aside from Bounds tests). One way could be to shrink the collider meshs, I wonder why this even occours, do you use MeshCollider (MeshOrBox) for this?
    I've been using MeshOrBox, to get a more precise fit with my shards, but it still occurs regularly. Perhaps there are just some strange cutting results on my model, such as found with objects like tubes... that produce polys that overlap. Pretty hard problem??!
     
  22. unity3dx

    unity3dx

    Joined:
    Apr 15, 2011
    Posts:
    175
    Is it possible to use it in real time? I mean you shoot at a wall, it breaks up in pieces? Without pre-calculate it? That would be awesome.
     
  23. Marrrk

    Marrrk

    Joined:
    Mar 21, 2011
    Posts:
    1,032
    jrdata2k: Thank you for your reply, I will have a look into the things, especially the MeshCollider Problem.

    unity3dx: Well,it is possible with some restrictions, it should be doable in almost realtime with smaller/simpler objects. MAybe you have seen it, I created a little slicing sample in which some kind of dynamic breaking is done, I could enhance this to allow multiple breaks, its no problem, but it will come with some limitations:

    As I will use multithreading for this it may take some frames until everything is broken nicely, eg. progressive breaking.
    And maybe some more.

    Well short version: Its possible.
     
  24. PolyMad

    PolyMad

    Joined:
    Mar 19, 2009
    Posts:
    2,350
    I tested compound colliders on my tool DICE UNLIMITED and I can say that, unless you talk about a couple or three colliders instead than a mesh, it's not worth, because it falls in counterperformance if you add more base colliders.
    So, if you go for 2 or 3 compound colliders that's ok, if you plan to add more, then make some tests because it's much probably not helping at all.
     
  25. blastone

    blastone

    Joined:
    Apr 7, 2009
    Posts:
    168
    Looks great, I love the slicer, can't wait for that to come about.... whats involved in being a beta tester ( apart from buying the proper version which is a given!)
     
  26. Marrrk

    Marrrk

    Joined:
    Mar 21, 2011
    Posts:
    1,032
    Hi

    blastone, could you elaborate this?
    I am not quite sure if this was a question or something ;)

    ---

    Currently I work on some enhancements to the mesh generation, currently some artifacts will occour because of overlapping (or almost overlapping) vertices, I search and weld those for better results. Also I add tangent recreation, which should eliminate bad looking lighting for dynamically created meshs (like what will be done when slicing a mesh in realtime).

    Some bugs will be fixed:
    - problem with mesh selection
    - problem when serailizing presets (done)
    - problems when building (done)

    Some more options will be added:
    - restriction of the used area for the UV Mapper (this should ensure you could render a mesh in 1 drawcall)
    - another chaos factor option which will ensure that not every shard is around the same size

    Also some new things:
    - calculation of convex mesh hulls (the current implementation is very instable)
    - the slicer component

    Tell me what you think :)
     
  27. dragonstar

    dragonstar

    Joined:
    Sep 27, 2010
    Posts:
    222
    are making this for IOS devices i am about to finish my first game and after that i will build and third person shooter for the Ipad and Piecemaker will be a great asset to put on the shooter
     
  28. Marrrk

    Marrrk

    Joined:
    Mar 21, 2011
    Posts:
    1,032
    So, I finished the Slicer component and the convex hull calculation code. I think everyone could adapt the code for his own purposes.

    Here the sample for the slicer which creates dynamic slices and a simplified convex collision mesh:
    http://www.dras.biz/Slicer/WebPlayer.html
     
  29. AzraelKans

    AzraelKans

    Joined:
    Oct 29, 2009
    Posts:
    135
    I would like to know if android /iphone support is considered or possible for this extension, thanks!
     
  30. mikevanman

    mikevanman

    Joined:
    Sep 30, 2009
    Posts:
    108
    I'm looking for a solution to create a recking ball try game.

    would this provide the solution I'v been looking for, I want to chuck objects at a structure and have it demolished, would this extension shatter may object from the impact point. and can I set different parts of the structure (different models) with different strengths life the windows and walls etc.
     
  31. Marrrk

    Marrrk

    Joined:
    Mar 21, 2011
    Posts:
    1,032
    AzraelKans: As long as an android or iphone build supports Mono/.Net 3.5 it should work. Iam not sure which version is supported, but you can test it by writing a little script, add "using System.Linq;" at the using area and check if the build for iOS or Android runs without problems.

    mikevanman:

    The vanilla Piecemaker version does precalculate the destruction, so there is no way for it to know who you will hit the object. But an script component for dynamic destruction is possible, but making it realtime (hit -> boom) is not so easy.

    You can set many options to how you want to shatter an object. if you really use different models (Window model, Wall Model, eg.) this should work for you.
     
  32. AzraelKans

    AzraelKans

    Joined:
    Oct 29, 2009
    Posts:
    135
    Hi, I recently bought PieceMaker from the asset store, and is working great, but I really need some help on how applicator classes work, all I need is for the prefab to spawn a particle and play a distinctive sound when the entire mesh collapses. Maybe there is a way to send a message when this occurs?

    p.s. Where can I check if there is a new update? does the asset store has the functionality to let me know when there is updates available?
     
  33. Rush-Rage-Games

    Rush-Rage-Games

    Joined:
    Sep 9, 2010
    Posts:
    1,997
  34. pixelsteam

    pixelsteam

    Joined:
    May 1, 2009
    Posts:
    924
    Hey MarrrK, I bought version 1, will you be releasing version 2? and what new goodies. Awesome work man.
     
  35. Marrrk

    Marrrk

    Joined:
    Mar 21, 2011
    Posts:
    1,032
    @AzraelKans:
    For this you dont need an applicator, you could create a Prefab which does that for you and assign it into the fitting slot inside Piecemaker.
    A message send in this case is doable, I will look into this and add this into the next version.

    Regarding Updates: I will show new updates in this thread with a post with the release notes.

    @24pfilms:
    Well, I dont plan a completely new version of Piecemaker, but new features and goodies and bug fixes.
    If you or any other member has some wishs regarding goodies or features, dont hesitate to tell me :)

    With best regards, Mark
     
  36. pixelsteam

    pixelsteam

    Joined:
    May 1, 2009
    Posts:
    924
  37. pixelsteam

    pixelsteam

    Joined:
    May 1, 2009
    Posts:
    924
    I think a better video tutorial would be a big help on how to get the most effect with the least amount of processing. I had a couple of Unity crashes when it was processing the shards...MBP 8gigs of ram. It also takes a serious FPS hit. So if you have a particular setup to get the best bang for the FPS would be a big help.

    Aside from that, a REALLY great asset.
     
    Last edited: Jul 29, 2011
  38. onllm

    onllm

    Joined:
    Mar 4, 2011
    Posts:
    111
    how is the mobile performance?
     
  39. AzraelKans

    AzraelKans

    Joined:
    Oct 29, 2009
    Posts:
    135
    That sounds great bui when I do that then I cant use the piece that piecemaker created, I can only see the prefab instead.
     
  40. Rush-Rage-Games

    Rush-Rage-Games

    Joined:
    Sep 9, 2010
    Posts:
    1,997
  41. pixelsteam

    pixelsteam

    Joined:
    May 1, 2009
    Posts:
    924
  42. fallingbrickwork

    fallingbrickwork

    Joined:
    Mar 16, 2009
    Posts:
    1,072
    This looks really cool, don't know how I missed it. Will have to check it out further. Great stuff.

    Best Regards,
    Matt.
     
  43. Rush-Rage-Games

    Rush-Rage-Games

    Joined:
    Sep 9, 2010
    Posts:
    1,997
  44. Marrrk

    Marrrk

    Joined:
    Mar 21, 2011
    Posts:
    1,032
    @24pfilms: Looks very great :D

    @AzraelKans: I will create a small video tutorial regarding the applicator and the prefab settings, this should make things a little bit more clear :)

    @onllm: I dont own any mobile license from Unity so Iam not able to test it, but some people using Piecemaker for some iPad games I know that everything works fine. Of course you need to limit the ammount of triangles, fragments and so on.

    ---

    Some small guideline:

    Dont go atomic, dont use too many destruction levels, if you split your initial mesh in 16 fragments and this generated fragments again in 9 fragments and these again into 4 fragments you create up to 736 fragments, even on a good PC, this is a serious performance impact.

    A better way here is to keep the desctruction level low and use particles for the destruction of the smallest fragments, they will spawn faster and Unity is able to update these particles more efficient.

    Prebreak if possible, you want to destroy a building, with a complex roof, many walls, eg.? Better separate the walls into an extra mesh and destroy the mesh parts, you receive a better control over the destruction process (Walls break differently than a roof) and you can control the destruction levels way better than destroying the whole house mesh. Also colliders will dont pose a threat to you and your environment.

    Keep it simple, you want to destroy a dragon figure with wings, tail, horns and many legs. Well its perfectly possible, but Piecemaker works faster and better with low polygon meshs. Many polygons will result in a big memory footprint (the generated meshs need to be loaded from and saved to the harddisc) which increases the overall memory consumption of your application.

    Also a fragmented high poly model will result in many triangles which need to be rendered, keep this in mind.

    Mesh collider are fine but also very hard to calculate, try different collider settings to see what performes best in your environment. Even if piecemaker uses mesh colliders as default colliders, a box collider may be enough to satisfy your needs. Also its much faster on mobile plattforms.

    Open world is nice, but keep your meshs closed.
     
  45. AzraelKans

    AzraelKans

    Joined:
    Oct 29, 2009
    Posts:
    135
    Hahahaha I just found out how to use this with enemies :) awesome!

    Is pretty easy all you have to do is to create a breakable out of the enemy mesh then break it into small pieces (only one level) add a texture for the innards for added gore. and use it as a material.

    Then all you have to do is to instantiate the shard container when the enemy dies, for added effect you can also do an explosion that affects all rigidbodies (like you do in ragdolls) and just watch pieces fly :)
     
    Last edited: Aug 4, 2011
  46. pixelsteam

    pixelsteam

    Joined:
    May 1, 2009
    Posts:
    924
    Fantastic would love to see a webplayer!

     
  47. AzraelKans

    AzraelKans

    Joined:
    Oct 29, 2009
    Posts:
    135
    2dpFilms: Sorry. is for an unannounced project, maybe later I can upload an example with standard assets.

    Marrk: Looking forward to that video mark, sounds like it would be really interesting :)
     
  48. Evan-Greenwood

    Evan-Greenwood

    Joined:
    Aug 6, 2008
    Posts:
    98
    Hi Marrrk, thanks for the plugin! (I haven't properly tested it yet, but I believe it is just what I need).

    Out of interest, I know you specifically say that no bone data is supported, is this something you intend to implement?

    I'm probably going to try taking my mesh and deforming it manually using bone data and using your code to split it... But it would be even more awesome if you figure out how to do this first ^_^
     
  49. pneill

    pneill

    Joined:
    Jan 21, 2007
    Posts:
    207
    Seems to be bug with piecemaker and Unity 3.4 Looks like it's using a deprecated type/method.

    Any chance we'll see an update soon to address this?
     
  50. Evan-Greenwood

    Evan-Greenwood

    Joined:
    Aug 6, 2008
    Posts:
    98