Join also our Discord channel! Click here.

[Request]Ratchet & Clank: Tools of Destruction

Post questions about game models here, or help out others!
o0DemonBoy0o
veteran
Posts: 106
Joined: Tue Apr 03, 2012 6:02 am
Has thanked: 11 times
Been thanked: 12 times

[Request]Ratchet & Clank: Tools of Destruction

Post by o0DemonBoy0o » Fri Jan 31, 2014 12:27 am

I took a look at the files in ToD and while the format of the textures seem to be the same used in the later games the models seem to be in a different format.

Image

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

Gh0stBlade
Moderator
Posts: 684
Joined: Mon Jul 05, 2010 8:55 pm
Has thanked: 20 times
Been thanked: 333 times

Re: [Request]Ratchet & Clank: Tools of Destruction

Post by Gh0stBlade » Thu Feb 06, 2014 10:23 pm

Edited....
Last edited by Gh0stBlade on Thu Feb 13, 2014 1:02 pm, edited 1 time in total.
Click the thanks button if I helped!

o0DemonBoy0o
veteran
Posts: 106
Joined: Tue Apr 03, 2012 6:02 am
Has thanked: 11 times
Been thanked: 12 times

Re: [Request]Ratchet & Clank: Tools of Destruction

Post by o0DemonBoy0o » Fri Feb 07, 2014 12:33 am

Neat, Thanks for the info.
I noticed the missing data when comparing the verticies.dat to the mobys.dat from the other games.
I'm able to get meshes with hex2obj after editing the verticies.dat slightly
Image
It's a pretty painful processes though

I can't get files from ToD right now, but Quest for Booty uses the same format.
Here are some files from the prologue level. I included some files witch might have that missing data in them, though if it's not, then i'm not sure what would contain it?
the game.self, or eboot.bin maybe? There's also a debug.psarc and game.psarc in the main game folder.
https://www.dropbox.com/s/qyqbhodsls12o ... ologue.zip

User avatar
shakotay2
MEGAVETERAN
MEGAVETERAN
Posts: 3137
Joined: Fri Apr 20, 2012 9:24 am
Location: Nexus, searching for Jim Kirk
Has thanked: 835 times
Been thanked: 1674 times

Re: [Request]Ratchet & Clank: Tools of Destruction

Post by shakotay2 » Fri Feb 07, 2014 6:01 pm

o0DemonBoy0o wrote:It's a pretty painful processes though
yep.
The sequence 0000 0001 0002 is found 3945 times.
Don't know whether each sequence is indicating the start of a new object's/sub meshes face index list
but using a script on this as Gh0sBblade did seems to be the better choice.

btw: UV pos=12 seems to fit better for your example

For Quest for Booty (vertices.dat)I used these params:
Image
Bigchillghost, Reverse Engineering a Game Model: viewtopic.php?f=29&t=17889
extracting simple models: viewtopic.php?f=29&t=10894
Make_H2O-ForzaHor3-jm9.zip
"You quoted the whole thing, what a mess."

o0DemonBoy0o
veteran
Posts: 106
Joined: Tue Apr 03, 2012 6:02 am
Has thanked: 11 times
Been thanked: 12 times

Re: [Request]Ratchet & Clank: Tools of Destruction

Post by o0DemonBoy0o » Sat Feb 08, 2014 1:12 am

Wow, 3945 times?

I figured I would fix that once I got to a model I wanted, but it appears that won't happen anytime soon.
I've been through about 40 meshes so far in the ToD Fastoon verticies.dat, and everything seems to be its own object.

User avatar
cra0
ultra-veteran
ultra-veteran
Posts: 432
Joined: Fri Apr 27, 2012 9:37 am
Has thanked: 29 times
Been thanked: 184 times
Contact:

Re: [Request]Ratchet & Clank: Tools of Destruction

Post by cra0 » Sun Feb 09, 2014 9:45 am

Gh0stBlade 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.
Very useful yeah I'll look into it again

User avatar
chrrox
Moderator
Posts: 2564
Joined: Sun May 18, 2008 3:01 pm
Has thanked: 57 times
Been thanked: 1308 times

Re: [Request]Ratchet & Clank: Tools of Destruction

Post by chrrox » Sun Feb 09, 2014 4:22 pm

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

o0DemonBoy0o
veteran
Posts: 106
Joined: Tue Apr 03, 2012 6:02 am
Has thanked: 11 times
Been thanked: 12 times

Re: [Request]Ratchet & Clank: Tools of Destruction

Post by o0DemonBoy0o » Sun Feb 09, 2014 7:10 pm

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
Thanks chrrox, but it's already possible to get models from A Crack in Time and the games after.
viewtopic.php?f=16&t=10977
The only thing left is the UVs which seem correct but stretch out for some reason

Tools of Destruction and Quest for Booty seem to use a different format than the later games which is what i'm interested in.

User avatar
chrrox
Moderator
Posts: 2564
Joined: Sun May 18, 2008 3:01 pm
Has thanked: 57 times
Been thanked: 1308 times

Re: [Request]Ratchet & Clank: Tools of Destruction

Post by chrrox » Mon Feb 10, 2014 6:28 am

Not sure what you mean the format looks identical.

Gh0stBlade
Moderator
Posts: 684
Joined: Mon Jul 05, 2010 8:55 pm
Has thanked: 20 times
Been thanked: 333 times

Re: [Request]Ratchet & Clank: Tools of Destruction

Post by Gh0stBlade » Mon Feb 10, 2014 4:01 pm

chrrox wrote:Not sure what you mean the format looks identical.
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.

-------------------------------------------------

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.
Click the thanks button if I helped!

o0DemonBoy0o
veteran
Posts: 106
Joined: Tue Apr 03, 2012 6:02 am
Has thanked: 11 times
Been thanked: 12 times

Re: [Request]Ratchet & Clank: Tools of Destruction

Post by o0DemonBoy0o » Mon Feb 10, 2014 11:30 pm

Gh0stBlade wrote:
chrrox wrote:Not sure what you mean the format looks identical.
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.

-------------------------------------------------

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.
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.
I guess what i'm looking for is some sort of automated process or something.

User avatar
chrrox
Moderator
Posts: 2564
Joined: Sun May 18, 2008 3:01 pm
Has thanked: 57 times
Been thanked: 1308 times

Re: [Request]Ratchet & Clank: Tools of Destruction

Post by chrrox » Tue Feb 11, 2014 3:23 am

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.

o0DemonBoy0o
veteran
Posts: 106
Joined: Tue Apr 03, 2012 6:02 am
Has thanked: 11 times
Been thanked: 12 times

Re: [Request]Ratchet & Clank: Tools of Destruction

Post by o0DemonBoy0o » Tue Feb 11, 2014 5:06 am

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.
Tools of Destruction and Quest for booty don't have a shaders.dat file.

All the level folders for both games look pretty much exactly like this

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.dat

Gh0stBlade
Moderator
Posts: 684
Joined: Mon Jul 05, 2010 8:55 pm
Has thanked: 20 times
Been thanked: 333 times

Re: [Request]Ratchet & Clank: Tools of Destruction

Post by Gh0stBlade » Tue Feb 11, 2014 2:32 pm

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.
I 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.
Click the thanks button if I helped!

User avatar
chrrox
Moderator
Posts: 2564
Joined: Sun May 18, 2008 3:01 pm
Has thanked: 57 times
Been thanked: 1308 times

Re: [Request]Ratchet & Clank: Tools of Destruction

Post by chrrox » Tue Feb 11, 2014 3:15 pm

you can tell if main.dat is the file just search for 00 02 AB 00 in hex
if it shows up everywhere that is your file.

Post Reply