Binary VDF: Difference between revisions

From Valve Developer Community
Jump to navigation Jump to search
(Created page with "'''Binary VDF''' is a binary version of the text-based KeyValues format. In C++, Binary VDF can be read using the function <code>KeyValues::ReadAsBinary</code>. The form...")
 
(adding Unicodes)
 
(2 intermediate revisions by 2 users not shown)
Line 1: Line 1:
{{Multiple issues|
{{Underlinked|date=January 2024}}
{{Orphan|date=January 2024}}
}}
'''Binary VDF''' is a binary version of the text-based [[KeyValues]] format.
'''Binary VDF''' is a binary version of the text-based [[KeyValues]] format.


Line 9: Line 14:
{| class="wikitable"
{| class="wikitable"
|-
|-
! # !! Type !! Data Format
! # !! Unicode !! Type !! Data Format
|-
|-
| 0 || TYPE_NONE || a nested Binary VDF document
| 0 || NUL || TYPE_NONE || a nested Binary VDF document
|-
|-
| 1 || TYPE_STRING || a null-terminated byte string
| 1 || SOH || TYPE_STRING || a null-terminated byte string
|-
|-
| 2 || TYPE_INT || a 32-bit little-endian signed integer
| 2 || STX || TYPE_INT || a 32-bit little-endian signed integer
|-
|-
| 3 || TYPE_FLOAT || a 32-bit little-endian IEEE-754 single-precision floating point number
| 3 || ETX || TYPE_FLOAT || a 32-bit little-endian IEEE-754 single-precision floating point number
|-
|-
| 4 || TYPE_PTR || a 32-bit pointer; not generally useful for applications of KeyValues that require serialization
| 4 || EOT || TYPE_PTR || a 32-bit pointer; not generally useful for applications of KeyValues that require serialization
|-
|-
| 5 || TYPE_WSTRING || a 16-bit little-endian signed integer representing the number of characters in the string (not including null terminator), followed by that many little-endian UCS-2 codepoints. (Note: Valve's implementation of KeyValues in Source SDK 2013 does not support this.)
| 5 || ENQ || TYPE_WSTRING || a 16-bit little-endian signed integer representing the number of characters in the string (not including null terminator), followed by that many little-endian UCS-2 codepoints. (Note: Valve's implementation of KeyValues in Source SDK 2013 does not support this.)
|-
|-
| 6 || TYPE_COLOR || an RGBA8888 color, consisting of one byte each for red, green, blue, and alpha, in that order
| 6 || ACK || TYPE_COLOR || an RGBA8888 color, consisting of one byte each for red, green, blue, and alpha, in that order
|-
|-
| 7 || TYPE_UINT64 || a 64-bit little-endian unsigned integer
| 7 || BEL || TYPE_UINT64 || a 64-bit little-endian unsigned integer
|-
|-
| 8 || TYPE_COMPILED_INT_BYTE || an 8-bit signed integer, converted to TYPE_INT when read. (Note: Valve's implementation of KeyValues in Source SDK 2013 does not support this.)
| 8 || BS || TYPE_COMPILED_INT_BYTE || an 8-bit signed integer, converted to TYPE_INT when read. (Note: Valve's implementation of KeyValues in Source SDK 2013 does not support this.)
|-
|-
| 9 || TYPE_COMPILED_INT_0 || no data bytes; represents a TYPE_INT set to 0. (Note: Valve's implementation of KeyValues in Source SDK 2013 does not support this.)
| 9 || HT or TAB|| TYPE_COMPILED_INT_0 || no data bytes; represents a TYPE_INT set to 0. (Note: Valve's implementation of KeyValues in Source SDK 2013 does not support this.)
|-
|-
| 10 || TYPE_COMPILED_INT_1 || no data bytes; represents a TYPE_INT set to 1. (Note: Valve's implementation of KeyValues in Source SDK 2013 does not support this.)
| 10 || DLE || TYPE_COMPILED_INT_1 || no data bytes; represents a TYPE_INT set to 1. (Note: Valve's implementation of KeyValues in Source SDK 2013 does not support this.)
|-
|-
| 11 || TYPE_NUMTYPES || not actually a type; this "type" has no name or data and represents the end of a binary VDF document.
| 11 || DC1 || TYPE_NUMTYPES || not actually a type; this "type" has no name or data and represents the end of a binary VDF document.
|}
|}
{{stub}}
{{Uncategorized stub|date=January 2024}}

Latest revision as of 11:04, 29 June 2025

Wikipedia - Letter.png
This article has multiple issues. Please help improve it or discuss these issues on the talk page. (Learn how and when to remove these template messages)
Underlinked - Logo.png
This article needs more Wikipedia icon links to other articles to help Wikipedia icon integrate it into the encyclopedia. Please help improve this article by adding links Wikipedia icon that are relevant to the context within the existing text.
January 2024

Binary VDF is a binary version of the text-based KeyValues format.

In C++, Binary VDF can be read using the function KeyValues::ReadAsBinary.

The format of Binary VDF is a simple repetition of a byte (type), a string (name), and the data based on the type byte. The file ends with one final byte with a value of 11 (0x0B).

The types are:

# Unicode Type Data Format
0 NUL TYPE_NONE a nested Binary VDF document
1 SOH TYPE_STRING a null-terminated byte string
2 STX TYPE_INT a 32-bit little-endian signed integer
3 ETX TYPE_FLOAT a 32-bit little-endian IEEE-754 single-precision floating point number
4 EOT TYPE_PTR a 32-bit pointer; not generally useful for applications of KeyValues that require serialization
5 ENQ TYPE_WSTRING a 16-bit little-endian signed integer representing the number of characters in the string (not including null terminator), followed by that many little-endian UCS-2 codepoints. (Note: Valve's implementation of KeyValues in Source SDK 2013 does not support this.)
6 ACK TYPE_COLOR an RGBA8888 color, consisting of one byte each for red, green, blue, and alpha, in that order
7 BEL TYPE_UINT64 a 64-bit little-endian unsigned integer
8 BS TYPE_COMPILED_INT_BYTE an 8-bit signed integer, converted to TYPE_INT when read. (Note: Valve's implementation of KeyValues in Source SDK 2013 does not support this.)
9 HT or TAB TYPE_COMPILED_INT_0 no data bytes; represents a TYPE_INT set to 0. (Note: Valve's implementation of KeyValues in Source SDK 2013 does not support this.)
10 DLE TYPE_COMPILED_INT_1 no data bytes; represents a TYPE_INT set to 1. (Note: Valve's implementation of KeyValues in Source SDK 2013 does not support this.)
11 DC1 TYPE_NUMTYPES not actually a type; this "type" has no name or data and represents the end of a binary VDF document.


Stub

This article or section is a stub. You can help by expanding it.

Wikipedia - Letter.png
This article has not been added to any content Wikipedia icon categories. Please help out by Wikipedia icon adding categories.
January 2024