Search Unity

[Release] URG! The ultimate ragdoll generator

Discussion in 'Assets and Asset Store' started by The-Arc-Games, Oct 9, 2011.

  1. The-Arc-Games

    The-Arc-Games

    Joined:
    Oct 3, 2011
    Posts:
    225
    Thanks and yes, we know the conventions kind of suck, but sadly, in simple words, Unity 4 doesn't support namespaces for the class structure that URG needs. We actually namespaced what we could (i.e. the urg utilities) so it is easier to address URG functions now.

    Regarding the new version... Developer package is just waiting Unity approval, and Standard and Free will follow shortly after.
    The major improvement is in fact ASM ragdoll to Mecamim, which is even better and easier than with Legacy!
    We're also updating the new site and will upload a demo video of the Mecanim ASM as soon as possible.
     
  2. Miggy

    Miggy

    Joined:
    Feb 9, 2010
    Posts:
    76
    Yeah, I just mean if you used some upper case letters or underscores something like this:

    clsdismemberatorwrapper

    would look like this:

    cls_dismemberatorWrapper and be a lot easier for the eyes to parse.

    Sounds awesome. Will all of the features work with Mecanim?
     
    Last edited: Apr 1, 2015
  3. The-Arc-Games

    The-Arc-Games

    Joined:
    Oct 3, 2011
    Posts:
    225
    Yes, all of the features work with Mecanim.
     
  4. JBR-games

    JBR-games

    Joined:
    Sep 26, 2012
    Posts:
    708
    hey guys let me first say so far very impressed with your product. I had a question. I'm wondering if there's a way to save dismember body part mesh. so I went to your script off your sample scenes where you pick the body part to dismember and I added the run in editor to it .so I was able to dismembered body parts in the editor but I still couldn't access the mesh ,any ideas?
     
  5. The-Arc-Games

    The-Arc-Games

    Joined:
    Oct 3, 2011
    Posts:
    225
    Hi and thanks for using URG!

    Regarding your question, the component you're looking for is basically the sharedMesh of the SkinnedMeshRenderer
    attached to the dismembered part.
    The sharedmesh in a dismembered part is 100% dynamic, but you should be able to use Unity's asset saving functions (http://docs.unity3d.com/ScriptReference/AssetDatabase.CreateAsset.html) to save it down.
     
  6. GenOli

    GenOli

    Joined:
    Apr 21, 2013
    Posts:
    139
    I've been trying to use this on mobile and the only real performance problems (stutters) are caused by instantiating after a player has been killed and respawns, is there some way to recycle characters (ie: put them back together)?

    Also it seems dismemberment doesn't work on some models properly, even the included soldier, some body parts stretch to base and some have no stump material or it's too small, the apparent solution is to convert it to quads in the modelling application before hand, just wondering if it's possible to include a 'quadrifier' tool?
     
    Last edited: Apr 27, 2015
  7. The-Arc-Games

    The-Arc-Games

    Joined:
    Oct 3, 2011
    Posts:
    225
    Hi and thanks for using URG!
    The stutter you notice, is from using the ASM on a mecanim character?

    In relation to dismemberment, please pay attention to the compiling log: you might be trying to dismember a non indexed bone, or a closed loop.

    Please check the ASM demo scene and the Dismemberator demo scene with those models, and let us know where the issue originates from.
     
  8. Melvin Eng

    Melvin Eng

    Joined:
    Jul 4, 2014
    Posts:
    12
    Hi there,

    I'd like to know if URG supports adaptive physics-based animation(where the character applies appropriate forces to its bones in an attempt to follow the keyframed animation, while being affected by external forces/collisions at the same time)?
    As a reference to clarify what I meant, you check out UE4's physics-based animation...


    Cheers :)
    Melvin Eng
    Workshop Foundry
     
  9. The-Arc-Games

    The-Arc-Games

    Joined:
    Oct 3, 2011
    Posts:
    225
    Hi and thanks for your interest in URG!

    Adaptive physics based animation is normally part of the animation system. At the moment Unity does not implement it, and URG! offers no utility for this feature at the moment.
    We had an old technical case for this request, but it was basically impractical to implement with Unity 3.5 compatibility that we only recently dismissed.

    We'll have a go at this feature again, since Mecanim offers a couple of shortcuts that could help to implement it. We can't promise anything right now, but seems feasible at least!
     
  10. The-Arc-Games

    The-Arc-Games

    Joined:
    Oct 3, 2011
    Posts:
    225
    Please note that with yesterday's patch, URG will throw obsolete method errors.

    We'll fix this error on the incoming new version, but in the meanwhile a simple fix is available.

    Just replace
    UNITY_5_0
    with
    UNITY_5
    in a project-wide search and replace, and change
    Code (CSharp):
    1. varcurrentlimit.spring = 0;
    into
    Code (CSharp):
    1. //varcurrentlimit.spring = 0;
    in the U_r_g.cs script.

    Sorry for the trouble.
     
    Last edited: Jul 26, 2015
  11. UnitedBluff

    UnitedBluff

    Joined:
    Apr 19, 2015
    Posts:
    15
    Hello

    Any reason why it is using characterjoints ? I'm mainly interested in configurable joint and jointhinges because I need to use motors.
     
  12. The-Arc-Games

    The-Arc-Games

    Joined:
    Oct 3, 2011
    Posts:
    225
    Hi and thanks for your interest in URG!
    The reason for the characterjoints is in their design purpose, since they're aimed at emulating body joints.
    They're easier to configure and tweak, and offer a more realistic ragdoll response, in respect to the other joint types.

    However, if you need to, you can write a routine to replace them with a different joint type, once the ragdoll is created. This'd be done entirely using Unity methods, so it should be relatively simple to do.
     
  13. UnitedBluff

    UnitedBluff

    Joined:
    Apr 19, 2015
    Posts:
    15
    Ok thank you. Perhaps, for the future, the user could select joint types as well ?
     
  14. HakJak

    HakJak

    Joined:
    Dec 2, 2014
    Posts:
    192
    Is there any way to make the dismemberment run as a co-routine?? I get a sharp drop in frame rate when it's called for multiple models / models with higher poly counts. Everything essentially stops for a half-second or so while the dismember method runs

    I have the Standard Editon.
     
  15. HakJak

    HakJak

    Joined:
    Dec 2, 2014
    Posts:
    192

    PLEASE DISREGARD! It was my fault. Debugging print messages were slowing it down! I turned them all off and now it runs smooooooth as butter!! Thanks again for producing such an epic product :D
     
  16. The-Arc-Games

    The-Arc-Games

    Joined:
    Oct 3, 2011
    Posts:
    225
    Thanks for the feedback and appreciation.
    Do however know that you triggered a frenzy here since we started conceiving a way to run URG's cutter in multithread :D
    It's going to be tricky but we should be able to increase performance with this idea.
    Thanks for getting in touch with us.
     
  17. HakJak

    HakJak

    Joined:
    Dec 2, 2014
    Posts:
    192
    Wow! Sorry again for the confusion. However, I am also looking forward to this new version, if you're able to figure it out (no pressure because your product is great, as-is). This project I'm working on will really push this asset to the limits; lots of models, lots of polys, lots of simultaneous dismemberment! Although it works really great in its current form, if you can manage to implement multithreading then I think it will pay off in even better performance. The only time I've noticed any issue so far is when dismemberment methods are called for high velocity impacts (> 40 relative velocity) or when I'm dismembering many joints at once. Then there is just a very slight delay. But again, it could be due to my own scripts running around yours, and it's not noticeable unless I'm running things in slow motion.

    Overall, very happy with your product and the performance is great! But I'm happy to help keep it evolving.
     
  18. RichyK

    RichyK

    Joined:
    Feb 8, 2015
    Posts:
    57
    I've just purchased the standard edition and I'm getting two errors in Unity 5:

    Assets/UltimateRagdollStandard/Scripts/clscameratarget.cs(56,33): error CS0619: `UnityEngine.Physics.minPenetrationForPenalty' is obsolete: `use Physics.defaultContactOffset or Collider.contactOffset instead.'

    Assets/UltimateRagdollStandard/Scripts/clscameratarget.cs(62,33): error CS0619: `UnityEngine.Physics.maxAngularVelocity' is obsolete: `use Rigidbody.maxAngularVelocity instead.'

    I thought URG! was compatible with Unity 5?

    Richard

    ps I'm using version 5.1.1f1
     
  19. RichyK

    RichyK

    Joined:
    Feb 8, 2015
    Posts:
    57
    Is there any documentation for URG?
     
  20. The-Arc-Games

    The-Arc-Games

    Joined:
    Oct 3, 2011
    Posts:
    225
    Hi and thanks for contacting us!
    URG! is 100% compatible with Unity 5 and later, but there seems to be a slight problem with the precompilation directives we used, and Unity updates.

    To fix the issue simply replace
    UNITY_5_0
    with
    UNITY_5
    in a project wide search.

    You should be all set afterwards.
     
  21. The-Arc-Games

    The-Arc-Games

    Joined:
    Oct 3, 2011
    Posts:
    225
    Documentation is found inside the asset folder, in two files:
    ___U_r_g_README
    and
    ___U_r_g_REFERENCE, this one being actually a reference manual for URG.
     
  22. RichyK

    RichyK

    Joined:
    Feb 8, 2015
    Posts:
    57
    Thank you :)
     
  23. JBR-games

    JBR-games

    Joined:
    Sep 26, 2012
    Posts:
    708

    this was in July, its now september don't you think rather than having us " your customers " look for forums that are not easily found you should add an update for this issue and maybe post the forum link in the Asset description ?? This is a great Asset and i hope you keep supporting it..

    Also FYI your ,"advance use, Animation states" in the main demo seems to be broken.

    NullReferenceException: GetRef
    clsshowcasehelper+<metAsmRoutine>c__Iterator4.MoveNext () (at Assets/UltimateRagdollDeveloper/Scripts/clsshowcasehelper.cs:117)

    The AnimationClip 'transition' used by the Animation component 'Alien_ASM' must be marked as Legacy.
    UnityEngine.Animation:AddClip(AnimationClip, String)
    U_r_g_utils.clsurgutils:metcrossfadetransitionanimation(Transform, String, Single, Transform, String, Boolean, String, Animation, SkinnedMeshRenderer, clsurganimationstatesmanager) (at Assets/UltimateRagdollDeveloper/Scripts/U_r_g_utils/clsurgutilities.cs:135)
    <metAsmRoutine>c__Iterator4:MoveNext() (at Assets/UltimateRagdollDeveloper/Scripts/clsshowcasehelper.cs:116)

    The animation state transition could not be played because it couldn't be found!
    Please attach an animation clip with the name 'transition' or call this function only for existing animations.
    UnityEngine.Animation:CrossFade(String)
    U_r_g_utils.clsurgutils:metcrossfadetransitionanimation(Transform, String, Single, Transform, String, Boolean, String, Animation, SkinnedMeshRenderer, clsurganimationstatesmanager) (at Assets/UltimateRagdollDeveloper/Scripts/U_r_g_utils/clsurgutilities.cs:145)
    <metAsmRoutine>c__Iterator4:MoveNext() (at Assets/UltimateRagdollDeveloper/Scripts/clsshowcasehelper.cs:116)
     
    Last edited: Sep 3, 2015
  24. The-Arc-Games

    The-Arc-Games

    Joined:
    Oct 3, 2011
    Posts:
    225
    Hi and thanks for contacting us.
    The actual issue you write about was solved with a new minor patch for all versions a few days later.

    We've actually downloaded the current free version and noticed what you describe, so we'll immediately verify what's going on.

    We'll make sure all versions work again as intended ASAP. Sorry for the trouble.
     
    theANMATOR2b likes this.
  25. JBR-games

    JBR-games

    Joined:
    Sep 26, 2012
    Posts:
    708
    I have the developer version. Just loaded it 2 days ago and it still had the unity5_0_ issue, if that helps. Wasnt hard to fix once i saw the forums. Thanks
     
  26. The-Arc-Games

    The-Arc-Games

    Joined:
    Oct 3, 2011
    Posts:
    225
    Thanks for getting back to us with this info. We apparently made a mistake updating the latest version of URG so we've reapplied the fix and submitted the correct versions for approval.

    Thanks for your patience and have fun using URG!
     
  27. JBR-games

    JBR-games

    Joined:
    Sep 26, 2012
    Posts:
    708
    @The Arc Games I would like to add some components to the newly created Arms or legs when using Dismemberment. Is there a way to reference these new game objects via a script, or give them a new tag when being created ?
    thanks
     
  28. The-Arc-Games

    The-Arc-Games

    Joined:
    Oct 3, 2011
    Posts:
    225
    Hi and thanks for using URG!

    To answer your question: Certainly! The
    Code (CSharp):
    1. metdismemberpart
    function returns the newly created gameobject's transform.
    the simplest, more commonly called, metdismember function is a wrapper, that returns a boolean, while metdismemberpart is the actual separation function.
    Iterating through metdismemberpart's returned transform you'll be able to manipulate the separated object entirely.
     
  29. JBR-games

    JBR-games

    Joined:
    Sep 26, 2012
    Posts:
    708
    @The Arc Games thanks for the info. I have hopefully one last question :) i used the dismemberment on a model i had. In unity editor (play mode) worked perfectly. I made a small script that dismembers model when shot , looks epic.... But i did a standalone build and it didnt work. I added your test scene to my build and your test model still works but my model doesnt in the test scene, any ideas why my model wont work ?

    Thanks
     
  30. The-Arc-Games

    The-Arc-Games

    Joined:
    Oct 3, 2011
    Posts:
    225
    Is it possible that you're using a different prefab in play mode in respect to the non working one in the built test scene?
    To make sure, create a new prefab out of the working, dismemberable model, and make sure to use that in the test scene in the build.
    If this still doesn't work, please take a look at the build's log file, look for any messages from the dismemberator and get back to us.
     
    Last edited: Sep 24, 2015
  31. JBR-games

    JBR-games

    Joined:
    Sep 26, 2012
    Posts:
    708
    Its not a prefab issues as the game works as intended in editor play mode but not in standalone build. Unless there is some strange switching done during the build.

    Ill do a new build in next few days and send you over the info. Thanks
     
  32. kent13304

    kent13304

    Joined:
    Aug 15, 2012
    Posts:
    9
    Bought UltimateRagdollDeveloper, I'm getting this error trying to dismember the head of my character...

    Can't separate the ragdoll root bone. Aborting.

    I've stepped through some of your code. My skinned mesh renderer does indeed return the head as the first bone in the skinnedMeshRenderer.bones array. Looks like your code assumes this first bone is the root bone of the model.

    I can actually comment out this code to work around it a bit...

    if (varbonecounter == 0) {
    Debug.LogWarning("Can't separate the ragdoll root bone. Aborting.");
    return null;
    }

    This does indeed allow me to dismember the head but it isn't filled in so I'm guessing there is other logic in your code that also doesn't like the head to be the first bone in the skinnedMeshRenderer.bones array.

    Is there a better work around to allow dismembering my model that has a non-root bone as the first element of the skinnedMeshRenderer.bones array?
     
  33. The-Arc-Games

    The-Arc-Games

    Joined:
    Oct 3, 2011
    Posts:
    225
    Hi and thanks for contacting us.
    URG! dismemberator assumes that the target is a standard game character armature, so the bone index 0 as the root is based on Unity's definition.

    We assume that you created the armature manually, and started from the head?

    In any case, the message means that bone 0 has no parent, so you can't separate it.
    To detach the head, you should separate the NECK, in your case.

    Try it and let us know.
     
  34. Tinjaw

    Tinjaw

    Joined:
    Jan 9, 2014
    Posts:
    518
  35. theANMATOR2b

    theANMATOR2b

    Joined:
    Jul 12, 2014
    Posts:
    7,790
    Consider trying a different character - maybe Ethan or another less complex system than Morph3D. Looking in the support thread Morph3D appears to be an unstable system at the moment, and from some of the user feedback doesn't play well with others. Attempting to run another package with it seems like an exercise in trouble shooting.
     
  36. Tinjaw

    Tinjaw

    Joined:
    Jan 9, 2014
    Posts:
    518
    I asked Morph3D in their forum. Their reply is here.

    With that info, is it possible for URG! be updated to handle MCS characters? Is there something I can do workflow-wise now to handle MCS with URG! as it is now?

    Thanks
     
  37. martinamenegon

    martinamenegon

    Joined:
    Aug 28, 2014
    Posts:
    31
    Hello, I have a question: i need to have ragdoll driven characters (1 prefab cloned tot times), that should fall on the ground.. their heads should follow a target (while being in ragdoll state).. is that possible with your asset?
     
  38. Arganth

    Arganth

    Joined:
    Jul 31, 2015
    Posts:
    277
    Does this work with opsives Third person Controller?
    (as it generates ragdolls automatically)
     
  39. The-Arc-Games

    The-Arc-Games

    Joined:
    Oct 3, 2011
    Posts:
    225
    Hi and thanks for contacting us. We're terribly sorry for the late reply but we had problems accessing the account here on the forums.
    What can be see in the video you gently provided is a typical multiple renderer issue / non uniform armature.
    Normally you need to identify the "armature" of the model, which is the parent transform / bone of all the others that compose the character's skeleton.
    You'll usually recognize this transform thanks to the fact it's the parent to a bone usually named "spine" or "root".

    We've noticed you contacted MORPH3D about this.
    With the MCS character the normal ragdolling process is not possible right now, since there are multiple armatures on the model once you attach clothes and props.

    URG! will be able to ragdoll these models separately, but you'll need serious tweaking to make the MCS character behave as a normal ragdoll. The solutions that we think about are:
    1) Ragdoll the base character, and before going ragdoll, merge the extra armatures into the base characters'.
    2) Ragdoll all the armatures separately but identically and create a synch script that sets the extra armatures parts based on the base character ragdoll. This'll also need that you set non-colliding layers between the ragdoll parts of each different armature.
     
    Last edited: Jan 5, 2016
  40. The-Arc-Games

    The-Arc-Games

    Joined:
    Oct 3, 2011
    Posts:
    225
    Hi and thanks for contacting us. We're terribly sorry for the late reply but we had problems accessing the account here on the forums.

    Regarding your question, URG! will be able to create ragdolls for your characters and with the help of the URGent entities option during ragdolling, you'll have easy access to the ragdoll components (in particular the head in your case).

    Your workflow would be:
    - Create ragdoll in editor mode and integrate in your prefab
    - Turn your character into ragdoll with URG routines
    - Get the "clsurgent" class from the ragdoll root and use it to access one specific part of the ragdoll (i.e. the head) and for example activate your tracking script (this is not included in URG!)
     
  41. The-Arc-Games

    The-Arc-Games

    Joined:
    Oct 3, 2011
    Posts:
    225
    Hi and thanks for contacting us. We're terribly sorry for the late reply but we had problems accessing the account here on the forums.

    URG! can manipulate an existing ragdoll thanks to its many functions.
    For example, the dismemberator and animation states tools don't expect an URG! ragdoll to work, so yes it works with other ragdolling tools.

    The only requisite though (as per Unity's standards), is that the ragdoll is 'solid': meaning that physical parts are connected and attached to eachother in terms of character joints, rigidbodies and colliders.
     
  42. sfaok

    sfaok

    Joined:
    Nov 27, 2012
    Posts:
    23
    I'm currently using the fantastic URG! to implement dismemberment.

    If the character is dynamic (i.e.a ragdoll), then everything works ok.
    If the character is animating (mechanim) then the second the body part is removed (i.e. a call to metdismember), the animation breaks and the character rotates, animating oddly, starts stretching etc.



    It's a custom armature but works fine for everything else.

    Strangely if I click on "Apply Root Motion" on the character's Animator component the broken animation fixes itself, animating as normal without the leg as I expect. It doesn't matter if I'm switching "Apply Root Motion" on or off, it fixes itself when I click. I've tried doing the exact same thing in the script (animator.applyRootMotion = true|false, forcing an update etc.) but this doesn't work...It seems clicking on the apply root motion button in the editor updates the mesh/mechanim somehow.

    I'd be very grateful for any advice!

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

    Edit : I currently fix it by calling this coroutine:

    IEnumerator RebindAnimator()
    {
    yield return 0;
    animator.Rebind ();
    }

    If I call this from LateUpdate() on the frame the dismemberment happened, then it rebinds the Animator on the next frame before the model has a chance to break. Any ideas why I need this workaround?
     
    Last edited: Jan 5, 2016
    theANMATOR2b likes this.
  43. The-Arc-Games

    The-Arc-Games

    Joined:
    Oct 3, 2011
    Posts:
    225
    Hi and thanks for contacting us, and for the kind words.
    What you describe is very odd, so we suspect it might be mecanim-related.
    Is it possible that you had the animator active (for example while inspecting the animation controller in edit mode) when you used the dismember utility?

    Another cause might be that the avatar mask needs adjustment in the inspector, if your model is mecanim-humanoid-based (you can check this by accessing the model in the project, then clicking on the "RIG" tab in the inspector, and then in "CONFIGURE" and enforcing t-pose).

    Once you're sure the character's mecanim configuration is proper, re-run the dismemberator utility so that mecanim and dismemberator use the same rest-pose. Once the D process is complete, update the prefab or create a new one, and test it in the dismemberator tester scene.

    Please let us know how it goes.
     
  44. sfaok

    sfaok

    Joined:
    Nov 27, 2012
    Posts:
    23
    The character's rig is "Generic", I assume I needed this because it's a 6 legged alien. I tried changing to humanoid and enforcing T-pose but no luck, same corruption once I dismember.

    I've ran the dismemberator script without any animator window active, same result unfortunately!
     
  45. The-Arc-Games

    The-Arc-Games

    Joined:
    Oct 3, 2011
    Posts:
    225
    All right please considering contacting us by e-mail and sending us the bare model fbx (no textures no scripts, etc.), so that we can take a look at it.
     
  46. HakJak

    HakJak

    Joined:
    Dec 2, 2014
    Posts:
    192
    After updating to the latest version of URG, I'm having a weird issue. It's saying the clsurgutils does not exist in the current context. Dismemberment is still working, but just trying to clarify what this might be, to avoid possible problems down the road.

    using clsurgutils = U_r_g_utils.clsurgutils;
     
  47. The-Arc-Games

    The-Arc-Games

    Joined:
    Oct 3, 2011
    Posts:
    225
    Hi and thanks for contacting us.
    This is a strange message you'e receiving. Can you clarify where does it appear?
    Is it during manual compile, or during automatic compilation?
    Plus is it an error that you suppressed somehow, or a warning?
     
  48. HakJak

    HakJak

    Joined:
    Dec 2, 2014
    Posts:
    192
    Yeah, it is really weird. Everything seems to functioning correctly, and I get no warning/error messages on my Unity console. It only appears in MonoDevelop. The "using clsurgutils = U_r_g_utils.clsurgutils;" appears in red, and then this causes all of the other URG references to appear in red: clsdismemberator, etc. Normally you can't even compile and use code that does this, so it's really strange. My thought was maybe the "using" line was incorrect, or you guys changed something in your namespace/coding structure that I missed when I updated.

    It doesn't appear to be a big deal right now since everything is functioning, but thought maybe you had already seen something like this. If I get more info/problems/fix then I'll let you know.
     
  49. The-Arc-Games

    The-Arc-Games

    Joined:
    Oct 3, 2011
    Posts:
    225
    We've tried reproducing the issue in a number of ways, but were unable to.

    To better understand what's going on, please create a new empty project, import URG! into it and verify if the broken reference still appears.
    If it does, there might be a glitch in the monodevelop installation.
     
  50. HakJak

    HakJak

    Joined:
    Dec 2, 2014
    Posts:
    192
    Just dropped by to say THANK YOU for the latest updates. The new Ragdoll Copy feature is a major time saver!