READ THE RULES: Click here

Follow us on Facebook: https://www.facebook.com/xentax/ :)

Crytek CGF models

Post questions about game models here, or help out others!
Tanasoo
ultra-n00b
Posts: 6
Joined: Thu Jan 31, 2008 3:20 am

Crytek CGF models

Post by Tanasoo » Thu Jan 31, 2008 8:00 pm

I saw this site when I was googling info on cracking model files, so I decided to make a post to see if anyone wanted to help me with cracking the new (crysis) CGF files.

I have done this sort of thing before. I was one of the guys that cracked the Halo 3 beta models, but I was more on the end of coding an importer in maxscript then finding out the actual data. Although once I knew the general layout I was able to help by finding out things like the UV, and bone weight data.

I really want to get these imported into 3ds max, so any help would be great!

fatduck
mega-veteran
mega-veteran
Posts: 315
Joined: Wed Aug 02, 2006 10:07 pm
Has thanked: 10 times
Been thanked: 93 times

Post by fatduck » Sat Feb 02, 2008 9:15 am

So what do you already know!?

I did have a look at the format and it is very complicated! Although I can basically "import" the mesh, but I can't find the skin/weight data!

I don't have any document in hand atm. But I recall it is a tag base format. The tag is a dword, something like 0xCCCC000F. You can find a resource table at the beginning of the cgf as well.

Tanasoo
ultra-n00b
Posts: 6
Joined: Thu Jan 31, 2008 3:20 am

Post by Tanasoo » Sat Feb 02, 2008 9:48 pm

Wow, really? That's awesome!

I don't really know anything about them, but I might be able to help find some of the other stuff. If I could know what parts of the file are used for storing data like vert positions, triangle strips, etc. Also, are these models compressed in any way?

User avatar
Wobble
ultra-veteran
ultra-veteran
Posts: 585
Joined: Tue Jan 04, 2005 9:47 pm
Has thanked: 43 times
Been thanked: 112 times

Re: Crytek CGF models

Post by Wobble » Mon Feb 04, 2008 11:00 pm

[out]
Last edited by Wobble on Sun Mar 12, 2017 12:32 pm, edited 1 time in total.

Tanasoo
ultra-n00b
Posts: 6
Joined: Thu Jan 31, 2008 3:20 am

Re: Crytek CGF models

Post by Tanasoo » Tue Feb 05, 2008 9:21 am

OK, here are a few objects.

http://www.megaupload.com/?d=GV19C3MV

box.cgf is, well, a box...
box_nodraw is a low poly sphere.
nannoSuit_us.chr is a different format. It is the format used for characters. It looks, to my untrained eye, to be similar, with the exception of extra stuff for probably bones, skin, nodes, etc.

From what I can tell about the chr, again, from my untrained eye, after the "header" there is a string with the name of the original 3ds max file, a BS timestamp (or proof of time travel :ninja: ) and possibly the artist's name? Then it looks like it lists all of the node names, but I don't see any position or orientation numbers... in fact, I see very little except 0000. A little ways down (approximately offset 13984) it looks like it is listing the original 3ds max material names, then more nodes, and more mat names. Not sure what this is all about... Then @~ 24918 it looks like it starts listing the actual skeleton (bone) data, with some values, although I don't know what they mean. Moving right along, down to about 92368. I'm not sure exactly what all this is, but if I was to hazard a guess, I would say vertex data because: @98894 there are some values that look an awful lot like triangle strip data. Then it looks like there is another vertex data chunk, then more tri-strips, etc. until the end. Keep in mind that there are a few "regions" or separate model sections in this file (like arms, body head, etc.)

I hope that helps a little, and wish I could be more help.
Thanks!

fatduck
mega-veteran
mega-veteran
Posts: 315
Joined: Wed Aug 02, 2006 10:07 pm
Has thanked: 10 times
Been thanked: 93 times

Re: Crytek CGF models

Post by fatduck » Tue Feb 05, 2008 10:05 am

Before you guys go to the wrong direction, I show you what I found!

CGF and CHR are model file, and strange enough they share the same format!!!

first 20 byte should be the header, possibility version etc

Code: Select all

char[6]     CryTek
word       unknown1           //??0x00 or 0x7400
word       unknown2           //constant 0x00
word       unknown3           //constant 0xFFFF
word       unknown4           //constant 0x0744
word       unknown5           //constant 0x00
dword     ofsResTable         //usually point to 0x14
As I said the format is "tag" based. And the Resource Table list out all the tag section, offset, index etc.

Resource Table

Code: Select all

dword     numRes
struct ResTable {
dword     Tag
dword     ??
dword     ofsTag
dword     Index
}
AFAIK:
CCCC0013 Filelog
CCCC000E Distance related (LOD distance etc??)
CCCC000B Name and Transform
CCCC0000 Mesh Description
CCCC0016 mesh data (0-vert, 1-normal, 2-UV, 3-VertColor, 5-Face Index)

each Tag/Section share same format as ResTable:

Code: Select all

dword     Tag
dword     ??
dword     ofsTagStart
dword     Index
{data}
No more Fatduck, no more FatImporter, Byebye everyone!

Tanasoo
ultra-n00b
Posts: 6
Joined: Thu Jan 31, 2008 3:20 am

Re: Crytek CGF models

Post by Tanasoo » Tue Feb 05, 2008 8:24 pm

That's great!

Is there any reference to the size of each tag? How do you tell when you reached the end?

Thanks for all of the help!

User avatar
Wobble
ultra-veteran
ultra-veteran
Posts: 585
Joined: Tue Jan 04, 2005 9:47 pm
Has thanked: 43 times
Been thanked: 112 times

Re: Crytek CGF models

Post by Wobble » Tue Feb 05, 2008 10:51 pm

[out]
Last edited by Wobble on Sun Mar 12, 2017 12:32 pm, edited 1 time in total.

fatduck
mega-veteran
mega-veteran
Posts: 315
Joined: Wed Aug 02, 2006 10:07 pm
Has thanked: 10 times
Been thanked: 93 times

Re: Crytek CGF models

Post by fatduck » Wed Feb 06, 2008 9:00 am

Wobble wrote: In fact, from the two files posted, the mesh structure has changed completely.
Before, it stored vertices, uvs, and trigs, but now, all that information has
been removed. All I see is an empty structure with some counts, just a descriptor.
All the other stuff must have been moved to new chunks.
Those are not count, they are index number. All point to the CCCC0016 mesh data. The spaces are fixed for specific data like:
00 -> 15 chunk index 0x15 (vert)
01 -> 16 chunk index 0x16 (normal)
02 -> 00 no such data (UV)
03 -> 17 chunk index 0x17 (VertColor)
Tanasoo wrote: Is there any reference to the size of each tag? How do you tell when you reached the end?
There is no size data, but each section/chunk is followed one form the other, so you can calculate the size form the ResTable.
No more Fatduck, no more FatImporter, Byebye everyone!

User avatar
Wobble
ultra-veteran
ultra-veteran
Posts: 585
Joined: Tue Jan 04, 2005 9:47 pm
Has thanked: 43 times
Been thanked: 112 times

Re: Crytek CGF models

Post by Wobble » Wed Feb 06, 2008 7:15 pm

[out]
Last edited by Wobble on Sun Mar 12, 2017 12:32 pm, edited 1 time in total.

Tanasoo
ultra-n00b
Posts: 6
Joined: Thu Jan 31, 2008 3:20 am

Re: Crytek CGF models

Post by Tanasoo » Thu Feb 07, 2008 2:41 am

I think you're right about the bounding box (-X, -Y, -Z, X, Y, Z)

I'm not sure about the rest, but thanks a ton for all of your work :]

fatduck
mega-veteran
mega-veteran
Posts: 315
Joined: Wed Aug 02, 2006 10:07 pm
Has thanked: 10 times
Been thanked: 93 times

Re: Crytek CGF models

Post by fatduck » Thu Feb 07, 2008 1:33 pm

Wobble wrote: Are you saying chunk 0xCCCC0000 contain chunk table indices?

Because NanoSuit_us.chr has 144 chunk table entries, and these numbers exceed 144:
If you look carefully, the indices are not in orders!!!

As I said, I already "import" the mesh! I just can't found materialID(which faces belong to which material) and skinning data!
You do not have the required permissions to view the files attached to this post.
No more Fatduck, no more FatImporter, Byebye everyone!

fatduck
mega-veteran
mega-veteran
Posts: 315
Joined: Wed Aug 02, 2006 10:07 pm
Has thanked: 10 times
Been thanked: 93 times

Re: Crytek CGF models

Post by fatduck » Thu Feb 07, 2008 1:59 pm

Just realize that I forgot to mention how CCCC0016 work!

Code: Select all

dword     ChunkID
dword     ChunkVer
dword     ofsChunk
dword     ChunkIndex
dword     Unknown00        //always 00
dword     DataType         //0-vert, 1-normal ...
dword     numData
dword     BytePerData      //eg: type 00, it is 0x0C(12) = float X 3(vert pos XYZ)
dword     Unknown00        //always 00
dword     Unknown00        //always 00
<data>
Last edited by fatduck on Fri Feb 08, 2008 8:51 am, edited 1 time in total.
No more Fatduck, no more FatImporter, Byebye everyone!

User avatar
Wobble
ultra-veteran
ultra-veteran
Posts: 585
Joined: Tue Jan 04, 2005 9:47 pm
Has thanked: 43 times
Been thanked: 112 times

Re: Crytek CGF models

Post by Wobble » Thu Feb 07, 2008 7:40 pm

[out]
Last edited by Wobble on Sun Mar 12, 2017 12:29 pm, edited 1 time in total.

Tanasoo
ultra-n00b
Posts: 6
Joined: Thu Jan 31, 2008 3:20 am

Re: Crytek CGF models

Post by Tanasoo » Thu Feb 07, 2008 8:27 pm

If someone could explain this 0XCCCC0000 stuff to me, I might be able to help with the materials and weights. I just need to know where to look.

I'm going to take a wild guess and say that after CCCC there are eight Dwords with data about the chunk. And the ChunkIndex is the location of the chunk. Right?

Post Reply