Jump to content

Welcome to NiGHTS COMMUNiTY
Register now to gain access to all of our features. Once registered and logged in, you will be able to create topics, post replies to existing threads, give reputation to your fellow members, get your own private messenger, post status updates, manage your profile and so much more. If you already have an account, login here - otherwise create an account for free today!

The Gremmar Warden

The Gremmar Warden

Member Since 20 Jul 2021
Offline Last Active Dec 01 2021 06:52 AM

In Topic: My Dream Info

16 October 2021 - 02:46 AM

Nice work, and yeah this forum seems pretty dead


In Topic: Reverse engineering Steam NiGHTS Into Dreams...

17 September 2021 - 06:16 PM

Thanks!
And yep, there are some more updates. First, someone informed me that the images are using a common PS2 file format, so it turns out there was no need to reverse engineer them after all. Instead, I turned to the model formats (probably a known format as well but I didn't know that at the time, and the only PS2 model ripping methods I see when googling it involve using a PS2 emulator). I stumbled across this reddit post that gave me a clue on where and how the vertices were stored. Starting with this knowledge, I was able to work out how most of the model data is stored (details in spoiler)

Spoiler

 

And now having access to the model data, me and a few other people in a NiGHTS discord channel discovered that there is actually a HUGE amount of unused content. This is just one of many unused, likely prototype models in the game:

NiGHTSintoDreams-UnusedNiGHTSModel.png

We put some of this content up on TCRF, and someone else offered add the rest of the model renders there. 


In Topic: Reverse engineering Steam NiGHTS Into Dreams...

05 August 2021 - 11:49 PM

Some updates:

  1. Actually, images can be rectangular, and many of them are.
  2. Some images are encoded as 4-bit bitmaps, using only 4 bits for each pixel. This limits the color palette to 16 colors. They also appear to be scrambled in a different way than the 8-bit bitmaps.
  3. After some trial and error, I think I've managed to figure out the meaning of certain header bytes. Here's an example:

These two blocks of bytes are the header data for one image. I believe the first one refers to the length and formatting of the pixel data itself, and the second one defines the length and formatting of the palette. However, some files (notably some starting with DITEM) have an odd number of header "blocks." I'm not sure what this means.

 

I'm not completely sure, but this blue byte seems to be connected with whether or not you need to double the width and height values to get the true size of the image. If 14, don't double, and if 00, do double. 

 

06 00 00 10 00 00 00 00 00 00 00 00 00 00 00 00

04 00 00 00 00 00 00 10 0E 00 00 00 00 00 00 00

00 00 00 00 66 04 02 14 50 00 00 00 00 00 00 00         

00 00 00 00 00 00 00 00 51 00 00 00 00 00 00 00

08 00 00 00 10 00 00 00 52 00 00 00 00 00 00 00        pink = width of image in pixels

00 00 00 00 00 00 00 00 53 00 00 00 00 00 00 00        green = height of image in pixels 

04 00 00 00 00 00 00 08 00 00 00 00 00 00 00 00

04 00 00 30 00 00 00 00 00 00 00 00 00 00 00 00

Both the width and height values appear to be 4-byte integers, and are little endian (bytes must be read backwards). Thus, width here is 0x00000008 = 8, and height is 0x00000010 = 16.

 

This byte is connected with the type of palette. If 02, the colors are 16-bit, otherwise they are 24-bit.

06 00 00 10 00 00 00 00 00 00 00 00 00 00 00 00

04 00 00 00 00 00 00 10 0E 00 00 00 00 00 00 00

00 00 00 00 BA 04 01 02 50 00 00 00 00 00 00 00

00 00 00 00 00 00 00 00 51 00 00 00 00 00 00 00

08 00 00 00 02 00 00 00 52 00 00 00 00 00 00 00

00 00 00 00 00 00 00 00 53 00 00 00 00 00 00 00

02 00 00 00 00 00 00 08 00 00 00 00 00 00 00 00

02 00 00 30 00 00 00 00 00 00 00 00 00 00 00 00

 

These 2 bytes always appear to have the same value as each other, and seem to say whether or not an image is 4-bit (probably has something to do with the size of the palette). If 02, the pixels are 4-bit, otherwise they are 8-bit.