Problem with recording simulation

Hey guys,
when i record simulation the cached version is different to the lovely ragdoll sim. You can see the difference when i remove the cache.

Anything im doing wrong in the video? Ive followed the tutorials on the site.

thanks in advance

Thanks for reposting this here Anton. There’s a lot going on in this video, so let me try and break it down.

  1. When you record, I expect that top-head control to move with the simulation, which it does seem to do. Is the issue that it isn’t following more closely?
  2. You’ve assigned Markers to controls directly, no joints?
  3. If joints, have you retargeted anything?
  4. When you record, you expect only the selected Markers to receive keyframes from the record?

In the bottom of the viewport, you can see this dotted line, this means Ragdoll isn’t keeping up with the viewport playback and is skipping frames. You’ll see slightly different results between recording (which does include every frame) and playback. The most reliable results happens when you playback every frame. It probably isn’t the cause of your issue, but something to keep in mind generally.

In the original video, I noticed a number of non-defaults in the Record dialog.

  • Include Kinematic Keys, this would keyframe things that aren’t affected by the simulation, in this case anything greyed out. This is typically not necessary, what results do you expect from this option?
  • Auto Cache, this would keep the original simulation around after having been recorded. This can be useful to compare the result with the original simulation, is that why it’s on?
  • Use Selection typically, you’d only assign to things you want to record. What was the reason for ticking this?

My guess would be that this head control is not entirely responsible for the head position and orientation, that there is a Spline IK or similar system behind it. Ragdoll would try and Parent Constrain your control to the simulated Marker. If the Marker can move places your control cannot, your control would lag behind.

The solution typically is to assign to things that move like your character, in this case the spine joints, and then retarget onto the controls responsible for moving this joints. In this case, there is likely more controls involved than just the head, e.g. torso and neck controls.

So, to narrow this down, would you be able to:

  1. Reproduce the problem in a smaller scene, e.g. a scene with just a single joint chain?
  2. Reproduce the problem in a new scene, with just the smaller character? E.g. in a t-pose, with the spine assigned and recorded.

thanks Marcus for the reply. Im using simple FK controls for spine and head. The head pre recording is a little more seperated from the recorded version which is what im after. For some reason after hitting record it lacks the drag and overlap im after.
For context I have attached a screen shot of the record settings used.However ive tried with every combination checked and unchecked. I get the same result.

(i only need the FK head and spine simulated). Happy to animate the limbs.

thanks again

In that case, it’s likely the Markers are able to move in ways the assigned controls cannot.

For example, if the markers can translate (Translate Motion = Soft) but the controls cannot, then the controls would miss out on that motion.

Would it be possible to capture a closer look, with less controls, so we can better spot the difference? It’s very subtle from where I’m standing at the moment.

This is recorded with default settings, and snapped to simulation (not sure if thats necessary) but its not cached so the sim is great but my controls dont follow.

*edit: FYI there’s no limitations on the controls. Both translate and rotate channels are unlocked for the spine and head controls

Ok, let’s try and perform each step of the recording one at a time, to find where things start to misalign.

  1. Instead of Record Simulation, run Ragdoll → Utilities → Extract Simulation

You’ll find an animated joint hierarchy where the simulation is, this is what Ragdoll exports from the simulation before then constraining your controls to it and baking the constraints to keyframes.

You can try and manually constrain one or more controls to these joints, to see whether your controls are able to follow.

  1. In the options for Extract Simulation there is a Attach Controls option, which would perform the same constraining as the Record Simulation command does. At this point, you should get the same result as the recorded version, except the constraints are still active and present, something you can debug to see why the controls aren’t following.

yeh weird. doesnt want to constrain for some reason, or at least it does but not following

Great, that’s likely the culprit. Bear in mind that with the controls following the extracted simulation, the current simulation will be different. After extracting and attaching, you can hide the Solver and work solely with the constraints to hunt down where things go wrong. This is now a plain Maya issue.

Hmm. not sure why the dont really follow the sim 1 to 1 though. The sim is lovely and the constraints should follow exact but dont.

Thanks Marcus for this support btw

original mesh cut up and extracted

Just double-checking that you are aware that the simulation you are looking at in that video is not the one being constrained to. Instead, you should look at the new joints that were created, that the constraints are attached to. Best to hide the solver to avoid confusion, and maybe color those joints to something more obvious, and crank up their joint size.

yeah i see now. thanks
They follow those but its still not the sim im after.

any way to get a closer match to the solver? took me some time to set up. it would be a shame to scrap and look at other options…or dare i say, animate by hand :rofl:

could i maybe send my scene file to someone? would like this solved really. not sure why the solver is behaving but spitting out joints that are like 50%

Sure we can try that, but let me just confirm one last thing.

The joints that come out of Extract Simulation, they behave as you expect? If your rig were to follow these extracted joints, you’d have what you want? The challenge now is how to constrain your controls to follow these joints?

No. Sadly they dont behave as i want. The solver is awesome, the joints arent like i’d want, therefore my rig following it isnt.

thanks

If that’s the case it would be a major bug in Ragdoll itself, so let’s verify:

  1. Given a Ragdoll setup, such as your scene:

  1. Cache

  1. Extract Simulation

You should now have a simulation and joints that do exactly the same thing. No amount of Maya constraints or rig complexity should change this, this is the fundamentals of the inner workings of Ragdoll.

I can also spot that you are on 2023.10.05, a version heavily behind the times. The latest version is 2024.07.01. It’s possible the advice I’m giving here is not relevant to this version, are you able to upgrade? It’s free.

Im actually using 2020. I’l grab 2024 and try again and let you know. My solver when cached, somehow dilutes. Which is what the joints end up as, which is what my rig ends up as (as you can see in my above videos).

I’l try 2024 and follow the steps above. thanks

oh you mean Ragdoll 2023.10.05 sorry

Hm, so let’s step back a bit.

Is the result you see during playback different from what you see when the simulation is cached? The problem you see is happening before Record Simulation, and before Extract Simulation?

If that’s the case, then it sounds more related to the “Play Every Frame” setting I mentioned earlier. The “Skipped” message at the bottom of the viewport means Ragdoll didn’t manage to simulate every frame. To Ragdoll, your character is moving inconsistently, popping between frames. You should see effectively random results each time you playback.

Try playing back with “Max Realtime” and you should see the same result during both cache and playback.