Lib20070319, a library to read/write Ryu Ga Gotoku Studio's proprietary 20070319 file format

Banner


Why the weird name?

The format does not have an official name, so it has been named after its header magic (0x20070319).


Quick demo

For demonstration purposes, let's make some quick edits to Yakuza 0's ability.bin_c file.

It is worth noting that the file encoding must be specified. RGGS decided, in their infinite wisdom, to have some files use UTF-8 encoding for text while others use Shift-JIS. There is no practical way to distinguish them, so it is required that the user provides the correct encoding.

The general rule of thumb is that JP files (often with the .bin_j extension) tend to use Shift-JIS while everything else uses UTF-8.

// Open the 20070319 file
Bin20070319 bin = Bin20070319FileReader.ReadBin20070319("ability.bin_c", Encoding.UTF8);

// Print all column names, their internal data type enum and the C# type for that data type
foreach (Bin20070319Column column in bin.GetColumns())
{
	Console.WriteLine($"{column.Name} [{column.InternalDataType}]: {column.GetDataType()}");
}

// Get entry for the "Heat Wave 1" upgrade
Bin20070319Entry entry = bin.GetEntry(112);

// Since we know the "SKILL" column is a String, we can retrieve the value as such
string skillValue = entry.GetValueFromColumn<string>("SKILL");

// This will print "Heat Wave 1"
Console.WriteLine(skillValue);

// Let's edit the value
entry.SetValueFromColumn("SKILL", "Some new skill name");

// Let's also make it free. The "MONEY" column is of type Int32
entry.SetValueFromColumn("MONEY", 0);

// Now we can save the edited file
Bin20070319FileWriter.WriteBin20070319ToFile(bin, "edited_ability.bin_c", Encoding.UTF8);