Benny Posted September 14, 2005 Share Posted September 14, 2005 I've been trying to work out the file format for the PS2 version (1 huge 3.2GB file RESOURCE.PAK). I doubt I'm going to be able to make an extractor for it but I did find some interesting stuff inside the archive: An uncompiled lua script PsychoMunger1 PsychoMunger2 As you'll see from the txt files, PsychoMunger seems to be DoubleFine's internal tool for compiling level files. It also shows that .plb files are levels (or at least some of them are). As for the ps2 archive itself, I cant find a way to extract files from it yet. There doesnt appear to be a name directory but there are 2 sections (near the beginning and end of the file) that look like file records, I cant get these to match up to anything though. The level pack files (PPAK) are included inside the archive, but the main PsychonautsData.pkg file doesnt seem to be there. The sheer size of the archive makes it a real pain to work with and half the time crashes my already-fragile pc. So support for the PS2 version in Psychonauts Explorer is quite unlikely right now. Link to comment Share on other sites More sharing options...
john_doe Posted September 16, 2005 Share Posted September 16, 2005 Not bad. At least we know that there are at least two types of plb-files, one for the levels and one for models. I haven't made any progress with them, though, due to a lack of time and the complexity of the files I still can't even parse the plb-files to get at least the vertex and index data to display some wireframes. Some files are quite simple but other files have some additional data which varies in size and I didn't find a way yet to find out this size. Link to comment Share on other sites More sharing options...
Benny Posted September 16, 2005 Author Share Posted September 16, 2005 If you ever manage to view the models then perhaps we could also view the levels, assuming that they share a similar format Link to comment Share on other sites More sharing options...
Benny Posted October 4, 2005 Author Share Posted October 4, 2005 I made some progress with the PS2 version, I found the location of the MPAK level files and by hardcoding their offsets I can display a great many of the files. The image files in the PS2 version are set out in a similar way to the headerless DDS files in the other versions. They all seem to use 'texture id 14', which appears a few times in the XBox version. Its 1 byte per pixel with a 1024 byte palette coming after it (512 bytes of data then 512 of 00 usually). Unfortunately I havent been able to display these images yet, if I cant manage it then I'll post some examples and see if anyone else can Link to comment Share on other sites More sharing options...
Benny Posted October 5, 2005 Author Share Posted October 5, 2005 I've uploaded some ps2 files (and the equivalent decoded image from the pc version) here perhaps someone else can make sense of them As I said, they are laid out in a very similar way to the headerless dds' : 2 bytes ID1 2 bytes ID2 2 bytes Texture ID (always 14) 6 bytes ? 4 bytes Width 4 bytes Height 4 bytes No of mipmaps (always 1?) 4 bytes ? 2 bytes Secondary Texture ID 12 bytes ? 56 bytes ? Width*Height bytes Image Data 1024 bytes Palette The format changes slightly for 'animated' images but none of the examples that i've uploaded are animated. I'm not totally sure about the 56 bytes, I *think* that the pixel data begins after this, but its more of a guess than fact. Link to comment Share on other sites More sharing options...
john_doe Posted October 7, 2005 Share Posted October 7, 2005 Today I had some time to work on the models again. The extra data at the end of the ppf files really is the level "model". I've tried it in my "viewer" (nothing exciting, I have to hardcode the data offsets). The only thing that really annoys me is that I could not find where the texture coordinates are stored. I'm afraid they're compressed or something. Each model is divided into several "sub-meshes" (I guess one for each texture to save on switching textures). Each one of these has at least some vertex data (x,y,z floats and a vertex color) and index data (list of 16bit words). Both are needed to draw the part (most of them are triangle strips but some seem to be just triangle lists). Also, I guess there could be normal data. This could probably be calculated at runtime but could be slow for a lot of data. Then there have to be some texture coordinates. It's probably quite easy and I'm looking for texture coordinates in all the wrong places I've also run Psychonauts with PIX which works great, you can easily display textures etc. and it even shows you the texture format and stuff like that. But it won't let me save the vertex data or other model-related stuff PS: I hope it's ok to hijack this thread for model-related stuff? Link to comment Share on other sites More sharing options...
Benny Posted October 7, 2005 Author Share Posted October 7, 2005 Hijack away! I uninstalled PIX because I couldnt get it to work, perhaps running it with the demo version or even a *cough* cracked .exe would give different results? When I was trying to decompile the exe I couldnt get the original to decompile, but a cracked exe did. Just a suggestion anyway Link to comment Share on other sites More sharing options...
Benny Posted October 7, 2005 Author Share Posted October 7, 2005 The ps2 models seem slightly different to the pc and xbox ones, i've uploaded some here in case they can help. [Edit] Another thought - we know that the levels were created in Maya and then converted, maybe the models were too? Perhaps theres something in the Maya file formats that will give some pointers. Link to comment Share on other sites More sharing options...
Benny Posted October 13, 2005 Author Share Posted October 13, 2005 Regarding the ps2 images - I created an image that was compressed with ATI 3DC compression. I then chopped out the image data and replaced it with the image data from a ps2 file. This was the result (the bottom image), it suggests that the image is compressed in a similar way to 3DC compression. Its a bit weird that the image shows twice, but its definately the correct image. Link to comment Share on other sites More sharing options...
Benny Posted October 19, 2005 Author Share Posted October 19, 2005 I was adding stuff to this wiki and noticed that someone had already added the .pkg specs for Psychonauts. Looking at it I realised that they were correct and that my specs were slightly wrong. Instead of this: File Records: ------------- Each file record is 16 bytes long: 4 bytes: Identifier 4 bytes: Offset of name in Name Directory (relative to start of name dir) 4 bytes: Offset of file data 4 bytes: File data size The identifier identifies the file type: 256: .asd 1280: .atx etc.. It should be this: File Records: ------------- Each file record is 16 bytes long: 1 byte: Null 2 bytes: File Extension Offset (relative to start of file ext dir) 1 byte: Null 4 bytes: Offset of name in Name Directory (relative to start of name dir) 4 bytes: Offset of file data 4 bytes: File data size I've changed the code in Psychonauts Explorer, but it doesnt appear to have made much difference. I think the 'identifiers' that I used match up to the correct file extension anyway. Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.