NicknineTheEagle / Frostbite-Scripts

Python scripts for extracting Frostbite Engine assets
Other
87 stars 14 forks source link

Possibly missing chunks in NFS The Run #34

Closed Felipe379 closed 2 years ago

Felipe379 commented 2 years ago

I've been using an old script that was found in XeNTaX forums to extract NFS The Run assets models, however when I try to dump a very few specific cars meshes:

\bundles\res_c4\vehicles\nfs\for_pol_int_11\kits \bundles\res_c4\vehicles\nfs\test_sphere_car\kits \bundles\res_c4\vehicles\nfs\por_911_c4s_11\kits

It asks for chunks that can't be found in neither: \chunks \bundles\chunks

I'm not sure why it happens. My first guess is that not all the .chunk files are getting dumped. This appears to happens with both the new script and the old scripts that could be found in the XeNTaX forums. I can provide the script (both to dump the game and the mesh assets) I've been using if necessary.

NicknineTheEagle commented 2 years ago

Ugh, there's a bit of a problem with these old tools and chunks. See, EA formats have schizophrenic byte endianness where they can't decide if they want to stick with little endian or big endian byte order. When it comes to chunk GUIDs specifically, TOC files are little endian and non-cas bundles are big endian. And MeshSet headers are machine endian. Fun times ensure. Older dumper scripts do not account for this at all, they just extract chunks with raw binary GUIDs as names without reading bytes in the right order and mesh converter scripts do not account for byte endianness either so they end up failing to find some chunks (specifically chunks from non-cas bundles). My dumper scripts do read chunk GUIDs properly but they write them in a different format and there's still the issue of mesh converter scripts not accounting for byte endianness + I'm pretty sure none of them support big endian byte order (used on PS3/X360). This whole thing is a mess. I'm currently planning on adding mesh support to ebx2asset where it would read MeshSet headers, collect chunks and copy them to output in the form ready to use with the old converter scripts. To put it shortly, my dumper is not skipping any chunks, we're just dealing with a mess of obsolete and/or incomplete tools.

Felipe379 commented 2 years ago

Oh, I see what you mean. Since this is an issue only with the old dumper, I guess this issue can be closed.

Also, just taking advantage of the issue I want to mention there is a Batch_Itexture_Converter (apparently made by dainiuxxx) with source code written in C# for getting textures assets frostbites games supporting BF4, BF3 and Medal of Honor. With slightly modification to them I was able to get the texture from NFSTR textures as well.

I'm not sure if you have heard of it or are aware of it, but I guess (and hope) it could help with the development.

NicknineTheEagle commented 2 years ago

Also, just taking advantage of the issue I want to mention there is a Batch_Itexture_Converter (apparently made by dainiuxxx) with source code written in C# for getting textures assets frostbites games supporting BF4, BF3 and Medal of Honor. With slightly modification to them I was able to get the texture from NFSTR textures as well.

Obsolete for FB2 games since I've added support for extracting textures to ebxtoasset script recently. I handle mipmaps, cubemaps and depth textures properly, too, attaching the right DDS headers.

Felipe379 commented 2 years ago

Oh wow. That's great to hear. Looking forward for the future updates.