What's new

SZS file format explained

Status
Not open for further replies.

thakis

New member
Hi,

I've written a program that extracts all data from .szs files (found in supermariosunshine for example), get it with source and documentation from

http://www.amnoid.de/gc/szstools.zip

Post to this thread if you find out what's stored in all the files that are generated from the szs/rarc files :) Some wild guesses by me:

.bmg: Messages/Subtitles. Contain lots of text.
.bmd: 3d model data?? Contains "VTX1" blocks which could stand for "Vertex". However, most of these files are not too big. The "map/map" subdir of the szs files in "data/scene" contains a map.bmpd which is quite big (nearly always > 1mb), this could be the main level model.
.jpa: Texture/Image??
bmt: Material??

Bye,
thakis

[edit: fixed link :-O ]
 
Last edited:

MGFox

The Quiet One!
Good Work, and Welcome to the EmuTalk Forums! :happy:

Just to let you know, the yaz0 compression in the SZS files is also used in the REL files on Wind Waker. I suppose it's highly possible that its been used in other games as well, just with different extensions!

Cheers,
Fox
 
OP
thakis

thakis

New member
Status update

Hi,

I've managed to extract most of the texture data from the .bmd files (currently only s3tc1 compressed data is extracted, but most textures are in that format. It seems that the format byte has the same meaning as in .tpl files, so I hope I can extract the other formats soon, too). I will post an exe for it when I managed to extract the vertex/face data as well (it's stored in the .bmd files as well).
 
OP
thakis

thakis

New member
As you can see, tristrip loading kinda works now, too. I managed to decode which kind of data is stored in the model (colors, texcoords, normals, ...), but the viewer has not yet been updated to use this additional information, so the tris are grey...

Things still missing:
- I don't know how many normals/texcoords/colors are stored in the file. I could let the program count them, but it's gotta be stored somewhere in this file as well...
- There are different kinds of tristrips in a single model: some tris have only normals while others have normals and texture coords. I don't know at which boundaries tristrip types change - so only the first "type" is displayed right now (that's why not the whole scene below is triangulated).

I'll take a creative break tomorrow, I hope I'm able to display textured, lighted and colorful models this weekend :canadian:
 

MGFox

The Quiet One!
Dude, this progress is amazing, excellent work!

I know this maybe a stupid question, but would there be any possiblity of a guide to reverse-engineering file formats? I would love to help you out, but I've only ever reverse-engineered settings files (e.g. DAT files) so this is VERY different!

Cheers,
Fox
 
OP
thakis

thakis

New member
Hm, basically I open a file in a hex editor, look at it until I see what some of the bytes could mean, write a little program to test it my assumptions work, and if it works for about 5 different files I assume that my guess was right and I move on to the next block.

When I've finished decoding the vertex data, I'll post a document that describes the .bmd format and another one that describes which of the files helped me most to understand the format and what I learned from which file. Hopefully this weekend... :)
 

Guru64

New member
Sounds great! Remembers me of Sanik, he was hacking the Sonic Adventure models.

Well, good luck.
 
OP
thakis

thakis

New member
Getting somewhere...
Took me some time, but now I understand the tristrip data format well enough to display triangles for the whole scene - here is a screenie. Theoretically textures and normals are now working as well (the normals used in the screenie weren't loaded from the file but computed from the triangle data), I just have to implement it (but I know where to read the data from in the file).

Next steps are support for animated models (they still look somewhat horked because I need to take joint data into account for them, what I'm not doing at the moment [and I don't understand the joint data format at the moment]) and support for models with more than one texture.
 
Last edited:

Azimer

Emulator Developer
Moderator
I agree. This is quite interesting. I hope more people look into making use of gamecube games in a non-emulation way. Thanks for sharing all your progress.
 
OP
thakis

thakis

New member
Now with colors but without lighting - seems as if the lighting is included in the vertex colors anyway.
 
OP
thakis

thakis

New member
Textures in the airport level. Because there's only one texture per file supported at the moment, you can choose which part of the map looks correct - the rest looks kinda weird with the chosen texture :)

Below are shots with the airplane texture and the mountain texture enabled.
 
OP
thakis

thakis

New member
No, I thought it's nice to always use the same scene so one can better see the progress. All scenes work. Name your favorite one and I'll post a screenie ;-)
 
OP
thakis

thakis

New member
Play it, it's a great game! Here's the town (looks *really* weird 'cause it uses lots of different textures)...
 
Status
Not open for further replies.

Top