Jigglebone Chains (CTC) and Colliders (CCL) - Ezekial711/MonsterHunterWorldModding GitHub Wiki
Before I get into this, I would like to thank Karbon for their extensive work in making the CTC and CCL templates for the 010 Editor. Without them, I would have never been able to get the jiggly rigs I make for my mods or even this wiki page. This page will also only be going over jigglebones for armor, NOT weapons. Though it is possible to do so, I have not made jiggly weapons and have been told they read a tad differently compared to armor. I also do not claim to be an expert on these matters so some things may be incomplete or untested.
Infinity of thanks to Statyk for writing all of this as well. Not only did he help massively with the experimental research but he also was the one to compile it into this guide/docs.
This page assumes you already have Blender 2.79 and Asterisk's .mod3 plugin. Things you will need:
- GrainyStatyk KarbonAra (Blender Plugin for ctc and ccl Editing): https://github.com/AsteriskAmpersand/CTC-MHW-Research
TABLE OF CONTENTS
Understanding the .ctc Filetype
The .ctc filetype is what contains information on how certain bones in the .mod3 react to physics. Some groundwork to keep in mind when working with jigglebones:
- These files ONLY contain the bones for physics and do not read the base skeleton in any way. Using bonefunctionIDs on the ctc that map to bones used by hardcoded animations may cause bizarre issues.
- Even if the armour doesn't have a .ctc file next to the mod3, you can simply create one and the game will read it properly.
- Physics bones usually have IDs in the ranges of 150-200 (50 bones). It's theoretically possible to have 255 bones in one ctc but the IDs will have to be unique. Try sticking to the 150-200 range for your own sanity.
- Not having enough bones in the .ctc, having more bones in the .ctc, or having the wrong chain length value will not cause the game to crash, so feel free to add one bone chain at a time as you make your own.
- The .ctc file only reads the bonefunctionID in the custom properties. The actual object name of the bone in Blender is only used for weight painting purposes.
- .Ctc files read the .ccl for collision. They ONLY read .ccl's from their part folder. For example, if you have a body model and want the physics to react to the legs, you need to add the leg collision to the body.ccl, NOT the leg.ccl.
Understanding the .ccl Filetype
The .ccl filetype is what contains information on how jigglebone chains interact with parts of the character's body. This file's true understanding is still "under construction" but there is enough known right now to get by. Here's some info:
- MHW uses the Havok engine for physics. While it would be normal to have colliders be capsules (and the structure appears to be), it seems as though .ctc files only interact with the spheres on the End Bone ID. You'll see these listed below. If you would like to experiment with this, please let us know of your discoveries in the MHW Modding Discord!
- .Ccls do not interact with .ccls from other armor parts. Overlapping in different files should not cause issues.
Determining Jigglebones in Blender
Jigglebones in Blender are referenced by chains of empty objects, their child positions for orientation, and their boneFunction ID. In this screenshot, I've highlighted all the jigglebones on the female Hunter torso. It is entirely possible to make jigglebone chains from scratch but if you're doing so, I recommend adding a chain from an existing model. Some existing .ctcs have float limits that prevent them from going too far (like hair and capes) and that may be preferred compared to making them loose. That will be covered later in this page.
[]
It is also recommended to only move empty bone objects but if you need to re-orient the way the bone objects are laid out, you will need to apply the change before exporting. In most cases, the chain doesn't even have to be exact, but that's all dependent on your project. Here's an example of the parent object on the cape being rotated and where to apply it.
[]
For the rest of the page, I will be using screenshots and examples from mods I've created since I understand them the most.
Creating and Weighting Jigglebones in Blender
In this example image, I've added jigglebones to Lucina's cape, dangling belt strap, sleeve cuffs, and collar by copy+pasting and repositioning chains from other models. That makes for 6 bone chains and a total of 15 bones. You MUST include the bone-end object even though it doesn't get weighted to the model. Jigglebones work on IK chains and if that chain length isn't specified later, it will break and react undesirably.
[]
Now that you have your jigglebone chains in place, you need to parent them to a bone on the body rig (typically between boneFunction IDs 0-100) so that they have something to follow. To do this, select the jigglebone parent, THEN hold Shift and select the body bone. The jigglebone selection will now be highlighted blue and the body bone highlighted white. Now press Ctrl+P and select Object (Keep Transform). You will then see a relationship line going from one to the other. Alt+P is used to unparent selected objects.
[]
Here comes the fun part, weight painting! Thankfully jigglebone weighting can mostly be done by using the gradient tool rather than normal painting. However, the gradient tool is based on screen position and will weight everything in the selected model. If possible, separate mesh parts that you don't want affected into another model by selecting the mesh in Edit Mode (Tab) and separating it with the P key. Alternatively, you can use the "Paint Selected Faces" feature to restrict the painting area. For Lucina's torso, I've separated the belt dangle and cape into their own model. Some things to keep in mind:
- Weight Paint Mode can be swapped with Object Mode by using Ctrl+Tab.
[]
- It might be helpful to enable Show Zero Weights while in Weight Paint Mode. This makes unassigned vertexes black in the viewport so you know you don't have stray weights.
[]
- The gradient tool in Weight Paint Mode has a button to use it but it's much easier to hold Alt and click-drag in the direction you want the gradient to go. Use keypad numbers to change the camera to a front or side view as needed. Here the gradient is set to mix and a weight value of 1.0.
[] []
- The tool makes use of the brush settings so you can even subtract via gradient or give it a certain level. Here I subtracted with a weight value of 0.8. This'll remove anything below that value and bring high level weights down to a maximum level of 0.2.
[] []
Now that we know how to use the weight gradient tool, let's make a smooth transition between bones. Start by going into Edit Mode and selecting all vertexes in the mesh we want to weight. Go to the Vertex Group list and assign them to the body bone you childed the jigglebone chain to. In this case, the entire cape is assigned to Bone.003, the torso bone. Once they are selected, click the locks next to any existing vertex groups so they keep their values throughout the process.
[]
After the model now has a base to weight from, follow these steps:
- Add a vertex group with the name of the first bone object in the chain.
- Now create a 1.0, Mix gradient from the bone after the child of the bone you're weighting for up to the point above it where a parent bone would be. The thing you're looking for is having the green range in between the active bone and its child bone.
- Once you have the gradient on, you may want to subtract from the parent at the top so the existing weights on Bone.003 here aren't too affected. Again, this is only necessary for the parent bone!
- Now you need to go to the Weight Tools section under the brush settings and select Normalize All while the jigglebone weight is still selected. This will remove the weights from everything else as needed
- Repeat this process down the chain EXCEPT for the end bone. Each bone should have a nice green or greenish-yellow gradient split between the different bones.
[]
- Once you've filled in all the jigglebone weights, go into the Weight Tools list again and use the Clean function with a value of 0.001 to get rid of all zero/low weights that might be leftover. Press Normalize All again to polish up the vertex groups. It may also help to use Limit Total with a value of 4. Weights get wonky when there are more than 4 weights on a vertex. Chances are the results will return with 0 changes if you did this right.
[]
Here are some good guidelines that help visually explain the measuring tips:
[]
[]
By having this extended gradient, each bone gets a piece of another bone's nearby vertexes, making WAY more smooth. Here's a comparison shot of a shorter gradient between bones:
[]
Repeat as needed for all the things you want rigged and don't forget to Clean + Normalize All along the way! Now that the chains are in place and weighted to the mesh and the model exports successfully, it's time to start adding physics!
Editing the Jiggle Physics (.ctc)
Now that the model is exported with the jigglebone chains in place, each with their own unique IDs, and weighted, it's time to give them actual physics! Let's start by giving an overview of each section.
The Header
The header is what sets up the Chain Definitions and Bones in the rest of the file and how they behave.
[]
- Update Ticks: This is always set to 0.16666 (1/60)! This means the physics update 60 times per second. If you were to change this to something like 1.0, the physics would update once every second and look pretty silly.
- Pose Snapping: Retention of the initial pose. Unless you're doing something unnatural, keep this at 1.0.
- Spring/Damping: This affects all chains in the .ctc, so be mindful. A value of 0.0 will make the chains behave like gelatin. A value of 1.0 will make the chain move gently and never bounce. Hair usually sits around 0.6 so you can imagine how slowly it'll fall at 1.0. Here's an example of hair with this set to 0.0.
- Reaction Speed: Sensitivity to movement. This does NOT include wind. Here's an example of hair with this set to 20.0
- Gravity Multiplier: This is NOT the gravity parameter for jigglebone chains. It's merely a global "power" for the gravity value found in the Chain Definitions. By default this is 1.0, but can be negative to make things go up/reverse. By setting it to 0.0 along with the Chain Definition gravity and Wind Multipliers, we can get zero-g effects!
- Wind Multiplier (Mid): Power of medium-level winds. A value of 0.0 will disable this tier of wind, only allowing the other two multipliers to move the chain. Negative values will push the chain in the opposite direction.
- Wind Multiplier (Low): Power of weak winds. A value of 0.0 will disable this tier of wind, only allowing the other two multipliers to move the chain. Negative values will push the chain in the opposite direction.
- Wind Multiplier (High): Power of strong winds. A value of 0.0 will disable this tier of wind, only allowing the other two multipliers to move the chain. Negative values will push the chain in the opposite direction.
The Chain Definitions
Most of the tweaking is done in here.
[]
- Collision: Determines if the chain can collide with shapes in the .ccl. 0 = disabled, 4 = Enabled.
- Weightiness: Hard to tell what this actually does. Keep it at 7.0
- X Axis Gravity: 10 = 1m/s^2. Left and right gravity. Typically 0.0.
- Y Axis Gravity: 10 = 1m/s^2. Up and down gravity. -981 for normal gravity.
- Z Axis Gravity: 10 = 1m/s^2. Forward and backward gravity. Typically 0.0.
- X Inertia: (Potentially unrelated to inertia according to a Havok Engine PDF. Needs more info/testing.) Usually a very low number.
- Y Inertia: (Potentially unrelated to inertia according to a Havok Engine PDF. I believe this value is a cone of motion for the chain) This value determines the level of movement the chain has overall. Capes and hair tend to sit around 0.8.
- Z Inertia: (Potentially unrelated to inertia according to a Havok Engine PDF. Needs more info/testing.) Usually the lowest number. I believe this value also determines the "spring" but in reverse to the header value. A higher number snaps the chain back in place faster.
- Wind Multiplier: The level of strength that wind has over this specific jigglebone chain.
The Nodes
I haven't tested it but it may be possible to have jiggle chains attached to jiggle chains with proper parenting.
[]
- Rotation and Translation Matrix: These values are used to stop a bone from rotating too far and are based on radians. A value of 0.8 (~45°) prevents the bone from moving any further than that angle and has authority over the "cone of motion" given in the Chain Definition. A value of 0 will disable limitation and let the chain move wherever it pleases. These parameters can be helpful for preventing clipping or overall ridiculous motions. However, it is still a bit misunderstood and needs more testing. One recommendation would be to copy the limits from an existing .ctc with a similar angle and range of motion. Another recommendation, and like I did in the example of Lucina's belt dangle, is to disable all limits and use the .ccl to restrict clipping. We do not fully understand what the translation matrix does.
Creating a CTC
Start by creating a CTC File object by pressing the Create CTC File button.
[]
Select the bones you want the chain to be made of. It might be helpful to disable selecting meshes by accident, you can do this by clicking on the cursor icon next to the mesh entry on the hierarchy panel (right side).
[]
Press the Chain from Selection button when you are satisfied with your selection. You'll now be able to set the different values for chain-wide properties.
[]
You'll then want to add the chain to the file we created before. This is done by selecting the newly created CTC Chain object and then selecting the CTC Header we created before and Parenting (Ctrl+P).
[]
The chain might not be aligning with it's relevant bones. This tends to happen after every edit, so mashing this button regularly will probably become a habit. Realign Chain Visuals with Bones is for the time being a necessary evil.
[]
In case you missed a bone, or loaded a pre-made CTC Chain and want to extend it you do this by first selecting the Bone you want to add and then selecting the node on the chain you want the bone to continue from, then press Extend Chain. If the node is in the middle of the chain, it will insert your bone in the middle, if it's the last node on the chain it extends it.
[]
Sometimes you want a CTC Chain to apply to a different line of bones. While you can manually Change Targets one by one, it's much faster to instead selected the node which starts the skeleton section you want to "Paste the chain on" and then the first node of the chain and use Restart Chain. It's possible to use this command in special ways, one doesn't HAVE to pick the first node of the chain, the operation only affects the node and it's children, so it's possible to use it to redirect chains from splits or do more complex operations creatively. If the bone selected has multiple children it will attempt to follow the line with closest Function IDs to the previous entry, additionally if it runs out of bones it will set the remaining parts of the chain to no bone (depending on your export settings and goals this will probably be an issue and you should shorten the chain before doing this operation).
[]
[]
An analogue operation but going the other way is Re-ending the chain. Select the bone where the chain should end, select the last node of the chain and press the Re-end Chain operator.
[]
Finally you will probably want to copy properties from pre-existing chains since unknowns abound. The way to do this is using the Chain Wide Data tools for CTC Chains and Node Linear Structures for individual nodes. Import the ctc with desirable properties, Set the Chain Wide Data from the desired chain and Set it on your chain. Then do the same for each node. (Alternatively you can re-start the imported chain on your model which might save you some work if the chains have equal length to the jiggle section of your model).
[]
Editing the Jiggle Collision (.ccl)
This file is still pretty unexplored and should be able to contain different shapes. In general, these appear to house capsules. Yet despite that, only the End Sphere Definition generates collision. In testing, the Start Bone Definition did not appear to affect jigglebone chains.
The Collision Capsule Definitions
These are the actual colliders. There are potentially ways to get shapes other than capsule spheres but how is unknown to me.
[]
- 1. The Start Sphere: The sphere where the collision capsule begins. You can move it around or resize it. Moving it around produces a fixed offset from the bone it tracks (see number 4).
- 2. The End Sphere: The sphere where the collision capsule ends. You can move it around or resize it. Moving it around produces a fixed offset from the bone it tracks (see number 4).
- 3. The Collision Capsule: The actual collider is the convex hull of both start and end sphere. The CCL plugin allows visualizing this on request (if you make changes delete older capsules) by selecting the capsule itself and using Mesh from Capsule.
- 4. Sphere Bone: This refers to the bone object in the base skeleton which the sphere will track. In the image as the End Sphere is selected this is the bone the End Sphere will track. Do not assign these to jigglebones.
Creating Collision Capsules
To create a collision capsule start by selecting the two bones which will be the start and end of it. If you want both spheres tracking the same bone simply select a single bone.
[]
Click Capsule from Selection and set the Radius of each sphere on the operator options on the bottom right.
[]
If you want to see how the capsule will (probably) behave in-game Mesh from Capsule will render the capsule with the values at that point in time.
[]
If you have issues in-game it might be due to the ctc, it might be because of the import and export multiplier (a theory posited by Statyk that the radii of the spheres) or it can be because of the sphere unknowns. You can test this by taking the data from another CCL and pasting it. To do this, import another CCL and copy the unknown data from the borrowed capsule and paste on your capsule.
[]
Video Aid
If none of that was enough to help you understand, these youtube videos could help clear things up!