Ported ragdoll's limbs tend to go crazy from time to time

Alright so I’ve ported a model from The Isle into Gmod but for some odd reason the arms and legs start freaking out for a few seconds then they go back to normal. It usually happens when the limbs collide with the ragdoll itself, so it must be something to do with the collision model. Correct me if I’m wrong. However I can’t seem to figure out what’s the problem? Are the collisions too big or too small? Are they interfering with something? If anyone could help, it would be greatly appreciated. Thanks.

Pics of the collision model: http://imgur.com/a/V3fm0

(every bone is attached to its respective body part, except for fingers and toes of course)

Add $noselfcollisions somewhere in the joint constraints area of the QC when you compile. Shrinking the collisions to add more space between each segment would also help.

Although simply segmenting your model “works,” it’s not exactly ideal to use. You have an unnecessarily high poly physics mesh and some of the hulls (the individual body segments) have gaps in between them large enough for things to get stuck in or vice-versa.

http://i.imgur.com/bACnWBV.png[/t]

It’s actually really easy to just create a physics model from scratch. The basic principles are:

  • The collision mesh itself dictates what hulls move (any hull attached to a bone will move, any bone without a hull does not). You can only have up to 32 different hulls and bones moving.
  • The collision mesh cannot be 2 dimensional. This includes anything hollow that isn’t built on 3d concavity. In other words, don’t leave hulls in your mesh or build anything from single planes left in a 2d state.
  • Any hull dictates what cannot intersect with that segment of the body. Anything in between can result in objects getting stuck in the model or the model getting stuck in walls, doors, and other thin surfaces far more easily. When looking at the mesh itself, hulls are given collision manually with anything they may intersect with ($jointcollide). Bones immediately next to eachother should not be given these values (Spine1 doesn’t need to collide with Spine2 and so on).

That said, the physics model is just a very low poly mesh. The hands and feet are created from blocks and the fingers have no hulls since they don’t need to move. The limbs and body are cylinders and the head is a modified sphere shape. For non-human forms or models that otherwise don’t fit this type of collision mesh, just shape it however you want. You’re basically creating a bounding box but with a mesh instead of just a box.

Lastly regarding the mesh itself, the smoothing groups actually do make a difference. They’re split in the screenshot above to make things easier to see but unless you’re using them to purposely dictate splitting (you probably don’t need to do that on your model) then you can assign everything to the same smoothing group.

When you have a proper mesh and need to move on to making the QC, you’ll basically be listing the collision mesh’s base values, how much each bone can move on each axis, and what bones can collide with eachother. Among that there’s other values for damping, rotational damping, individual limb weights, and so on. Here’s a base example on how the $collisionjoints may look: http://pastebin.com/VFW5ZdqF

Since you’re not building from a humanoid model where values can just be recycled, creating this can be done in modelviewer.
[t]http://i.imgur.com/3VomxP2.png

Go over to the physics tab, assign the base values on the right and select b ones on the left. From there you can dictate how much it moves on each axis (min/max from default position) by using the sliders, then using the additional test slider to experiment w ith your values. When you’re happy with everything, generate your QC (it wouldn’t hurt to do this frequently as you go along in case you crash or refresh the model for any reason) and place the values into your $collisionjoints command. Additional $jointcollide values can be generated manually later on by just looking at each hull and what other hulls it may touch, then dictating what needs to have collision and what can be ignored (ex: adjacent bones on the latter statement).

I think that about sums it up for now, but I wrote this first thing after waking up so I’m open to further questions if you have any.

The noselfcollision did the trick. Thank you! I redid the collision model so many times lol.

EDIT: @CaptainBigButt So pretty much the model has way too many physics meshes correct? And it would be easier to create my own from scratch correct? Hm. I’ll have to look more into that. Thanks. Is it alright if I pm you when and if I have any further questions?

You have far too many polygons if that’s what you mean. I’d be happy to walk you through it over Teamviewer and/or Skype if you’d like, but otherwise you’re welcome to reply here, PM me, or add me on Steam.