haekb / io_scene_lithtech

Based off of io_scene_abc by @cmbasnett
GNU General Public License v2.0
15 stars 5 forks source link

Support Jupiter EX #19

Open haekb opened 4 years ago

haekb commented 4 years ago

Jupiter EX is an upgraded version of Jupiter with DX9, and a physics engine. (Along with some other stuff I'm sure.)

Games like Condemned, and FEAR use it. The FEAR sdk includes Model00a files which are basically LTA files with extra meta data.

This involves building initial non-physics support for Model00a export.

haekb commented 3 years ago

While on a file format mapping spree, I've mapped the header of the model00p format (Packed/Compiled Files.)

struct Header {
    char Format[4];
    int Version;
    int Unk1;
    int AnimationCount;
    int NodeCount;
    int PieceCount;
    int ChildModelCount; // For some reason this always includes the current model, so it's always +1 more!
    int LODCount;
    int SocketCount;
    int AnimationWeightCount;
    int Unk8;
    int StringDataLength; // Length in bytes of the text section
    int PhysicsWeightCount;
    int PhysicsShapeCount;
    int Unk12;
    int Unk13;
    int StiffSpringConstraintCount;
    int HingeConstraintCount;
    int LimitedHingeConstraintCount;
    int RagdollConstraintCount;
    int WheelConstraintCount;
    int PrismaticConstraintCount;
    int AnimationDataLength;
    int Unk21;
};

Once I get a concrete template down, I'll post my findings as always and start to work on a model00p importer.

haekb commented 3 years ago

Also known Model00p versions:

Gotham City Imposters seems to be zlib compressed under the format .mdl. It's quite a bit different (as expected), but FEAR vs Condemned seem to be fairly similar.

haekb commented 3 years ago

So far I've determined most of the header, the node layout, and most of the animation header and binding information.

After the node layout, they have a couple of animation headers (count is in the model header), that seem to show how the animation is compressed. And then the animation data follows. However before we can actually read the animation data, we need to skip (total data length is in the header) the animation data, and read the binding / general info. This information has things like keyframes, is the location data compressed, which animation header does it use, etc...

It's pretty weird. But I'm making progress!

haekb commented 3 years ago

Cool it now imports SOME FEAR meshes. image

I think I'm missing a section or two, will have to look into that. Also not entirely sure my face generation is perfect. There seems to be a few missing faces on the deltaForce.model00p file behind the mask cover.

Anywho I'm poking away at Condemned's v34 changes. Looks like some minor adjustments, mesh data now contains colour by default. Also the after mesh data seems slightly different. (I might actually have to parse the shadow mesh, yuck!)

haekb commented 3 years ago

Condemned models are now kind of loading. Here's a left-over prototype head, probably for material testing. image