FF7 Crisis Core - File Format and Data Investigation

  • Thread starter Thread starter koral
  • Start date Start date
Status
Not open for further replies.
Neocloudstrife, 3d printscreen would work well with it i think. If we try with it first, it's less work for Koral/MrAdults.
That doesn't seem to want to work for me either (crashes on loading anything 3D)
STUPID VISTA  :cry:
 
Don't worry, I will add in a .OBJ exporter as standard with the next release :wink:
It is such a simple format to work with, it wont be a problem for me to do and for you guys to get into Max, Blender or whatever

I am converting the project into a Win32 MFC form, so it should be easier to work with.
Or maybe if mirex could add support for these files into Biturn then I might not have to?


apart from animations and bones, what else would there be to look into for this game?
There are maps, missions, materia, and the Debug-Menu somewhere in there too!
I also believe this game may be quite easy to Mod because of how the files are layed out, although I am not sure how else this game could be improved  :-P

But I am trying to solve the Sephi and Cloud texture issue right now, because a lot of other characters suffer from this problem too (such as Angeal).
It wouldn't do to release a buggy version, would it?
 
you're right, and as someone mentioned earlier, i think they're the ones with the weird scanline thingies. the textures are probably in a different format for some reason. they look like how the other textures started out, before you got them working.
lol, maybe it's just a joke from square or something. is it just a coincidence it happened to both cloud AND sephiroth? :P
 
I've worked with many console games before, and they all used .dds format for textures. It's common format used in games these days, it's very similar to .tga but smaller than it. It simply preserves high quality and alpha layer while maintaining smaller disk space than bloody .tga. I don't know if that helps but I'm trying to be helpful.
 
I always use PNGs for texture-maps, lossless compressed textures with alphas. Not as good as DDS I will admit, but definitly easier to for windows (open with Paint etc to view them). TGAs are useless  :-P

Anyway, I just discovered that there are multiple Textures in some of these !-Model files!

Example, the Cloud [file: 02183.raw] contains three textures:

02183rawchunk2.png
 
02183rawchunk4.png
 
02183rawchunk3.png


The way to access these other textures is to jump to the Texture-Offset (from the file header at 0x1c) then to read in 16-bytes until the first 0x77 byte.
Each of those 16-byte is a texture-map header which contains the image sizes and file offsets of where the pixel/pallete data are contained (ie, one 16-byte header per texture).

Ofcourse, this now suggests that the vertex data must also contain within it some kind of Texture-Index so the correct texture-map can be applied.
Seems like we are not quite done yet  :|
 
I was just coming here to tell you this, koral. :)
seph.jpg

It seems you have already figured out how to get at the multiple textures. I'm certain there are also multiple models outside of the main segment buffer, that can probably be accessed as well at the end of the main segment list. Not sure how that is exactly set up yet.

But! We got very lucky, and are given a WORD that is a direct index into our texture list for which texture to use when rendering a given segment. :) Going along with the example code on my web site, to get at that word, you would do this:
Code: [Select]
Code:
WORD texIdx = ((WORD *)vinfd)[2];
And then texIdx is a simple 0-based index into the texture list, in the order it was parsed. I have tested this across quite a few models, and it seems reliable.
 
Could you add option to extract the textures in .dds or .tga format though? PNG alpha layer isn't as good as dds/tga in jedi academy engine, which is modified quake 3 (For which I mod :P)
 
Haha, that is a funny coincidence, Aurenasek116. I was responsible for the multiplayer portion of Jedi Academy. :) And Jedi Knight II, actually.

Not sure what you mean by the alpha layer isn't as good, though. DXT5 compression is pretty far from lossless, and you should be able to export a png to a dds and retain the alpha channel. I personally use PNG for everything as well, and distribute both PNG (for lossless no-compression rendering) and DDS for all of my games. It should work great, unless I'm totally unaware of some png alpha limitation.

BTW, I forgot to mention. Once I'm done integrating this support into my toolset, it will be able to export the models as well, to my own model format as well as .smd (Valve's pre-processed model format, for which every modeling suite in existing has an importer). Which will be useful for retaining skeletal/weighting data, if we ever get that fully working. However, it's not in my immediately scheduled timeline to get that release out. It will probably happen sometime after I look more into the skeletal data, to make sure it isn't just an obvious/simple thing to get working. koral's obj export functionality should be quite suitable for exporting static meshes, so I'm not worried about getting that functionality out there.
 
In what way responsible for the multiplayer portion? Do/Did you work at Raven?

As for PNG I've noticed that atleast in jedi academy when using alphafunc with it on detailed half-transparent textures it seems to ignore the small radius around the alpha resulting in black/white outline while rendering. TGA doesn't have that problem.

Retaining weighting would be great since it could allow exporting models in poses using original animations instead of that "Jesus-stance".
 
Fabulous work guys! I look forward to exploiting this to further my low poly knowledge!
 
Yaay!



But it seems to crash strangly when I try to load Genesis [file: 02170.raw], also with the Barrel model [file: 02450.raw]. Maybe it is something I am doing wrong somewhere with texture loading, because they were working fine before i started playing the multi-textures.
Apparantly, those files don't contain any 0x77s to seperate the texture-data headers from the textures, so it is probably just a case of mistaken identity.
Perhaps there is a texture count somewhere?


And you may notice something peculiar with Tifa here [file: 02192]:


No hat!
Remember my earlier attempts showed her hat, and everyones weapons too.

MrAdults, you suggested the possibility of multiple models right? I will have to look for them before making the release, but if the multi-textures are any guide, then they should follow on immedietly after the primary model data.


And NO, I will not be adding in any more export formats for textures, because it should be simple enough to convert them to other formats.
I may have to switch to X files later if we discover precise skeletal and animation data, but OBJ should suffice until then.

Maybe we are getting a little ahead of ourselves here  :-P
Thanks for the support everyone!  :-D


EDIT:
I figured out the Texture-Count thing, there is a SHORT at 0xe of the file-header giving a count of the number of texture-headers present:



now to look for the count and location of other models within the same file!  :lol:


EDIT2:

Figured that out too!



The file header contains a SHORT at 0xa of the number of models, and jumping to the vertex-data offset simply read in the offset to the start of the vertices, located every 8-bytes. There is an unknown DWORD before each offset, a count for something in each vertex group but no idea what.

I ran through ALL the character !-Files [files: 02163 - 02457] and they all load up correctly, although some have screwed up texture-maps (because of differing interlacing or something).

So I can now happily annouce that the next release is on its way!
ETA: sometime later today
 :-D
 
Last edited:
:-o :-o :-o Neocloudstrife is gonna die when he sees this!
1aatIgMD1C68W2CqAIP65EXMC8.gif
 
Last edited:
If this gets released you will see swarm of crisis core models ported to Jedi Academy.
 
Here is the link: [link removed, baaaad file]
I have updated the first post too, get it now and extract to your heart's desire!  :lol:

Wouldn't it be cool if Marlie-chan (and her friends) could find their way into a new FF7 mod?
 
Last edited:
Uhm, I get error when trying to run the exe. It says the application has wrong configuration and can't be run...
I'm running Win XP Professional 32bit if that's needed.
 
HUUUUUUU, KORALL GREAAAATT WOOOOOOORKK, you made it, yes, now you unleashed, XD

-------------------------------
Same problem with font and crash with 3D model, can you be fix these things?
 
Last edited:
iiya, sorry about that  :oops:
I was messing with MFC and forms and stuff, probably some rubbish got left over, I will need to sort it ASAP!
Sorry

EDIT:
um, try this (v0.4b, GL): http://www.mediafire.com/?mtz0nyl2d3h
please tell me if this doesn't work, it must be something else then...

EDIT2:
this is v0.4c, which uses DX9 and is perfectly compatible with 3DRipperDX: http://www.mediafire.com/?yewwz3nnlwy

The program is extremelybuggy and likes to crash sometimes when you select a file.
There is nothing else I can do unless I completely revert away from irrlicht.

Sorry I couldn't make it easier :cry:
 
Last edited:
Awesome work again, koral. :) I was looking for skeletal data again last night, it's definitely not there in any obvious form. It seems there are groupings of 3 ints and 4 floats in one of the files. There is a short that specifies the number of those groups (seems to be "3" a lot), followed by that many groups, and some other unknown data in between. Those 4 floats could be a quaternion, but the 3 ints don't make sense as coordinates in any kind of interpretation. Plus it would be very strange to hold bone orientations in these kinds of groupings. So, I'm not confident that these models actually have the bone data/skeleton in them, though I'm not discounting it yet. But it would not be uncommon to have the skeleton in another file with the character's animations.

It seems very possible that the skeleton is "flattened" with no hierarchy, and because matrices are base-relative, the animation data could just be a flattened series of orientations that were computed based on the base pose matrix, which is no longer needed at run-time. The benefit of flattening is that no hiererchical transform is needed for joint matrices, although there is a downside of requiring more storage space for orientations. However, for Crisis Core, this means they could get away with absolutely no CPU cost for bone transforms. I am guessing they could not resist that even in the face of some extra memory overhead. ;)

All of that said, I did find where the bone index values are stored for each drawn segment (I think). So now I know which bones each existing weight is referencing. With that knowledge, I can actually re-create a skeleton and approximate the original joint hierarchy. I'm going to go ahead with this approach, because it will allow the characters to be exported and posed with rough bone positions, keeping the original vertex weighting intact. Since weighting is the hard part, this is suitable to my personal needs, at least. If the skeleton has problems, that's easy to tweak and change hierarchy in a modeling program, while retaining weighting info.

In what way responsible for the multiplayer portion? Do/Did you work at Raven?
Yeah, I worked there for a few years. As you probably know, we had separate executables for singleplayer and multiplayer. I was the guy responsible for the multiplayer codebase (which meant writing all of the MP-specific engine/game code, porting over all of the SP code to be multiplayer-friendly, etc).
 
Status
Not open for further replies.
Back
Top