What's new

Metroid Prime CMDL Viewer (still working on it however)

OP
SarahHarp

SarahHarp

New member
They arn't cube maps, but single image. You can dump the textures via thakis's texdump, however I cannot send them to you myself because they are copywrited. o.o
 

trepdimeflou

New member
Ok, thanks for clearing that up. Must be the UVWs on this custom model then =p

I'm actually batch dumping every bitmap straight to .dds using a custom tool I had my friend create ;)
 

BlueFalcon7

New member
So let me get this straight, which filetypes are not going to be emulated in this CMDL viewer? Because it seems to me that this thing will allow you to practically play the game with a little extra code.
 

Shalted

New member
trepdimeflou said:
Ok, thanks for clearing that up. Must be the UVWs on this custom model then =p

I'm actually batch dumping every bitmap straight to .dds using a custom tool I had my friend create ;)
=o.
Heh, I've been looking at the header, and it seems pretty simple. Except one peice of data, but maybe you can take a look at it Sarah, any way from what I remember it's something like this.
Code:
#define VertexBlock 1
#define NormalBlock 2//Pretty sure it's normals ;p
struct { // Size is a static 96 bytes
     uint32 DeadBabe;
     uint32 Unknown[2];
     //Bounding Box
     float MinX;
     float MaxX;
     float MinY;
     float MaxY;
     float MinZ;
     float MaxZ;
     uint32 Unknowns[2];
     uint SegmentSizes[12];
}CMDL_Header;
//^Something like that, I have the actual data some where... Should be close
//enough to use your own good judgement and figure it out.
The segment sizes secify how big a certain segment is, the first one is unknown, the second is vertices, third is UVs etc.
Although the segment's data could also have other data that uses some of the data in the rest of the file.
Example:
Code:
Header (To bad there arent any offsets :( )
|-FirstSegment(I still don't know what this is...)
|-+Segment Child
|-Vertex Data
|- UV Data
|- etc...
Then getting counts for the data segments is a simple matter of getting the quotient of the Segment Size, and A single data chunk.
Ex.
VerticeCount=SegmentSizes[1]/12;

Any remainder shouldn't matter because the segments are padded to every 0x10 bytes (I think 0x10...)
Currently I don't know what the first segment contains so you cant properly extreact the model data. Although it's a method I'm against, I'm sure a farily simple method of scanning could work for every model.

Actually any help regarding the Tristrip data, normals and smoothing groups would be nice :)
 
Last edited:
OP
SarahHarp

SarahHarp

New member
Well, Sound will not be emulated becuase, I havn't really found out much of audio programming.
Hmmm, there's a few files that I can't think of right now, but files like ELSE, DCLN, etc .. will not be done. As for the emulated game... that would be cool to have, but I'm not sure on how I'd actually program that. I'm sure it -could- be done... maybe after all the current projects on this are finished then I'll go into the actual game thing... maybe.

And Shalted, check your PM.
 
OP
SarahHarp

SarahHarp

New member
Yeah, and Thakis is godly compared to me too.. o.o
In any case, viewer now works with 95% of all CMDLs now : ) ... just a few small ones are confusing my viewer still.
 

Sercio

New member
95 % is more then enough...
i mean the bmd viewer from thakis dont work wth all models!
Just the models which does not work are not important....
Your viewer are going to be great!
Maybe you can implement a animation chooser....
you have just select the animation in a sup-menu and must not drag each animation file into that window like the bmd viewer....
Then it should be great!!!

Nice work ---> you can call youself a good hacker :matrix:
 

koss

New member
ok im new here. sorry if this is obvious but can soemone give me a link to thakis ripper or anything else u guys have. thanks alot!

~koss
 
OP
SarahHarp

SarahHarp

New member
I'm a perfectionist, I'm going to make sure 100% of the models work perfectly, as they should (well... with the exeption of Materials, because I havn't figured those out, but I'm actually finding some things out about them I think)

Anims are unknown still. But eventually, my viewer will be incorperated into a win32 app of some kind with a nice fancy interface that has a multitude of useful options. (This is also how I'd make a program capable of linking all the required files together (example, to play an ANIM you need a specific ANCS, CMDL, CINF, and CSKR ... so no "drag and drop" system is really going to be effective here, especially because this is really unefficient)
 
OP
SarahHarp

SarahHarp

New member
Thakis' BMDViewer is found in the thread along the lines of "SZS format explained" or something .. o.o
 

Shalted

New member
Arg, I'm so dumb, after looking at the header again, it doesn't work like I last described it.
Code:
struct { 
     uint32 DeadBabe;
     uint32 Unknown[2];
     //Bounding Box
     float MinX;
     float MaxX;
     float MinY;
     float MaxY;
     float MinZ;
     float MaxZ;
     uint32 SegmentCount;
     uint32 UnknownCount;
}CMDL_Header;
psuedo code:
read model(){
   open file;
   read header;
   int *UnknownSizes=new int[UnknownCount];
   int *SegmentSizes= new int[SegmentCount-UnknownCount];
   read unknown sizes;
   read segment sizes;
   round the file pointer to the nearest 0x20 and add the sum of all the unknown sizes;
  //now you're at the vertex data =o and the rest is easy :)
}
I'm actually thinking the other 2 unknowns are also counts to something else...
EDIT: Fixed a wrong member in the scructure :S
 
Last edited:
OP
SarahHarp

SarahHarp

New member
Major Update:
I implimented a new camera (thanks to Thakis : ) ) which involves matrices (the old one didn't, and thus, it was hideous)

Now for the good part: I've found the material definitions and applied thier basic contents on the model (alot of data in the Material Definitions is ignored right now) ... and as a result: http://img87.imageshack.us/img87/5488/matdsamusfk0.png .. so now texture placements are not "hardcoded" anymore : )
The only current downside is that the compatability took a nose dive, -.- so I'll have to work on that again (it's down to about 10% lol).

This also means that the beta of the CMDL component of my viewer is going to be released soon. However, I NEED to fix the compatability before sending it out (obviously)... and I'm moving this coming up weekend .. < .< So let's hope I can crank that compatability back up in 5 days (because I don't know when I'll get internet back).....


Update2: I've properly applied the shaders on the proper groups (However, shaders arn't 100% perfect yet)
http://img209.imageshack.us/img209/7211/matdgramk8.png
 
Last edited:

BlueFalcon7

New member
well, an idea for opening files with everything, is to just open the .pak files, and impliment a pak viewer, so all the files are all contained. But what would be really cool, is if you allowed the individual files (in the .pak) to be viewed, Like to view a mesh, or to view a texture, and then have the program tell what files are associated with the mesh or whatever. Also it would be cool to view a model, and then to view individual textures.

Im just throwin out ideas...
 

Shalted

New member
Sercio said:
is that a fun createt fake or real application??
No, it's a real application, although it currently isn't able to render anything. (Havn't decided how I want to do the viewer). Although it is able to extract/Batch extract Textures, and Tags. I'm still working on models.
 

Top