Ragdoll boat moving according to the water simulation

I need to animate a boat moving according to the water simulation.

I saw a LinkedIn post from Jason Snyman where he animated a small boat reacting to water waves. I’m trying to figure out how to use Ragdoll on Alembic-cached simulated geometry. I want to move my boat in a specific direction while also having the water wave motion affect the boat through Ragdoll. Is that possible? And if so, is there a way to make the simulation land on a specific point, endpoint, or a mid-point to art direct the result?

My shot is quite similar to what Jason posted, so I was wondering if there’s any existing workflow or internal reference for animating a boat on top of a water sim.

I know Jason’s session is scheduled for next month, but it would be great to get some guidance or references before then if possible.

Hi @Dicco, thanks for moving this question from LinkedIn to here and welcome to the forums.

For completeness, here’s the post.

Since the talk is yet to come, one can only speculate. Maybe @Jason can fill in some blanks, but here’s how I would approach it.

Racing Boat

boat_v03.ma (194.1 KB)
boat_x02.ma (75.0 KB)

Breakdown

  • Part 1 - The Ocean
  • Part 2 - The Boat

Let’s start with the ocean.

Ragdoll is only capable of simulating hard surface objects, and any deformation on such surfaces are ignored. So, to interact with a deforming object we’ll assign Markers to the individual faces of a mesh.

There are many ways of doing this, in this case we’ll use follicles.

1.1 Follicles

Follicles were originally intended for Maya’s hair system, but they work perfectly well as a generic surface constraint.

One of the limitations of this approach is that they depend on the surface having UV coordinates, as that is what they will be setup to follow. But they do include both position and orientation, which is enough for what we need.

  1. nHair → Create Hair Options
  2. Pick “At Selected Surface Points”
  3. Create Hairs
  4. Delete all but the follicles

1.2 Surface

Next, deform the surface such that it is representative of some ocean surface.

  1. Select surface
  2. Deform → Nonlinear Deformers → Wave
  3. Tune it

1.3 Markers

Now that the follicles are moving with the surface, we’ll assign Markers to it and shape these to line up with each face, which in this case are all of equal size and uniformly square. A limitation to this approach is that for more complex surfaces that have triangles of varying sizes the process may be less pleasant.

1.4 Quirk

One of the quirk of constraining anything to a face in Maya - and other DCCs - is that faces are typically dynamically divided into triangles depending on what gives the best result given one particular moment in time.

As a result, our follicles appear to flicker as the surface deforms. This is less noticeable the higher resolution surface you have, but should generally be avoided.

  1. Select shape
  2. Open Attribute Editor
  3. Open Mesh Controls
  4. Change Quad Split from Auto to Left or Right

As a result, the face will get split consistently as it deforms.

2.1 Boat Asset

Next, we’ll fetch the default Maya boat asset.

  1. Windows → Content Browser
  2. Examples / Modeling / Sculpting_Base_Meshes / Vehicles / SportsBoat.ma
  3. Resize to fit scene
  4. Assign Marker
  5. Scale to fit physics world

2.2 Custom Collisions

Clearly, letting the boat simply collide with the ocean is not what we want. We want the boat to intersect the surface and appear buoyant. So we’ll create 4 child Markers to represent where and how this boat is to contact with the surface. Then we’ll establish a soft relationship between contacts and boat.

  1. Position 4 locators at the 4 extremes of the boat
  2. Assign a Marker to each

Next, we’ll want these spheres attached to the boat.

  1. Attach Constrain Child → Boat
  2. Remove Rotate Stiffness
  3. Tune Translate Stiffness and Damping

Stiffness control the distance between contacts and boat. Damping will control how jiggly that distance is to be maintained.

The final trick is to disable contacts on the boat altogether, such that the only parts that collide are these spheres.

2.3 Final Tuning

And that’s all there is to it. The rest is detail.

Things to tune

  • Adjust the size and position of the child Markers to control where and how contacts should happen; e.g. higher positions means a more submerged boat.
  • Tune the stiffness indepdently between front and back to control the feeling of weight; maybe the boat is heavier at the back, maybe there are people at the front.
  • Animate the stiffness, in case some particularly rough wave cause more the boat to be more submerged than desired
  • The overall weight of the boat itself will have an effect, as in the geometry of the boat.
  • Experiment with 3, 6 or 8 Markers. Jason used 8 smaller spheres.

Share what you come up with and good luck! :partying_face:

2 Likes