Difference between revisions of "BCSV"

From Deep Sea Knowledge
Jump to navigation Jump to search
(Offsets)
(Updated information on column names)
 
(3 intermediate revisions by the same user not shown)
Line 1: Line 1:
Information on BCSV files found in ACNH
+
BCSV, known as '''B'''inary '''CSV''', stores information relating to general content in a compact CSV format
  
 
== General ==
 
== General ==
  
BCSV files contain a list of content blocks. The header contains metadata for each content block
+
All information in this document is from Animal Crossing: New Horizons
 +
 
 +
BCSV files contain a header which defines the number of entries, the size of each entry block, and the fields each entry has, followed by a number of entries with context-specific data
  
 
== Header ==
 
== Header ==
 +
 +
The header contains
  
 
{|class="wikitable"
 
{|class="wikitable"
Line 11: Line 15:
 
! Offset !! Size !! Description
 
! Offset !! Size !! Description
 
|-
 
|-
| 0x00 || 0x4 || Number of content blocks
+
| 0x00 || 0x4 || Entry count
 
|-
 
|-
| 0x04 || 0x4 || Content block size
+
| 0x04 || 0x4 || Entry size
 
|-
 
|-
| 0x08 || 0x2 || Number of offsets
+
| 0x08 || 0x2 || Column count
 
|-
 
|-
 
| 0x0A || 0x2 || Always '''0x0101'''
 
| 0x0A || 0x2 || Always '''0x0101'''
Line 21: Line 25:
 
| 0x0C || 0x4 || '''VSCB''' Magic
 
| 0x0C || 0x4 || '''VSCB''' Magic
 
|-
 
|-
| 0x10 || 0xC || Unknown
+
| 0x10 || 0x2 || Always '''0x1027'''
 +
|-
 +
| 0x12 || 0xA || Padding
 
|-
 
|-
| 0x1C || 0x8*Number of offsets || Offset list
+
| 0x1C || 0x8*Column count || Columns
 
|}
 
|}
  
== Offsets ==
+
== Column ==
  
Offsets in the header seem to be made up of two fields
+
The columns are defined in the header as 2 sections; an identifier and the relative offset in each entry for that entries column value
  
 
{|class="wikitable"
 
{|class="wikitable"
Line 34: Line 40:
 
! Offset !! Size !! Description
 
! Offset !! Size !! Description
 
|-
 
|-
| 0x00 || 0x4 || Unknown data
+
| 0x00 || 0x4 || Identifier
 
|-
 
|-
| 0x04 || 0x4 || Offset relative to content block
+
| 0x04 || 0x4 || Offset
 
|}
 
|}
  
The unknown data seems to tell the parser what type of data is stored at what offset. The only common identifier currently known is '''0x54607054''', which seems to always point to a uint16 that increments per content block
+
The `Identifier` is the CRC32 of the "field name + data type", for example `UniqueID u16`. In the case of AC:NH these are entirely in-lined and the game has no knowledge of the pre-hashed strings, so knowing what the fields original names are requires calculating them yourself
 +
 
 +
The data type for each field is only known at compile time and therefore there is no way to 100% know what each data type is. It is possible roughly determine the type by checking the data size, though (IE, data with a size of 2 could be an '''int16''')
  
== Content Block ==
+
== Entries ==
  
Content blocks always begin with their offset relative to the file start, and then contain the blocks data
+
Entries always begin with their offset relative to the file start, and then contain the entries data
  
 
{|class="wikitable"
 
{|class="wikitable"
Line 51: Line 59:
 
| 0x00 || 0x4 || Offset relative to file start
 
| 0x00 || 0x4 || Offset relative to file start
 
|-
 
|-
| 0x04 || || Content block data
+
| 0x04 || || Entry data
 
|}
 
|}
  
 
[[Category:File formats]]
 
[[Category:File formats]]

Latest revision as of 11:35, 20 May 2020

BCSV, known as Binary CSV, stores information relating to general content in a compact CSV format

General

All information in this document is from Animal Crossing: New Horizons

BCSV files contain a header which defines the number of entries, the size of each entry block, and the fields each entry has, followed by a number of entries with context-specific data

Header

The header contains

Offset Size Description
0x00 0x4 Entry count
0x04 0x4 Entry size
0x08 0x2 Column count
0x0A 0x2 Always 0x0101
0x0C 0x4 VSCB Magic
0x10 0x2 Always 0x1027
0x12 0xA Padding
0x1C 0x8*Column count Columns

Column

The columns are defined in the header as 2 sections; an identifier and the relative offset in each entry for that entries column value

Offset Size Description
0x00 0x4 Identifier
0x04 0x4 Offset

The `Identifier` is the CRC32 of the "field name + data type", for example `UniqueID u16`. In the case of AC:NH these are entirely in-lined and the game has no knowledge of the pre-hashed strings, so knowing what the fields original names are requires calculating them yourself

The data type for each field is only known at compile time and therefore there is no way to 100% know what each data type is. It is possible roughly determine the type by checking the data size, though (IE, data with a size of 2 could be an int16)

Entries

Entries always begin with their offset relative to the file start, and then contain the entries data

Offset Size Description
0x00 0x4 Offset relative to file start
0x04 Entry data