Trine 4: The Nightmare Prince

Trine 4: The Nightmare Prince

View Stats:
murla Aug 20, 2020 @ 10:26pm
FBQ file format
I've written a simple binary parser that can read file entries inside game archives (.fbq).

However, I'm stuck with compression used for actual files. lzf, lz4 and zstd are mentioned in end credits, but I had no success using them on compressed files with Linux utilities like lzf -d, lz4 -d, zstd -d. Any hint from anybody?
< >
Showing 1-8 of 8 comments
Chaosvex Aug 29, 2020 @ 8:18pm 
Trine uses zlib for decompression (inflate). If that doesn't work, I'd check whether you've extracted the files from the FBQ archives correctly.
Last edited by Chaosvex; Aug 29, 2020 @ 8:22pm
JLarja  [developer] Aug 30, 2020 @ 9:03am 
We actually use various algorithms (sometimes none at all) to compress the files. Original Trine used zlib (I think), T2 used a mix of zlib and LZ4. I don't quite remember when zstd was added. Some of the files are also internally compressed with specific algorithms, and thus not compressed at all by FBQ.

Do note that we use the algorithms, not particular utilities. I don't know if the ones mentioned in the original post are able to work with the files in FBQ. Also note that most interesting files are in processed format. Animations and models are not compatible with any editing software, Lua scripts are compiled to byte code and so on.

-JLarja / Frozenbyte
Kein Zantezuken Aug 31, 2023 @ 8:59am 
Originally posted by JLarja:
We actually use various algorithms (sometimes none at all) to compress the files. Original Trine used zlib (I think), T2 used a mix of zlib and LZ4. I don't quite remember when zstd was added. Some of the files are also internally compressed with specific algorithms, and thus not compressed at all by FBQ.

Do note that we use the algorithms, not particular utilities. I don't know if the ones mentioned in the original post are able to work with the files in FBQ. Also note that most interesting files are in processed format. Animations and models are not compatible with any editing software, Lua scripts are compiled to byte code and so on.

-JLarja / Frozenbyte

@JLarja

Can we have an update for Trine 5 FBQ changes? I've noticed there is new compression flag, 0x04 and the method changed from `lzf` to something else, perhaps encrypted? The entropy is fairly high:
https://imgur.com/a/xdqcNWA
JLarja  [developer] Aug 31, 2023 @ 9:20am 
The new compression method is Zstandard. There no encryption (in Trine 5), but I don't remember if there were some other changes. Decompression code was slightly altered to allow larger than four gigabyte FBQs.

-JLarja / Frozenbyte
Kein Zantezuken Aug 31, 2023 @ 9:40am 
Thanks!
Kein Zantezuken Aug 31, 2023 @ 6:03pm 
A follow-up question if you dont mind- you guys compiled your scripts with LUA 5.3.6? The header only indicates major version.
JLarja  [developer] Aug 31, 2023 @ 9:19pm 
Seems to be 5.3.5.

-JLarja / Frozenbyte
Kein Zantezuken Sep 2, 2023 @ 2:41pm 
Ah,. close enough, thanks again Larja!
< >
Showing 1-8 of 8 comments
Per page: 1530 50