v20230128-2230
Far Cry Binary Converter
FCBConverter is a tool for modifying mainly FC5 and New Dawn, but can be used also for older FC games.
It contains also original Gibbed code for converting FCB format, but it's heavily modified and was added compression.
It also contains unpacker and packer of DAT / FAT files. It can convert also many other formats.
FCBConverter uses special detecting types of values (int32, int64, float), but sometimes it can detect the type incorrectly, so output file isn't using decoded types and values directly, but rather they are in separate attribute and they are ignored during converting back to binary.
To change a value you can use directly BinHex or use detected type and put typed value (rather than BinHex 15020000 you can write int 533). Look below for more.
This is converted line from binary:
<field hash="ABDC41FE" name="fMaxHealth" value-Float32="1000" type="BinHex">00007A44</field>
For converting back to binary, one of name or hash is required.
To make you work easier, you don't have to convert your values to BinHex, but rather you can use types (more below).
So change the default line:
<field hash="ABDC41FE" name="fMaxHealth" value-Float32="1000" type="BinHex">00007A44</field>
To:
<field hash="ABDC41FE" name="fMaxHealth" type="Float32">1000</field>
As you can see, type is now Float32 and value is 1000, value-Float32="1000" attribute you can delete.
FCBConverter is primary command line program, but release contains GUI program that makes using of FCBConverter easier.
Simple usage:
FCBConverter.exe -source=<file>
file - path to supported binary file that will be converted
Example:
FCBConverter.exe -source=D:\patch.dbt.fcb
FCBConverter can convert many files at once, just specify a folder that contains files that's need to be converted.
FCBConverter.exe -source=<folder> -filter=<search pattern> <allow subfolders>
folder - path for folder, use \ to run it in the same directory where are you running the exe
search pattern - *.fcb for example convert all FCB files, separated by comma (,)
allow subfolders - if you set "-subfolders", batch convert will process all found subfolders
This will convert all *.fcb files in the "editing" directory:
FCBConverter.exe -source="d:\unpacked\editing" -filter=*.fcb
This will convert all converted *.fcb files back to binary form in the "editing" directory:
FCBConverter.exe -source="d:\unpacked\editing" -filter=*.fcb.converted.xml
This will convert all *.xbt and *.bin files in the "editing" directory and all subfolders:
FCBConverter.exe -source="d:\unpacked\editing" -filter=*.xbt,*.bin -subfolders
This will convert all *.fcb files starting with "character_" in the "editing" directory:
FCBConverter.exe -source="d:\unpacked\editing" -filter=character_*.fcb
It doesn't support regular expressions, but you can use wildcard specifies:
? (question mark) - Zero or one character in that position.
* (asterisk) - Zero or more characters in that position.
When you use the asterisk wildcard character in a search pattern such as "*.txt", the number of characters in the specified extension affects the search as follows:
When you use the question mark wildcard character, this method returns only files that match the specified file extension. For example, given two files, "file1.txt" and "file1.txtother", in a directory, a search pattern of "file?.txt" returns just the first file, whereas a search pattern of "file*.txt" returns both files.
Usage:
FCBConverter.exe -source=<fat file> -out=<output dir>
fat file - path to fat file
output dir - output folder path, file will extracted to this folder
Usage:
FCBConverter.exe -source=<fat file> -out=<output dir> -single=<desired file>
fat file - path to fat file
output dir - output folder path, file will extracted to this folder
desired file - file path inside the FAT file
Usage:
FCBConverter.exe -source=<input folder> -fat=<fat file> <FAT version>
input folder - input folder path with files
fat file - path to the new fat file
FAT version - can be -v9 (FC4, FC3, FC3BD) or -v5 (FC2), default version is 10 (FC5, FCND), note that older FAT versions can't be compressed
Oasis strings file from FC5 and New Dawn has same file names, but different format, so it needs to edit the file name before converting (FCBConverter then know what format the file has).
Oasis file for subtitles in ND and FC6 has almost same structure as previous FC, but there are some small changes, so when converting to xml, FCBConverter asks you if the file is from ND or FC6, if so, hit Y.
Because DAT / FAT doesn't contain filenames, but they are rather saved as hash, there must be a list with all file names. If you find a file that isn't in the list, but is in the DAT / FAT, then you can add to the FCBConverterFileNames.list
Same as file names, config entry names are also saved as hash, so there also need to be a list with known names. New names can be added to FCBConverterStrings.list
If you look to files from Ubisoft, most of FCB files are compressed, but not using any known compression method, but rather custom Ubisoft compress method (I can describe it to you if you want).
Typical example of the compression is on file named as nomadobjecttemplates_rt.fcb, if you edit it and convert it back to FCB, it will be 32MB, but original file size is 2MB, that's big reduce in size.
Compressing big FCB files can take much time, so it maybe can't be used for hot-swap editing.
For enabling compression, open FCBConverterSettings.xml and change value of CompressFile to true.
Compression can be used also on these files (only for FC5 and ND). If you need to exclude any file extension from compressing, open FCBConverterSettings.xml and change value of CompressExcludeFiles.
For enabling compression, open FCBConverterSettings.xml and change value of CompressFile to true.
I added support for converting bnk files to xml. This page helped me a lot, but there is problem that the page was edited last in 2012, so it's very old and some bytes are different. That means not all objects from bnk are converted into readable format, but rather stay in binary hex format. Finding their structure requires weeks of trying different functions in Wwise. Maybe I add them in future.
There is also problem that bnk has different versions, FC5 has 120, New Dawn has 128. For example the game World of Warships has 135. Versions are mostly the same, but there are some small changes I found, for example uint32 is replaced with ubyte.
There also can be some files which can produce error during converting, in this case please tell me which files they are.
This can help you with making new textures. You just need high resolution texture in PNG format, FCBConverter automatically make MIPS and HD textures, then you just add them to a package.
There are two ways - directly open PNG in FCBConverter and input resolutions OR make separate XML file with defined resolutions - faster if you're making changes often.
Here is the XML file - it's basic xml file from converted XBT file, but with some extra params, you also can change basic params if you need to (like change version, if it's color map or not, etc...). The XML file must have same name as source PNG file.
<?xml version="1.0" encoding="utf-8" standalone="yes"?> <XBTInfo> <Version>119</Version> <Param1>2</Param1> <Param2>0</Param2> <Param3>0</Param3> <Param4>2</Param4> <Param5>1</Param5> <MipsFileMipsCount>0</MipsFileMipsCount> <Param7>255</Param7> <Param8>255</Param8> <UnknownID1>0</UnknownID1> <UnknownID2>618593894</UnknownID2> <UnknownID3>3135255059</UnknownID3> <MipsFileName></MipsFileName> <FCBConvParamBaseRes>512x256</FCBConvParamBaseRes> <FCBConvParamMipsRes>1024x512</FCBConvParamMipsRes> <FCBConvParamMipsHDRes>2048x1024</FCBConvParamMipsHDRes> <FCBConvParamMipsPath>graphics\weapons\_textures\gadgets\cellphone\memento\</FCBConvParamMipsPath> </XBTInfo>
FCBConvParamBaseRes - resolution of base (NON-MIPS) texture (for example resolution 512x256 or 512x512)
FCBConvParamMipsRes - resolution of MIPS texture (for example resolution 2048x1024 or 2048x2048), if you don't want MIPS, then type 0
FCBConvParamMipsHDRes - resolution of HD MIPS texture (for example resolution 4096x2048 or 4096x4096), if you don't have HD, then type 0
FCBConvParamMipsPath - path to folder where will be textures placed (it means path inside DAT FAT, ending with \\, for example graphics\weapons\_textures\gadgets\cellphone\memento\)
Note: basic params MipsFileMipsCount and MipsFileName are overwritten by FCBConverter, so any value inside will be lost.
In case you you'll use converting without the XML, then in folder with FCBConverter there is file XBTTemplate.xml - it contains params of XBT which will be added to output XBT files. Edit it as you need.
I spent many hours with searching binary structures of unknown files, so if you want to support me and next development of this program, I'll be glad.
As I wrote it contains original FCB converter from Gibbed and it was heavily modified and edited for using in FC5 and New Dawn.
It also contains 3rd party software for converting wem to ogg called ww2ogg and revorb.
There is also library for uncompressing lzo.
Source code is available at GitHub.
Inspiration for this program was ffmpeg - many functions in one exe file.
You are not allowed to upload this file to other sites under any circumstances
You must get permission from me before you are allowed to modify my files to improve it
You must get permission from me before you are allowed to use any of the assets in this file
Last updated: 2023-01-29 00:34 UTC