Extracting Textures

For Descent, Descent II and Descent3 level editing and modification assistance.
Post Reply
User avatar
darthdoull
DBB Cadet
DBB Cadet
Posts: 4
Joined: Fri Jan 24, 2020 10:06 am

Extracting Textures

Post by darthdoull »

Hi there, I need help extracting the vanilla textures. I used a quickbms script to unpack descent2.hog but it gave me more compressed files and I don't know where to look. The script is limited to hog and pig files and it can't unpack the files in the hog file so I'm stuck. I'm also not sure where the textures are exactly.
Interesting...
User avatar
LightWolf
DBB Captain
DBB Captain
Posts: 908
Joined: Sat Mar 09, 2013 2:27 pm
Location: Yes

Re: Extracting Textures

Post by LightWolf »

Textures should be in the PIG.
Whatever I just said, I hope you understood it correctly. Understood what I meant, I mean.
#AllLivesMatter
User avatar
darthdoull
DBB Cadet
DBB Cadet
Posts: 4
Joined: Fri Jan 24, 2020 10:06 am

Re: Extracting Textures

Post by darthdoull »

I was afraid of that. I unpacked two pigs; ice and alien1 but there's nothing in them except folders. Inside the folders are random combinations of dat, ini, and txt files. Is there a way to convert or extract these into proper images?
Interesting...
User avatar
Krom
DBB Database Master
DBB Database Master
Posts: 16125
Joined: Sun Nov 29, 1998 3:01 am
Location: Camping the energy center. BTW, did you know you can have up to 100 characters in this location box?
Contact:

Re: Extracting Textures

Post by Krom »

There were some utilities that could extract sounds/textures/etc from descent and descent 2 called DTX and DTX2, the problem is they are 16 bit windows applications and won't work at all in a 64 bit environment. If you know and can jump through the hoops necessary (virtualization/emulation/etc) to get them working then you can download them here: http://www.cybertrash.com/shareware/dtx/
User avatar
darthdoull
DBB Cadet
DBB Cadet
Posts: 4
Joined: Fri Jan 24, 2020 10:06 am

Re: Extracting Textures

Post by darthdoull »

Yeah, I tried that before coming here and as you say, it doesn't work on my 64-bit system. I tried getting it to work in Dosbox too but that didn't work either. I'm not sure what else to try. I'll keep at it and thank you for the responses.

I'm not a programmer and I'm wondering if maybe someone here can take a look at this script and see if you can spot anything wrong with it. I have a hunch the script extracts the data incorrectly. It's doing its job a little too well, extracting the raw data from the images instead of giving me images. That's just my guess, anyway.

Code: Select all

# Descent (script 0.2)
# script for QuickBMS http://quickbms.aluigi.org

get ARCHIVE_SIZE asize
get EXT extension
getdstring SIGN 4
if SIGN == "PPIG"

    get DUMMY long
    get FILES long
    xmath BASE_OFF "0xc + (FILES * 0x12)"
    for i = 0 < FILES
        getdstring NAME 8
        get DUMMY short
        get DUMMY short
        get DUMMY short
        get OFFSET long
        math OFFSET + BASE_OFF
        putarray 0 i OFFSET
        putarray 1 i NAME
    next i

    putarray 0 i ARCHIVE_SIZE
    putarray 1 i ""
    sortarray 0 1

    for i = 0 < FILES
        getarray OFFSET 0 i
        getarray NAME   1 i
        math i + 1
        getarray NEXT_OFF 0 i
        goto OFFSET
        get SIZE long
        xmath TMP "OFFSET + SIZE"
        if TMP == NEXT_OFF
            math OFFSET + 4
            math SIZE   - 4
        else
            xmath SIZE "NEXT_OFF - OFFSET"
        endif
        string NAME + /
        log NAME OFFSET SIZE
    next


elif SIGN == "DSND"

    get DUMMY long
    get FILES long
    xmath BASE_OFF "0xc + (FILES * 0x14)"
    for i = 0 < FILES
        getdstring NAME 8
        get ZSIZE long  # ???
        get SIZE long
        get OFFSET long
        math OFFSET + BASE_OFF
        log NAME OFFSET SIZE
    next i

elif EXT == "hog"

    goto 0
    idstring "DHF"
    savepos OFFSET
    for OFFSET = OFFSET != ARCHIVE_SIZE
        getdstring NAME 13
        get SIZE long
        savepos OFFSET
        log NAME OFFSET SIZE
        math OFFSET + SIZE
        goto OFFSET
    next

else

    print "Error: unknown magic %SIGN%"
    cleanexit

endif
Interesting...
User avatar
LightWolf
DBB Captain
DBB Captain
Posts: 908
Joined: Sat Mar 09, 2013 2:27 pm
Location: Yes

Re: Extracting Textures

Post by LightWolf »

I'm not 100% certain, but I'm pretty sure that the images are palette references to descent.256.

Something else you can try if you have a level editor (i.e. DLE) is exporting the image from within the editor. It takes longer, but you do get a standard image format as a result.
Whatever I just said, I hope you understood it correctly. Understood what I meant, I mean.
#AllLivesMatter
User avatar
darthdoull
DBB Cadet
DBB Cadet
Posts: 4
Joined: Fri Jan 24, 2020 10:06 am

Re: Extracting Textures

Post by darthdoull »

Ah, the folders make a lot more sense now.

That's a good idea, I haven't thought of that. I tried DLE per your suggestion and it worked perfectly. It even gives me the frames for animations, feels like Christmas. Thank you so much to the both of you for the help.
Interesting...
Post Reply