Markemp / Cryengine-Converter

A c# program to convert Crytek files to Collada (XML) format
https://www.heffaypresents.com/GitHub/
GNU General Public License v2.0
208 stars 53 forks source link

Allow packfile input, and fix pbxml load #154

Closed Soreepeong closed 1 year ago

Soreepeong commented 1 year ago
  1. Added IPackFileSystem, and implemented RealFileSystem for passthrough and WiiuStreamPackFileSystem for Rise of Lyric.
  2. Fixed pbxml where integers were larger than 0x80, by changing ReadByte into ReadCryInt.
  3. Fixed cgf export asserting false when indices is zero by just skipping them for the time being.

Usage

cgf-converter.exe
    -glb
    -pp
    -datadir Z:\ROL\0005000010191F00\content\Sonic_Crytek
    -datadir Z:\ROL\0005000010191F00\content\Sonic_Crytek\**.wiiu.stream
    -out Z:\ROL3D
    **.cgf
    **.chr

This will take everything in the game's root content directory, and assume whatever's in wiiu.stream file also exists in the game root content directory. If multiple files of same name exists, the most recently discovered one takes place.

This currently has a memory leak (converted 2542 files, and it takes 28GB RAM.) Probably need to fix it. Adding GC.Collect(int.MaxValue, GCCollectionMode.Forced, true, true); "fixes" it. GC must be running on extremely lazy mode. Good enough!

Soreepeong commented 1 year ago

I'm actually working on terrain export right now, and fixing stuff while at it; do you want to check out back later when I'm reasonably done enough?

Markemp commented 1 year ago

That sounds good. I'd like to package up all the changes into a new release in the near future, but want to see if all the non Sonic models work with the new export format as well.

Soreepeong commented 1 year ago

I think it works for what's implemented. The rest seems to be about shader-specific implementations that probably can't be exported very well, so I'd consider this the extent of automation I would do.

Markemp commented 1 year ago

Let me know if you're good with this as is and I'll get it merged. Thanks!

Soreepeong commented 1 year ago

Yeah, I think I'm done with it for the time being. If I touch it again, then it will belong in another PR!

Markemp commented 1 year ago

This is working great for other game models. Once again, thank you a TON for this patch!

Soreepeong commented 1 year ago

Good to hear! I guess there are a lot of games that are tied to this specific version of terrain related files?