New Collision Model Information, Force Planes and Packets
Posted: Tue Mar 09, 2004 10:13 am
Fallen Trunk Example
MATERIAL DEFINITION
Sometimes its name comes as 'col left rudder' or something.
I suppose its not quite a material name like 'rubber' but the structure is the same.
There exists a reflexive pointer to material list @ 0x234
(This is constant for all collision models).
It will specify a chunk count and an address for the start of this material list.
Each chunk/material definition is 0x48 Bytes long.
(Although this doesn't seem 100% constant more like 95%)
If you measure 0x24 bytes into the block there is a short,
if turned to FFFF results in a 'black hole' behavior. If turned to various other int values, ie: 0400 for wood.
Then when you hit/melee/collide with this thing, it gives off different sound/visual effects.
This is good because you don't have to swap metas, and potentially erase cool effects.
FRAME DEFINITION
Reflexive pointer to frame list @ 0x28C
It specifies a chunk count and an address
(This is constant for all collision models)
ie: Fallen Trunk
0100 0000 50CF 4E40
1 Frame Chunk of 0x40 Bytes beginning at That offset.
Swap the Endian, Subtract the Magic, (Subtract the Meta if your working with the sub-files).
And there's your offset.
Inside the small meta files
that turns out to be 0x3D4
The Frame definition is
0x40 Bytes long.
0x20 Bytes in is a single quad which if turned to FFFF turns off the collision model.
I don not know if this is an intended result, or if its some kind of parsing error.
0x34 Bytes in is another reflexive pointer to the frame collision definition.
ie: for fallen trunk
0100 0000 90CF 4E40
FRAME COLLISION DEFINITION (REFERENCED TO BY REFLEXIVE POINTER IN FRAME DEFINITION)
Given the 0x60 byte Frame Col Def. Block.
**NOTE**
When I say @POS I am referring to the fallen_trunk.coll.meta
This is for example purposes only.
**END NOTE**
@POS 0x414
0600 0000 F0CF 4E40
6 Chunks :: Size 0xC bytes at 0x474
@POS 0x420
0600 0000 38D0 4E40
6 Chunks :: Size 0x10 bytes at 0x4BC
These are the force plane definitions.
@POS 0x42C
0600 0000 98D0 4E40
6 Chunks :: Size 0x30/0x6 = 0x08 bytes at 0x51C
@POS 0x438
0600 0000 C8D0 4E40
6 Chunks :: Size 0x8 bytes at 0x54C
@POS 0x450
0600 0000 F8D0 4E40
6 Chunks :: Size 0x48/0x6 = 0xC bytes at 0x57C
@POS 0x45C
0C00 0000 40D1 4E40
12 Chunks :: Size 0x18 bytes at 0x5C4
@POS 0x468
0800 0000 60D2 4E40
8 Chunks :: Size 0x10 bytes at 0x6E4
BLOCK 1 (All shorts, except for that FFFF FFFF?)
0000 0000 0100 0000 0500 0080
0100 0000 0200 0000 0400 0080
0200 0000 0300 0000 0300 0080
0300 0000 0400 0000 0200 0080
0400 0000 0500 0000 0100 0080
0500 0000 FFFF FFFF 0000 0080
BLOCK 2 (THE FORCE PLANE BLOCK [ALTERED FOR MY OWN PURPOSES])
0000 0000 0000 0000 35FA 7F3F 9A99 993E
0000 0000 0000 0000 0000 80BF 9A99 993E
0000 0000 0000 80BF 0000 0000 CDCC AC3F
0000 0000 0000 803F 0000 0000 CDCC AC3F
0000 80BF 0000 0000 0000 0000 CDCC AC3F
0000 803F 0000 0000 0000 0000 CDCC AC3F
Does the force plane always go z, z, y, y, x, x? And if so, does the pattern repeat?
BLOCK 3 (All Shorts)
0000 0100 0000 0000
0000 0100 0100 0000
0000 0100 0200 0000
0000 0100 0300 0000
0000 0100 0400 0000
0000 0100 0500 0000
BLOCK 4 (All shorts)
0500 0000 0500 0080
0400 0000 0400 0080
0300 0000 0300 0080
0200 0000 0200 0080
0100 0000 0100 0080
0000 0000 0000 0080
BLOCK 5 (All shorts)
0000 0000 0000 0000 0000 0000
0100 0000 0200 0000 0000 0000
0200 0000 0200 0000 0000 0000
0300 0000 0600 0000 0000 0000
0400 0000 0100 0000 0000 0000
0500 0000 0700 0000 0000 0000
BLOCK 6 (All shorts...Or Verticies?)
0100 0000 0200 0000 0100 0000 0B00 0000 0000 0000 0300 0000
0200 0000 0000 0000 0400 0000 0900 0000 0000 0000 0400 0000
0400 0000 0500 0000 0300 0000 0A00 0000 0100 0000 0200 0000
0500 0000 0300 0000 0600 0000 0800 0000 0100 0000 0400 0000
0000 0000 0600 0000 0500 0000 0800 0000 0000 0000 0200 0000
0600 0000 0100 0000 0000 0000 0A00 0000 0000 0000 0500 0000
0300 0000 0700 0000 0700 0000 0900 0000 0100 0000 0300 0000
0700 0000 0400 0000 0200 0000 0B00 0000 0100 0000 0500 0000
0000 0000 0500 0000 0200 0000 0100 0000 0200 0000 0400 0000
0300 0000 0200 0000 0000 0000 0300 0000 0300 0000 0400 0000
0400 0000 0600 0000 0400 0000 0700 0000 0200 0000 0500 0000
0100 0000 0700 0000 0600 0000 0500 0000 0300 0000 0500 0000
BLOCK 7 (CO-ORDINATE BLOCK [ALTERED FOR MY OWN PURPOSES])
CDCC ACBF CDCC ACBF 9A99 993E 0400 0000
CDCC AC3F CDCC AC3F 9A99 993E 0000 0000
CDCC ACBF CDCC AC3F 9A99 993E 0100 0000
CDCC ACBF CDCC AC3F 9A99 99BE 0600 0000
CDCC AC3F CDCC ACBF 9A99 99BE 0200 0000
CDCC ACBF CDCC ACBF 9A99 99BE 0300 0000
CDCC AC3F CDCC ACBF 9A99 993E 0500 0000
CDCC AC3F CDCC AC3F 9A99 99BE 0700 0000
THE STRETCHING THE LOG EXAMPLE
I'll tell you straight out, I haven't yet figured out how to stretch a collision model unconditionally. There seems to be a limit on how big it can get, for this log anyway. My analysis of the other data blocks may yield results in the future.
BUT, for the standard log-streching, I have some addition information in regards to forces exerted on each of the walls. If you haven't seen my SPRING-LOG movie go here:
http://files.halomods.com/viewtopic.php?t=1787
The streching of the log deals with BLOCK 2 and BLOCK 7.
(NOTE THAT IN FRAME COLLISION DEFINITIONS, THERE MAY BE MORE THAN 7 BLOCKS. IF SO, THE LAST BLOCK IN THE DEFINITION HOLDS THE CO-ORDINATE BOUNDARIES)
As far as I have discovered, there seems to be a limit of about 1.35 for the X, Y and Z values. Alas. I shall endevor to find a way around this.
Step 1
FIRST STRETCH THE CO-ORDINATE DATA
Lets take for example the first line of data in BLOCK 7
CDCC ACBF CDCC ACBF 9A99 993E 0400 0000
AAAA <- quad, AAAA AAAA <- double-quad
The First three double-quads are the X, Y, and Z boundaries
respectively.
The last double-quad is a vertex to which it refers.
ie: CDCC ACBF is the X-boundary.
If your using a hex-editor (which I strongly suggest)
then if you highlight this d-quad, then you'll notice
it has a float value of -1.35.
I didn't exactly stretch it or multiply the origional by
a integer as xorange or GlasssJAw did, I simply set it
to a number I liked.
Ensure that your consistant with your co-ordinates for making
a panel or cube.
Ie:
CDCC ACBF CDCC ACBF 9A99 993E 0400 0000
CDCC AC3F CDCC AC3F 9A99 993E 0000 0000
CDCC ACBF CDCC AC3F 9A99 993E 0100 0000
CDCC ACBF CDCC AC3F 9A99 99BE 0600 0000
CDCC AC3F CDCC ACBF 9A99 99BE 0200 0000
CDCC ACBF CDCC ACBF 9A99 99BE 0300 0000
CDCC AC3F CDCC ACBF 9A99 993E 0500 0000
CDCC AC3F CDCC AC3F 9A99 99BE 0700 0000
You'll notice that my x-bound is varying between
1.35 and -1.35.
y-bound between
1.35 and -1.35
z-bound between
0.3 and -0.3
The original log file did as well, although
it was more like 1.35094 ...
9AEB ACBF = -1.35....
You can perform similar streching for each co-ordinate,
but keep in mind, I believe these to be only defining
the vertex at specified co-ordinates.
The above blocks (not BLOCK 7) I believe define the
connections of verticies in the collision model.
So increasing these numbers arbitraily may result in
holes.
NOW, go to block 2 (The force plane block).
In the original it appears as:
69DF 593C 0000 0000 35FA 7F3F 87BF 863E
CBBE 8BB4 CF1F A733 0000 80BF F862 7B3E
998D 643C A0F9 7FBF DB49 00B4 D0C1 933E
942B BABB F1FE 7F3F F914 7E33 649C 8C3E
0000 80BF 0000 0000 0E0A F334 95EB AC3F
0000 803F B73A EC28 DA6A 82B4 99EB AC3F
These 0x10 packets define the forces exerted throughout
the collision model.
In the fallen trunk example (not necessarily others)
Packets 1 and 2 define z-forces [up/down]
Packets 3 and 4 define y-forces [-/+]
Packets 5 and 6 define x-forces.[-/+]
The format of the packet changes slightly depending on what
axis it deals with.
ie: For z-axis.
Skew-X, Skew-y, Force-Z, Distance-Z
Skew-[XYZ]
What do I mean by Skew?
Well, here's the deal.
If you put a skew of 1 (float32) or 0000 803F
then it will result in a 90 degree inclination.
If you want say, a 60 degree incline then the value
should be 60/90 = 0.7 = 3333 333F
The same goes for y-skew.
Force-[XYZ]:
Its a ratio of gravity. So a value of 0.9999 results in
a stable platform. 1.0 doesn't work for some reason.
So, if you want a spring, turn it to say 1.45.
Careful though, falling hurts
MATERIAL DEFINITION
Sometimes its name comes as 'col left rudder' or something.
I suppose its not quite a material name like 'rubber' but the structure is the same.
There exists a reflexive pointer to material list @ 0x234
(This is constant for all collision models).
It will specify a chunk count and an address for the start of this material list.
Each chunk/material definition is 0x48 Bytes long.
(Although this doesn't seem 100% constant more like 95%)
If you measure 0x24 bytes into the block there is a short,
if turned to FFFF results in a 'black hole' behavior. If turned to various other int values, ie: 0400 for wood.
Then when you hit/melee/collide with this thing, it gives off different sound/visual effects.
This is good because you don't have to swap metas, and potentially erase cool effects.
FRAME DEFINITION
Reflexive pointer to frame list @ 0x28C
It specifies a chunk count and an address
(This is constant for all collision models)
ie: Fallen Trunk
0100 0000 50CF 4E40
1 Frame Chunk of 0x40 Bytes beginning at That offset.
Swap the Endian, Subtract the Magic, (Subtract the Meta if your working with the sub-files).
And there's your offset.
Inside the small meta files
that turns out to be 0x3D4
The Frame definition is
0x40 Bytes long.
0x20 Bytes in is a single quad which if turned to FFFF turns off the collision model.
I don not know if this is an intended result, or if its some kind of parsing error.
0x34 Bytes in is another reflexive pointer to the frame collision definition.
ie: for fallen trunk
0100 0000 90CF 4E40
FRAME COLLISION DEFINITION (REFERENCED TO BY REFLEXIVE POINTER IN FRAME DEFINITION)
Given the 0x60 byte Frame Col Def. Block.
**NOTE**
When I say @POS I am referring to the fallen_trunk.coll.meta
This is for example purposes only.
**END NOTE**
@POS 0x414
0600 0000 F0CF 4E40
6 Chunks :: Size 0xC bytes at 0x474
@POS 0x420
0600 0000 38D0 4E40
6 Chunks :: Size 0x10 bytes at 0x4BC
These are the force plane definitions.
@POS 0x42C
0600 0000 98D0 4E40
6 Chunks :: Size 0x30/0x6 = 0x08 bytes at 0x51C
@POS 0x438
0600 0000 C8D0 4E40
6 Chunks :: Size 0x8 bytes at 0x54C
@POS 0x450
0600 0000 F8D0 4E40
6 Chunks :: Size 0x48/0x6 = 0xC bytes at 0x57C
@POS 0x45C
0C00 0000 40D1 4E40
12 Chunks :: Size 0x18 bytes at 0x5C4
@POS 0x468
0800 0000 60D2 4E40
8 Chunks :: Size 0x10 bytes at 0x6E4
BLOCK 1 (All shorts, except for that FFFF FFFF?)
0000 0000 0100 0000 0500 0080
0100 0000 0200 0000 0400 0080
0200 0000 0300 0000 0300 0080
0300 0000 0400 0000 0200 0080
0400 0000 0500 0000 0100 0080
0500 0000 FFFF FFFF 0000 0080
BLOCK 2 (THE FORCE PLANE BLOCK [ALTERED FOR MY OWN PURPOSES])
0000 0000 0000 0000 35FA 7F3F 9A99 993E
0000 0000 0000 0000 0000 80BF 9A99 993E
0000 0000 0000 80BF 0000 0000 CDCC AC3F
0000 0000 0000 803F 0000 0000 CDCC AC3F
0000 80BF 0000 0000 0000 0000 CDCC AC3F
0000 803F 0000 0000 0000 0000 CDCC AC3F
Does the force plane always go z, z, y, y, x, x? And if so, does the pattern repeat?
BLOCK 3 (All Shorts)
0000 0100 0000 0000
0000 0100 0100 0000
0000 0100 0200 0000
0000 0100 0300 0000
0000 0100 0400 0000
0000 0100 0500 0000
BLOCK 4 (All shorts)
0500 0000 0500 0080
0400 0000 0400 0080
0300 0000 0300 0080
0200 0000 0200 0080
0100 0000 0100 0080
0000 0000 0000 0080
BLOCK 5 (All shorts)
0000 0000 0000 0000 0000 0000
0100 0000 0200 0000 0000 0000
0200 0000 0200 0000 0000 0000
0300 0000 0600 0000 0000 0000
0400 0000 0100 0000 0000 0000
0500 0000 0700 0000 0000 0000
BLOCK 6 (All shorts...Or Verticies?)
0100 0000 0200 0000 0100 0000 0B00 0000 0000 0000 0300 0000
0200 0000 0000 0000 0400 0000 0900 0000 0000 0000 0400 0000
0400 0000 0500 0000 0300 0000 0A00 0000 0100 0000 0200 0000
0500 0000 0300 0000 0600 0000 0800 0000 0100 0000 0400 0000
0000 0000 0600 0000 0500 0000 0800 0000 0000 0000 0200 0000
0600 0000 0100 0000 0000 0000 0A00 0000 0000 0000 0500 0000
0300 0000 0700 0000 0700 0000 0900 0000 0100 0000 0300 0000
0700 0000 0400 0000 0200 0000 0B00 0000 0100 0000 0500 0000
0000 0000 0500 0000 0200 0000 0100 0000 0200 0000 0400 0000
0300 0000 0200 0000 0000 0000 0300 0000 0300 0000 0400 0000
0400 0000 0600 0000 0400 0000 0700 0000 0200 0000 0500 0000
0100 0000 0700 0000 0600 0000 0500 0000 0300 0000 0500 0000
BLOCK 7 (CO-ORDINATE BLOCK [ALTERED FOR MY OWN PURPOSES])
CDCC ACBF CDCC ACBF 9A99 993E 0400 0000
CDCC AC3F CDCC AC3F 9A99 993E 0000 0000
CDCC ACBF CDCC AC3F 9A99 993E 0100 0000
CDCC ACBF CDCC AC3F 9A99 99BE 0600 0000
CDCC AC3F CDCC ACBF 9A99 99BE 0200 0000
CDCC ACBF CDCC ACBF 9A99 99BE 0300 0000
CDCC AC3F CDCC ACBF 9A99 993E 0500 0000
CDCC AC3F CDCC AC3F 9A99 99BE 0700 0000
THE STRETCHING THE LOG EXAMPLE
I'll tell you straight out, I haven't yet figured out how to stretch a collision model unconditionally. There seems to be a limit on how big it can get, for this log anyway. My analysis of the other data blocks may yield results in the future.
BUT, for the standard log-streching, I have some addition information in regards to forces exerted on each of the walls. If you haven't seen my SPRING-LOG movie go here:
http://files.halomods.com/viewtopic.php?t=1787
The streching of the log deals with BLOCK 2 and BLOCK 7.
(NOTE THAT IN FRAME COLLISION DEFINITIONS, THERE MAY BE MORE THAN 7 BLOCKS. IF SO, THE LAST BLOCK IN THE DEFINITION HOLDS THE CO-ORDINATE BOUNDARIES)
As far as I have discovered, there seems to be a limit of about 1.35 for the X, Y and Z values. Alas. I shall endevor to find a way around this.
Step 1
FIRST STRETCH THE CO-ORDINATE DATA
Lets take for example the first line of data in BLOCK 7
CDCC ACBF CDCC ACBF 9A99 993E 0400 0000
AAAA <- quad, AAAA AAAA <- double-quad
The First three double-quads are the X, Y, and Z boundaries
respectively.
The last double-quad is a vertex to which it refers.
ie: CDCC ACBF is the X-boundary.
If your using a hex-editor (which I strongly suggest)
then if you highlight this d-quad, then you'll notice
it has a float value of -1.35.
I didn't exactly stretch it or multiply the origional by
a integer as xorange or GlasssJAw did, I simply set it
to a number I liked.
Ensure that your consistant with your co-ordinates for making
a panel or cube.
Ie:
CDCC ACBF CDCC ACBF 9A99 993E 0400 0000
CDCC AC3F CDCC AC3F 9A99 993E 0000 0000
CDCC ACBF CDCC AC3F 9A99 993E 0100 0000
CDCC ACBF CDCC AC3F 9A99 99BE 0600 0000
CDCC AC3F CDCC ACBF 9A99 99BE 0200 0000
CDCC ACBF CDCC ACBF 9A99 99BE 0300 0000
CDCC AC3F CDCC ACBF 9A99 993E 0500 0000
CDCC AC3F CDCC AC3F 9A99 99BE 0700 0000
You'll notice that my x-bound is varying between
1.35 and -1.35.
y-bound between
1.35 and -1.35
z-bound between
0.3 and -0.3
The original log file did as well, although
it was more like 1.35094 ...
9AEB ACBF = -1.35....
You can perform similar streching for each co-ordinate,
but keep in mind, I believe these to be only defining
the vertex at specified co-ordinates.
The above blocks (not BLOCK 7) I believe define the
connections of verticies in the collision model.
So increasing these numbers arbitraily may result in
holes.
NOW, go to block 2 (The force plane block).
In the original it appears as:
69DF 593C 0000 0000 35FA 7F3F 87BF 863E
CBBE 8BB4 CF1F A733 0000 80BF F862 7B3E
998D 643C A0F9 7FBF DB49 00B4 D0C1 933E
942B BABB F1FE 7F3F F914 7E33 649C 8C3E
0000 80BF 0000 0000 0E0A F334 95EB AC3F
0000 803F B73A EC28 DA6A 82B4 99EB AC3F
These 0x10 packets define the forces exerted throughout
the collision model.
In the fallen trunk example (not necessarily others)
Packets 1 and 2 define z-forces [up/down]
Packets 3 and 4 define y-forces [-/+]
Packets 5 and 6 define x-forces.[-/+]
The format of the packet changes slightly depending on what
axis it deals with.
ie: For z-axis.
Skew-X, Skew-y, Force-Z, Distance-Z
Skew-[XYZ]
What do I mean by Skew?
Well, here's the deal.
If you put a skew of 1 (float32) or 0000 803F
then it will result in a 90 degree inclination.
If you want say, a 60 degree incline then the value
should be 60/90 = 0.7 = 3333 333F
The same goes for y-skew.
Force-[XYZ]:
Its a ratio of gravity. So a value of 0.9999 results in
a stable platform. 1.0 doesn't work for some reason.
So, if you want a spring, turn it to say 1.45.
Careful though, falling hurts