FCBConverter
v20230711-1830
Far Cry Binary Converter
To run this app, you need to install .NET 7.
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.
Changing values in converted file
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>
- hash="ABDC41FE" - this is Hash32 of name attribute
- name="fMaxHealth" - this is readable format of hash attribute
For converting back to binary, one of name or hash is required.
- value-Float32="1000" - ignored during converting to binary!, it's detected type and value from binary data, may not be correct, but in almost all cases it's correct
- type="BinHex" - type of the value, default is always BinHex, can be changed by you, it's required when converting back to binary, look below what types are possible
- 00007A44 - the value of name or hash, it can be different, depends on type attribute
How to use my value
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.
Types
- Int16, Int32, Int64 - classical number type like 4, 8, 15, 16, 23, 42
- UInt16, UInt32, UInt64 - same as Int, but unsigned (can't be negative)
- Float32, Float64 - values with decimal points
- Vector2, Vector3, Vector4 - basically "array" of floats, like: Vector2 5.5,4.8 | Vector3 6.8,4.2,0.2 | Vector4 8.8,4.3,4.0,7.3
- String - just string, what else?
- Enum - enum, looks like Int
- Hash32, Hash64 - hash value
- Id32, Id64 - long IDs like: Id64 9015342852088885
- ComputeHash32, ComputeHash64 - this will make hash of value
- Boolean - just True or False, you thought something else?
- BinHex - default type, contains binary data
Usage
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
Batch converting
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
Examples
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:
- If the specified extension is exactly three characters long, the method returns files with extensions that begin with the specified extension. For example, "*.xls" returns both "book.xls" and "book.xlsx".
- In all other cases, the method returns files that exactly match the specified extension. For example, "*.ai" returns "file.ai" but not "file.aif".
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 for unpacking DAT / FAT
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 for unpacking single file from DAT / FAT
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 for packing DAT / FAT
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
FC5 and New Dawn Oasis strings file
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.
Known file names list
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
Known config entry names 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
FCB format compression
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 of DAT / FAT files
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.
Wwise SoundBank file
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.
Using PNG2XBT
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.
Supported file formats
- Far Cry Binary file (*.fcb)
- Database file (*.ndb)
- Dependency loader file (*_depload.dat)
- Sound info file (soundinfo.bin)
- Animation markup file (*.markup.bin)
- Far Cry 5 Strings file (oasisstrings.oasis.bin)
- Far Cry New Dawn Strings file (oasisstrings_nd.oasis.bin)
- Far Cry 4 Strings file (oasisstrings_compressed.bin)
- LuaQ file (*.lua)
- Lua file (adds LUAC header) (*.lua)
- Material file (*.material.bin)
- Texture file (*.xbt)
- Terrain texture file (*.xbts)
- Animation move file (*.move.bin)
- Combined Move File (CombinedMoveFile.bin)
- Sequence file (*.cseq)
- Flash UI file (*.feu)
- Bundle file (*.bdl)
- Wwise SoundBank file (*.bnk)
- Wwise Encoded Media (*.wem)
- File allocation table (DAT header file) (*.fat)
- Far Cry Mesh file (*.xbg)
Support development
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.
Credits
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.
As mentioned earlier, FCBConverter is based on original Gibbed's Dunia 2 Tools.
The GUI version design is based on Valky's Dunia Tools.
Dev note
Source code is available at GitHub.
Inspiration for this program was ffmpeg - many functions in one exe file.
Downloads
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
- Download (downloaded 4618 times)
- Google Drive mirror (downloaded 632 times)
Last updated: 2023-07-11 16:24 UTC
Added some new filenames and strings
Version 20230528-1500
Added unpacking Collection Zone Data
Added extracting FCB data from HKX and SPX
Version 20230212-0030
Added option to create lua bytecode
Version 20230128-2230
Fixed lua decompile float, double to string fix
Tweaked packing fat
Version 20230112-2300
Changed converting BNK - now just shows possible IDs inside
Version 20230106-2300
Added more filenames (thanks Steve64b)
Version 20221102-1800
Added more filenames
Animtrackcol file detect
Version 20221020-2000
Added PNG2XBT
Reworked params
Cleaned filelist + added more FC6 files
Version 20220914-2330
Added new filenames from FC6
Added FP fixer for FC6
Version 20220831-2330
Added support of new FCB RML format
Version 20220829-1800
Fixed converting array fields
Version 20220812-2100
-Added support for decompiling Luaq lua files
Version 1.32
Added support for Primal DAT FAT
Version 1.31
Fixed soundinfo.bin converting
Version 1.30
Fixed converting FC3 strings ending byte
Added FC6 soundinfo.bin
Version 1.29
Added some new file names and strings
Added some new definitions (especially for materials)
Version 1.28
Tweaked FP fixer
Version 1.27
Tweaks for external files
Version 1.26
Better detecting types of fields
Tweaked FP fixer
Some more strings
Version 1.25
Added some strings
Fixed converting entitylib
Version 1.24
Added converting entitylibrary to many files
Added support for some fcb entries
Added lib and obj files
Version 1.23
Added some new strings
Added gibbed's filelist
Version 1.22
Added some info strings to console output
Fixed some bad conversion in types
Version 1.21
Fixed converting of oasis
Version 1.20
Fixed unpacking FC6 dat
Version 1.19
Added support of FAT v11 (FC6)
Added support of FC6 oasis
Added some files from FC6
Added some strings from FC6
Version 1.18
Added support of FC3 oasis, new strings in list
Version 1.17
Added lookup for shader hash when converting materials
Added some new filenames for Blood Dragon
Version 1.16
Fixed ND oasis
Version 1.15
Tweaked Oasis converting
Version 1.14
Added some new filenames and strings
Added option to sucessfully convert FC2 configs
Version 1.13
Added some new filenames and strings
Version 1.12
Added UE4 to XBG for vehicles and weapons
Version 1.11
Reworked FP XBG fixer
Version 1.10
Added more files to filelist
Version 1.09
Fixed -keep bug when using GUI
Version 1.08
Fixed converting from UE to XBG
Version 1.07
Added converter from Unreal Engine 4 to XBG
Added FP clothes fixer
Version 1.06
Tweaked markup convert
Tweaked and fixed oasis converting
Version 1.05
markup frame CRC64 fix
Version 1.04
Fixed GUI interacting with CMD program
Version 1.03
Tweaked XBT converting, TEX now as XML
Some other tweaks
Version 1.02
Minor fixes
Version 1.01
Tweaked BNK