Users browsing this thread: 1 Guest(s)
Ripping RenderWare files from The Simpsons Game (PS3)
#3
(12-08-2021, 12:11 PM)McA Wrote: What you need

Blender (any... 2.8, 2.9, 3.0)
https://www.blender.org/download/

QuickBMS
http://aluigi.altervista.org/quickbms.htm

simpsons_str.bms (quickbms script to extract from simpsons .str files)
**this will be at the bottom of the QuickBMS page** or heres the direct link
aluigi.altervista.org/bms/simpsons_str.bms

Simpsons-Game-PS3-Blender-Plugin (Python script for blender)
https://github.com/Turk645/Simpsons-Game...der-Plugin



EXTRACT FILES
QuickBMS has 3 steps
(1) Asks you to find "simpsons_str.bms" script file
(2) Asks you to select .str file in simpsons game folder (which possibly contains the model you want)
(3) Asks you to choose a folder to dump the extracted files in.

FIND MODEL FILE
After those steps, you are left with usually 2 folders "assets" and "build". Go to "build" folder, and search for files that have extensions '.rws.PS3.preinstanced' or '.dff.PS3.preinstanced' which will be the model file

IMPORT INTO BLENDER
Open blender, go to 'Scripting' workplace
Press Alt+O to open a script and choose 'io_import_simpson_game.py' (downloaded from Github)
Press Alt P to run the script
Now the option to import simpsons models should be added to blenders import options
So, File > Import > Simpsons Game (.rws,dff)
and import your model!


EXTRACT TEXTURES

(1) Download Noesis
http://www.richwhitehouse.com/index.php?...project=91

(2) Download Simpsons txd script for Noesis - "tex_TheSimpsonsGame_PS3_txd.py"
https://forum.xentax.com/viewtopic.php?f...37#p147727
direct download, most be logged in to download
https://forum.xentax.com/download/file.php?id=15539
or direct code
Code:
from inc_noesis import *

def registerNoesisTypes():
    handle = noesis.register("The Simpsons game [PS3]", ".txd")
    noesis.setHandlerTypeCheck(handle, noepyCheckType)
    noesis.setHandlerLoadRGBA(handle, noepyLoadRGBA)
    #noesis.logPopup()
    return 1

def noepyCheckType(data):
    bs = NoeBitStream(data)
    if bs.readUInt() != 0x16: return 0
    return 1
   
def noepyLoadRGBA(data, texList):
    rapi.processCommands("-texnorepfn")
    bs = NoeBitStream(data)
    bs.seek(0x28)        
    this = 1
    while True:
        bs.seek(0x14, 1)
        texName = noeStrFromBytes(bs.readBytes(16))
        print(this, "-", texName)
        this += 1
        bs.seek(0x37, 1)
        #print(hex(bs.tell()), ":here")
        imgFmt = bs.readUByte()
        bs.setEndian(NOE_BIGENDIAN)
        imgWidth = bs.readUShort()
        imgHeight = bs.readUShort()
        bs.readByte()
        numMips = bs.readUByte()
        bs.readByte()
        bs.readByte()
        print(imgWidth, "x", imgHeight, "-", hex(imgFmt), "\n")
        bs.setEndian(NOE_LITTLEENDIAN)
        for i in range(numMips):
            mipSize = bs.readUInt()
            data = bs.readBytes(mipSize)
            #DXT1
            if imgFmt == 0x52:
                texFmt = noesis.NOESISTEX_DXT1
            #DXT3
            elif imgFmt == 0x53:
                texFmt = noesis.NOESISTEX_DXT3
            #DXT5
            elif imgFmt == 0x54:
                texFmt = noesis.NOESISTEX_DXT5
            #morton order swizzled raw
            elif imgFmt == 0x86:
                untwid = bytearray()
                for x in range(imgWidth):
                    for y in range(imgHeight):
                        idx = noesis.morton2D(x, y)
                        untwid += data[idx * 4:idx * 4 + 4]
                data = rapi.imageDecodeRaw(untwid, imgWidth, imgHeight, "b8g8r8a8")
                texFmt = noesis.NOESISTEX_RGBA32
            #morton order swizzled raw ???
            elif imgFmt == 0x2:
                untwid = bytearray()
                for x in range(imgWidth):
                    for y in range(imgHeight):
                        idx = noesis.morton2D(x, y)
                        untwid += data[idx * 2:idx * 2 + 2]
                data = rapi.imageDecodeRaw(untwid, imgWidth, imgHeight, "p8a8")
                texFmt = noesis.NOESISTEX_RGBA32
            if i == 0:
                texList.append(NoeTexture(texName, imgWidth, imgHeight, data, texFmt))
        bs.seek(0x2c, 1)
        if bs.tell() == bs.getSize():
            break
    return 1


(3) Move script into Noesis plugins python directory

C:\Users\<user_name>\Downloads\noesisv4464\plugins\python

(4) Run Noesis and go to File>Open File, and find a .txd file in the extracted folder after using QuickBMS previously.

Usually, its stored somewhere in this directory build/PS3/ntsc_en/assets_rws/.../texture_dictionary
or just use windows search function in build folder to find *.txd files

You can also drag and drop .txd files into Noesis

(5) Extract the texture - File>Export and choose the desired format


Still have to figure out the animations including the various mouth states they use when the characters speak

Hello, I have been trying to import the terrain models into blender using your incredible guide, and a lot of them work when applying the included color palettes, however, some appear to not work this way and come up with the wrong color when applying any of the palettes. Is there any way to correct this? Thank you.
Reply
Thanked by:


Messages In This Thread
RE: Ripping RenderWare files from The Simpsons Game (PS3) - by KDNR - 08-14-2022, 10:08 AM

Forum Jump: