Hex Editing: Cloth Properties (Net & Jerseys)

Patchmaking tutorials for NBA 2K12.

Hex Editing: Cloth Properties (Net & Jerseys)

Postby JaoSming on Tue Oct 18, 2011 10:28 am

This was found by comparing michaelvlutz49's net physics mod to the default gamedata.iff in NBA 2K11.

----



There are 3 cloth types in 2K12. Thin, Fat, and Reg. So for each cloth file (shorts, u, v, tri, etc) we need to make 3 edits. Also, we can ignore the "static" labels that will pop up since we are only interested in the jerseys that move.

Alright, open up your decompressed cloth_shorts.iff file with your hex editor.

Image

The first thing we want to do is search for any labels with "player" in them. Remember that label names in the iff files have blank bytes between each character, so instead of "player" we want "p.l.a.y.e.r". In hex, instead of searching for "706C 6179 6572" we want to search for "7000 6C00 6100 7900 6500 72" (70006C0061007900650072)

Image

As you can see, I selected the 2nd instance of "p.l.a.y.e.r" in the file which gives me the label for the Fat cloth shorts. Since there is no mention of "static" in this label, I know these are the moving cloth shorts.

If we look "up" right in front of this label we can see a bunch of "803F" values.

Image

These are the values that control the movement of the shorts when worn by fat players.

To edit this we need to change the 803F values to something else. If we click in front of a 803F and look at the Unsigned Short value we can see that it is 16256.


Image

Then if we click in front of two bytes of 0000 we can see that the Unsigned Short is 0.

Image

Finally, if we click in front of two bytes of FFFF we can see that the Unsigned Short is 65535. The highest possible value for an Unsigned Short.

Image

So the range for cloth movement is as follows;

0000 = Slowest/Stiffest Movement Possible
803F = Default Movement
FFFF = Fastest/Flowiest Movement Possible

Next, we are going to select the entire range of values to fully edit the movement of these fat shorts.

Image
Image

All I did was select everything "up" the file in front of the Label that was comprised of 0000 and 803F values. I stopped the selection at the bottom of another label.

We want to copy this stuff out, and paste it into a new blank file for editing.

Image

All that is in this file is the part that controls how fast the cloth moves. The reason we are isolating it is because 803F occurs many times in files and if we do a find/replace for 803F we will mess up a lot of stuff in the game including the offsets for the nets and indicators.

That said, we are going to do a find replace of 803F and change it to FFFF for the easiest moving jerseys possible.

Image

After that, we want to select all of this new file and copy it.

Then we want to go back to the cloth_shorts.iff file and delete the section we copied into the new file. MAKE SURE, that what you delete is the same size as what you are importing.

Image

After it is deleted, paste in your edited values.

Image

Thankfully, the size required to change these values are the same size and format for each cloth file and each cloth type (fat/thin/reg). This means if you keep that edited FFFF file you can easily paste it into the other files after you delete the 803F sections.

For the cloth_shorts.iff file, the thin label is the 5th instance of "p.l.a.y.e.r" in the file and the reg label is the 8th. The offsets are 20058 for reg, 155F8 for thin, and AB98 for fat.


----


Now, if you want to edit the net movement, we need to open the gamedata.iff file in your hex editor. Do a search for n.e.t (6E00650074) and you want to edit what is in front of the 3rd instance (offset: 5B64) and the 8th instance (offset: 9D44).

Image

The selected part is the part we want to edit. The same rules apply for the nets as the cloth. 0000 is the minimum amount of movement possible where as FFFF is the maxmimum.

Image

Then you can go ahead and save and enjoy!
Opinions are my own.
Right Click Loop
phpBB [video]

https://www.youtube.com/playlist?list=PL8ozxhwwmz4LJzpGAj22T5qa0ZVFBJ3yw

User avatar
JaoSming
2KTV Producer
NBA 2K Developer
 
Posts: 29895
Joined: Tue Sep 13, 2005 12:45 am
Location: 2K

Return to NBA 2K12 Tutorials & FAQs

Who is online

Users browsing this forum: No registered users and 1 guest