[Vita] Hyperdimension Neptunia - DDS to TID / TID to DDS

Textures, recreate headers, conversions, algorithms and parsing of image files
qwaert
Posts: 4
Joined: Thu Apr 26, 2018 10:34 pm

[Vita] Hyperdimension Neptunia - DDS to TID / TID to DDS

Post by qwaert »

Hello all,

I'm trying to mod some graphic files that are a TID file and that has a DXT1 compression
I successfully extracted the png file from the tid file using nr2_tidtool v1.0, but the problem is getting the file back into a compressed DDS (DXT1) file with a TID header using hex.

I have attempted to add the modified png to a dds file with dxt1 compression using paint.net and dds export, but unsure how to create a tid file from it. I tried using hex editor by copy/paste the header, but since the file sizes are different sizes, the resulting png is a scrambled image.

I have attached the original tid file, and a proper dds file created.
Hope someone may be able to give some tips for a tid to dds conversion, and dds to tid conversion; I believe the header is at Offset 0x00 to 0x7F, and I believe that is all that would need to be changed.

Regards,
TheUkrainianBard
Posts: 121
Joined: Sun May 01, 2016 10:06 pm

Re: [Vita] Hyperdimension Neptunia - DDS to TID / TID to DDS

Post by TheUkrainianBard »

It's a very simple format.
Magic is 3 bytes at 0x0, "TID"
Flags are 1 byte at 0x3, 0x80 is mandatory; others are: 0x1 - big endian header; 0x2 - ARGB instead of RGBA; 0x4 - Morton order swizzling; 0x8 - vertical flip; 0x10 - I've found no use for this
Width is 4 bytes at 0x44
Height is 4 bytes at 0x48
Data size is 4 bytes at 0x58
Format is 4 bytes at 0x64, if it's 0 - it's either RGBA or ARGB (see Flags)
Image data is at 0x80 till EOF

If you want to make a TID, just copy first 128 bytes from existing one and copy your new image data (if you haven't changed width/height/format).
I remember that Vita really hates RGBA, so set that 0x2 flag and make your image data ARGB. No need to do so for DXT.

Image

Usage for DDS2TID: place your DDS file in the same folder as it's TID source; run QuickBMS; select "neptunia_ideafactory_dds2tid.bms"; navigate and select the DDS file; navigate and select the same folder (input folder is the output folder).
Last edited by TheUkrainianBard on Sat Apr 28, 2018 6:41 pm, edited 5 times in total.
qwaert
Posts: 4
Joined: Thu Apr 26, 2018 10:34 pm

Re: [Vita] Hyperdimension Neptunia - DDS to TID / TID to DDS

Post by qwaert »

Thank you for your help understanding the TID headers and getting started!

I took your recommendation to change the first 128 bytes from the dds file to the tid file, but the image now looks like this (when extracted):

Image
I tried to edit the morton swizzle hex as you said, but unfortunately nothing happened, unless I am doing it incorrectly. I can provide the tools I am using if it would help?

Now, when I change the first 128 characters of the original .tid file do the dds header, I get the following:

DDS - Swizzle:
Image

Original Image:
Image

Would anyone have a tool to unswizzle and swizzle the above images? If more files are needed, I can provide them.
TheUkrainianBard
Posts: 121
Joined: Sun May 01, 2016 10:06 pm

Re: [Vita] Hyperdimension Neptunia - DDS to TID / TID to DDS

Post by TheUkrainianBard »

First image looks normal for a Morton order unswizzling done one too many times.
Second is what it looks like if you don't unswizzle a swizzled image.

Try setting 0x98 for Flags in the source of your post's first image.
Maybe Vita will eat it up.
qwaert
Posts: 4
Joined: Thu Apr 26, 2018 10:34 pm

Re: [Vita] Hyperdimension Neptunia - DDS to TID / TID to DDS

Post by qwaert »

I've attemtped to change the flag to 0x98, but the image is still scrambled.
I have attached the .tid file also (in zip).

Image

I repacked the files, and it worked, but the image is like the morton swizzled image (1st image).
Image
TheUkrainianBard
Posts: 121
Joined: Sun May 01, 2016 10:06 pm

Re: [Vita] Hyperdimension Neptunia - DDS to TID / TID to DDS

Post by TheUkrainianBard »

You've changed the wrong value though. Flags are at 0x03.
I've also updated my first reply.
qwaert
Posts: 4
Joined: Thu Apr 26, 2018 10:34 pm

Re: [Vita] Hyperdimension Neptunia - DDS to TID / TID to DDS

Post by qwaert »

Ah my mistake!
The tis2dds / dds2tid bms works very well; I tried it in game and it came out perfectly.

Thank you very much!

I'll let you know if I run into any snags
happydance
Posts: 81
Joined: Sun Jul 10, 2016 11:07 am

Re: [Vita] Hyperdimension Neptunia - DDS to TID / TID to DDS

Post by happydance »

I know this is an old thread, but would it be possible to add mipmaps on the export and import of the BMS scripts?

Attached a file with .tid that have mipmaps
Origa
Posts: 9
Joined: Tue Jul 28, 2020 11:59 pm

Re: [Vita] Hyperdimension Neptunia - DDS to TID / TID to DDS

Post by Origa »

Hello all. I need help also with .tid
Megadimension Neptunia VII for Nintendo Switch using .tid with BC7. Maybe someone can add support BC7 to this scripts?
Image