Def Jam Bitmap and .colours files

Get your graphics formats figures out here! Got details for others? Post here!
Fatal
n00b
Posts: 15
Joined: Mon Nov 16, 2009 10:10 pm
Has thanked: 3 times

Re: Def Jam Bitmap and .colours files

Post by Fatal » Thu Dec 31, 2009 8:40 pm

The contents of this post was deleted because of possible forum rules violation.
Image

User avatar
Mr.Mouse
Site Admin
Posts: 4036
Joined: Wed Jan 15, 2003 6:45 pm
Location: Dungeons of Doom
Has thanked: 413 times
Been thanked: 548 times
Contact:

Re: Def Jam Bitmap and .colours files

Post by Mr.Mouse » Fri Jan 01, 2010 7:08 pm

I've borrowed the game now and it sort of works on thepcsx2 emulator, so I can check some in-game textures and compare with the files. Using PT Explorer I could at least confirm that the 4th byte is an alpha (tranparency) value, but I'm unsure what the colours are. I see that each ssh file is accompanied by other files. ONe of those a .o file (ELF) has this text in it:

Code: Select all

__COORD4:::ColourTranslate
__Model:::2 
__EAGL::TAR:::RUNTIME_ALLOC::UID=3000;SHAPENAME=1,1;PS2EXTOBJ_SetClampH=EAGL::PS2CM_CLAMP;PS2EXTOBJ_SetClampV=EAGL::PS2CM_CLAMP;
__BBOX:::2 __COORD4:::ColourModulator __EAGL::GeoPrimState:::RUNTIME_ALLOC::UID=3000;;SetTextureEnable=true;SetAlphaCompareValue=1;SetAlphaBlendMode=EAGL::ABM_BLEND;SetDepthTestMethod=EAGL::DTM_GEQUAL;;SetPrimitiveType=EAGL::PT_TRIANGLESTRIP;
__const MATRIX4:::EAGL::ViewPort::gpModelViewProjectionMatrix TextureApt0__EAGLMicroCode
__EAGL_TOOLLIB_VERSION:::EAGL_TOOLLIB_VERSION-4
TextureApt 
This seems to mean as much as Electronic Arts Graphics Library (EAGL)
It then sets an alpha compare value of 1 and a blend mode of EAGL (standard I assume) But it also tests Depth.

User avatar
Mr.Mouse
Site Admin
Posts: 4036
Joined: Wed Jan 15, 2003 6:45 pm
Location: Dungeons of Doom
Has thanked: 413 times
Been thanked: 548 times
Contact:

Re: Def Jam Bitmap and .colours files

Post by Mr.Mouse » Sat Jan 02, 2010 12:09 am

Okay, a little progress.

1. I used MultiEx Commander to extract compressed BIG files from the non-compressed ASSETCMN.BIG file.
2. It gave me the tr1.big file that I opened with BigGUI and extracted the tr1.ssh file from.
3. I wrote a little program that created a test palette and picture to replace the tr1.ssh contents with (it is the trophy picture of the Danish SAS league).
4. I used BigGUI to replace the contents of the tr1.big file with my test picture and palette (my altered tr1.ssh).
5. I reimported the new tr1.big file into ASSETCMN.BIG with MultiEx Commander
6. I used UltraISO to delete the old ASSETCMN.BIG in the games's ISO and replaced it with my new one.
7. I mount the new iso using Virtual Clonedrive
8. I fire up PCSX2 and point to the new virtual drive to boot from and start the game

In the tournament selection screen I switch to the Danish league and look at my test picture. Here's the result:

First my test picture. It will show Blue Green and Red in ever increasing alpha up to 255 (0 transparency) at the end. You can't see the alpha here.
tr1_SAS_trophy_test.bmp


Here's my PTExplorer showing off the alpha variable. You notice it is a smooth transition to solid.
increasingalpha_alternatingRGB_ptexplorer.jpg
Now here's the in-game view.
increasingalpha_alternatingRGB_PS2.jpg
You'll notice two things. First, the game has RGB the other way around in the palette (I suspected as much, but this confirmed it). Second, the 4th byte (the alpha variable), is not a smooth one. It is indeed also giving rise to transparency, but in a jumpy way, and there's more to it. SOme values give less transparence than others, I think this may mean something about Depth as well.
You do not have the required permissions to view the files attached to this post.

grzesiek
beginner
Posts: 29
Joined: Fri Oct 23, 2009 6:59 pm
Has thanked: 6 times
Been thanked: 6 times

Re: Def Jam Bitmap and .colours files

Post by grzesiek » Sat Jan 02, 2010 1:30 pm

Many thanks. Waiting for more. :D
Maybe there would be a tool for editing these files without unnecessary cases from other files, such as BIG. ;)

User avatar
Mr.Mouse
Site Admin
Posts: 4036
Joined: Wed Jan 15, 2003 6:45 pm
Location: Dungeons of Doom
Has thanked: 413 times
Been thanked: 548 times
Contact:

Re: Def Jam Bitmap and .colours files

Post by Mr.Mouse » Sun Jan 03, 2010 1:05 am

I don't know about that. Could be, but not for sure. At least the above method succesfully mods the game.

User avatar
Mr.Mouse
Site Admin
Posts: 4036
Joined: Wed Jan 15, 2003 6:45 pm
Location: Dungeons of Doom
Has thanked: 413 times
Been thanked: 548 times
Contact:

Re: Def Jam Bitmap and .colours files

Post by Mr.Mouse » Mon Jan 04, 2010 1:18 pm

I think these textures are colour modulated in a way. This technique would enable an original image to be stored in less bytes, while retaining a sufficient resolution if you need to show the texture larger on screen. When plotted on screen the source cell colour is taken and put in an algorithm to obtain the actual colour based from a predetermined palette (in three dimensions : red, green and blue as axis), depending on size of the texture. Even with a palette of 256 colours, each taken from a prism of red, green and blue, one can create higher colour images.

I will need to keep experimenting to see what happens if I change certain aspects of images.

I've written a program that will extract a folder full of *.big files to another folder, and then extracts all .ssh files it finds, automatically creating *.bmp images as well of the images. This made it easier to find images that appear in the boot of the game, so I can alter those for testing purposes (and don't have to go through the game each time).

From what I saw, I can copy a part of the original image and duplicate it elsewhere in the original image without problem: it will show the same. So there is no underlying invisible colour map at work. I've also created some squares next to each other and that does not result in distortion at the edges of the squares. However, the squares were solid in one colour. I've also tried to import a new image using the palette of the original image, but that showed incorrectly in-game.

Fatal
n00b
Posts: 15
Joined: Mon Nov 16, 2009 10:10 pm
Has thanked: 3 times

Re: Def Jam Bitmap and .colours files

Post by Fatal » Tue Jan 05, 2010 10:44 pm

What a progress...

Does this work for Def Jam FFNY too??

how much u ask for the program?:P

very nice man keep it up

and thnx
Image

User avatar
Mr.Mouse
Site Admin
Posts: 4036
Joined: Wed Jan 15, 2003 6:45 pm
Location: Dungeons of Doom
Has thanked: 413 times
Been thanked: 548 times
Contact:

Re: Def Jam Bitmap and .colours files

Post by Mr.Mouse » Mon Jan 11, 2010 9:45 am

Ok, just a small update so I don't forget.

I've been working with the 47_legal.ssh file, the first picture is the one with all the logo's of the national competitions that you see during boot of the game.

I created a test picture that showed the complete palette of the picture as squares of 14x14, 16 columns with rows of 16 (thus making 256 colours of the palette) and set the alpha to 128 (0% transparency) for each. I wanted to see which colours would be exact in the game and which would be altered somehow.

I then made a screenshot and used the original testpicture as overlay in Photoshop and set the blending option to "Difference". This way I could see which colours were exact and which were modulated (example : a black result would mean no difference, any other would indicate some difference).

It turns out that the palette started with 8 colours that were exact, followed by 16 colours that were modulated, followed by 16 colours that were exact, followed by 16 colours that were modulated and this repeated for the whole palette. So colours 0-7 were unchanged by the game, 8-23 were modulated somehow, 24-39 were unchanged, 40-15 were modulated etc. So there is a definite pattern there. I have yet to check if this is the same pattern for other pictures.

I then tried to create a picture with only the unchanced colours (I call them 'primary colours'), and did so using a palette that only left the primary colours and the modulated ones I made black. Using that palette in Photoshop I could simply copy and paste another picture there, Photoshop would choose the right colours (and had only the primaries to chose from).

Interestingly, the game did not like this, as it hung when trying to show the picture. I will have to confirm that as well, when I left the picture alone, but used that trimmed palette instead, the picture showed up, so it seems that the game expects or needs certain colours at specific locations in the palette to be used in the image.

User avatar
Mr.Mouse
Site Admin
Posts: 4036
Joined: Wed Jan 15, 2003 6:45 pm
Location: Dungeons of Doom
Has thanked: 413 times
Been thanked: 548 times
Contact:

Re: Def Jam Bitmap and .colours files

Post by Mr.Mouse » Tue Jan 12, 2010 11:49 pm

Interesting, I got a picture in, using only the primaries.

It shows as intended. Note I edited the picture's palette to have only the primaries remain and all other colours I made black. Note how the rest of the picture is now as "corrupted" as we see it in a paintprogram. The colour modulation depends on the non-primaries.
primary picture.jpg
You do not have the required permissions to view the files attached to this post.

User avatar
Mr.Mouse
Site Admin
Posts: 4036
Joined: Wed Jan 15, 2003 6:45 pm
Location: Dungeons of Doom
Has thanked: 413 times
Been thanked: 548 times
Contact:

Re: Def Jam Bitmap and .colours files

Post by Mr.Mouse » Sun Jan 17, 2010 10:01 pm

I've noticed something interesting. Those modulated palette entries (16 bytes in lenght) are actually two sets of 8 entries that are switched position in game. So the first set becomes second and the second becomes first.

User avatar
Mr.Mouse
Site Admin
Posts: 4036
Joined: Wed Jan 15, 2003 6:45 pm
Location: Dungeons of Doom
Has thanked: 413 times
Been thanked: 548 times
Contact:

Re: Def Jam Bitmap and .colours files

Post by Mr.Mouse » Sun Jan 17, 2010 10:41 pm

Yes, hehe, that looks a lot better doesn't it:
47_legal_ssh_file1.jpg
That's the logo bit at the start. I've extracted the bitmap and palette from 47_legal.ssh and converted the palette to my idea. Notice how the colours now match !
You do not have the required permissions to view the files attached to this post.

User avatar
Mr.Mouse
Site Admin
Posts: 4036
Joined: Wed Jan 15, 2003 6:45 pm
Location: Dungeons of Doom
Has thanked: 413 times
Been thanked: 548 times
Contact:

Re: Def Jam Bitmap and .colours files

Post by Mr.Mouse » Sun Jan 17, 2010 10:51 pm

Yes, and here's a part of the picture in PT Explorer with active alpha (transparency), it works 100%.
47_legal_ssh_file1_pt_alpha.jpg
It's half as bright, because the game uses 128 as max opacity (0 transparency) instead of 256 assumed by PT Explorer. So you see it as 50% transparent against a black background.

Check out this picture as well, I extracted the bitmap and palette, converted the palette and voila!
backPS22.ssh.png
You do not have the required permissions to view the files attached to this post.

grzesiek
beginner
Posts: 29
Joined: Fri Oct 23, 2009 6:59 pm
Has thanked: 6 times
Been thanked: 6 times

Re: Def Jam Bitmap and .colours files

Post by grzesiek » Mon Jan 18, 2010 8:13 am

Wow, nice! Can you make a program to view or convert these files? Ex bmp to ssh and vice versa?

User avatar
Mr.Mouse
Site Admin
Posts: 4036
Joined: Wed Jan 15, 2003 6:45 pm
Location: Dungeons of Doom
Has thanked: 413 times
Been thanked: 548 times
Contact:

Re: Def Jam Bitmap and .colours files

Post by Mr.Mouse » Mon Jan 18, 2010 8:28 am

In time yes. There is still some unanswered question: why is this palette modification being done? I tried importing a new image instead of the logos, with exactly the same size and pre-converted the palette. However, the game hung when the image was about to come up. So, there is more to the palette than just the switching of colours. Perhaps the game expects certain colours to be present at certain locations, or certain colours with 0 alpha at certain location, it can be anything. This requires even more research.

For now, if you want to thank me, press the "thank you" button below my previous post for figuring out a way to properly show the textures outside the game. :) It is common courtesy at these forums :D.

I will release the tool when I'm satisfied I've covered most or enough of the format. It would be interesting to see if this method also applies to other games than FIFA2009. A universal tool to modifiy these PS2 Electronic Arts games could then be created.

A viewer to at least browse and view the files is also an option to release first.

grzesiek
beginner
Posts: 29
Joined: Fri Oct 23, 2009 6:59 pm
Has thanked: 6 times
Been thanked: 6 times

Re: Def Jam Bitmap and .colours files

Post by grzesiek » Mon Jan 18, 2010 8:55 am

Can you get out something from this compressed ssh? From FIFA Street.

http://www.speedyshare.com/files/20405464/splash.ssh

It should look like this but with no load bar:
You do not have the required permissions to view the files attached to this post.

Post Reply