Jan04

Dynamic Rope/Cable System for UE4

Categories // Dynamic Rope System

A fully dynamic Rope/Cable System developed for UE4

Purchase

This plugin has been depricated. See this page for the new version: VICO Dynamics

Intro

This whole thing started after WWE 2K15 came out. Dave and I really liked the rope system they implemented which properly reacted to collisions and physical forces and made the ring feel dynamic and lively. At the time, the ropes in the AAW3 Arena were simple Skeletal Meshes with animations that played on cues to bounce and stretch. But if anything clipped them, nothing happened.

R&D Phase

I remembered that UE4 had a plugin built in called the CableComponent made by James Golding, which modeled the physics of a cable using Verlet Integration with proper procedural rendering. It looked great, but that system lacked any kind of interaction with other Actors in a Level. It essentially only simulated gravity and sway when the end points were moved. I began my implementation by using the CableComponent as a reference to completely rework and re-implement the system with the features we need for AAW3.

Development Phase

The first thing I set out to figure out was a way to link the internal Verlet Integration that the Rope Particles are using for Physics with the Rigid Body physics from PhysX. My first goal was to setup Static Collision; I defined this as the rope colliding with a non-simulating blocking RigidBody.

I created an array of Body Instances that accompanied the array of Rope Particles to act as a representation of the Rope Particles in the PhysX Scene. From here I had accidentally achieved one-way collision, simulating Actors now collided with the Rope as if it was Kinematic. This was great but not exactly what I was trying to achieve. I then decided to implement Position Projection which would do a sweep from the old Position to the new Position and check for hits or if we are already penetrating a Rigid Body. It would then correct the End Position to compensate for the Hit. Or if already penetrating, it would project the new position based on the Penetration vector to put the Particle outside of the Rigid Body. This gave nearly perfect results where the rope would now properly conform to the shape of the Colliding Rigid Body.

Green Spheres Indicate Body Instances the Rope Uses.

After getting Static Collision working the next goal was to have the rope interact with other simulating Rigid Bodies. I defined this as Dynamic Collision.

The first approach I tried was to "transfer" the forces on the Ropes Body Instances to their associated Rope Particles and have Verlet Integration take care of the rest. But this led to instability and a number of simulation errors. I then decided to isolate the Hit Impacts on a per Particle basis and later integrate them inside the Verlet phase. Using this, I listened to Hit events in the Rope component and during a Hit that had a non-zero Impulse; I first calculated the impact force based on Mass of the two bodies, the Restitution of the bodies and Impact strength. This was then recorded into the HitForce array for that Particle and a certain amount of energy was returned to the body that hit the rope. This simulated loss of energy during the impact.

The result was pretty darn good considering the amount of rerouting of forces that occurs.

The last major feature that we needed was the ability to turn off the Physics of the Rope and have it fallow a Skeletal Mesh animation. This is a feature specific to AAW3 where we have instances that a certain Move requires complex rope movement and timing. For this I created the SkinnedRopeComponent which inherits RopeComponent and internally runs a SkeletelMeshComponent which is used to Play the Animation and get the Bone transforms. Currently the component assumes the bones are setup as a rope/cable and are in-order. During a Tick, it extract the bone transform and applies it only if the associated Rope Particle is Fixed (not being Simulated). This means that only part of the rope can be animated and the rest can be simulated.

Updates to this plugin will be regular since this plugin is being used in AAW3 and features will also be added from user feedback.

Videos

First Demo (Intro and overview of the system)

Second Demo (Improved Collisions, Improved Constraint and Force interaction)

Third Demo (Attach to Sockets/Bones and Character Collision)

AAW3 Ring Ropes Demo In-Game (Shows Off the Rope Physics In-Game)

Getting Started with the Plugin

Comments (2)

  • Noah_Z

    Noah_Z

    22 May 2015 at 06:09 |
    Hi, I bought the plugin yesterday.

    Could you please tell me how to set start location and end location in the rope component? Is there something like cookbook of the plugin?

    And btw, how to attach start point to the component or the mesh component socket?
    • Admin

      Admin

      22 May 2015 at 15:03 |
      Hi Noah_Z,

      Thank you for purchasing the plugin!

      There is a getting started video above which should help you with all of your questions. I'll paste it here as well: https://www.youtube.com/watch?v=IGphxBhYNOc

      If you have any other questions, feel free to ask.

Leave a comment

Please login to leave a comment. Optional login below.

Twitter Feed

RT @ChikaraAAW: Working on finishers. Top rope, grapple, Irish whip, submission, opponent-down, etc. And we want you 2 be able 2 assign as…

Eugene Tchoukhrov Eugene Tchoukhrov

@_TheJamsh Can reduce it to 3, at first glance, by getting Velocity.Size() before getting its Normal and using it to get the Normal manually

Eugene Tchoukhrov Eugene Tchoukhrov