Dinosaur modder - Update on 2 channel .gf files!

Discuss tools to aid in the modification and running of Rayman games.

Moderator: Modding and utilities team

Forum rules
Please keep the forum rules and guidelines in mind when creating or replying to a topic.
Post Reply
dinotora
Jumping eye
Posts: 9
Joined: Sun May 29, 2016 1:54 pm
Tings: 45

Dinosaur modder - Update on 2 channel .gf files!

Post by dinotora »

I've restarted my attempts into trying to extract the weird 2 channel .gf files from 5(!!!!) years ago, and finally, after a day of work, they've been cracked!

The 2 palette .gf file employs a unique RGB palette format that I have not seen anywhere else, hence why it took a while to decode as there were basically no online references to look upon, and I had to manually brute-force the game using custom.gf files.

COLOR FORMAT:

R - 256 - 8 bits
G - 64 - 6 bits
B - 32 - 5 bits

RGB865 format - 19 bit(?) color, above High Color but below True Color, proprietary Ubi Soft format?
I don't think it appears in Rayman 2, the sister game to Dinosaur, and even though Ubi Soft's earlier game, F1 Racing Simulation, uses .bnm files, it doesn't seem to run on the same engine as Ray2 and Dino and thus texture files are in a foreign format.

At first glance, RGB865 seems just like a odd-numbered RGB format, However, unlike standard unconventional RGB formats, where each color has its own data domain, it seems that one of the colors interacts with both of the other colors, and influences them in some way. In the case of Disney's Dinosaur, it was found that green was the split color.

PALETTES:
The 2 channel .gf format uses 2 0-255 palettes, with one colour being represented by both palettes.

Blue-green channel (0-255 from L-R)
Image
---blue channel goes up by 4 every time blue repeats, repeated 8 times to form 32 shades of blue. For every 'column' of blue, green increases by 4.

Red-green channel (0-255 from L-R)
Image
---the green goes in increments of 32, repeated 32 times. Each column of green is 8 wide. The red spans the entire sector, with a full 256 shades.

The green value is derived from putting both the blue and green values together. In total, this creates 64 different shades of green across all possible combinations of red-green and blue-green. The easiest way to show how the green interacts with both channels is to see them as a 2d palette:
Image

For those with a more intricate knowledge of binary and RGB palettes, the reason for this green format should be pretty obvious - The LSB and MSB of the green channel interacts with the other 2 channels in some form. In the case of the Dinosaur palette format, the MSB of the green channel overlaps with the LSB of the red channel and affects the final red color, and the LSB of the green channel controls the blue-green channel, but does not affect the final blue color as it does not overlap with the final blue channel.
Image

Many thanks to szymski for creating the original set of texture tools and for cracking the .gf file format itself, you're a legend.

I have MATLAB files that can encrypt and decrypt these 2-channel .gf files, and if anyone is so curious I can share the files and their related look-up table .MAT.
Last edited by dinotora on Wed Oct 19, 2022 12:37 pm, edited 2 times in total.
RayCarrot
Carmen
Posts: 2476
Joined: Sat Jan 11, 2014 5:46 pm
Tings: 40322

Re: Dinosaur modder - Update on 2 channel .gf files!

Post by RayCarrot »

I haven't played this game before, but using the Tonic Trouble configuration in RCP it seems to be able to read them:
Rayman_Control_Panel_2022-10-19_13-28-46.png
Looking there it seems to be a combination of 4444 and 565 color formats (depending on if it's transparent or not). I'm not sure if this is the same result you got or not, but if you want to see how this was done the code is here. It's mostly derived from Droolie's work in raymap.
dinotora
Jumping eye
Posts: 9
Joined: Sun May 29, 2016 1:54 pm
Tings: 45

Re: Dinosaur modder - Update on 2 channel .gf files!

Post by dinotora »

RayCarrot wrote: Wed Oct 19, 2022 12:35 pm I haven't played this game before, but using the Tonic Trouble configuration in RCP it seems to be able to read them:
Rayman_Control_Panel_2022-10-19_13-28-46.png
Looking there it seems to be a combination of 4444 and 565 color formats (depending on if it's transparent or not). I'm not sure if this is the same result you got or not, but if you want to see how this was done the code is here. It's mostly derived from Droolie's work in raymap.
The .cnt file I'm working on currently is Vignette.cnt - those textures are from Texture.cnt, and use a strange format I'm still not really familiar with.

It seems that Dinosaur uses an odd RGB format for Vignette.cnt (RGB865) where the green channel influences both the red and blue channel, as shown below:
Image

I've never come across anything like it - I'm sure some older games might use this to save space.

I haven't yet explored into Textures.cnt yet, as I am still stuck in regards to decrypting it. I will use those tools suggested to try and crack them - thanks for the pointer!

I haven't been here for around 3 years so I guess I'm still stuck in the Stone Age! :mrgreen:
RayCarrot
Carmen
Posts: 2476
Joined: Sat Jan 11, 2014 5:46 pm
Tings: 40322

Re: Dinosaur modder - Update on 2 channel .gf files!

Post by RayCarrot »

The vignette files are all 565 using the same format. So 5 red bits, 6 green bits and 5 blue bits. That's a standard 16-bit format when there is no transparency.
Rayman_Control_Panel_2022-10-19_13-43-23.png
dinotora
Jumping eye
Posts: 9
Joined: Sun May 29, 2016 1:54 pm
Tings: 45

Re: Dinosaur modder - Update on 2 channel .gf files!

Post by dinotora »

Ah, I see what's going on now. I guess it was using the original format - I got a little pigeonholed when writing my code.

Thanks for the info! I really appreciate your help.
RayCarrot
Carmen
Posts: 2476
Joined: Sat Jan 11, 2014 5:46 pm
Tings: 40322

Re: Dinosaur modder - Update on 2 channel .gf files!

Post by RayCarrot »

No problem. Being able to view and edit these graphics is fairly new in RCP and I haven't actually tested it on all the games using the CPA engine, so I'm glad it works here as well!
Btw, if you haven't seen it already I'd also recommend checking out the raymap map viewer by Droolie and Robin as it has support for Dinosaur.
dinotora
Jumping eye
Posts: 9
Joined: Sun May 29, 2016 1:54 pm
Tings: 45

Re: Dinosaur modder - Update on 2 channel .gf files!

Post by dinotora »

It's amazing, the difference 3 years (and a leaked rayman 2 engine) makes!

Your wonderful tools are a lot better to use than brute forcing and blind stabbing, that's for sure 8) 8)

I'll definitely help report back on how Dinosaur runs on your tools.
Post Reply