Jump to content

[Tutorial] Notes on CTC physics/jiggle files


UberGrainy

Recommended Posts

Haven't figured out how to do much other than make the physics move a little more than usual, implode them, or make them get stuck in weird directions.

 

Edit: CCL files are used to define collision. Otherwise hair passes through the body.

 

File structure:
First 80 bytes = header
Type A entries = 80 bytes each
Type B entries = 96 bytes each

Header:
2nd line first byte = number of type A entries
2nd line 5th byte = number of type B entries

For example, if these two are 03 and 08, then the file structure after the header will be Type A 80 bytes x3, and then Type B 96 bytes x8.

Other bytes seem mostly identical between CTC files.

 

Type A entry:
First byte is the number of Type B entries pertaining to this section.

5th byte has something to do with collision, If this is set to 00, the physics will not collide with anything even if there's a CCL file. 04 seems common.

Setting the 5th byte to FF will cause crashes in character select and some menus.

6th bytes seems to influence the floatiness/direction of the physics. 07 = weighty-ish, 17 = floaty.

If your physics goes straight up/down try switching to the other.

Dunno what the rest of the values are. The last two lines seem to be float values.

 

Type B entry:
First 64 bytes seem to define limitations. Values in float (4 bytes each).
Dunno the order, but it'd have to be X Y and Z min and max limits.

The next 16 bytes seems to be some kind of identifiers or switches.

3rd byte seems to define if the bone is a parent or not. 00 = not a parent. 01 = parent.
9th byte seems to increase in increments, and I think no entry shares the same value. Pretty sure it's the bone reference number.

Changing stuff on this line seems to break the physics entirely (ie. probably can't find the bone anymore).

Final 16 bytes are float values (4 bytes each), possibly defining stiffness or something.

Edited by UberGrainy
Link to comment
Share on other sites

  • 4 weeks later...

A little more info: the bone references in the CTC don't refer to normal bones.

It refers to physics bones that can be seen in the mod3 bone index, usually at the bottom of the index after all the other bones.

 

CrazyT's importer/exporter currently doesn't seem to display those physics bones in Blender.

Edited by UberGrainy
Link to comment
Share on other sites

  • 1 month later...

Note: physics bones are referred to in the model's bone map. If you don't write those bones there, the physics bones don't seem to move.

I'm pretty sure the address you write hair bones in the bone map also affects how the hairstyle is affected when wearing helms.

 

Oh yeah, and (going from memory) CCL files have a header that defines how many collision primitives (assuming they are, there's probably a byte that tells it whether it's a circle, cylinder, box or something) and then an entry for each primitive and float values defining the size of the collision. I haven't really experimented with the much though. I think I shrank or moved one for the tight ponytail, to stop the end from bending weird.

Link to comment
Share on other sites

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...