Hex Editing: Changing Court Colors (Warning, Math Required)

Patchmaking tutorials for NBA 2K11.

Hex Editing: Changing Court Colors (Warning, Math Required)

Postby JaoSming on Mon Jun 20, 2011 11:33 am

Alright, I locked up the old thread since this should effectively replace it, but you can still see it here viewtopic.php?f=138&t=75880


I am going to walk you through how to change the Celtics green out of bounds and lane colors to their Saint Patty's Day gold. So first we need to get the RGB (Red, Green, Blue) values of that gold.

Image

Alright, so open the Celtics court up (f005.iff) in the hex editor of your choice. I use Hex Workshop, but as long as your editor has a Base Converter and basic Find, Find/Replace tools you should be OK.

Image

Alrighty, so the first thing we want to do is run a search for the following Hex, press CTRL + F to search.
Code: Select all
FFFFFFFF000000000000000000000000FFFFFFFF

Image

Now we want to find the 2nd instance of that in the file. Then we want to look "up" in the file for the "0000 803F" in the first two columns. The part circled in red is the Celtics green we want to change.

Image

For those that know a bit more about hex, you want to look 8c bytes before the first instance of the code we searched for.

Image

Alright, so this is where it gets tricky. This area circled in red above contains the RGB for that Celtics green. What we need to do is convert the hex shown to Float (32 bit) values so we can get those into RGB numbers. We need to start looking at the hex like this.

Code: Select all
|  Red   |  Green  |   Blue  |
DDBC 173E 4260 B13E 76AE 463E 0000803F


Hex Workshop automatically converts your selection into various things, like (un)signed bytes, (un)signed short/long, and what we need, Float values. Here are the 3 Float values that correlate to the RGB in that hex.

Image
Image
Image

Now we need to convert those decimals into RGB values. White is what you get when you max out the RGB scale, which is 255, 255, 255. Black is 0, 0, 0. These decimals we just obtained from that hex are actually relate to that 255 scale. To get the RBG values we need to multiply those decimals by 255.

Image

If we plug the RGB of 43, 101, 48 into GIMP or Pain, or whatever you use, that green looks familiar.

Image

So, if we multiply by 255 to go from decimal to RGB, we need to divide our custom RGB by 255 to get our Float decimals.

Image

Now that we have our Float values, we need to convert those to hex. I'm sure there is a website that will do this online, but Hex Workshop comes with a Base Converter which allows us to do the conversion in the program.

Image

You need to make sure that you choose "Intel" for the Byte Order and "float (32)" as the Data Type. You then want to input your decimal in the Decimal box and then copy out your generated Hex. Copy these out into notepad.

Image
Image
Image

So we should have this

Image

Now string them all together Red first, then Green, then Blue, and add the 0000803F at the end. You want to do a find/replace (CTRL + H in hex workshop), finding the original Celtics green hex, and replacing it with your new color.

Image

You want to make sure that you replace exactly the same amount as you find or else you will corrupt the file by changing the file size. The number of occurrences differs from court to court and depends if the court has multiple paint colors.

Image

Now that will replace all the green with the gold on the Celtics court, that means the out of bounds and both lane colors will be gold now. Courts with multiple colors on it, like the Lakers with the Purple lanes and Yellow out of bounds, will require you to look at the other instances of this code,
Code: Select all
FFFFFFFF000000000000000000000000FFFFFFFF

and manually try to locate those colors. Unfortunately again, these color locations differ from court to court so we cannot simply have a list of offsets that cover them all.



Whew, let me know if that makes more sense than the previous tutorial and if there is anything that needs to be cleared up.
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: 29848
Joined: Tue Sep 13, 2005 12:45 am
Location: 2K

Re: Hex Editing: Changing Court Colors (Warning, Math Requir

Postby Vl@d Zola Jr. on Wed Jun 22, 2011 12:57 am

Yeah, looks nice. :)
Though, it's quite a strange manner to store colors as 3 doubles, rather than just 1 integer. At first, i thought, it was some DXT compression used here ))) Nice finding!
User avatar
Vl@d Zola Jr.
Contributor
Contributor
 
Posts: 1055
Joined: Wed Apr 04, 2007 1:31 am
Location: Binaryland

Re: Hex Editing: Changing Court Colors (Warning, Math Requir

Postby Verminator on Sun Jun 26, 2011 8:02 pm

It might be a stupid question, but i'm a newbie at this hex editing thing, so I can't understand this:

Image

I type that hex code - FFFFFFFF000000000000000000000000FFFFFFFF and get lost totally. Like in this case, where should I find the colour code of the paint, out of bounds colours etc.? :oops:
User avatar
Verminator
 
Posts: 196
Joined: Sat Jul 10, 2010 8:29 pm

Re: Hex Editing: Changing Court Colors (Warning, Math Requir

Postby JaoSming on Sun Jun 26, 2011 9:41 pm

did you decompress the iff file first?
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: 29848
Joined: Tue Sep 13, 2005 12:45 am
Location: 2K

Re: Hex Editing: Changing Court Colors (Warning, Math Requir

Postby Verminator on Sun Jun 26, 2011 11:49 pm

Yes
User avatar
Verminator
 
Posts: 196
Joined: Sat Jul 10, 2010 8:29 pm

Re: Hex Editing: Changing Court Colors (Warning, Math Requir

Postby JaoSming on Mon Jun 27, 2011 5:06 am

in my f002, the first position of the colors is around 20E90, you are waaay too far down in the file.
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: 29848
Joined: Tue Sep 13, 2005 12:45 am
Location: 2K

Re: Hex Editing: Changing Court Colors (Warning, Math Requir

Postby Verminator on Mon Jun 27, 2011 6:03 am

Yes, I was way too far down.. And now i managed to find it! :wink:

Image

Big thanks, man! (Y)
User avatar
Verminator
 
Posts: 196
Joined: Sat Jul 10, 2010 8:29 pm

Re: Hex Editing: Changing Court Colors (Warning, Math Requir

Postby JaoSming on Mon Jun 27, 2011 6:13 am

nice job, good luck with it (Y) (Y)
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: 29848
Joined: Tue Sep 13, 2005 12:45 am
Location: 2K

Re: Hex Editing: Changing Court Colors (Warning, Math Requir

Postby Mythbuster on Sun Jul 03, 2011 1:18 am

Finally I can now understand this tutorial more than the previous one. Thanks sir JaoSming :bowdown2:
Trying my best to get better.
Like the Facebook page: http://www.facebook.com/Mythbuster2KX/


Please donate, would be a big help for me, my mods and my PC. Thanks!
Image

My 2k14 Thread-Mythbuster
My 2k13 Thread-Mythbuster
My 2k12 Thread-Mythbuster
My 2k11 Thread-GS6CAR7/Mythbuster

http://www.youtube.com/user/Manaphy756
User avatar
Mythbuster
Extremely Addictive
Contributor
 
Posts: 1167
Joined: Thu Nov 04, 2010 11:47 am
Location: España

Re: Hex Editing: Changing Court Colors (Warning, Math Requir

Postby JaoSming on Mon Jul 04, 2011 10:11 am

no problem man, I just wish we could still do 3D editing to the floors
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: 29848
Joined: Tue Sep 13, 2005 12:45 am
Location: 2K

Re: Hex Editing: Changing Court Colors (Warning, Math Requir

Postby wyq284037353 on Mon Jul 11, 2011 1:18 am

:bowdown2: :bowdown2: :bowdown2: :bowdown2: i have tried it and make it successed.but i have a question that:if i want to make the colors-postions been transparent,what can i input the repleaced color ? please help me ,thanks . because some colors' positions have no colors in my repleaced-floor, so please help me .

and i want to give U some my experience:when U have searched for the FFFFFFFF000000000000000000000000FFFFFFFF,the second of them can change the colors around the stadium,and go on changing the third fourth and go on ,so i thought the Ninth can change the three-point-lines' color and the Twelfth can change the lines around the Paint.i always hope this can help U to finish what U want to do ,thanks and i am looking forward to U help.
User avatar
wyq284037353
 
Posts: 26
Joined: Fri Feb 25, 2011 12:35 am

Re: Hex Editing: Changing Court Colors (Warning, Math Requir

Postby thelegend23 on Mon Jul 11, 2011 5:16 pm

thanks for this tutorial Jao (Y) this is my problem before it takes a lot of trial to get the right combination of color, now it's easy :cool:
User avatar
thelegend23
 
Posts: 1315
Joined: Wed May 14, 2008 5:48 am
Location: Dubai

Re: Hex Editing: Changing Court Colors (Warning, Math Requir

Postby wyq284037353 on Tue Jul 12, 2011 1:15 pm

good job,jiaoming :bowdown: :bowdown2:

and can U answer my two questions ? if the paint and some other part all are same color ,and i just want to change the paint's color ,do not change the others', what can i search for and replace?
the second is if i want to make some parts' colors be transparent how can i do ,please tell me the key to the success if U can.thanks a lot and waitting for U answers!
User avatar
wyq284037353
 
Posts: 26
Joined: Fri Feb 25, 2011 12:35 am

Re: Hex Editing: Changing Court Colors (Warning, Math Requir

Postby JaoSming on Tue Jul 12, 2011 1:29 pm

I dont know and i dont know, you'll have to experiment or use a court with two paint colors in the lane
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: 29848
Joined: Tue Sep 13, 2005 12:45 am
Location: 2K

Re: Hex Editing: Changing Court Colors (Warning, Math Requir

Postby wyq284037353 on Tue Jul 19, 2011 4:31 am

JaoSming wrote:I dont know and i dont know, you'll have to experiment or use a court with two paint colors in the lane

thanks a lot and support U again, good job !
User avatar
wyq284037353
 
Posts: 26
Joined: Fri Feb 25, 2011 12:35 am

Re: Hex Editing: Changing Court Colors (Warning, Math Requir

Postby 187 on Sun Jul 24, 2011 9:48 am

This tutorial is spectacular, just learned how to edit the colors in the paint.
Last edited by 187 on Sun Jul 24, 2011 11:36 am, edited 1 time in total.
187
 
Posts: 493
Joined: Mon Feb 16, 2009 8:03 am

Re: Hex Editing: Changing Court Colors (Warning, Math Requir

Postby JaoSming on Sun Jul 24, 2011 11:35 am

glad it helped (Y)
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: 29848
Joined: Tue Sep 13, 2005 12:45 am
Location: 2K

Re: Hex Editing: Changing Court Colors (Warning, Math Requir

Postby Mythbuster on Mon Jul 25, 2011 4:42 am

wyq284037353 wrote:the second is if i want to make some parts' colors be transparent how can i do ,please tell me the key to the success if U can.thanks a lot and waitting for U answers!


Some courts let their colors be transparent if you put 0000803F0000803F0000803F0000803F (ex: Wizards)

but in some courts if you put them it becomes white. In case 0000803F0000803F0000803F0000803F becomes white, you should make a color that is the same color as your floor texture-like what dRoseBulls did with his all star game court.
Trying my best to get better.
Like the Facebook page: http://www.facebook.com/Mythbuster2KX/


Please donate, would be a big help for me, my mods and my PC. Thanks!
Image

My 2k14 Thread-Mythbuster
My 2k13 Thread-Mythbuster
My 2k12 Thread-Mythbuster
My 2k11 Thread-GS6CAR7/Mythbuster

http://www.youtube.com/user/Manaphy756
User avatar
Mythbuster
Extremely Addictive
Contributor
 
Posts: 1167
Joined: Thu Nov 04, 2010 11:47 am
Location: España

Re: Hex Editing: Changing Court Colors (Warning, Math Requir

Postby #basedmods! on Sun Aug 07, 2011 6:56 am

confusing but it kinda helped me
Image
#basedmods!
 
Posts: 509
Joined: Mon Aug 01, 2011 12:22 pm

Re: Hex Editing: Changing Court Colors (Warning, Math Requir

Postby kittles7 on Mon Aug 08, 2011 7:39 pm

#basedmods! wrote:confusing but it kinda helped me


yeah it can be confusing. no tool has been released for this, it goes to good ol' hex editin'. it is easier if you add additional characters to the label text. it's a good idea to try to look for sections ending in 0000803F, and looking to the values in the groups of hex data a few sections before that.

this tut is helpful to going through the hex data and making courts for the college hoops 2k11 mod. you really have to concentrate and have some testing time so you can test each section with different hex data colors. some courts may have more sections of hex data or longer sections. i make a list of the hex data in these sections in a notepad, compare two courts, and copy and paste the hex data back and forth. the trick is finding the same section of hex data in the court you which to edit with the one that has the court data that you want to try. i count the sections of label text that have the hex data where you can change the colors and what not.
kittles7
 
Posts: 40
Joined: Fri Nov 05, 2010 8:01 pm

Re: Hex Editing: Changing Court Colors (Warning, Math Requir

Postby lavergapuerca on Thu Nov 10, 2011 7:52 am

serves also to nba2k12?
-
Image
User avatar
lavergapuerca
 
Posts: 70
Joined: Thu Dec 03, 2009 5:24 am

Re: Hex Editing: Changing Court Colors (Warning, Math Requir

Postby JaoSming on Thu Nov 10, 2011 9:07 am

there is a court colors tutorial in the 2k12 tutorials forum which is unchanged from this one....so yes.
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: 29848
Joined: Tue Sep 13, 2005 12:45 am
Location: 2K


Return to NBA 2K11 Tutorials & FAQs

Who is online

Users browsing this forum: No registered users and 1 guest