
I think the models could be in the vertices.dat and/or the main.dat located in each of the level folders.
Here are the those two files from the Fastoon level so that someone can take a look.
https://www.dropbox.com/sh/z4fwpdnx7y36isa/a9hQ56QbN9



yep.o0DemonBoy0o wrote:It's a pretty painful processes though

Very useful yeah I'll look into it againGh0stBlade wrote:I'll get things started off. I decided to take a quick peek, I have managed to suss out the majority of the format however, there seems to be "missing info" for the mesh vert strides etc. I think another file must contain the info because I cannot see where it could be stored. Where i have the full size of the vertices it seems to be wrong since the data keeps changing, i think multiple FVFs must be referenced somewhere else.
I don't have the time to fix this nor the file samples so I'll just post this so that someone else can either fix it or just use it in the future.
Code: Select all
#Ratchet and Clank Tools Of Destruction .DAT loader #By Gh0stBlade #v0.1a from inc_noesis import * import noesis import rapi def registerNoesisTypes(): handle = noesis.register("Ratchet and Clank Tools Of Destruction [PS3]", ".dat") noesis.setHandlerTypeCheck(handle, noepyCheckType) noesis.setHandlerLoadModel(handle, noepyLoadModel) #see also noepyLoadModelRPG noesis.logPopup() return 1 NOEPY_HEADER = "" #check if it's this type based on the data def noepyCheckType(data): bs = NoeBitStream(data) MAGIC = bs.readInt() if MAGIC != 0x57484749: print("Fatal Error: Unknown filetype!") return 0 return 1 #load the model def noepyLoadModel(data, mdlList): ctx = rapi.rpgCreateContext() rapi.rpgSetOption(noesis.RPGOPT_BIGENDIAN, 1) bs = NoeBitStream(data) bs.setEndian(NOE_BIGENDIAN) SIGN = bs.readInt() #Signature - "WHGI" UNK00 = bs.readShort() #??? UNK01 = bs.readShort() #??? NUMOBJECTS = bs.readInt() #Number of Objects in the file? PTR_END_OTBL = bs.readInt() #Points to end of object table OR start of "PAD" data o.o PTR_UNK00 = bs.readInt() #Points to some unknown table with each value with length 0x4 NUM_UNK00 = bs.readInt() #Unknown, is the count of how many longs stored at the offset above. PADDING = bs.readShort() #Padding just says "0xDE, 0xAD" or "DEAD" o.o; PADDING = bs.readShort() #Padding just says "0xDE, 0xAD" or "DEAD" o.o; PADDING = bs.readShort() #Padding just says "0xDE, 0xAD" or "DEAD" o.o; PADDING = bs.readShort() #Padding just says "0xDE, 0xAD" or "DEAD" o.o; MESHINFO = [] #MESH[] for i in range(0, NUMOBJECTS): OBJECTTYPE = bs.readInt() OBJECTOFFSET = bs.readInt() OBJECTUNK00 = bs.readInt() OBJECTSIZE = bs.readInt() # 0 1 2 3 MESHINFO.append([OBJECTTYPE, OBJECTOFFSET, OBJECTUNK00, OBJECTSIZE]) for i in range(0, NUMOBJECTS): if MESHINFO[i][0] == 0x00009000: #Vertices? bs.seek(MESHINFO[i][1], NOESEEK_ABS) #Skip to the vertices print(bs.tell()) VBUFFER = bs.readBytes(MESHINFO[i][3]) #Read vertices NUMVERTS = int(MESHINFO[i][3] / 0x18) print(bs.tell()) elif MESHINFO[i][0] == 0x00009100: #Faces? #bs.seek(MESHINFO[i][1], NOESEEK_ABS) #Skip to the faces #FBUFFER = bs.readBytes(MESHINFO[i][3]) #Read faces #NUMFACES = print(bs.tell()) rapi.rpgBindPositionBufferOfs(VBUFFER, noesis.RPGEODATA_INT, 0x18, 0) rapi.rpgCommitTriangles(None, noesis.RPGEODATA_USHORT, 0x1900, noesis.RPGEO_POINTS, 1) #rapi.rpgCommitTriangles(FBUFFER, noesis.RPGEODATA_USHORT, NUMFACES, noesis.RPGEO_TRIANGLE_STRIP, 1) mdl = rapi.rpgConstructModel() mdlList.append(mdl) #important, don't forget to put your loaded model in the mdlList rapi.rpgClearBufferBinds() return 1
It's messy but it pretty much explains the full format.
Thanks chrrox, but it's already possible to get models from A Crack in Time and the games after.chrrox wrote:if you want to look at a full games files.
Ratchet & Clank: A Crack in Time Clank (Great Clock Demo):
http://zeus.dl.playstation.net/cdn/UP90 ... 9JKPJF.pkg
Ratchet & Clank: A Crack in Time Ratchet (Krell Canyon Demo):
http://zeus.dl.playstation.net/cdn/UP90 ... jOPpBY.pkg
Yeah I did a search and I think Resistance 2 (i think that's what the game was) used the same format. Only the flags had been changed which references the types of the objects.chrrox wrote:Not sure what you mean the format looks identical.
Well while I can get the models, it's a very slow process. going through over 3000 different meshes one by one just to get a single model isn't very fun.Gh0stBlade wrote:Yeah I did a search and I think Resistance 2 (i think that's what the game was) used the same format. Only the flags had been changed which references the types of the objects.chrrox wrote:Not sure what you mean the format looks identical.
-------------------------------------------------
I'm not sure what has been "done" but if there are already tools which can view the models as seen a few posts above, why does it need doing twice?
This thread needs a bit of clarification hmmm, I'm mis-informed.
Tools of Destruction and Quest for booty don't have a shaders.dat file.chrrox wrote:you have to parse shaders.dat it contains all the information for loading the other files.
the list of files is in level_cached.toc and they need to be loaded in the order in that file.
Code: Select all
built/levels/fastoon/main.dat
built/levels/fastoon/vertices.dat
built/levels/fastoon/textures.dat
built/levels/fastoon/collision.dat
built/levels/fastoon/gameplay.dat
built/levels/fastoon/resident_sound.dat
built/levels/fastoon/resident_sound.us.dat
built/levels/fastoon/resident_sound.gb.dat
built/levels/fastoon/resident_sound.fr.dat
built/levels/fastoon/resident_sound.it.dat
built/levels/fastoon/resident_sound.de.dat
built/levels/fastoon/resident_sound.es.dat
built/levels/fastoon/resident_sound.nl.dat
built/levels/fastoon/resident_sound.pt.dat
built/levels/fastoon/resident_sound.jp.dat
built/levels/fastoon/resident_sound.kr.dat
built/levels/fastoon/resident_sound.cn.dat
built/levels/fastoon/resident_sound.dk.dat
built/levels/fastoon/resident_sound.fi.dat
built/levels/fastoon/resident_sound.no.dat
built/levels/fastoon/resident_sound.se.dat
packed/levels/levelfastoon/ps3gameplay.us.pkg
packed/levels/levelfastoon/ps3gameplay.gb.pkg
packed/levels/levelfastoon/ps3gameplay.fr.pkg
packed/levels/levelfastoon/ps3gameplay.it.pkg
packed/levels/levelfastoon/ps3gameplay.de.pkg
packed/levels/levelfastoon/ps3gameplay.es.pkg
packed/levels/levelfastoon/ps3gameplay.nl.pkg
packed/levels/levelfastoon/ps3gameplay.pt.pkg
packed/levels/levelfastoon/ps3gameplay.jp.pkg
packed/levels/levelfastoon/ps3gameplay.kr.pkg
packed/levels/levelfastoon/ps3gameplay.cn.pkg
packed/levels/levelfastoon/ps3gameplay.dk.pkg
packed/levels/levelfastoon/ps3gameplay.fi.pkg
packed/levels/levelfastoon/ps3gameplay.no.pkg
packed/levels/levelfastoon/ps3gameplay.se.pkg
built/levels/fastoon/fxconduit_packed.dat
built/levels/fastoon/effect.dat
built/levels/fastoon/system.tp
built/levels/fastoon/system.tph
built/levels/fastoon/dialogue.us.pkg
built/levels/fastoon/dialogue.gb.pkg
built/levels/fastoon/dialogue.fr.pkg
built/levels/fastoon/dialogue.it.pkg
built/levels/fastoon/dialogue.de.pkg
built/levels/fastoon/dialogue.es.pkg
built/levels/fastoon/dialogue.nl.pkg
built/levels/fastoon/dialogue.pt.pkg
built/levels/fastoon/dialogue.jp.pkg
built/levels/fastoon/dialogue.kr.pkg
built/levels/fastoon/dialogue.cn.pkg
built/levels/fastoon/dialogue.dk.pkg
built/levels/fastoon/dialogue.fi.pkg
built/levels/fastoon/dialogue.no.pkg
built/levels/fastoon/dialogue.se.pkg
built/levels/fastoon/lipsync.us.dat
built/levels/fastoon/lipsync.gb.dat
built/levels/fastoon/lipsync.fr.dat
built/levels/fastoon/lipsync.it.dat
built/levels/fastoon/lipsync.de.dat
built/levels/fastoon/lipsync.es.dat
built/levels/fastoon/lipsync.nl.dat
built/levels/fastoon/lipsync.pt.dat
built/levels/fastoon/lipsync.jp.dat
built/levels/fastoon/lipsync.kr.dat
built/levels/fastoon/lipsync.cn.dat
built/levels/fastoon/lipsync.dk.dat
built/levels/fastoon/lipsync.fi.dat
built/levels/fastoon/lipsync.no.dat
built/levels/fastoon/lipsync.se.dat
built/levels/fastoon/resident_dialogue.us.dat
built/levels/fastoon/resident_dialogue.gb.dat
built/levels/fastoon/resident_dialogue.fr.dat
built/levels/fastoon/resident_dialogue.it.dat
built/levels/fastoon/resident_dialogue.de.dat
built/levels/fastoon/resident_dialogue.es.dat
built/levels/fastoon/resident_dialogue.nl.dat
built/levels/fastoon/resident_dialogue.pt.dat
built/levels/fastoon/resident_dialogue.jp.dat
built/levels/fastoon/resident_dialogue.kr.dat
built/levels/fastoon/resident_dialogue.cn.dat
built/levels/fastoon/resident_dialogue.dk.dat
built/levels/fastoon/resident_dialogue.fi.dat
built/levels/fastoon/resident_dialogue.no.dat
built/levels/fastoon/resident_dialogue.se.datI had a quick look and there appears to be no shader.dat in one of the levels I extracted. I am just going to assume it's all contained in main.dat but I still don't know. You're right, it is indeed a pain.chrrox wrote:you have to parse shaders.dat it contains all the information for loading the other files.
the list of files is in level_cached.toc and they need to be loaded in the order in that file.