Results 1 to 35 of 35
  1. #1
    Redeemer
    Join Date
    Jun 2010
    Location
    Barcelona
    Posts
    1,954

    Default Using BoneBreak for dismemberment

    ok I've seen a few threads about this but never with a clear answer. I just discovered this so I'd thought I'd share it with this nice community
    Now I present you the working way to use BoneBreak and cause dismemberment in-game!

    Ok I've updated the tutorial slightly.
    I found a slightly easier but much more effective way to have the verts imported and work correctly, by using the ‘Full Weight Swap’ option instead of ‘Partial Weight Swap (Gore)’. This also needed a few extra lines of code but it’s now included as well
    The tutorial is now only accesible at my blog, but there's a direct link for you [right here]

    hope it's of use.
    and yes, you guys can re-format and add it to UDKC if you give me credit

  2. #2
    MSgt. Shooter Person
    Join Date
    Mar 2011
    Posts
    65

    Default

    Man is a Champion.

  3. #3
    MSgt. Shooter Person
    Join Date
    Oct 2010
    Location
    Australia
    Posts
    315

    Default

    Is 'Bip01-Head' supposed to be 'b_head' (for default skeletons)?

  4. #4
    Redeemer
    Join Date
    Jun 2010
    Location
    Barcelona
    Posts
    1,954

    Default

    I believe it is, but Bip01-Head really is supposed to be whatever bone you want to break
    I've already tested breaking the torso and the arms and works just the same
    as long as that specific bone has a phys body inside your PhAT setup then it should work

  5. #5
    MSgt. Shooter Person
    Join Date
    Oct 2010
    Location
    Australia
    Posts
    315

    Default

    Man this is so awesome. Gonna start work on my new gore-ready model!

  6. #6
    MSgt. Shooter Person
    Join Date
    Oct 2010
    Location
    Australia
    Posts
    315

    Default

    After importing the Base and then Duplicate, I receive no prompt asking whether to have Partial or Full...

  7. #7
    Redeemer
    Join Date
    Jun 2010
    Location
    Barcelona
    Posts
    1,954

    Default

    uh that's weird. I'm using the April2011 build (May2011 crashes on me). the partial option is the default one though, so maybe it'll work anyway

  8. #8
    MSgt. Shooter Person
    Join Date
    Oct 2010
    Location
    Australia
    Posts
    315

    Default

    Yeah, I'm still using old 2010-05. For some reason newer UDKs lag like crazy for me. It seems like the weights themselves are not getting imported correctly for me... when I select a bone I want to break, the verts just go crazy. I've triple-checked my Maya files to make sure the weights are done properly (One with smooth weighting and one with 'broken' weighting'). Could my UDK just be too old?

  9. #9
    MSgt. Shooter Person
    Join Date
    Dec 2009
    Posts
    151

    Default

    Shindawg, are you just re-importing it through the 'File' menu? Or are you importing as alternate bone weighting?

  10. #10
    MSgt. Shooter Person
    Join Date
    Oct 2010
    Location
    Australia
    Posts
    315

    Default

    Yeah, I'm following the tutorial exactly and importing through the Alt. Bone Weight option. It still won't work. My Broken Mesh weights appear normal if I import the Mesh seperately to have a look, but it's when I import them as an alternate bone weight that they screw up. I can't tell you how many times I've checked and re-checked my Maya files to make sure the skinning is correct.
    This seems to happen with just about everything to do with bone weights. The initial Meshes always import fine, but if I want something like a morpher or in this case bone break weighting, the verts just go loopy.
    Last edited by Shindawg; 05-21-2011 at 03:51 AM.

  11. #11
    MSgt. Shooter Person
    Join Date
    Aug 2010
    Location
    Greensboro. NC
    Posts
    126
    Gamer IDs

    Gamertag: Cheahhhhh

    Default

    it would be super nice to have a video tutorial on this somewhere...

  12. #12

    Default

    you sir are awesome, thanks so much for this tutorial

  13. #13
    MSgt. Shooter Person
    Join Date
    Jan 2009
    Posts
    60

    Default

    my question: is it possible to reattach the body part?

  14. #14

    Default

    Is it possible to break a physic asset this way?
    I have created a simple rope mesh made of 10 long boxes. I wanted to break it in the middle after causing impulse or damage. When i imported two 3dsmax objects exactly as it was said here, one with regular weights, one with left and right parts not affecting each other and then created physics asset and set middle bone to be breakable, bones are breaking, but mesh is stretching in game and in PhaT. In AnimSet editor everything is fine, no stretching there.
    Then I realized that i have to use BreakConstraint function. How should I do it? In a class extending KAsset I can't use BreakConstraint, but when i extend SkeletalMeshActor I can't use physics (or maybe I am but I don't know how to do it). Or maybe there is easier way to break physics affected skeletal mesh into physics affected colliding pieces (would be best to make it possible to break between any two bones depending on impulse location instead of damage location).

  15. #15
    Redeemer
    Join Date
    Jun 2010
    Location
    Barcelona
    Posts
    1,954

    Default

    Ok guys, I've slightly updated the tutorial. now it's slightly easier to make the import for the body part meshes (less steps involved), and the new method doesn't leave vertices behind (when everything seemed correct in the editor) like the old method did.
    head to the first post for a link to the updated tutorial.
    To anyone having problems with this: follow the whole thing again from start to finish.

    btw this tutorial only covers the full weight swap which works great when you only need to sever a body part (ie. chop the head off the body) but doesn't look good for a body part off of where multiple parts can be chopped from (ie. a chest off of which you can chop the head and both arms). since I'm using the latter in most of my body parts I ended up figuring out how to make it work properly using partial weight swaps. if enough people have need for this I'll write a followup mini-tutorial


    eviltenchi: I'm pretty sure you can't re-attach the body part in a similar way that we're breaking it here. I believe I've read some stuff about creating new constraints but I've never needed it so I have no idea, and it probably would be messy to say the least. At the worst case you can probably just reset the pawn.

    Vordhosbn: this way is breaking a physic asset, in fact if your mesh doesn't have a physic asset you'll get nowhere.
    as the tutorial mentions you need to use the BreakConstraint function, right. I do it all in my Pawn class but I'd say it should be the same in a KAsset. The BreakConstraint function doesn't on the pawn itself but on its mesh, that's why it's called Mesh.BreakConstraint(blah). from a KAsset you'd need to run it from its mesh, probably SkeletalMeshComponent.BreakConstraint(blah) which I believe its the mesh.

  16. #16
    MSgt. Shooter Person
    Join Date
    Jun 2011
    Posts
    186

    Default

    Sorry if this question is a bit noobish, but the tutorial says the mesh must come pre-broken. Does this mean that the arm will be a different mesh that the body or will it still be a part of the same mesh.

    Also, what is the best way to break up meshes if it must be in the same mesh?
    Thanks

  17. #17
    Redeemer
    Join Date
    Jun 2010
    Location
    Barcelona
    Posts
    1,954

    Default

    it can work both ways, using a single mesh or as different meshes. of course with different meshes they already come separate, so if you're using a single mesh then pre-broken means that they are different elements inside a mesh

  18. #18
    MSgt. Shooter Person
    Join Date
    Jun 2011
    Posts
    186

    Default

    Alright, cool. Thank you again for your help.


    Edit: I would be interested in finding out how you did the partially weighted method.
    Last edited by LucasWalter; 12-15-2011 at 05:56 PM.

  19. #19
    Redeemer
    Join Date
    Jun 2010
    Location
    Barcelona
    Posts
    1,954

    Default

    Quote Originally Posted by LucasWalter View Post
    Alright, cool. Thank you again for your help.


    Edit: I would be interested in finding out how you did the partially weighted method.
    ok here it is.
    the process is pretty much the same except for two differences:
    - At the step 4d. select 'Partial Weight Swap' instead of 'Full Weight Swap'. right after that, in the list of bones of the animeditor you need to right-click the bone that's supposed to break and click on 'Calculate Bone Break Vert Weightings - Rigid Body Preferred'
    - at step 5, instead of adding the following lines of code:
    Mesh.BreakConstraint(Impulse, HitLoc, ‘Bip01-Head’);
    for (LODIdx=0; LODIdx < Mesh.LODInfo.length; LODIdx++ )
    {
    Mesh.ToggleInstanceVertexWeights(true, LODIdx);
    TorsoMesh.ToggleInstanceVertexWeights(true, LODIdx);
    }
    add the following:
    TorsoMesh.AddInstanceVertexWeightBoneParented('Bip 01-Head', true);
    Mesh.BreakConstraint(Impulse, HitLocation, 'Bip01-Head');
    this is of course for a Pawn that has a torso mesh that's different from a head mesh. if you just use a single mesh you call the AddInstanceVertexWeightBoneParented thing on 'Mesh' instead of 'TorsoMesh'

  20. #20
    MSgt. Shooter Person
    Join Date
    Jun 2010
    Location
    San Diego, CA
    Posts
    166

    Default

    Quote Originally Posted by Chosker View Post
    it can work both ways, using a single mesh or as different meshes. of course with different meshes they already come separate, so if you're using a single mesh then pre-broken means that they are different elements inside a mesh
    Wow, I did not know that, I thought they had to be completely separate. That info about the elements is really useful.

    I was not sure whether to ask but its related to Physics and Modular Character Meshes. As I mentioned I believed they had to be modular to break apart, So I made a test mesh person with separated upper body(waist up) and lower body meshes. Got my pawn all together using multi-mesh-previews in SkelMesh editor window, everything went smooth until I got to making the Physics assets, because I cant figure out if or how to preview/edit the multiple meshes (upper body & lower body) at the same time the way we do in the Skeletal Mesh editor window.

    I'm basically worried since I dont know how the two Physics assets will interact if created separately.
    My blog for UDK stuff: http://udkoder.geekprojex.com

  21. #21
    Redeemer
    Join Date
    Jun 2010
    Location
    Barcelona
    Posts
    1,954

    Default

    yes that's what I meant with completely separate. they can be separate inside the same mesh, or be different meshes that come as different modular components. if you do the latter you just have to do the stuff on all relevant components.
    I myself only have the head mesh on the Physics asset editor, the rest isn't there and there isn't a way to do so. However this isn't even needed. if you're using modular components the physics asset must be shared among them, not created separately. as such, they won't "interact", it will just act as a single thing. how to do this? I believe the only thing you need is for them to share animations which is done for example in my torso mesh doing "ParentAnimComponent=Head" on the torso component at the defaultproperties, where Head is the name of my main mesh component, which already has the animtreetemplate and animset defined

  22. #22
    MSgt. Shooter Person
    Join Date
    Jun 2011
    Posts
    186

    Default

    If I am understanding this right, for a modular pawn with several skeletal meshes you just need to set the body or whatever mesh that has the physics asset as the parent anim component and define that all in the default properties?

  23. #23
    Redeemer
    Join Date
    Jun 2010
    Location
    Barcelona
    Posts
    1,954

    Default

    yes that's all you need. at least for me that works. the rest of the body parts use the main one's animations and even ragdoll physics

  24. #24
    MSgt. Shooter Person
    Join Date
    Jun 2010
    Location
    San Diego, CA
    Posts
    166

    Default

    It totally makes sense to use the parentanim, I've got that doing the animations for the modular pawn now and that works.
    My problem is I dont know how I am supposed to rig all the boxes and constraints in one physics asset.. when I cant see those parts.
    Right now I've got the Upperbody (head,neck,torso,arms) physics asset just how I want it, and the lowerbody (hips, legs, feet) had to make a seperate phys asset for them because I can't rig/test them if I cant see them.

    I mean, I get that I guess I could tell the upperbody to create all bones and rig those, but how when the legs arent there for reference. So if I can only create 1 Physics assets to include all the parts of the mesh... I cant with modular because the meshes are seperate until I put them togethor in code, I COULD put them togethor, but there is no way to make the phys asset for the final composite?!? argghg face-->kboard
    My blog for UDK stuff: http://udkoder.geekprojex.com

  25. #25
    Redeemer
    Join Date
    Jun 2010
    Location
    Barcelona
    Posts
    1,954

    Default

    if all you want to do is to create the physics asset, export a custom model that has all the body part meshes attached to a single one, import in UDK, use it to create the physics asset (seeing, not guessing), then use the same physics asset on the modular meshes
    I don't think using a phys asset for the upper body and another one for the lower body would be a very good idea, but who knows maybe it carries no problems

  26. #26
    MSgt. Shooter Person
    Join Date
    Jun 2010
    Location
    San Diego, CA
    Posts
    166

    Default

    Quote Originally Posted by Chosker View Post
    if all you want to do is to create the physics asset, export a custom model that has all the body part meshes attached to a single one, import in UDK, use it to create the physics asset (seeing, not guessing)
    NICE. I don't know why I didnt think of that, I guess I spent so much time breaking the mesh apart it never dawned on me to put it back together, Seems to be working though! I didn't even have to collapse+attach (in fact doing that broke the individual physiques) I simply had to select both part then export w/ actorx the refpose, imported as one mesh just fine, called it PHYSREF..making the phys asset now and then I'll just assign it to the parent in the script. THANKS! I think I get it now

    EDIT: IT WORKED GREAT
    Last edited by neurosys; 12-31-2011 at 01:33 AM.
    My blog for UDK stuff: http://udkoder.geekprojex.com

  27. #27
    Redeemer
    Join Date
    May 2012
    Location
    Barcelona
    Posts
    1,604

    Default

    Finally Got it , looks like it's all about breaking the mesh in 3dsmax , wiehgting the bones with the weight tables so the indpeendent arm skeleton does only effect arm and toroso not to arm , and adding the breakConstraint in take damage , and having Ragdoll

    You can even check if it's well weighted so you can break through Phat Tool , just simulating
    Last edited by Neongho; 08-17-2012 at 05:29 PM.

  28. #28
    MSgt. Shooter Person
    Join Date
    Dec 2009
    Location
    College Park, Georgia
    Posts
    355
    Gamer IDs

    Gamertag: Tanx100 PSN ID: HawkX4

    Default

    Man, this is definitely an awesome achievement! I wonder if i can keep the player alive after being dismembered. Hehe.... No arms or legs and still movin'.
    Franklin Iheanacho - Unrealscript Programmer/3D Environmental Artist

    Renegade X - http://www.renegade-x.com/
    Army Men III - http://armymen3.com/
    Neotl Empire - http://www.youtube.com/user/HawkX4

  29. #29
    Redeemer
    Join Date
    Jun 2010
    Location
    Barcelona
    Posts
    1,954

    Default

    you probably can because the code that does the dismemberment doesn't need to be in the dying functions (they could be at takedamage, or wherever)
    problem is, it would probably cause inconsistencies if you chop the weapon arm, the camera to be totally broken if you're using a true first person view and you chop the head, etc

  30. #30
    Redeemer
    Join Date
    Apr 2010
    Location
    Middle East - Kingdom of Bahrain
    Posts
    1,268

    Default

    Great tutorial. I think another alternative could be:

    1- Scale the arm bone to zero (makes it completely disappear - done via a skelcontrol)
    2- Spawn a dismembered arm, with physics applied to it, so that it falls down. Maybe some nice blood particles attached to it would be great.
    3- Slap a blood decal on the body where the arm was dismembered (because when you scale the bone to zero, the texture at that point gets screwed, so this is used to hide it).

    I'm going to try this on my own project, just thought of sharing my idea.
    Hamad Al-Hasan
    Gameplay Programmer / Technical Artist
    Portfolio: http://www.alhasanstudio.com/

    Personal Project: zBioBlow !


    UDK Version: Feb-2013
    OS: Windows 7 Ultimate 64-bit - Service Pack 1
    Intel Core i7 960 3.2 GHz 8MB L3 Cache LGA 1366 130W Quad Core CPU
    12 GB DDR3 Mushkin PC3-12800 998959 (6 x 2048MB) 6-9-7-24 1.65V Blackline
    ASUS Sabertooth X58 LGA 1366 Intel X58 SATA 6Gb/s USB 3.0 ATX Intel Motherboard
    EVGA GTX 580 1.5 GB GDDR5 - Driver Version: 296.10

  31. #31

    Default

    I keep getting the mesh mismatched error on one of my characters when I try to import the alt. bone weighting. Everything is the same between the exported meshes except the VRawBoneInfluences (which is different in the meshes this does work on). I can't seem to find any information on that error, any help/info on what causes that error would be appreciated

    here is my log on the skeletal mesh:

    Log: * Skeletal skin VPoints : 5333
    Log: * Skeletal skin VVertices : 6561
    Log: * Skeletal skin VTriangles : 10363
    Log: * Skeletal skin VMaterials : 1
    Log: * Skeletal skin VBones : 32
    Log: * Skeletal skin VRawBoneInfluences : 6727
    Log: * Skeletal skin VertexColors : 0
    Log: * Skeletal skin Num Tex Coords : 1
    Log: * Skeletal skin VPoints : 5333
    Log: * Skeletal skin VVertices : 6561
    Log: * Skeletal skin VTriangles : 10363
    Log: * Skeletal skin VMaterials : 1
    Log: * Skeletal skin VBones : 32
    Log: * Skeletal skin VRawBoneInfluences : 8504
    Log: * Skeletal skin VertexColors : 0
    Log: * Skeletal skin Num Tex Coords : 1
    Log: Mesh material not found among currently loaded ones: body_new2:defaultMat
    Log: Bones digested - 32 Depth of hierarchy - 9
    Log: Importing weights: Mismatched mesh data. Cannot import mesh weights

  32. #32
    Redeemer
    Join Date
    Jun 2010
    Location
    Barcelona
    Posts
    1,954

    Default

    are you importing via FBX? I've found that meshes that you import using the FBX format will only import correct bone locations for bones that have at least one vertex assigned to them. else the bones get imported at point (0,0,0) or not imported at all.

    since I'm using modular pawns I've never been able to use the FBX format to import my meshes
    try using ActorX to see if that works. if you have a more recent version of max than 2011 google 'ActorX 2012' and you'll find a third-party package with max 2012 and 2013 x86 and x64 versions of it

  33. #33

    Default

    We are using ActorX via Maya

  34. #34

    Default

    Quote Originally Posted by Chosker View Post
    are you importing via FBX? I've found that meshes that you import using the FBX format will only import correct bone locations for bones that have at least one vertex assigned to them. else the bones get imported at point (0,0,0) or not imported at all.

    since I'm using modular pawns I've never been able to use the FBX format to import my meshes
    try using ActorX to see if that works. if you have a more recent version of max than 2011 google 'ActorX 2012' and you'll find a third-party package with max 2012 and 2013 x86 and x64 versions of it
    I can import my chopped up models fine, even the "main mesh (head)" that has all the bones attached (70 bones).

    My problem is that the parts don't want to "break" properly. They do fall off but stay attached some how and the model stretches (it's not broken right?)

  35. #35
    Redeemer
    Join Date
    Jun 2010
    Location
    Barcelona
    Posts
    1,954

    Default

    are you sure both the regular meshes and the alternate weights versions of them were imported correctly?
    if so all that's left is you're probably not using the code that switches them correctly


 

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Copyright ©2009-2011 Epic Games, Inc. All Rights Reserved.
Digital Point modules: Sphinx-based search vBulletin skin by CompletevB.com.