Rope Setup

Overview

Ropes (or Character Ropes) have many purposes but mainly they are used for attaching cloth, hair, or ropes to a character so that the objects can dangle, shake and deform realistically against the player and other objects.

Example Files

  • chr_rope.rar: This package includes example files for Max and Maya as well as a pre-defined .cdf file.

General Setup

Generally, rope bones should be named "ropeXXX YYY", where ropeXXX is a unique rope's name that identifies all bones belonging to a single rope, and YYY is an arbitrary suffix that's only needed to make individual bones have unique names. However, if cdf attachment was used to set rope's properties, 'rope' prefix is not necessary and rope will be created automatically by following the hierarchy down to the leaf (childless) node. The only important thing is to have bone names start with 'rope'. Everything from the word 'rope' up to the next space constitutes the rope's name, which should be entered in the editor properties. If several ropes are present in the file, they should be named ropeXXX1/2/3 etc, so that the script can iterate through them while setting properties.

  • The YYY name suffix only matters for cloths and is used to arrange separate strands sequentially. So, in this case YYYs should be increasing in lexicographical order (for instance, s06,s07,s08,s09,s10,s11)
  • The hierarchy of the joints should be going from top to bottom as in a regular bone chain
  • Last bone in either a rope or cloth strand is only used to set the terminating vertex position, its direction and size are not used

For Max Users: By indexing the Chainname, it is possible to use several chains/rope objects in one file. It is useful to double-click select the root bone of the chain (will select all children) and use the 3ds Max Renaming Tool.

For Maya Users: Be sure to parent a polygon to the root of the rope with a proxy no draw material assigned to it and the following naming conventions: Rope1_Seg01_physShape

Setup in Sandbox

  1. Open the character you are using in the Character Editor
  2. Add an empty (i.e. having no cgf) bone attachment to the first rope/cloth bone
  3. Use "Phys Props Alive"/"Phys Props Ragdoll" to tweak the corresponding rope/cloth properties

Properties

Here is a list of what the properties mean in the Rope Alive tab of the character editor:

  • Gravity - whether gravity will be applied on top of the initial pose (meaning that when on, the rope's stable simulated pose will be lower then the target pose from the animation.)
    • 0 disables gravity, value over 90 are not practical.
  • JointLimit - per-segment bending limit in angles.
  • JointLimitIncrease - how much JointLimit increases towards the end (in fractions of 1). so, if JointLimit is 10 and JointLimitIncrease is 0.8, the limit will be 10 at the base, and 18 at the last segment
    • Multiply JointLimit by 1+this variable to get the limit at the end to see if it makes sense.
  • MaxTimeStep - time step granularity. smaller timesteps produce smoother results, but are more expensive. normally you don't need any substeps for ropes, so you can set it to large values like 0.05 or even 1 (unless you use very stiff or long ropes.)
    • 0.01 for really complex ropes, 0.05 for simple. typically don’t need to go higher than your 1/framerate

  • SimpleBlending - when on, target pose matching will be done by using independent linear spring targets at each rope vertex; when off - by properly applying angular forces at joints. the first method is more controllable/predictable (especially on longer ropes), the second's more realistic.
    • Generally about 10 in no-simple-blending, can be 100 in simple, but overall very flexible.

  • Stiffness - affects the speed with which the rope returns to the target pose. 10 is a good starting point for tweaking. higher values can compromise simulation stability (might need lower MaxTimeStep), though SimpleBlending mode is less susceptible to that. note that 0 means a fully animated rope, to make a very limp rope use a small but non-0 number (like 0.01)
  • StiffnessDecay - how much Stiffness decreases towards the end of the rope. 1 means full decay (100%), a completely limp segment.
    • Numbers should be on a scale of 0-1.
  • Damping - dampens the rope's oscillations created by stiffness. so, it should be tweaked in conjunction with the latter. the default 1 is a good starting point for adjustments. it's better to start with an underdamped state and gradually go up, since overdamped simulations are harder to spot, so they might look "ok-ish" while in fact being rather sub-optimal.
    • 0-1 is weak, 1-3 is average, 3+ is strong.
  • Friction - sliding friction at collision points. 0 means no friction, 1 is "somewhat average".
    • About 0.4 is ok for characters, 2+ is super-sticky.

  • Mass - only affects how much velocity the rope gets from external impulses (heavier ropes are affected less.)
    • Anything which is not 0 is sufficient.
  • Thickness - radius of the rope for the simulation. when collisions are on, it's better not to use excessively thick ropes (keep radius below 10% of a segment's length - although it's a very "soft" restriction)
  • StiffnessControlBone - when it's set to a non-0 integer value N, the code will scale the current stiffness and damping with the rotation of a bone named "rope_stiffness_controller_N" (100 angles rotation = *1.0)
  • BodyCollisions - enables collisions with the character skeleton
  • EnvCollisions - enables collisions with the world
  • HingeY,HingeZ - restricts rotation to either Y or Z axis (not recommended for ropes with world collisions)