The Suffering .TDU archive with textures stored

Textures, recreate headers, conversions, algorithms and parsing of image files
YAGAMI55
Posts: 55
Joined: Sun May 24, 2020 9:16 pm

The Suffering .TDU archive with textures stored

Post by YAGAMI55 »

So. I finaly figured out in this

PC textures DDS DXT3-DXT5
Header 0x30(hex)
with Widht and Height
some flags about format(DXT3-DXT5)

PS2 textures raw 8bpp some 4bpp without swizzle
Header 0x40(hex)
with Widht and Height
some flags about format(4bpp-8bpp)

XBOX textures need test ii
But i sure there is raw 8bpp some 4bpp with Morton swizzle


aluigi scripts Drakan.bms https://aluigi.altervista.org/bms/drakan.bms perfectly works to extract/reimport all textures in .TDU

but i fix it for suffering game

there is fix

Code: Select all

# Drakan
#
# The archive uses lot of compressed data in each file,
# so the script tries to dump directly the decompressed
# data instead of the file "as-is"

math DUMP_ORIGINAL_FILES = 0

comtype zlib_noerror

idstring "SRSC"
get DUMMY byte
get DUMMY byte
get OFFSET long
get FILES short

goto OFFSET
for i = 0 < FILES
    get TYPE byte
    get TYPE2 byte
    get DUMMY long
    get OFFSET long
    get SIZE long

    if DUMP_ORIGINAL_FILES != 0
        log "" OFFSET SIZE
    else
        math SKIP_BYTES = 0
        if TYPE == 0x40
            math SKIP_BYTES = 0x0 # skip bytes 0 for extract textures with correct headers
        elif TYPE == 2
            if TYPE2 == 3
                callfunction SKIP_BYTES_TYPE_2 1
            endif
        endif

        math OFFSET + SKIP_BYTES
        math SIZE   - SKIP_BYTES
        clog "" OFFSET SIZE SIZE
    endif
next i

startfunction SKIP_BYTES_TYPE_2
    savepos TMP_OFF
    goto OFFSET
    callfunction GET_NAME 1
    get DUMMY long
    get CHANNELS short
    get BITS short
    get FREQUENCY long
    getdstring DUMMY 0xc
    get TMP_SIZE long
    get TMP_ZIP long
    get TMP_ZSIZE long
    savepos SKIP_BYTES
    math SKIP_BYTES - OFFSET
    goto TMP_OFF
endfunction

startfunction GET_NAME
    get NAMESZ short
    getdstring NAME NAMESZ
endfunction


If could someone create a tool for textures to convert them in standart DDS(pc) and TGA(ps2) we can change them in game
(translate, or change some skin, repaint them and other stuff)
y2keeth
Posts: 3
Joined: Mon May 30, 2022 4:17 am

Re: The Suffering .TDU archive with textures stored

Post by y2keeth »

I use this bms on the suffering i get .dat files instead of dds and tga's
YAGAMI55
Posts: 55
Joined: Sun May 24, 2020 9:16 pm

Re: The Suffering .TDU archive with textures stored

Post by YAGAMI55 »

y2keeth wrote:I use this bms on the suffering i get .dat files instead of dds and tga's

Yeah. That right. Texture in game without header. You can manualy add header and edit.
Timeflex
Posts: 1
Joined: Tue Jul 05, 2022 9:32 pm

Re: The Suffering .TDU archive with textures stored

Post by Timeflex »

I was able to extract all the textures by using Total Commander with this plugin.
http://forrox.narod.ru/files/wcx_gaup_p ... 0.3pro.rar
mirror: http://wincmd.ru/files/wcx_gaup_plugin_0.6.0.3pro.rar
I just need to figure out how to get them back to TDU format.
Cluster
Posts: 4
Joined: Wed Oct 12, 2022 1:44 pm

Re: The Suffering .TDU archive with textures stored

Post by Cluster »

Timeflex wrote:I was able to extract all the textures by using Total Commander with this plugin.
http://forrox.narod.ru/files/wcx_gaup_p ... 0.3pro.rar
mirror: http://wincmd.ru/files/wcx_gaup_plugin_0.6.0.3pro.rar
I just need to figure out how to get them back to TDU format.
Hi!

Did you manage to pack the files into a *.tdu archive?
With gaup 0.6.0.3pro it is impossible to pack.
YAGAMI55
Posts: 55
Joined: Sun May 24, 2020 9:16 pm

Re: The Suffering .TDU archive with textures stored

Post by YAGAMI55 »

bms script importing back
Cluster
Posts: 4
Joined: Wed Oct 12, 2022 1:44 pm

Re: The Suffering .TDU archive with textures stored

Post by Cluster »

YAGAMI55 wrote:bms script importing back
Thanks for the answer!

As I understand it, for this I first have to convert *.dds to *.dat?
YAGAMI55
Posts: 55
Joined: Sun May 24, 2020 9:16 pm

Re: The Suffering .TDU archive with textures stored

Post by YAGAMI55 »

Cluster wrote:
YAGAMI55 wrote:bms script importing back
Thanks for the answer!

As I understand it, for this I first have to convert *.dds to *.dat?
Its not convert. In pc heardless dds. Just remove first 80 byte in hex
Cluster
Posts: 4
Joined: Wed Oct 12, 2022 1:44 pm

Re: The Suffering .TDU archive with textures stored

Post by Cluster »

YAGAMI55 wrote:
Cluster wrote:
YAGAMI55 wrote:bms script importing back
Thanks for the answer!

As I understand it, for this I first have to convert *.dds to *.dat?
Its not convert. In pc heardless dds. Just remove first 80 byte in hex
Thanks for the explanation!
But I don't have enough experience to do this with all texture files. It is very sad :(
I wanted to restore this cool game.
y2keeth
Posts: 3
Joined: Mon May 30, 2022 4:17 am

Re: The Suffering .TDU archive with textures stored

Post by y2keeth »

game extractor can replace the textures from png back into the tdu one by one
I have done most the textures but having issues
Cluster
Posts: 4
Joined: Wed Oct 12, 2022 1:44 pm

Re: The Suffering .TDU archive with textures stored

Post by Cluster »

This is only possible on the full version, if I understood correctly.