<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://wiki.wexosmk.xyz/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Atlas</id>
	<title>Wexos&#039;s Wiki - User contributions [en]</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.wexosmk.xyz/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Atlas"/>
	<link rel="alternate" type="text/html" href="https://wiki.wexosmk.xyz/index.php/Special:Contributions/Atlas"/>
	<updated>2026-08-10T06:56:04Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.41.1</generator>
	<entry>
		<id>https://wiki.wexosmk.xyz/index.php?title=BNSH_(File_Format)&amp;diff=708</id>
		<title>BNSH (File Format)</title>
		<link rel="alternate" type="text/html" href="https://wiki.wexosmk.xyz/index.php?title=BNSH_(File_Format)&amp;diff=708"/>
		<updated>2026-08-09T10:32:25Z</updated>

		<summary type="html">&lt;p&gt;Atlas: /* Version List */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&#039;&#039;&#039;BNSH&#039;&#039;&#039; (&#039;&#039;&#039;B&#039;&#039;&#039;inary &#039;&#039;&#039;N&#039;&#039;&#039;X &#039;&#039;&#039;SH&#039;&#039;&#039;ader) is a shader file format used on the [[Nintendo Switch]]. It contains shader data.&lt;br /&gt;
&lt;br /&gt;
= File Format =&lt;br /&gt;
== Header ==&lt;br /&gt;
The file format starts with the following header: &lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Offset !! Type !! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x00 || Char[8] || &#039;&#039;&#039;File magic&#039;&#039;&#039;. Always &#039;&#039;BNSH\0\0\0\0&#039;&#039; in ASCII, or 42 4E 53 4E 00 00 00 00.&lt;br /&gt;
|-&lt;br /&gt;
| 0x08 || UInt32 || &#039;&#039;&#039;[[#Version List|Version number]]&#039;&#039;&#039;.&lt;br /&gt;
|-&lt;br /&gt;
| 0x0C || UInt16 || {{BOM}}&lt;br /&gt;
|-&lt;br /&gt;
| 0x0E || Byte || &#039;&#039;&#039;Alignment shift&#039;&#039;&#039;. 1 &amp;lt;&amp;lt; v, where v is this value is the alignment required by the file.&lt;br /&gt;
|-&lt;br /&gt;
| 0x0F || Byte || &#039;&#039;&#039;Target address size&#039;&#039;&#039;. Size of a pointer in bits, thus 64. &lt;br /&gt;
|-&lt;br /&gt;
| 0x10 || UInt32 || &#039;&#039;&#039;File name offset&#039;&#039;&#039;. Points directly to the string, and not to the length unlike all other strings.&lt;br /&gt;
|-&lt;br /&gt;
| 0x14 || UInt16 || A &#039;&#039;&#039;flag&#039;&#039;&#039; which is only used on runtime. One bit sets wether the file is relocated.&lt;br /&gt;
|-&lt;br /&gt;
| 0x16 || UInt16 || Offset to the &#039;&#039;&#039;first section&#039;&#039;&#039;.&lt;br /&gt;
|-&lt;br /&gt;
| 0x18 || UInt32 || &#039;&#039;&#039;[[#Relocation Table|Relocation table]] offset&#039;&#039;&#039;.&lt;br /&gt;
|-&lt;br /&gt;
| 0x1C || UInt32 || &#039;&#039;&#039;Size of the file&#039;&#039;&#039; in bytes.&lt;br /&gt;
|-&lt;br /&gt;
| 0x20 || Byte[64] || &#039;&#039;&#039;Reserved&#039;&#039;&#039;.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Shader Container ==&lt;br /&gt;
The shader container is the root and stores some general information about the shaders.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Offset !! Type !! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x00 || Char[4] || &#039;&#039;&#039;Section magic&#039;&#039;&#039;. Always &#039;&#039;grsc&#039;&#039; in ASCII.&lt;br /&gt;
|-&lt;br /&gt;
| 0x04 || UInt32 || &#039;&#039;&#039;Next section offset&#039;&#039;&#039;.&lt;br /&gt;
|-&lt;br /&gt;
| 0x08 || UInt32 || &#039;&#039;&#039;Size of this section&#039;&#039;&#039; in bytes.&lt;br /&gt;
|-&lt;br /&gt;
| 0x0C || Byte[4] || &#039;&#039;&#039;Reserved&#039;&#039;&#039;.&lt;br /&gt;
|-&lt;br /&gt;
| 0x10 || UInt16 || &#039;&#039;&#039;API target type&#039;&#039;&#039;.&lt;br /&gt;
|-&lt;br /&gt;
| 0x12 || UInt16 || &#039;&#039;&#039;API target version&#039;&#039;&#039;.&lt;br /&gt;
|-&lt;br /&gt;
| 0x14 || Byte || &#039;&#039;&#039;Target code type.&lt;br /&gt;
|-&lt;br /&gt;
| 0x15 || Byte[3] || &#039;&#039;&#039;Reserved&#039;&#039;&#039;.&lt;br /&gt;
|-&lt;br /&gt;
| 0x18 || UInt32 || &#039;&#039;&#039;Compiler version&#039;&#039;&#039;.&lt;br /&gt;
|-&lt;br /&gt;
| 0x1C || UInt32 || &#039;&#039;&#039;Number of [[#Shader Variation|shader variation]]s&#039;&#039;&#039;.&lt;br /&gt;
|-&lt;br /&gt;
| 0x20 || Int64 || &#039;&#039;&#039;[[#Shader Variation|Shader variation]] array offset&#039;&#039;&#039;.&lt;br /&gt;
|-&lt;br /&gt;
| 0x28 || Int64 || &#039;&#039;&#039;[[#Memory Pool|Shader memory pool]] offset&#039;&#039;&#039;.&lt;br /&gt;
|-&lt;br /&gt;
| 0x30 || UInt64 || &#039;&#039;&#039;Low level compiler version&#039;&#039;&#039;.&lt;br /&gt;
|-&lt;br /&gt;
| 0x38 || Byte[40] || &#039;&#039;&#039;Reserved&#039;&#039;&#039;.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Shader Variation ===&lt;br /&gt;
A shader variation contains a variation of a shader program. The binary program is used for binary files on the [[Nintendo Switch]] and the source program is used when testing PTCL files on a computer (which means it contains text shader data). The intermediate language program has an unknown usage. Each entry has the following structure:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Offset !! Type !! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x00 || Int64 || &#039;&#039;&#039;[[#Shader Program|Source program]] offset&#039;&#039;&#039;.&lt;br /&gt;
|-&lt;br /&gt;
| 0x08 || Int64 || &#039;&#039;&#039;[[#Shader Program|Intermediate language program]] offset&#039;&#039;&#039;.&lt;br /&gt;
|-&lt;br /&gt;
| 0x10 || Int64 || &#039;&#039;&#039;[[#Shader Program|Binary program]] offset&#039;&#039;&#039;.&lt;br /&gt;
|-&lt;br /&gt;
| 0x18 || Int64 || &#039;&#039;&#039;Parent [[#Shader Container|shader container]] offset&#039;&#039;&#039;.&lt;br /&gt;
|-&lt;br /&gt;
| 0x20 || Byte[32] || &#039;&#039;&#039;Reserved&#039;&#039;&#039;.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== Shader Program ====&lt;br /&gt;
The shader program structure specifies a shader program, which will be run on the GPU. It has the following structure:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Offset !! Type !! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x00 || Byte || &#039;&#039;&#039;Flags&#039;&#039;&#039;. 0 = Separation, 1= ResShader.&lt;br /&gt;
|-&lt;br /&gt;
| 0x01 || Byte || &#039;&#039;&#039;Code type&#039;&#039;&#039;.&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! ID !! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x00 || Binary&lt;br /&gt;
|-&lt;br /&gt;
| 0x01 || Intermediate language&lt;br /&gt;
|-&lt;br /&gt;
| 0x02 || Source&lt;br /&gt;
|-&lt;br /&gt;
| 0x03 || Source array&lt;br /&gt;
|}&lt;br /&gt;
|-&lt;br /&gt;
| 0x02 || Byte || &#039;&#039;&#039;Source format&#039;&#039;&#039;. Only GLSL (0) is supported.&lt;br /&gt;
|-&lt;br /&gt;
| 0x03 || Byte || &#039;&#039;&#039;Reserved&#039;&#039;&#039;.&lt;br /&gt;
|-&lt;br /&gt;
| 0x04 || Int32 || &#039;&#039;&#039;Binary format&#039;&#039;&#039;.&lt;br /&gt;
|-&lt;br /&gt;
| 0x08 || Int64 || &#039;&#039;&#039;[[#Shader Code|Vertex shader code]] offset&#039;&#039;&#039;.&lt;br /&gt;
|-&lt;br /&gt;
| 0x10 || Int64 || &#039;&#039;&#039;[[#Shader Code|Hull shader code]] offset&#039;&#039;&#039;.&lt;br /&gt;
|-&lt;br /&gt;
| 0x18 || Int64 || &#039;&#039;&#039;[[#Shader Code|Domain shader code]] offset&#039;&#039;&#039;.&lt;br /&gt;
|-&lt;br /&gt;
| 0x20 || Int64 || &#039;&#039;&#039;[[#Shader Code|Geometry shader code]] offset&#039;&#039;&#039;.&lt;br /&gt;
|-&lt;br /&gt;
| 0x28 || Int64 || &#039;&#039;&#039;[[#Shader Code|Fragment shader code]] offset&#039;&#039;&#039;.&lt;br /&gt;
|-&lt;br /&gt;
| 0x30 || Int64 || &#039;&#039;&#039;[[#Shader Code|Compute shader code]] offset&#039;&#039;&#039;.&lt;br /&gt;
|-&lt;br /&gt;
| 0x38 || Byte[40] || &#039;&#039;&#039;Reserved&#039;&#039;&#039;.&lt;br /&gt;
|-&lt;br /&gt;
| 0x60 || UInt32 || &#039;&#039;&#039;Object size&#039;&#039;&#039;. The maximum shader size in bytes to store shader object.&lt;br /&gt;
|-&lt;br /&gt;
| 0x64 || Byte[4] || &#039;&#039;&#039;Reserved&#039;&#039;&#039;.&lt;br /&gt;
|-&lt;br /&gt;
| 0x68 || Int64 || &#039;&#039;&#039;Object offset&#039;&#039;&#039;.&lt;br /&gt;
|-&lt;br /&gt;
| 0x70 || Int64 || &#039;&#039;&#039;Parent [[#Shader Variation|shader variation]] offset&#039;&#039;&#039;.&lt;br /&gt;
|-&lt;br /&gt;
| 0x78 || Int64 || &#039;&#039;&#039;[[#Shader Reflection|Shader reflection]] offset&#039;&#039;&#039;.&lt;br /&gt;
|-&lt;br /&gt;
| 0x80 || Byte[32] || &#039;&#039;&#039;Reserved&#039;&#039;&#039;.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
===== Shader Code =====&lt;br /&gt;
Depending on the code type, a different structure can be stored. This one is stored for source:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Offset !! Type !! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x00 || Int64 || {{Unknown-left|&#039;&#039;&#039;Unknown&#039;&#039;&#039;.}}&lt;br /&gt;
|-&lt;br /&gt;
| 0x08 || Int64 || &#039;&#039;&#039;Data 1 offset&#039;&#039;&#039;.&lt;br /&gt;
|-&lt;br /&gt;
| 0x10 || Int64 || &#039;&#039;&#039;Data 2 offset&#039;&#039;&#039;.&lt;br /&gt;
|-&lt;br /&gt;
| 0x18 || UInt32 || &#039;&#039;&#039;Data 2 size&#039;&#039;&#039; in bytes.&lt;br /&gt;
|-&lt;br /&gt;
| 0x1C || UInt32 || &#039;&#039;&#039;Data 1 size&#039;&#039;&#039; in bytes.&lt;br /&gt;
|-&lt;br /&gt;
| 0x20 || Byte[32] || &#039;&#039;&#039;Padding&#039;&#039;&#039;.&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;!--This structure is exported by the SDK, has the same version as MK8D, but the MK8D one is different.&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Offset !! Type !! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x00 || UInt32 || &#039;&#039;&#039;Size of code&#039;&#039;&#039; in bytes.&lt;br /&gt;
|-&lt;br /&gt;
| 0x04 || UInt32 || &#039;&#039;&#039;Size of decompressed code&#039;&#039;&#039; in bytes. 0 if the data is not compressed.&lt;br /&gt;
|-&lt;br /&gt;
| 0x08 || Int64 || &#039;&#039;&#039;Code data offset&#039;&#039;&#039;.&lt;br /&gt;
|-&lt;br /&gt;
| 0x10 || Byte[16] || &#039;&#039;&#039;Reserved&#039;&#039;&#039;.&lt;br /&gt;
|}--&amp;gt;&lt;br /&gt;
This one is stored for source array:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Offset !! Type !! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x00 || UInt16 || &#039;&#039;&#039;Number of codes&#039;&#039;&#039;.&lt;br /&gt;
|-&lt;br /&gt;
| 0x02 || Byte[6] || &#039;&#039;&#039;Reserved&#039;&#039;&#039;.&lt;br /&gt;
|-&lt;br /&gt;
| 0x08 || Int64 || &#039;&#039;&#039;Code size array offset&#039;&#039;&#039;. Points to an array of UInt32s which stores the code size.&lt;br /&gt;
|-&lt;br /&gt;
| 0x10 || Int64 || &#039;&#039;&#039;Code data table offset&#039;&#039;&#039;. Points to an array of Int64s which points to the code datas&#039;&#039;&#039;.&lt;br /&gt;
|-&lt;br /&gt;
| 0x18 || Byte[8] || &#039;&#039;&#039;Reserved&#039;&#039;&#039;.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
===== Shader Reflection =====&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Offset !! Type !! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x00 || Int64 || &#039;&#039;&#039;[[#Shader Reflection Stage|Vertex reflection]] offset&#039;&#039;&#039;.&lt;br /&gt;
|-&lt;br /&gt;
| 0x08 || Int64 || &#039;&#039;&#039;[[#Shader Reflection Stage|Hull reflection]] offset&#039;&#039;&#039;.&lt;br /&gt;
|-&lt;br /&gt;
| 0x10 || Int64 || &#039;&#039;&#039;[[#Shader Reflection Stage|Domain reflection]] offset&#039;&#039;&#039;.&lt;br /&gt;
|-&lt;br /&gt;
| 0x18 || Int64 || &#039;&#039;&#039;[[#Shader Reflection Stage|Geometry reflection]] offset&#039;&#039;&#039;.&lt;br /&gt;
|-&lt;br /&gt;
| 0x20 || Int64 || &#039;&#039;&#039;[[#Shader Reflection Stage|Fragment reflection]] offset&#039;&#039;&#039;.&lt;br /&gt;
|-&lt;br /&gt;
| 0x28 || Int64 || &#039;&#039;&#039;[[#Shader Reflection Stage|Compute reflection]] offset&#039;&#039;&#039;.&lt;br /&gt;
|-&lt;br /&gt;
| 0x30 || Byte[16] || &#039;&#039;&#039;Reserved&#039;&#039;&#039;.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
====== Shader Reflection Stage ======&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Offset !! Type !! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x00 || Int64 || &#039;&#039;&#039;Shader input [[#Dictionary|dictionary]] offset&#039;&#039;&#039;.&lt;br /&gt;
|-&lt;br /&gt;
| 0x08 || Int64 || &#039;&#039;&#039;Shader output [[#Dictionary|dictionary]] offset&#039;&#039;&#039;.&lt;br /&gt;
|-&lt;br /&gt;
| 0x10 || Int64 || &#039;&#039;&#039;Sampler [[#Dictionary|dictionary]] offset&#039;&#039;&#039;.&lt;br /&gt;
|-&lt;br /&gt;
| 0x18 || Int64 || &#039;&#039;&#039;Constant buffer [[#Dictionary|dictionary]] offset&#039;&#039;&#039;.&lt;br /&gt;
|-&lt;br /&gt;
| 0x20 || Int64 || &#039;&#039;&#039;Unordered access buffer [[#Dictionary|dictionary]] offset&#039;&#039;&#039;.&lt;br /&gt;
|-&lt;br /&gt;
| 0x28 || Int32 || &#039;&#039;&#039;Shader output offset&#039;&#039;&#039; into the array.&lt;br /&gt;
|-&lt;br /&gt;
| 0x2C || Int32 || &#039;&#039;&#039;Sampler offset&#039;&#039;&#039; into the array.&lt;br /&gt;
|-&lt;br /&gt;
| 0x30 || Int32 || &#039;&#039;&#039;Constant buffer offset&#039;&#039;&#039; into the array.&lt;br /&gt;
|-&lt;br /&gt;
| 0x34 || Int32 || &#039;&#039;&#039;Unordered access buffer offset&#039;&#039;&#039; into the array.&lt;br /&gt;
|-&lt;br /&gt;
| 0x38 || Int64 || &#039;&#039;&#039;Shader slot array offset&#039;&#039;&#039;.&lt;br /&gt;
|-&lt;br /&gt;
| 0x40 || UInt32 || &#039;&#039;&#039;Compute work group size X&#039;&#039;&#039;. The size of the workgroup&#039;s X dimension for compute shaders.&lt;br /&gt;
|-&lt;br /&gt;
| 0x44 || UInt32 || &#039;&#039;&#039;Compute work group size Y&#039;&#039;&#039;. The size of the workgroup&#039;s Y dimension for compute shaders.&lt;br /&gt;
|-&lt;br /&gt;
| 0x48 || UInt32 || &#039;&#039;&#039;Compute work group size Z&#039;&#039;&#039;. The size of the workgroup&#039;s Z dimension for compute shaders.&lt;br /&gt;
|-&lt;br /&gt;
| 0x4C || Int32 || &#039;&#039;&#039;Image offset&#039;&#039;&#039; into the array.&lt;br /&gt;
|-&lt;br /&gt;
| 0x50 || Int64 || &#039;&#039;&#039;Image [[#Dictionary|dictionary]] offset&#039;&#039;&#039;.&lt;br /&gt;
|-&lt;br /&gt;
| 0x58 || Byte[8] || &#039;&#039;&#039;Reserved&#039;&#039;&#039;.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Memory Pool ===&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Offset !! Type !! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x00 || UInt32 || {{Unknown-left|&#039;&#039;&#039;Memory pool property&#039;&#039;&#039;. Always 0x61.}}&lt;br /&gt;
|-&lt;br /&gt;
| 0x04 || UInt32 || &#039;&#039;&#039;Size of the memory pool&#039;&#039;&#039; in bytes.&lt;br /&gt;
|-&lt;br /&gt;
| 0x08 || Int64 || &#039;&#039;&#039;Offset to the memory pool&#039;&#039;&#039;. Points directly to the start of the data.&lt;br /&gt;
|-&lt;br /&gt;
| 0x10 || Byte[16] || &#039;&#039;&#039;Reserved&#039;&#039;&#039;.&lt;br /&gt;
|-&lt;br /&gt;
| 0x20 || Int64 || &#039;&#039;&#039;Memory pool offset&#039;&#039;&#039;. Points to an array of 0x140 empty bytes, with unknown use.&lt;br /&gt;
|-&lt;br /&gt;
| 0x28 || Byte[8] || &#039;&#039;&#039;Reserved&#039;&#039;&#039;.&lt;br /&gt;
|-&lt;br /&gt;
| 0x30 || Int64 || &#039;&#039;&#039;Current memory pool offset&#039;&#039;&#039;, set at runtime.&lt;br /&gt;
|-&lt;br /&gt;
| 0x38 || Byte[24] || &#039;&#039;&#039;Reserved&#039;&#039;&#039;.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== String Table ==&lt;br /&gt;
{{NX String Table}}&lt;br /&gt;
== Dictionary ==&lt;br /&gt;
{{NX Dictionary}}&lt;br /&gt;
== Relocation Table ==&lt;br /&gt;
{{NX Relocation Table}}&lt;br /&gt;
&lt;br /&gt;
= Version List =&lt;br /&gt;
{|class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Version !! Found in&lt;br /&gt;
|-&lt;br /&gt;
| 2.1.2&lt;br /&gt;
|&lt;br /&gt;
* [[1-2-Switch]]&lt;br /&gt;
* [[ARMS]]&lt;br /&gt;
* Nintendo Switch System BIOS (1.0.0 &amp;amp;ndash; 2.3.0)&lt;br /&gt;
* [[Mario Kart 8 Deluxe]]&lt;br /&gt;
* [[Mario Kart 8 Deluxe]] (S00018080-R00018076-A00000000 Prototype)&lt;br /&gt;
* [[Nintendo Switch Sports]]&lt;br /&gt;
* [[Splatoon 2]]&lt;br /&gt;
* [[Splatoon 3]]&lt;br /&gt;
* [[Super Mario Maker 2]]&lt;br /&gt;
* [[The Legend of Zelda: Breath of the Wild]] (Nintendo Switch)&lt;br /&gt;
|-&lt;br /&gt;
| 2.1.4&lt;br /&gt;
|&lt;br /&gt;
* [[Pokémon Shield]]&lt;br /&gt;
* [[Pokémon Sword]]&lt;br /&gt;
|-&lt;br /&gt;
| 2.1.5&lt;br /&gt;
|&lt;br /&gt;
* [[Captain Toad: Treasure Tracker]] (Nintendo Switch)&lt;br /&gt;
* [[Game Builder Garage]]&lt;br /&gt;
* [[Mario Party Superstars]]&lt;br /&gt;
* [[Mario Tennis Aces]]&lt;br /&gt;
* [[New Super Mario Bros. U Deluxe]]&lt;br /&gt;
* [[Nintendo Labo - Toy-Con 01: Variety Kit]]&lt;br /&gt;
* [[Nintendo Labo - Toy-Con 02: Robot Kit]]&lt;br /&gt;
* [[Nintendo Labo - Toy-Con 03: Vehicle Kit]]&lt;br /&gt;
* [[Nintendo Labo - Toy-Con 04: VR Kit]]&lt;br /&gt;
* Nintendo Switch System BIOS (3.0.0 &amp;amp;ndash; 5.1.0)&lt;br /&gt;
* [[Pokémon: Let&#039;s Go, Eevee!]]&lt;br /&gt;
* [[Pokémon: Let&#039;s Go, Pikachu!]]&lt;br /&gt;
* [[Splatoon 2]]&lt;br /&gt;
* [[Super Mario Odyssey]]&lt;br /&gt;
* [[Super Mario Party]]&lt;br /&gt;
* [[Sushi Striker: The Way of Sushido]] (Nintendo Switch)&lt;br /&gt;
|-&lt;br /&gt;
| 2.1.10&lt;br /&gt;
|&lt;br /&gt;
* Nintendo Switch System BIOS (6.0.0 &amp;amp;ndash; 6.2.0)&lt;br /&gt;
* [[Tetris 99]]&lt;br /&gt;
|-&lt;br /&gt;
| 2.1.11&lt;br /&gt;
|&lt;br /&gt;
* [[Big Brain Academy: Brain vs. Brain]]&lt;br /&gt;
* [[Clubhouse Games: 51 Worldwide Classics]]&lt;br /&gt;
* [[Dr Kawashima&#039;s Brain Training for Nintendo Switch]]&lt;br /&gt;
* [[Everybody 1-2-Switch!]]&lt;br /&gt;
* [[Mario Golf: Super Rush]]&lt;br /&gt;
* [[Momotaro Dentetsu: Showa, Heisei, Reiwa mo Teiban!]]&lt;br /&gt;
* Nintendo Switch System BIOS (7.0.0 &amp;amp;ndash; 8.1.0)&lt;br /&gt;
* [[PAC-MAN 99]]&lt;br /&gt;
* [[Pikmin 3 Deluxe]]&lt;br /&gt;
* [[Pokémon Legends: Arceus]]&lt;br /&gt;
* [[Pokémon Shield]]&lt;br /&gt;
* [[Pokémon Sword]]&lt;br /&gt;
* [[Ring Fit Adventure]]&lt;br /&gt;
* [[Super Kirby Clash]]&lt;br /&gt;
* [[Super Mario 3D World + Bowser&#039;s Fury]]&lt;br /&gt;
* [[Super Mario 3D All-Stars]]&lt;br /&gt;
* [[Super Mario Maker 2]]&lt;br /&gt;
* [[The Legend Of Zelda: Link&#039;s Awakening]]&lt;br /&gt;
* [[Tokyo Mirage Sessions ♯FE Encore]]&lt;br /&gt;
* [[WarioWare: Get It Together!]]&lt;br /&gt;
|-&lt;br /&gt;
| 2.1.12&lt;br /&gt;
|&lt;br /&gt;
* [[Kirby&#039;s Dream Buffet]]&lt;br /&gt;
* [[Nintendo Switch Sports]]&lt;br /&gt;
* [[Pokémon Scarlet]]&lt;br /&gt;
* [[Pokémon Violet]]&lt;br /&gt;
* [[Splatoon 3]]&lt;br /&gt;
* [[WarioWare: Move It!]]&lt;br /&gt;
|-&lt;br /&gt;
| 2.2.1&lt;br /&gt;
|&lt;br /&gt;
* [[F-ZERO 99]]&lt;br /&gt;
* [[Nintendo World Championships: NES Edition]]&lt;br /&gt;
* [[Paper Mario: The Thousand-Year Door]] (Nintendo Switch)&lt;br /&gt;
* [[Super Mario Bros. Wonder]]&lt;br /&gt;
* [[The Legend of Zelda: Echoes of Wisdom]]&lt;br /&gt;
* [[The Legend of Zelda: Tears of the Kingdom]]&lt;br /&gt;
|-&lt;br /&gt;
| 2.3.1&lt;br /&gt;
|&lt;br /&gt;
* [[Nintendo Switch Online Playtest Program]]&lt;br /&gt;
* [[Super Mario Party Jamboree]]&lt;br /&gt;
|-&lt;br /&gt;
| 2.4.0&lt;br /&gt;
|&lt;br /&gt;
* [[Rhythm Heaven Groove]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
= Tools =&lt;br /&gt;
The following tools can handle BNSH files:&lt;br /&gt;
* (none)&lt;br /&gt;
&lt;br /&gt;
[[Category:Switch File Formats]]&lt;/div&gt;</summary>
		<author><name>Atlas</name></author>
	</entry>
	<entry>
		<id>https://wiki.wexosmk.xyz/index.php?title=HZC_(File_Format)&amp;diff=707</id>
		<title>HZC (File Format)</title>
		<link rel="alternate" type="text/html" href="https://wiki.wexosmk.xyz/index.php?title=HZC_(File_Format)&amp;diff=707"/>
		<updated>2026-07-28T18:36:56Z</updated>

		<summary type="html">&lt;p&gt;Atlas: /* Linked List Array */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&#039;&#039;&#039;HZC&#039;&#039;&#039; is a collision format used in some [[Nintendo DS]] and [[Nintendo 3DS]] games developed by &#039;&#039;[https://en.wikipedia.org/wiki/Firebrand_Games Firebrand Games]&#039;&#039; such as &#039;&#039;[https://en.wikipedia.org/wiki/Cartoon_Network_Racing Cartoon Network Racing DS]&#039;&#039; and &#039;&#039;[https://en.wikipedia.org/wiki/Race_Driver:_Create_%26_Race Race Driver: Create &amp;amp; Race]&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
= File Format =&lt;br /&gt;
The file byte order is always little endian.&lt;br /&gt;
&lt;br /&gt;
== Header ==&lt;br /&gt;
The file starts with the following header:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Offset !! Type !! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x00 || UInt16 || &#039;&#039;&#039;[[#Version List|Version number]]&#039;&#039;&#039;.&lt;br /&gt;
|-&lt;br /&gt;
| 0x02 || UInt16 || &#039;&#039;&#039;Number of vertices&#039;&#039;&#039; (&#039;&#039;&#039;V&#039;&#039;&#039;).&lt;br /&gt;
|-&lt;br /&gt;
| 0x04 || UInt16 || &#039;&#039;&#039;Number of triangles&#039;&#039;&#039; (&#039;&#039;&#039;T&#039;&#039;&#039;).&lt;br /&gt;
|-&lt;br /&gt;
| 0x06 || UInt16 || &#039;&#039;&#039;Number of custom attributes&#039;&#039;&#039; (&#039;&#039;&#039;A&#039;&#039;&#039;).&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Vertex Data ==&lt;br /&gt;
Followed by the header, there&#039;s plain vertex position data stored as a sequence of groups of 3 Int32s (one per axis). The values need to be divided by 4096.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Offset !! Type !! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x00 || Int32[3][&#039;&#039;&#039;V&#039;&#039;&#039;] || &#039;&#039;&#039;Vertex XYZ coordinates&#039;&#039;&#039;.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Triangle Index Data ==&lt;br /&gt;
After the vertex data, there&#039;s a list of &#039;&#039;&#039;T&#039;&#039;&#039; * 3 UInt16s that correspond to the indices of each triangle.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Offset !! Type !! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x00 || UInt16[3][&#039;&#039;&#039;T&#039;&#039;&#039;] || &#039;&#039;&#039;Triangle indices&#039;&#039;&#039;.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Triangle Normal Data ==&lt;br /&gt;
Directly after the triangle indices there are the triangle&#039;s face normals, consisting of 3 Int32s per triangle. They seem to match the cross product of the triangle&#039;s first two edges with a magnitude of 4096.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Offset !! Type !! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x00 || Int32[3][&#039;&#039;&#039;T&#039;&#039;&#039;] || &#039;&#039;&#039;Triangle XYZ normals&#039;&#039;&#039;.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Grid ==&lt;br /&gt;
Followed by the triangle normal data, there&#039;s a spatial grid consisting of 3D cells used for better collision detection. Each cell corresponds to an index to the [[#Linked List Array|Linked List Array]].&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Offset !! Type !! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x00 || Int32 || &#039;&#039;&#039;Number of cells&#039;&#039;&#039; (&#039;&#039;&#039;C&#039;&#039;&#039;).&lt;br /&gt;
|-&lt;br /&gt;
| 0x04 || UInt16[&#039;&#039;&#039;C&#039;&#039;&#039;] || &#039;&#039;&#039;Cell indices&#039;&#039;&#039;. 0xFFFF if empty.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Grid Info ===&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Offset !! Type !! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x00 || Int32[3] || &#039;&#039;&#039;Number of cells in the grid&#039;s XYZ dimensions&#039;&#039;&#039;.&lt;br /&gt;
|-&lt;br /&gt;
| 0x0C || Int32[3] || &#039;&#039;&#039;Grid bounding box minimum XYZ position&#039;&#039;&#039;.&lt;br /&gt;
|-&lt;br /&gt;
| 0x18 || Int32[3] || &#039;&#039;&#039;Grid bounding box maximum XYZ position&#039;&#039;&#039;.&lt;br /&gt;
|-&lt;br /&gt;
| 0x24 || Int32 || {{Unknown-left|&#039;&#039;&#039;Unknown&#039;&#039;&#039;. Always 0?}}&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Linked List Array ==&lt;br /&gt;
After the grid data there&#039;s an array of triangle/cell links.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Offset !! Type !! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x00 || Int32 || &#039;&#039;&#039;Number of links&#039;&#039;&#039; (&#039;&#039;&#039;L&#039;&#039;&#039;).&lt;br /&gt;
|-&lt;br /&gt;
| 0x04 || UInt16[2][&#039;&#039;&#039;L&#039;&#039;&#039;] || &#039;&#039;&#039;Triangle index&#039;&#039;&#039; and &#039;&#039;&#039;next index&#039;&#039;&#039;. The next index is 0xFFFF at the end of a cell&#039;s chain, otherwise another index into this same array.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Custom Attribute Table ==&lt;br /&gt;
This section is only present if &#039;&#039;&#039;A&#039;&#039;&#039; &amp;gt; 0. It contains a list of &#039;&#039;&#039;T&#039;&#039;&#039; UInt16s that link each triangle to a [[#Key-Value Property|Key-Value Property]] in a string table. Some tracks contain unused attributes.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Offset !! Type !! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x00 || UInt16[&#039;&#039;&#039;T&#039;&#039;&#039;] || &#039;&#039;&#039;Attribute IDs&#039;&#039;&#039;. 0xFFFF if none.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== String Table ===&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Offset !! Type !! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x00 || [[#Key-Value Property|Key-Value Property]][&#039;&#039;&#039;A&#039;&#039;&#039;] || &#039;&#039;&#039;Key-value property strings&#039;&#039;&#039;.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== Key-Value Property ====&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Offset !! Type !! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x00 || UInt16 || &#039;&#039;&#039;Key string length&#039;&#039;&#039; (&#039;&#039;&#039;PK&#039;&#039;&#039;).&lt;br /&gt;
|-&lt;br /&gt;
| 0x02 || String (Char[&#039;&#039;&#039;PK&#039;&#039;&#039;]) || &#039;&#039;&#039;Attribute key&#039;&#039;&#039;.&lt;br /&gt;
|-&lt;br /&gt;
| 0x02 + &#039;&#039;&#039;K&#039;&#039;&#039; || UInt16 || &#039;&#039;&#039;Value string length&#039;&#039;&#039; (&#039;&#039;&#039;PV&#039;&#039;&#039;).&lt;br /&gt;
|-&lt;br /&gt;
| 0x04 + &#039;&#039;&#039;K&#039;&#039;&#039; || String (Char[&#039;&#039;&#039;PV&#039;&#039;&#039;]) || &#039;&#039;&#039;Attribute value&#039;&#039;&#039;. Always &#039;&#039;float(SurfaceType)=&#039;&#039;&#039;X&#039;&#039;&#039;.000000&#039;&#039; in Cartoon Network Racing DS.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+ Seen attributes (Cartoon Network Racing DS)&lt;br /&gt;
! Key !! Value !! Found in&lt;br /&gt;
|-&lt;br /&gt;
| COL_grass&lt;br /&gt;
| float(SurfaceType)=1.000000&lt;br /&gt;
|&lt;br /&gt;
* CrossTown.hzc&lt;br /&gt;
* evilGlade.hzc&lt;br /&gt;
* IslandDash.hzc&lt;br /&gt;
|-&lt;br /&gt;
| grass&lt;br /&gt;
| float(SurfaceType)=1.000000&lt;br /&gt;
| Townsville.hzc&lt;br /&gt;
|-&lt;br /&gt;
| Grass&lt;br /&gt;
| float(SurfaceType)=1.000000&lt;br /&gt;
|&lt;br /&gt;
* AronSpeed.hzc&lt;br /&gt;
* MandarkLab.hzc&lt;br /&gt;
* MidNowhere.hzc&lt;br /&gt;
|-&lt;br /&gt;
| heavyTerrain&lt;br /&gt;
| float(SurfaceType)=2.000000&lt;br /&gt;
|&lt;br /&gt;
* CrossTown.hzc&lt;br /&gt;
* MandarkLab.hzc&lt;br /&gt;
* SnowSunday.hzc&lt;br /&gt;
|-&lt;br /&gt;
| HeavyTerrain&lt;br /&gt;
| float(SurfaceType)=3.000000&lt;br /&gt;
|&lt;br /&gt;
* IslandDash.hzc &lt;br /&gt;
* MandarkLab.hzc&lt;br /&gt;
|-&lt;br /&gt;
| MudPuddle&lt;br /&gt;
| float(SurfaceType)=5.000000&lt;br /&gt;
| IslandDash.hzc&lt;br /&gt;
|-&lt;br /&gt;
| not_track&lt;br /&gt;
|&lt;br /&gt;
* float(SurfaceType)=1.000000&lt;br /&gt;
* float(SurfaceType)=4.000000&lt;br /&gt;
|&lt;br /&gt;
* MandarkLab.hzc&lt;br /&gt;
* MidNowhere.hzc&lt;br /&gt;
* Townsville.hzc&lt;br /&gt;
|-&lt;br /&gt;
| raceTrackFloor&lt;br /&gt;
| {{Unknown-left|&amp;amp;mdash;}}&lt;br /&gt;
| DextersLab.hzc&lt;br /&gt;
|-&lt;br /&gt;
| raceTrackWalls&lt;br /&gt;
| {{Unknown-left|&amp;amp;mdash;}}&lt;br /&gt;
| DextersLab.hzc&lt;br /&gt;
|-&lt;br /&gt;
| RoughGround&lt;br /&gt;
|&lt;br /&gt;
* float(SurfaceType)=0.000000&lt;br /&gt;
* float(SurfaceType)=4.000000&lt;br /&gt;
|&lt;br /&gt;
* AronSpeed.hzc&lt;br /&gt;
* MandarkLab.hzc&lt;br /&gt;
* MidNowhere.hzc&lt;br /&gt;
|-&lt;br /&gt;
| terrainLight&lt;br /&gt;
| float(SurfaceType)=0.000000&lt;br /&gt;
|&lt;br /&gt;
* MandarkLab.hzc&lt;br /&gt;
* MountRush.hzc&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
= Version List =&lt;br /&gt;
= Version List =&lt;br /&gt;
{|class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Version !! Found in&lt;br /&gt;
|-&lt;br /&gt;
| 1.3&lt;br /&gt;
|&lt;br /&gt;
* [https://en.wikipedia.org/wiki/Cartoon_Network_Racing Cartoon Network Racing DS]&lt;br /&gt;
* [https://en.wikipedia.org/wiki/Ferrari_Challenge:_Trofeo_Pirelli Ferrari Challenge: Trofeo Pirelli DS]&lt;br /&gt;
|-&lt;br /&gt;
| 1.4&lt;br /&gt;
| [https://en.wikipedia.org/wiki/Race_Driver:_Create_%26_Race Race Driver: Create &amp;amp; Race]&lt;br /&gt;
|-&lt;br /&gt;
| 1.5&lt;br /&gt;
|&lt;br /&gt;
* [https://en.wikipedia.org/wiki/Cars_2:_The_Video_Game Cars 2: The Video Game DS]&lt;br /&gt;
* [https://en.wikipedia.org/wiki/Colin_McRae:_Dirt_2 Colin McRae: Dirt 2 DS]&lt;br /&gt;
* [https://en.wikipedia.org/wiki/Hot_Wheels:_Track_Attack Hot Wheels: Track Attack DS]&lt;br /&gt;
* [https://en.wikipedia.org/wiki/Need_for_Speed:_Nitro Need for Speed: Nitro DS]&lt;br /&gt;
* [[Need for Speed: Nitro-X]]&lt;br /&gt;
* [https://en.wikipedia.org/wiki/Need_for_Speed:_Undercover Need for Speed: Undercover DS]&lt;br /&gt;
* [https://en.wikipedia.org/wiki/Race_Driver:_Grid Race Driver: Grid DS]&lt;br /&gt;
* [https://en.wikipedia.org/wiki/SpongeBob&#039;s_Boating_Bash SpongeBob&#039;s Boating Bash]&lt;br /&gt;
|-&lt;br /&gt;
| 1.12&lt;br /&gt;
|&lt;br /&gt;
* [[Planet 51: The Game DS]]&lt;br /&gt;
* [https://en.wikipedia.org/wiki/TrackMania_DS TrackMania DS]&lt;br /&gt;
|-&lt;br /&gt;
| 1.14&lt;br /&gt;
| [https://en.wikipedia.org/wiki/TrackMania_Turbo_(2010_video_game) TrackMania Turbo (2010)]&lt;br /&gt;
|-&lt;br /&gt;
| 1.18&lt;br /&gt;
|&lt;br /&gt;
* [https://en.wikipedia.org/wiki/Cars_2:_The_Video_Game Cars 2: The Video Game 3DS]&lt;br /&gt;
* [https://en.wikipedia.org/wiki/NASCAR_Unleashed NASCAR Unleashed]&lt;br /&gt;
|-&lt;br /&gt;
| 1.19&lt;br /&gt;
| [https://en.wikipedia.org/wiki/Need_for_Speed:_The_Run Need for Speed: The Run 3DS]&lt;br /&gt;
|-&lt;br /&gt;
| 1.22&lt;br /&gt;
| [https://en.wikipedia.org/wiki/Fast_&amp;amp;_Furious:_Showdown Fast &amp;amp; Furious: Showdown 3DS]&lt;br /&gt;
|-&lt;br /&gt;
| 1.23&lt;br /&gt;
|&lt;br /&gt;
* [https://en.wikipedia.org/wiki/Hot_Wheels:_World&#039;s_Best_Driver Hot Wheels: World&#039;s Best Driver 3DS]&lt;br /&gt;
* [https://en.wikipedia.org/wiki/WRC_FIA_World_Rally_Championship WRC FIA World Rally Championship 3DS]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
= Tools =&lt;br /&gt;
The following tools can handle HZC files:&lt;br /&gt;
* (none)&lt;br /&gt;
&lt;br /&gt;
[[Category:Cartoon Network Racing DS File Formats]]&lt;/div&gt;</summary>
		<author><name>Atlas</name></author>
	</entry>
	<entry>
		<id>https://wiki.wexosmk.xyz/index.php?title=HZC_(File_Format)&amp;diff=706</id>
		<title>HZC (File Format)</title>
		<link rel="alternate" type="text/html" href="https://wiki.wexosmk.xyz/index.php?title=HZC_(File_Format)&amp;diff=706"/>
		<updated>2026-07-27T11:00:24Z</updated>

		<summary type="html">&lt;p&gt;Atlas: /* Vertex Data */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&#039;&#039;&#039;HZC&#039;&#039;&#039; is a collision format used in some [[Nintendo DS]] and [[Nintendo 3DS]] games developed by &#039;&#039;[https://en.wikipedia.org/wiki/Firebrand_Games Firebrand Games]&#039;&#039; such as &#039;&#039;[https://en.wikipedia.org/wiki/Cartoon_Network_Racing Cartoon Network Racing DS]&#039;&#039; and &#039;&#039;[https://en.wikipedia.org/wiki/Race_Driver:_Create_%26_Race Race Driver: Create &amp;amp; Race]&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
= File Format =&lt;br /&gt;
The file byte order is always little endian.&lt;br /&gt;
&lt;br /&gt;
== Header ==&lt;br /&gt;
The file starts with the following header:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Offset !! Type !! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x00 || UInt16 || &#039;&#039;&#039;[[#Version List|Version number]]&#039;&#039;&#039;.&lt;br /&gt;
|-&lt;br /&gt;
| 0x02 || UInt16 || &#039;&#039;&#039;Number of vertices&#039;&#039;&#039; (&#039;&#039;&#039;V&#039;&#039;&#039;).&lt;br /&gt;
|-&lt;br /&gt;
| 0x04 || UInt16 || &#039;&#039;&#039;Number of triangles&#039;&#039;&#039; (&#039;&#039;&#039;T&#039;&#039;&#039;).&lt;br /&gt;
|-&lt;br /&gt;
| 0x06 || UInt16 || &#039;&#039;&#039;Number of custom attributes&#039;&#039;&#039; (&#039;&#039;&#039;A&#039;&#039;&#039;).&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Vertex Data ==&lt;br /&gt;
Followed by the header, there&#039;s plain vertex position data stored as a sequence of groups of 3 Int32s (one per axis). The values need to be divided by 4096.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Offset !! Type !! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x00 || Int32[3][&#039;&#039;&#039;V&#039;&#039;&#039;] || &#039;&#039;&#039;Vertex XYZ coordinates&#039;&#039;&#039;.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Triangle Index Data ==&lt;br /&gt;
After the vertex data, there&#039;s a list of &#039;&#039;&#039;T&#039;&#039;&#039; * 3 UInt16s that correspond to the indices of each triangle.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Offset !! Type !! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x00 || UInt16[3][&#039;&#039;&#039;T&#039;&#039;&#039;] || &#039;&#039;&#039;Triangle indices&#039;&#039;&#039;.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Triangle Normal Data ==&lt;br /&gt;
Directly after the triangle indices there are the triangle&#039;s face normals, consisting of 3 Int32s per triangle. They seem to match the cross product of the triangle&#039;s first two edges with a magnitude of 4096.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Offset !! Type !! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x00 || Int32[3][&#039;&#039;&#039;T&#039;&#039;&#039;] || &#039;&#039;&#039;Triangle XYZ normals&#039;&#039;&#039;.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Grid ==&lt;br /&gt;
Followed by the triangle normal data, there&#039;s a spatial grid consisting of 3D cells used for better collision detection. Each cell corresponds to an index to the [[#Linked List Array|Linked List Array]].&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Offset !! Type !! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x00 || Int32 || &#039;&#039;&#039;Number of cells&#039;&#039;&#039; (&#039;&#039;&#039;C&#039;&#039;&#039;).&lt;br /&gt;
|-&lt;br /&gt;
| 0x04 || UInt16[&#039;&#039;&#039;C&#039;&#039;&#039;] || &#039;&#039;&#039;Cell indices&#039;&#039;&#039;. 0xFFFF if empty.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Grid Info ===&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Offset !! Type !! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x00 || Int32[3] || &#039;&#039;&#039;Number of cells in the grid&#039;s XYZ dimensions&#039;&#039;&#039;.&lt;br /&gt;
|-&lt;br /&gt;
| 0x0C || Int32[3] || &#039;&#039;&#039;Grid bounding box minimum XYZ position&#039;&#039;&#039;.&lt;br /&gt;
|-&lt;br /&gt;
| 0x18 || Int32[3] || &#039;&#039;&#039;Grid bounding box maximum XYZ position&#039;&#039;&#039;.&lt;br /&gt;
|-&lt;br /&gt;
| 0x24 || Int32 || {{Unknown-left|&#039;&#039;&#039;Unknown&#039;&#039;&#039;. Always 0?}}&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Linked List Array ==&lt;br /&gt;
After the grid data there&#039;s an array of triangle/cell links.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Offset !! Type !! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x00 || Int32 || &#039;&#039;&#039;Number of links&#039;&#039;&#039; (&#039;&#039;&#039;L&#039;&#039;&#039;).&lt;br /&gt;
|-&lt;br /&gt;
| 0x04 || UInt16[2][&#039;&#039;&#039;L&#039;&#039;&#039;] || &#039;&#039;&#039;Triangle index&#039;&#039;&#039; and &#039;&#039;&#039;next index&#039;&#039;&#039;. The next index is 0xFFFF at the end of a cell&#039;s chain, otherwise another index into this same array (?)&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Custom Attribute Table ==&lt;br /&gt;
This section is only present if &#039;&#039;&#039;A&#039;&#039;&#039; &amp;gt; 0. It contains a list of &#039;&#039;&#039;T&#039;&#039;&#039; UInt16s that link each triangle to a [[#Key-Value Property|Key-Value Property]] in a string table. Some tracks contain unused attributes.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Offset !! Type !! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x00 || UInt16[&#039;&#039;&#039;T&#039;&#039;&#039;] || &#039;&#039;&#039;Attribute IDs&#039;&#039;&#039;. 0xFFFF if none.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== String Table ===&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Offset !! Type !! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x00 || [[#Key-Value Property|Key-Value Property]][&#039;&#039;&#039;A&#039;&#039;&#039;] || &#039;&#039;&#039;Key-value property strings&#039;&#039;&#039;.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== Key-Value Property ====&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Offset !! Type !! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x00 || UInt16 || &#039;&#039;&#039;Key string length&#039;&#039;&#039; (&#039;&#039;&#039;PK&#039;&#039;&#039;).&lt;br /&gt;
|-&lt;br /&gt;
| 0x02 || String (Char[&#039;&#039;&#039;PK&#039;&#039;&#039;]) || &#039;&#039;&#039;Attribute key&#039;&#039;&#039;.&lt;br /&gt;
|-&lt;br /&gt;
| 0x02 + &#039;&#039;&#039;K&#039;&#039;&#039; || UInt16 || &#039;&#039;&#039;Value string length&#039;&#039;&#039; (&#039;&#039;&#039;PV&#039;&#039;&#039;).&lt;br /&gt;
|-&lt;br /&gt;
| 0x04 + &#039;&#039;&#039;K&#039;&#039;&#039; || String (Char[&#039;&#039;&#039;PV&#039;&#039;&#039;]) || &#039;&#039;&#039;Attribute value&#039;&#039;&#039;. Always &#039;&#039;float(SurfaceType)=&#039;&#039;&#039;X&#039;&#039;&#039;.000000&#039;&#039; in Cartoon Network Racing DS.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+ Seen attributes (Cartoon Network Racing DS)&lt;br /&gt;
! Key !! Value !! Found in&lt;br /&gt;
|-&lt;br /&gt;
| COL_grass&lt;br /&gt;
| float(SurfaceType)=1.000000&lt;br /&gt;
|&lt;br /&gt;
* CrossTown.hzc&lt;br /&gt;
* evilGlade.hzc&lt;br /&gt;
* IslandDash.hzc&lt;br /&gt;
|-&lt;br /&gt;
| grass&lt;br /&gt;
| float(SurfaceType)=1.000000&lt;br /&gt;
| Townsville.hzc&lt;br /&gt;
|-&lt;br /&gt;
| Grass&lt;br /&gt;
| float(SurfaceType)=1.000000&lt;br /&gt;
|&lt;br /&gt;
* AronSpeed.hzc&lt;br /&gt;
* MandarkLab.hzc&lt;br /&gt;
* MidNowhere.hzc&lt;br /&gt;
|-&lt;br /&gt;
| heavyTerrain&lt;br /&gt;
| float(SurfaceType)=2.000000&lt;br /&gt;
|&lt;br /&gt;
* CrossTown.hzc&lt;br /&gt;
* MandarkLab.hzc&lt;br /&gt;
* SnowSunday.hzc&lt;br /&gt;
|-&lt;br /&gt;
| HeavyTerrain&lt;br /&gt;
| float(SurfaceType)=3.000000&lt;br /&gt;
|&lt;br /&gt;
* IslandDash.hzc &lt;br /&gt;
* MandarkLab.hzc&lt;br /&gt;
|-&lt;br /&gt;
| MudPuddle&lt;br /&gt;
| float(SurfaceType)=5.000000&lt;br /&gt;
| IslandDash.hzc&lt;br /&gt;
|-&lt;br /&gt;
| not_track&lt;br /&gt;
|&lt;br /&gt;
* float(SurfaceType)=1.000000&lt;br /&gt;
* float(SurfaceType)=4.000000&lt;br /&gt;
|&lt;br /&gt;
* MandarkLab.hzc&lt;br /&gt;
* MidNowhere.hzc&lt;br /&gt;
* Townsville.hzc&lt;br /&gt;
|-&lt;br /&gt;
| raceTrackFloor&lt;br /&gt;
| {{Unknown-left|&amp;amp;mdash;}}&lt;br /&gt;
| DextersLab.hzc&lt;br /&gt;
|-&lt;br /&gt;
| raceTrackWalls&lt;br /&gt;
| {{Unknown-left|&amp;amp;mdash;}}&lt;br /&gt;
| DextersLab.hzc&lt;br /&gt;
|-&lt;br /&gt;
| RoughGround&lt;br /&gt;
|&lt;br /&gt;
* float(SurfaceType)=0.000000&lt;br /&gt;
* float(SurfaceType)=4.000000&lt;br /&gt;
|&lt;br /&gt;
* AronSpeed.hzc&lt;br /&gt;
* MandarkLab.hzc&lt;br /&gt;
* MidNowhere.hzc&lt;br /&gt;
|-&lt;br /&gt;
| terrainLight&lt;br /&gt;
| float(SurfaceType)=0.000000&lt;br /&gt;
|&lt;br /&gt;
* MandarkLab.hzc&lt;br /&gt;
* MountRush.hzc&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
= Version List =&lt;br /&gt;
= Version List =&lt;br /&gt;
{|class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Version !! Found in&lt;br /&gt;
|-&lt;br /&gt;
| 1.3&lt;br /&gt;
|&lt;br /&gt;
* [https://en.wikipedia.org/wiki/Cartoon_Network_Racing Cartoon Network Racing DS]&lt;br /&gt;
* [https://en.wikipedia.org/wiki/Ferrari_Challenge:_Trofeo_Pirelli Ferrari Challenge: Trofeo Pirelli DS]&lt;br /&gt;
|-&lt;br /&gt;
| 1.4&lt;br /&gt;
| [https://en.wikipedia.org/wiki/Race_Driver:_Create_%26_Race Race Driver: Create &amp;amp; Race]&lt;br /&gt;
|-&lt;br /&gt;
| 1.5&lt;br /&gt;
|&lt;br /&gt;
* [https://en.wikipedia.org/wiki/Cars_2:_The_Video_Game Cars 2: The Video Game DS]&lt;br /&gt;
* [https://en.wikipedia.org/wiki/Colin_McRae:_Dirt_2 Colin McRae: Dirt 2 DS]&lt;br /&gt;
* [https://en.wikipedia.org/wiki/Hot_Wheels:_Track_Attack Hot Wheels: Track Attack DS]&lt;br /&gt;
* [https://en.wikipedia.org/wiki/Need_for_Speed:_Nitro Need for Speed: Nitro DS]&lt;br /&gt;
* [[Need for Speed: Nitro-X]]&lt;br /&gt;
* [https://en.wikipedia.org/wiki/Need_for_Speed:_Undercover Need for Speed: Undercover DS]&lt;br /&gt;
* [https://en.wikipedia.org/wiki/Race_Driver:_Grid Race Driver: Grid DS]&lt;br /&gt;
* [https://en.wikipedia.org/wiki/SpongeBob&#039;s_Boating_Bash SpongeBob&#039;s Boating Bash]&lt;br /&gt;
|-&lt;br /&gt;
| 1.12&lt;br /&gt;
|&lt;br /&gt;
* [[Planet 51: The Game DS]]&lt;br /&gt;
* [https://en.wikipedia.org/wiki/TrackMania_DS TrackMania DS]&lt;br /&gt;
|-&lt;br /&gt;
| 1.14&lt;br /&gt;
| [https://en.wikipedia.org/wiki/TrackMania_Turbo_(2010_video_game) TrackMania Turbo (2010)]&lt;br /&gt;
|-&lt;br /&gt;
| 1.18&lt;br /&gt;
|&lt;br /&gt;
* [https://en.wikipedia.org/wiki/Cars_2:_The_Video_Game Cars 2: The Video Game 3DS]&lt;br /&gt;
* [https://en.wikipedia.org/wiki/NASCAR_Unleashed NASCAR Unleashed]&lt;br /&gt;
|-&lt;br /&gt;
| 1.19&lt;br /&gt;
| [https://en.wikipedia.org/wiki/Need_for_Speed:_The_Run Need for Speed: The Run 3DS]&lt;br /&gt;
|-&lt;br /&gt;
| 1.22&lt;br /&gt;
| [https://en.wikipedia.org/wiki/Fast_&amp;amp;_Furious:_Showdown Fast &amp;amp; Furious: Showdown 3DS]&lt;br /&gt;
|-&lt;br /&gt;
| 1.23&lt;br /&gt;
|&lt;br /&gt;
* [https://en.wikipedia.org/wiki/Hot_Wheels:_World&#039;s_Best_Driver Hot Wheels: World&#039;s Best Driver 3DS]&lt;br /&gt;
* [https://en.wikipedia.org/wiki/WRC_FIA_World_Rally_Championship WRC FIA World Rally Championship 3DS]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
= Tools =&lt;br /&gt;
The following tools can handle HZC files:&lt;br /&gt;
* (none)&lt;br /&gt;
&lt;br /&gt;
[[Category:Cartoon Network Racing DS File Formats]]&lt;/div&gt;</summary>
		<author><name>Atlas</name></author>
	</entry>
	<entry>
		<id>https://wiki.wexosmk.xyz/index.php?title=HZC_(File_Format)&amp;diff=705</id>
		<title>HZC (File Format)</title>
		<link rel="alternate" type="text/html" href="https://wiki.wexosmk.xyz/index.php?title=HZC_(File_Format)&amp;diff=705"/>
		<updated>2026-07-26T23:55:37Z</updated>

		<summary type="html">&lt;p&gt;Atlas: /* Key-Value Property */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&#039;&#039;&#039;HZC&#039;&#039;&#039; is a collision format used in some [[Nintendo DS]] and [[Nintendo 3DS]] games developed by &#039;&#039;[https://en.wikipedia.org/wiki/Firebrand_Games Firebrand Games]&#039;&#039; such as &#039;&#039;[https://en.wikipedia.org/wiki/Cartoon_Network_Racing Cartoon Network Racing DS]&#039;&#039; and &#039;&#039;[https://en.wikipedia.org/wiki/Race_Driver:_Create_%26_Race Race Driver: Create &amp;amp; Race]&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
= File Format =&lt;br /&gt;
The file byte order is always little endian.&lt;br /&gt;
&lt;br /&gt;
== Header ==&lt;br /&gt;
The file starts with the following header:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Offset !! Type !! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x00 || UInt16 || &#039;&#039;&#039;[[#Version List|Version number]]&#039;&#039;&#039;.&lt;br /&gt;
|-&lt;br /&gt;
| 0x02 || UInt16 || &#039;&#039;&#039;Number of vertices&#039;&#039;&#039; (&#039;&#039;&#039;V&#039;&#039;&#039;).&lt;br /&gt;
|-&lt;br /&gt;
| 0x04 || UInt16 || &#039;&#039;&#039;Number of triangles&#039;&#039;&#039; (&#039;&#039;&#039;T&#039;&#039;&#039;).&lt;br /&gt;
|-&lt;br /&gt;
| 0x06 || UInt16 || &#039;&#039;&#039;Number of custom attributes&#039;&#039;&#039; (&#039;&#039;&#039;A&#039;&#039;&#039;).&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Vertex Data ==&lt;br /&gt;
Followed by the header, there&#039;s plain vertex position data stored as a sequence of groups of 3 Int32s (one per axis). The values are divided by 1024.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Offset !! Type !! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x00 || Int32[3][&#039;&#039;&#039;V&#039;&#039;&#039;] || &#039;&#039;&#039;Vertex XYZ coordinates&#039;&#039;&#039;.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Triangle Index Data ==&lt;br /&gt;
After the vertex data, there&#039;s a list of &#039;&#039;&#039;T&#039;&#039;&#039; * 3 UInt16s that correspond to the indices of each triangle.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Offset !! Type !! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x00 || UInt16[3][&#039;&#039;&#039;T&#039;&#039;&#039;] || &#039;&#039;&#039;Triangle indices&#039;&#039;&#039;.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Triangle Normal Data ==&lt;br /&gt;
Directly after the triangle indices there are the triangle&#039;s face normals, consisting of 3 Int32s per triangle. They seem to match the cross product of the triangle&#039;s first two edges with a magnitude of 4096.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Offset !! Type !! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x00 || Int32[3][&#039;&#039;&#039;T&#039;&#039;&#039;] || &#039;&#039;&#039;Triangle XYZ normals&#039;&#039;&#039;.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Grid ==&lt;br /&gt;
Followed by the triangle normal data, there&#039;s a spatial grid consisting of 3D cells used for better collision detection. Each cell corresponds to an index to the [[#Linked List Array|Linked List Array]].&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Offset !! Type !! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x00 || Int32 || &#039;&#039;&#039;Number of cells&#039;&#039;&#039; (&#039;&#039;&#039;C&#039;&#039;&#039;).&lt;br /&gt;
|-&lt;br /&gt;
| 0x04 || UInt16[&#039;&#039;&#039;C&#039;&#039;&#039;] || &#039;&#039;&#039;Cell indices&#039;&#039;&#039;. 0xFFFF if empty.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Grid Info ===&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Offset !! Type !! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x00 || Int32[3] || &#039;&#039;&#039;Number of cells in the grid&#039;s XYZ dimensions&#039;&#039;&#039;.&lt;br /&gt;
|-&lt;br /&gt;
| 0x0C || Int32[3] || &#039;&#039;&#039;Grid bounding box minimum XYZ position&#039;&#039;&#039;.&lt;br /&gt;
|-&lt;br /&gt;
| 0x18 || Int32[3] || &#039;&#039;&#039;Grid bounding box maximum XYZ position&#039;&#039;&#039;.&lt;br /&gt;
|-&lt;br /&gt;
| 0x24 || Int32 || {{Unknown-left|&#039;&#039;&#039;Unknown&#039;&#039;&#039;. Always 0?}}&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Linked List Array ==&lt;br /&gt;
After the grid data there&#039;s an array of triangle/cell links.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Offset !! Type !! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x00 || Int32 || &#039;&#039;&#039;Number of links&#039;&#039;&#039; (&#039;&#039;&#039;L&#039;&#039;&#039;).&lt;br /&gt;
|-&lt;br /&gt;
| 0x04 || UInt16[2][&#039;&#039;&#039;L&#039;&#039;&#039;] || &#039;&#039;&#039;Triangle index&#039;&#039;&#039; and &#039;&#039;&#039;next index&#039;&#039;&#039;. The next index is 0xFFFF at the end of a cell&#039;s chain, otherwise another index into this same array (?)&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Custom Attribute Table ==&lt;br /&gt;
This section is only present if &#039;&#039;&#039;A&#039;&#039;&#039; &amp;gt; 0. It contains a list of &#039;&#039;&#039;T&#039;&#039;&#039; UInt16s that link each triangle to a [[#Key-Value Property|Key-Value Property]] in a string table. Some tracks contain unused attributes.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Offset !! Type !! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x00 || UInt16[&#039;&#039;&#039;T&#039;&#039;&#039;] || &#039;&#039;&#039;Attribute IDs&#039;&#039;&#039;. 0xFFFF if none.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== String Table ===&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Offset !! Type !! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x00 || [[#Key-Value Property|Key-Value Property]][&#039;&#039;&#039;A&#039;&#039;&#039;] || &#039;&#039;&#039;Key-value property strings&#039;&#039;&#039;.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== Key-Value Property ====&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Offset !! Type !! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x00 || UInt16 || &#039;&#039;&#039;Key string length&#039;&#039;&#039; (&#039;&#039;&#039;PK&#039;&#039;&#039;).&lt;br /&gt;
|-&lt;br /&gt;
| 0x02 || String (Char[&#039;&#039;&#039;PK&#039;&#039;&#039;]) || &#039;&#039;&#039;Attribute key&#039;&#039;&#039;.&lt;br /&gt;
|-&lt;br /&gt;
| 0x02 + &#039;&#039;&#039;K&#039;&#039;&#039; || UInt16 || &#039;&#039;&#039;Value string length&#039;&#039;&#039; (&#039;&#039;&#039;PV&#039;&#039;&#039;).&lt;br /&gt;
|-&lt;br /&gt;
| 0x04 + &#039;&#039;&#039;K&#039;&#039;&#039; || String (Char[&#039;&#039;&#039;PV&#039;&#039;&#039;]) || &#039;&#039;&#039;Attribute value&#039;&#039;&#039;. Always &#039;&#039;float(SurfaceType)=&#039;&#039;&#039;X&#039;&#039;&#039;.000000&#039;&#039; in Cartoon Network Racing DS.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+ Seen attributes (Cartoon Network Racing DS)&lt;br /&gt;
! Key !! Value !! Found in&lt;br /&gt;
|-&lt;br /&gt;
| COL_grass&lt;br /&gt;
| float(SurfaceType)=1.000000&lt;br /&gt;
|&lt;br /&gt;
* CrossTown.hzc&lt;br /&gt;
* evilGlade.hzc&lt;br /&gt;
* IslandDash.hzc&lt;br /&gt;
|-&lt;br /&gt;
| grass&lt;br /&gt;
| float(SurfaceType)=1.000000&lt;br /&gt;
| Townsville.hzc&lt;br /&gt;
|-&lt;br /&gt;
| Grass&lt;br /&gt;
| float(SurfaceType)=1.000000&lt;br /&gt;
|&lt;br /&gt;
* AronSpeed.hzc&lt;br /&gt;
* MandarkLab.hzc&lt;br /&gt;
* MidNowhere.hzc&lt;br /&gt;
|-&lt;br /&gt;
| heavyTerrain&lt;br /&gt;
| float(SurfaceType)=2.000000&lt;br /&gt;
|&lt;br /&gt;
* CrossTown.hzc&lt;br /&gt;
* MandarkLab.hzc&lt;br /&gt;
* SnowSunday.hzc&lt;br /&gt;
|-&lt;br /&gt;
| HeavyTerrain&lt;br /&gt;
| float(SurfaceType)=3.000000&lt;br /&gt;
|&lt;br /&gt;
* IslandDash.hzc &lt;br /&gt;
* MandarkLab.hzc&lt;br /&gt;
|-&lt;br /&gt;
| MudPuddle&lt;br /&gt;
| float(SurfaceType)=5.000000&lt;br /&gt;
| IslandDash.hzc&lt;br /&gt;
|-&lt;br /&gt;
| not_track&lt;br /&gt;
|&lt;br /&gt;
* float(SurfaceType)=1.000000&lt;br /&gt;
* float(SurfaceType)=4.000000&lt;br /&gt;
|&lt;br /&gt;
* MandarkLab.hzc&lt;br /&gt;
* MidNowhere.hzc&lt;br /&gt;
* Townsville.hzc&lt;br /&gt;
|-&lt;br /&gt;
| raceTrackFloor&lt;br /&gt;
| {{Unknown-left|&amp;amp;mdash;}}&lt;br /&gt;
| DextersLab.hzc&lt;br /&gt;
|-&lt;br /&gt;
| raceTrackWalls&lt;br /&gt;
| {{Unknown-left|&amp;amp;mdash;}}&lt;br /&gt;
| DextersLab.hzc&lt;br /&gt;
|-&lt;br /&gt;
| RoughGround&lt;br /&gt;
|&lt;br /&gt;
* float(SurfaceType)=0.000000&lt;br /&gt;
* float(SurfaceType)=4.000000&lt;br /&gt;
|&lt;br /&gt;
* AronSpeed.hzc&lt;br /&gt;
* MandarkLab.hzc&lt;br /&gt;
* MidNowhere.hzc&lt;br /&gt;
|-&lt;br /&gt;
| terrainLight&lt;br /&gt;
| float(SurfaceType)=0.000000&lt;br /&gt;
|&lt;br /&gt;
* MandarkLab.hzc&lt;br /&gt;
* MountRush.hzc&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
= Version List =&lt;br /&gt;
= Version List =&lt;br /&gt;
{|class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Version !! Found in&lt;br /&gt;
|-&lt;br /&gt;
| 1.3&lt;br /&gt;
|&lt;br /&gt;
* [https://en.wikipedia.org/wiki/Cartoon_Network_Racing Cartoon Network Racing DS]&lt;br /&gt;
* [https://en.wikipedia.org/wiki/Ferrari_Challenge:_Trofeo_Pirelli Ferrari Challenge: Trofeo Pirelli DS]&lt;br /&gt;
|-&lt;br /&gt;
| 1.4&lt;br /&gt;
| [https://en.wikipedia.org/wiki/Race_Driver:_Create_%26_Race Race Driver: Create &amp;amp; Race]&lt;br /&gt;
|-&lt;br /&gt;
| 1.5&lt;br /&gt;
|&lt;br /&gt;
* [https://en.wikipedia.org/wiki/Cars_2:_The_Video_Game Cars 2: The Video Game DS]&lt;br /&gt;
* [https://en.wikipedia.org/wiki/Colin_McRae:_Dirt_2 Colin McRae: Dirt 2 DS]&lt;br /&gt;
* [https://en.wikipedia.org/wiki/Hot_Wheels:_Track_Attack Hot Wheels: Track Attack DS]&lt;br /&gt;
* [https://en.wikipedia.org/wiki/Need_for_Speed:_Nitro Need for Speed: Nitro DS]&lt;br /&gt;
* [[Need for Speed: Nitro-X]]&lt;br /&gt;
* [https://en.wikipedia.org/wiki/Need_for_Speed:_Undercover Need for Speed: Undercover DS]&lt;br /&gt;
* [https://en.wikipedia.org/wiki/Race_Driver:_Grid Race Driver: Grid DS]&lt;br /&gt;
* [https://en.wikipedia.org/wiki/SpongeBob&#039;s_Boating_Bash SpongeBob&#039;s Boating Bash]&lt;br /&gt;
|-&lt;br /&gt;
| 1.12&lt;br /&gt;
|&lt;br /&gt;
* [[Planet 51: The Game DS]]&lt;br /&gt;
* [https://en.wikipedia.org/wiki/TrackMania_DS TrackMania DS]&lt;br /&gt;
|-&lt;br /&gt;
| 1.14&lt;br /&gt;
| [https://en.wikipedia.org/wiki/TrackMania_Turbo_(2010_video_game) TrackMania Turbo (2010)]&lt;br /&gt;
|-&lt;br /&gt;
| 1.18&lt;br /&gt;
|&lt;br /&gt;
* [https://en.wikipedia.org/wiki/Cars_2:_The_Video_Game Cars 2: The Video Game 3DS]&lt;br /&gt;
* [https://en.wikipedia.org/wiki/NASCAR_Unleashed NASCAR Unleashed]&lt;br /&gt;
|-&lt;br /&gt;
| 1.19&lt;br /&gt;
| [https://en.wikipedia.org/wiki/Need_for_Speed:_The_Run Need for Speed: The Run 3DS]&lt;br /&gt;
|-&lt;br /&gt;
| 1.22&lt;br /&gt;
| [https://en.wikipedia.org/wiki/Fast_&amp;amp;_Furious:_Showdown Fast &amp;amp; Furious: Showdown 3DS]&lt;br /&gt;
|-&lt;br /&gt;
| 1.23&lt;br /&gt;
|&lt;br /&gt;
* [https://en.wikipedia.org/wiki/Hot_Wheels:_World&#039;s_Best_Driver Hot Wheels: World&#039;s Best Driver 3DS]&lt;br /&gt;
* [https://en.wikipedia.org/wiki/WRC_FIA_World_Rally_Championship WRC FIA World Rally Championship 3DS]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
= Tools =&lt;br /&gt;
The following tools can handle HZC files:&lt;br /&gt;
* (none)&lt;br /&gt;
&lt;br /&gt;
[[Category:Cartoon Network Racing DS File Formats]]&lt;/div&gt;</summary>
		<author><name>Atlas</name></author>
	</entry>
	<entry>
		<id>https://wiki.wexosmk.xyz/index.php?title=HZC_(File_Format)&amp;diff=704</id>
		<title>HZC (File Format)</title>
		<link rel="alternate" type="text/html" href="https://wiki.wexosmk.xyz/index.php?title=HZC_(File_Format)&amp;diff=704"/>
		<updated>2026-07-26T23:40:06Z</updated>

		<summary type="html">&lt;p&gt;Atlas: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&#039;&#039;&#039;HZC&#039;&#039;&#039; is a collision format used in some [[Nintendo DS]] and [[Nintendo 3DS]] games developed by &#039;&#039;[https://en.wikipedia.org/wiki/Firebrand_Games Firebrand Games]&#039;&#039; such as &#039;&#039;[https://en.wikipedia.org/wiki/Cartoon_Network_Racing Cartoon Network Racing DS]&#039;&#039; and &#039;&#039;[https://en.wikipedia.org/wiki/Race_Driver:_Create_%26_Race Race Driver: Create &amp;amp; Race]&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
= File Format =&lt;br /&gt;
The file byte order is always little endian.&lt;br /&gt;
&lt;br /&gt;
== Header ==&lt;br /&gt;
The file starts with the following header:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Offset !! Type !! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x00 || UInt16 || &#039;&#039;&#039;[[#Version List|Version number]]&#039;&#039;&#039;.&lt;br /&gt;
|-&lt;br /&gt;
| 0x02 || UInt16 || &#039;&#039;&#039;Number of vertices&#039;&#039;&#039; (&#039;&#039;&#039;V&#039;&#039;&#039;).&lt;br /&gt;
|-&lt;br /&gt;
| 0x04 || UInt16 || &#039;&#039;&#039;Number of triangles&#039;&#039;&#039; (&#039;&#039;&#039;T&#039;&#039;&#039;).&lt;br /&gt;
|-&lt;br /&gt;
| 0x06 || UInt16 || &#039;&#039;&#039;Number of custom attributes&#039;&#039;&#039; (&#039;&#039;&#039;A&#039;&#039;&#039;).&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Vertex Data ==&lt;br /&gt;
Followed by the header, there&#039;s plain vertex position data stored as a sequence of groups of 3 Int32s (one per axis). The values are divided by 1024.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Offset !! Type !! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x00 || Int32[3][&#039;&#039;&#039;V&#039;&#039;&#039;] || &#039;&#039;&#039;Vertex XYZ coordinates&#039;&#039;&#039;.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Triangle Index Data ==&lt;br /&gt;
After the vertex data, there&#039;s a list of &#039;&#039;&#039;T&#039;&#039;&#039; * 3 UInt16s that correspond to the indices of each triangle.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Offset !! Type !! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x00 || UInt16[3][&#039;&#039;&#039;T&#039;&#039;&#039;] || &#039;&#039;&#039;Triangle indices&#039;&#039;&#039;.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Triangle Normal Data ==&lt;br /&gt;
Directly after the triangle indices there are the triangle&#039;s face normals, consisting of 3 Int32s per triangle. They seem to match the cross product of the triangle&#039;s first two edges with a magnitude of 4096.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Offset !! Type !! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x00 || Int32[3][&#039;&#039;&#039;T&#039;&#039;&#039;] || &#039;&#039;&#039;Triangle XYZ normals&#039;&#039;&#039;.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Grid ==&lt;br /&gt;
Followed by the triangle normal data, there&#039;s a spatial grid consisting of 3D cells used for better collision detection. Each cell corresponds to an index to the [[#Linked List Array|Linked List Array]].&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Offset !! Type !! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x00 || Int32 || &#039;&#039;&#039;Number of cells&#039;&#039;&#039; (&#039;&#039;&#039;C&#039;&#039;&#039;).&lt;br /&gt;
|-&lt;br /&gt;
| 0x04 || UInt16[&#039;&#039;&#039;C&#039;&#039;&#039;] || &#039;&#039;&#039;Cell indices&#039;&#039;&#039;. 0xFFFF if empty.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Grid Info ===&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Offset !! Type !! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x00 || Int32[3] || &#039;&#039;&#039;Number of cells in the grid&#039;s XYZ dimensions&#039;&#039;&#039;.&lt;br /&gt;
|-&lt;br /&gt;
| 0x0C || Int32[3] || &#039;&#039;&#039;Grid bounding box minimum XYZ position&#039;&#039;&#039;.&lt;br /&gt;
|-&lt;br /&gt;
| 0x18 || Int32[3] || &#039;&#039;&#039;Grid bounding box maximum XYZ position&#039;&#039;&#039;.&lt;br /&gt;
|-&lt;br /&gt;
| 0x24 || Int32 || {{Unknown-left|&#039;&#039;&#039;Unknown&#039;&#039;&#039;. Always 0?}}&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Linked List Array ==&lt;br /&gt;
After the grid data there&#039;s an array of triangle/cell links.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Offset !! Type !! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x00 || Int32 || &#039;&#039;&#039;Number of links&#039;&#039;&#039; (&#039;&#039;&#039;L&#039;&#039;&#039;).&lt;br /&gt;
|-&lt;br /&gt;
| 0x04 || UInt16[2][&#039;&#039;&#039;L&#039;&#039;&#039;] || &#039;&#039;&#039;Triangle index&#039;&#039;&#039; and &#039;&#039;&#039;next index&#039;&#039;&#039;. The next index is 0xFFFF at the end of a cell&#039;s chain, otherwise another index into this same array (?)&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Custom Attribute Table ==&lt;br /&gt;
This section is only present if &#039;&#039;&#039;A&#039;&#039;&#039; &amp;gt; 0. It contains a list of &#039;&#039;&#039;T&#039;&#039;&#039; UInt16s that link each triangle to a [[#Key-Value Property|Key-Value Property]] in a string table. Some tracks contain unused attributes.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Offset !! Type !! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x00 || UInt16[&#039;&#039;&#039;T&#039;&#039;&#039;] || &#039;&#039;&#039;Attribute IDs&#039;&#039;&#039;. 0xFFFF if none.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== String Table ===&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Offset !! Type !! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x00 || [[#Key-Value Property|Key-Value Property]][&#039;&#039;&#039;A&#039;&#039;&#039;] || &#039;&#039;&#039;Key-value property strings&#039;&#039;&#039;.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== Key-Value Property ====&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Offset !! Type !! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x00 || UInt16 || &#039;&#039;&#039;Key string length&#039;&#039;&#039; (&#039;&#039;&#039;PK&#039;&#039;&#039;).&lt;br /&gt;
|-&lt;br /&gt;
| 0x02 || String (Char[&#039;&#039;&#039;PK&#039;&#039;&#039;]) || &#039;&#039;&#039;Attribute key&#039;&#039;&#039;.&lt;br /&gt;
|-&lt;br /&gt;
| 0x02 + &#039;&#039;&#039;K&#039;&#039;&#039; || UInt16 || &#039;&#039;&#039;Value string length&#039;&#039;&#039; (&#039;&#039;&#039;PV&#039;&#039;&#039;).&lt;br /&gt;
|-&lt;br /&gt;
| 0x04 + &#039;&#039;&#039;K&#039;&#039;&#039; || String (Char[&#039;&#039;&#039;PV&#039;&#039;&#039;]) || &#039;&#039;&#039;Attribute value&#039;&#039;&#039;. Always &#039;&#039;float(SurfaceType)=&#039;&#039;&#039;X&#039;&#039;&#039;.000000&#039;&#039;.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+ Seen attributes (Cartoon Network Racing DS)&lt;br /&gt;
! Key !! Value !! Found in&lt;br /&gt;
|-&lt;br /&gt;
| COL_grass&lt;br /&gt;
| float(SurfaceType)=1.000000&lt;br /&gt;
|&lt;br /&gt;
* CrossTown.hzc&lt;br /&gt;
* evilGlade.hzc&lt;br /&gt;
* IslandDash.hzc&lt;br /&gt;
|-&lt;br /&gt;
| grass&lt;br /&gt;
| float(SurfaceType)=1.000000&lt;br /&gt;
| Townsville.hzc&lt;br /&gt;
|-&lt;br /&gt;
| Grass&lt;br /&gt;
| float(SurfaceType)=1.000000&lt;br /&gt;
|&lt;br /&gt;
* AronSpeed.hzc&lt;br /&gt;
* MandarkLab.hzc&lt;br /&gt;
* MidNowhere.hzc&lt;br /&gt;
|-&lt;br /&gt;
| heavyTerrain&lt;br /&gt;
| float(SurfaceType)=2.000000&lt;br /&gt;
|&lt;br /&gt;
* CrossTown.hzc&lt;br /&gt;
* MandarkLab.hzc&lt;br /&gt;
* SnowSunday.hzc&lt;br /&gt;
|-&lt;br /&gt;
| HeavyTerrain&lt;br /&gt;
| float(SurfaceType)=3.000000&lt;br /&gt;
|&lt;br /&gt;
* IslandDash.hzc &lt;br /&gt;
* MandarkLab.hzc&lt;br /&gt;
|-&lt;br /&gt;
| MudPuddle&lt;br /&gt;
| float(SurfaceType)=5.000000&lt;br /&gt;
| IslandDash.hzc&lt;br /&gt;
|-&lt;br /&gt;
| not_track&lt;br /&gt;
|&lt;br /&gt;
* float(SurfaceType)=1.000000&lt;br /&gt;
* float(SurfaceType)=4.000000&lt;br /&gt;
|&lt;br /&gt;
* MandarkLab.hzc&lt;br /&gt;
* MidNowhere.hzc&lt;br /&gt;
* Townsville.hzc&lt;br /&gt;
|-&lt;br /&gt;
| raceTrackFloor&lt;br /&gt;
| {{Unknown-left|&amp;amp;mdash;}}&lt;br /&gt;
| DextersLab.hzc&lt;br /&gt;
|-&lt;br /&gt;
| raceTrackWalls&lt;br /&gt;
| {{Unknown-left|&amp;amp;mdash;}}&lt;br /&gt;
| DextersLab.hzc&lt;br /&gt;
|-&lt;br /&gt;
| RoughGround&lt;br /&gt;
|&lt;br /&gt;
* float(SurfaceType)=0.000000&lt;br /&gt;
* float(SurfaceType)=4.000000&lt;br /&gt;
|&lt;br /&gt;
* AronSpeed.hzc&lt;br /&gt;
* MandarkLab.hzc&lt;br /&gt;
* MidNowhere.hzc&lt;br /&gt;
|-&lt;br /&gt;
| terrainLight&lt;br /&gt;
| float(SurfaceType)=0.000000&lt;br /&gt;
|&lt;br /&gt;
* MandarkLab.hzc&lt;br /&gt;
* MountRush.hzc&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
= Version List =&lt;br /&gt;
= Version List =&lt;br /&gt;
{|class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Version !! Found in&lt;br /&gt;
|-&lt;br /&gt;
| 1.3&lt;br /&gt;
|&lt;br /&gt;
* [https://en.wikipedia.org/wiki/Cartoon_Network_Racing Cartoon Network Racing DS]&lt;br /&gt;
* [https://en.wikipedia.org/wiki/Ferrari_Challenge:_Trofeo_Pirelli Ferrari Challenge: Trofeo Pirelli DS]&lt;br /&gt;
|-&lt;br /&gt;
| 1.4&lt;br /&gt;
| [https://en.wikipedia.org/wiki/Race_Driver:_Create_%26_Race Race Driver: Create &amp;amp; Race]&lt;br /&gt;
|-&lt;br /&gt;
| 1.5&lt;br /&gt;
|&lt;br /&gt;
* [https://en.wikipedia.org/wiki/Cars_2:_The_Video_Game Cars 2: The Video Game DS]&lt;br /&gt;
* [https://en.wikipedia.org/wiki/Colin_McRae:_Dirt_2 Colin McRae: Dirt 2 DS]&lt;br /&gt;
* [https://en.wikipedia.org/wiki/Hot_Wheels:_Track_Attack Hot Wheels: Track Attack DS]&lt;br /&gt;
* [https://en.wikipedia.org/wiki/Need_for_Speed:_Nitro Need for Speed: Nitro DS]&lt;br /&gt;
* [[Need for Speed: Nitro-X]]&lt;br /&gt;
* [https://en.wikipedia.org/wiki/Need_for_Speed:_Undercover Need for Speed: Undercover DS]&lt;br /&gt;
* [https://en.wikipedia.org/wiki/Race_Driver:_Grid Race Driver: Grid DS]&lt;br /&gt;
* [https://en.wikipedia.org/wiki/SpongeBob&#039;s_Boating_Bash SpongeBob&#039;s Boating Bash]&lt;br /&gt;
|-&lt;br /&gt;
| 1.12&lt;br /&gt;
|&lt;br /&gt;
* [[Planet 51: The Game DS]]&lt;br /&gt;
* [https://en.wikipedia.org/wiki/TrackMania_DS TrackMania DS]&lt;br /&gt;
|-&lt;br /&gt;
| 1.14&lt;br /&gt;
| [https://en.wikipedia.org/wiki/TrackMania_Turbo_(2010_video_game) TrackMania Turbo (2010)]&lt;br /&gt;
|-&lt;br /&gt;
| 1.18&lt;br /&gt;
|&lt;br /&gt;
* [https://en.wikipedia.org/wiki/Cars_2:_The_Video_Game Cars 2: The Video Game 3DS]&lt;br /&gt;
* [https://en.wikipedia.org/wiki/NASCAR_Unleashed NASCAR Unleashed]&lt;br /&gt;
|-&lt;br /&gt;
| 1.19&lt;br /&gt;
| [https://en.wikipedia.org/wiki/Need_for_Speed:_The_Run Need for Speed: The Run 3DS]&lt;br /&gt;
|-&lt;br /&gt;
| 1.22&lt;br /&gt;
| [https://en.wikipedia.org/wiki/Fast_&amp;amp;_Furious:_Showdown Fast &amp;amp; Furious: Showdown 3DS]&lt;br /&gt;
|-&lt;br /&gt;
| 1.23&lt;br /&gt;
|&lt;br /&gt;
* [https://en.wikipedia.org/wiki/Hot_Wheels:_World&#039;s_Best_Driver Hot Wheels: World&#039;s Best Driver 3DS]&lt;br /&gt;
* [https://en.wikipedia.org/wiki/WRC_FIA_World_Rally_Championship WRC FIA World Rally Championship 3DS]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
= Tools =&lt;br /&gt;
The following tools can handle HZC files:&lt;br /&gt;
* (none)&lt;br /&gt;
&lt;br /&gt;
[[Category:Cartoon Network Racing DS File Formats]]&lt;/div&gt;</summary>
		<author><name>Atlas</name></author>
	</entry>
	<entry>
		<id>https://wiki.wexosmk.xyz/index.php?title=HZC_(File_Format)&amp;diff=703</id>
		<title>HZC (File Format)</title>
		<link rel="alternate" type="text/html" href="https://wiki.wexosmk.xyz/index.php?title=HZC_(File_Format)&amp;diff=703"/>
		<updated>2026-07-26T21:20:14Z</updated>

		<summary type="html">&lt;p&gt;Atlas: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&#039;&#039;&#039;HZC&#039;&#039;&#039; is a collision format used in some games developed by &#039;&#039;[https://en.wikipedia.org/wiki/Firebrand_Games Firebrand Games]&#039;&#039; such as &#039;&#039;[https://en.wikipedia.org/wiki/Cartoon_Network_Racing Cartoon Network Racing DS]&#039;&#039; and &#039;&#039;[https://en.wikipedia.org/wiki/Race_Driver:_Create_%26_Race Race Driver: Create &amp;amp; Race]&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
= File Format =&lt;br /&gt;
The file byte order is always little endian.&lt;br /&gt;
&lt;br /&gt;
== Header ==&lt;br /&gt;
The file starts with the following header:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Offset !! Type !! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x00 || UInt16 || &#039;&#039;&#039;[[#Version List|Version number]]&#039;&#039;&#039;.&lt;br /&gt;
|-&lt;br /&gt;
| 0x02 || UInt16 || &#039;&#039;&#039;Number of vertices&#039;&#039;&#039; (&#039;&#039;&#039;V&#039;&#039;&#039;).&lt;br /&gt;
|-&lt;br /&gt;
| 0x04 || UInt16 || &#039;&#039;&#039;Number of triangles&#039;&#039;&#039; (&#039;&#039;&#039;T&#039;&#039;&#039;).&lt;br /&gt;
|-&lt;br /&gt;
| 0x06 || UInt16 || &#039;&#039;&#039;Number of custom attributes&#039;&#039;&#039; (&#039;&#039;&#039;A&#039;&#039;&#039;).&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Vertex Data ==&lt;br /&gt;
Followed by the header, there&#039;s plain vertex position data stored as a sequence of groups of 3 Int32s (one per axis). The values are divided by 1024.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Offset !! Type !! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x00 || Int32[3][&#039;&#039;&#039;V&#039;&#039;&#039;] || &#039;&#039;&#039;Vertex XYZ coordinates&#039;&#039;&#039;.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Triangle Index Data ==&lt;br /&gt;
After the vertex data, there&#039;s a list of &#039;&#039;&#039;T&#039;&#039;&#039; * 3 UInt16s that correspond to the indices of each triangle.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Offset !! Type !! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x00 || UInt16[3][&#039;&#039;&#039;T&#039;&#039;&#039;] || &#039;&#039;&#039;Triangle indices&#039;&#039;&#039;.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Triangle Normal Data ==&lt;br /&gt;
Directly after the triangle indices there are the triangle&#039;s face normals, consisting of 3 Int32s per triangle. They seem to match the cross product of the triangle&#039;s first two edges with a magnitude of 4096.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Offset !! Type !! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x00 || Int32[3][&#039;&#039;&#039;T&#039;&#039;&#039;] || &#039;&#039;&#039;Triangle XYZ normals&#039;&#039;&#039;.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Grid ==&lt;br /&gt;
Followed by the triangle normal data, there&#039;s a spatial grid consisting of 3D cells used for better collision detection. Each cell corresponds to an index to the [[#Linked List Array|Linked List Array]].&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Offset !! Type !! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x00 || Int32 || &#039;&#039;&#039;Number of cells&#039;&#039;&#039; (&#039;&#039;&#039;C&#039;&#039;&#039;).&lt;br /&gt;
|-&lt;br /&gt;
| 0x04 || UInt16[&#039;&#039;&#039;C&#039;&#039;&#039;] || &#039;&#039;&#039;Cell indices&#039;&#039;&#039;. 0xFFFF if empty.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Grid Info ===&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Offset !! Type !! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x00 || Int32[3] || &#039;&#039;&#039;Number of cells in the grid&#039;s XYZ dimensions&#039;&#039;&#039;.&lt;br /&gt;
|-&lt;br /&gt;
| 0x0C || Int32[3] || &#039;&#039;&#039;Grid bounding box minimum XYZ position&#039;&#039;&#039;.&lt;br /&gt;
|-&lt;br /&gt;
| 0x18 || Int32[3] || &#039;&#039;&#039;Grid bounding box maximum XYZ position&#039;&#039;&#039;.&lt;br /&gt;
|-&lt;br /&gt;
| 0x24 || Int32 || {{Unknown-left|&#039;&#039;&#039;Unknown&#039;&#039;&#039;. Always 0?}}&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Linked List Array ==&lt;br /&gt;
After the grid data there&#039;s an array of triangle/cell links.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Offset !! Type !! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x00 || Int32 || &#039;&#039;&#039;Number of links&#039;&#039;&#039; (&#039;&#039;&#039;L&#039;&#039;&#039;).&lt;br /&gt;
|-&lt;br /&gt;
| 0x04 || UInt16[2][&#039;&#039;&#039;L&#039;&#039;&#039;] || &#039;&#039;&#039;Triangle index&#039;&#039;&#039; and &#039;&#039;&#039;next index&#039;&#039;&#039;. The next index is 0xFFFF at the end of a cell&#039;s chain, otherwise another index into this same array (?)&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Custom Attribute Table ==&lt;br /&gt;
This section is only present if &#039;&#039;&#039;A&#039;&#039;&#039; &amp;gt; 0. It contains a list of &#039;&#039;&#039;T&#039;&#039;&#039; UInt16s that link each triangle to a [[#Key-Value Property|Key-Value Property]] in a string table. Some tracks contain unused attributes.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Offset !! Type !! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x00 || UInt16[&#039;&#039;&#039;T&#039;&#039;&#039;] || &#039;&#039;&#039;Attribute IDs&#039;&#039;&#039;. 0xFFFF if none.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== String Table ===&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Offset !! Type !! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x00 || [[#Key-Value Property|Key-Value Property]][&#039;&#039;&#039;A&#039;&#039;&#039;] || &#039;&#039;&#039;Key-value property strings&#039;&#039;&#039;.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== Key-Value Property ====&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Offset !! Type !! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x00 || UInt16 || &#039;&#039;&#039;Key string length&#039;&#039;&#039; (&#039;&#039;&#039;PK&#039;&#039;&#039;).&lt;br /&gt;
|-&lt;br /&gt;
| 0x02 || String (Char[&#039;&#039;&#039;PK&#039;&#039;&#039;]) || &#039;&#039;&#039;Attribute key&#039;&#039;&#039;.&lt;br /&gt;
|-&lt;br /&gt;
| 0x02 + &#039;&#039;&#039;K&#039;&#039;&#039; || UInt16 || &#039;&#039;&#039;Value string length&#039;&#039;&#039; (&#039;&#039;&#039;PV&#039;&#039;&#039;).&lt;br /&gt;
|-&lt;br /&gt;
| 0x04 + &#039;&#039;&#039;K&#039;&#039;&#039; || String (Char[&#039;&#039;&#039;PV&#039;&#039;&#039;]) || &#039;&#039;&#039;Attribute value&#039;&#039;&#039;. Always &#039;&#039;float(SurfaceType)=&#039;&#039;&#039;X&#039;&#039;&#039;.000000&#039;&#039;.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+ Seen attributes (Cartoon Network Racing DS)&lt;br /&gt;
! Key !! Value !! Found in&lt;br /&gt;
|-&lt;br /&gt;
| COL_grass&lt;br /&gt;
| float(SurfaceType)=1.000000&lt;br /&gt;
|&lt;br /&gt;
* CrossTown.hzc&lt;br /&gt;
* evilGlade.hzc&lt;br /&gt;
* IslandDash.hzc&lt;br /&gt;
|-&lt;br /&gt;
| grass&lt;br /&gt;
| float(SurfaceType)=1.000000&lt;br /&gt;
| Townsville.hzc&lt;br /&gt;
|-&lt;br /&gt;
| Grass&lt;br /&gt;
| float(SurfaceType)=1.000000&lt;br /&gt;
|&lt;br /&gt;
* AronSpeed.hzc&lt;br /&gt;
* MandarkLab.hzc&lt;br /&gt;
* MidNowhere.hzc&lt;br /&gt;
|-&lt;br /&gt;
| heavyTerrain&lt;br /&gt;
| float(SurfaceType)=2.000000&lt;br /&gt;
|&lt;br /&gt;
* CrossTown.hzc&lt;br /&gt;
* MandarkLab.hzc&lt;br /&gt;
* SnowSunday.hzc&lt;br /&gt;
|-&lt;br /&gt;
| HeavyTerrain&lt;br /&gt;
| float(SurfaceType)=3.000000&lt;br /&gt;
|&lt;br /&gt;
* IslandDash.hzc &lt;br /&gt;
* MandarkLab.hzc&lt;br /&gt;
|-&lt;br /&gt;
| MudPuddle&lt;br /&gt;
| float(SurfaceType)=5.000000&lt;br /&gt;
| IslandDash.hzc&lt;br /&gt;
|-&lt;br /&gt;
| not_track&lt;br /&gt;
|&lt;br /&gt;
* float(SurfaceType)=1.000000&lt;br /&gt;
* float(SurfaceType)=4.000000&lt;br /&gt;
|&lt;br /&gt;
* MandarkLab.hzc&lt;br /&gt;
* MidNowhere.hzc&lt;br /&gt;
* Townsville.hzc&lt;br /&gt;
|-&lt;br /&gt;
| raceTrackFloor&lt;br /&gt;
| {{Unknown-left|&amp;amp;mdash;}}&lt;br /&gt;
| DextersLab.hzc&lt;br /&gt;
|-&lt;br /&gt;
| raceTrackWalls&lt;br /&gt;
| {{Unknown-left|&amp;amp;mdash;}}&lt;br /&gt;
| DextersLab.hzc&lt;br /&gt;
|-&lt;br /&gt;
| RoughGround&lt;br /&gt;
|&lt;br /&gt;
* float(SurfaceType)=0.000000&lt;br /&gt;
* float(SurfaceType)=4.000000&lt;br /&gt;
|&lt;br /&gt;
* AronSpeed.hzc&lt;br /&gt;
* MandarkLab.hzc&lt;br /&gt;
* MidNowhere.hzc&lt;br /&gt;
|-&lt;br /&gt;
| terrainLight&lt;br /&gt;
| float(SurfaceType)=0.000000&lt;br /&gt;
|&lt;br /&gt;
* MandarkLab.hzc&lt;br /&gt;
* MountRush.hzc&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
= Version List =&lt;br /&gt;
{|class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Version !! Found in&lt;br /&gt;
|-&lt;br /&gt;
| 1.3&lt;br /&gt;
| [https://en.wikipedia.org/wiki/Cartoon_Network_Racing Cartoon Network Racing DS]&lt;br /&gt;
|-&lt;br /&gt;
| 1.4&lt;br /&gt;
| [https://en.wikipedia.org/wiki/Race_Driver:_Create_%26_Race Race Driver: Create &amp;amp; Race]&lt;br /&gt;
|-&lt;br /&gt;
| 1.5&lt;br /&gt;
|&lt;br /&gt;
* [https://en.wikipedia.org/wiki/Cars_2:_The_Video_Game Cars 2: The Video Game DS]&lt;br /&gt;
* [https://en.wikipedia.org/wiki/Hot_Wheels:_Track_Attack Hot Wheels: Track Attack DS]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= Tools =&lt;br /&gt;
The following tools can handle HZC files:&lt;br /&gt;
* (none)&lt;br /&gt;
&lt;br /&gt;
[[Category:Cartoon Network Racing DS File Formats]]&lt;/div&gt;</summary>
		<author><name>Atlas</name></author>
	</entry>
	<entry>
		<id>https://wiki.wexosmk.xyz/index.php?title=HZC_(File_Format)&amp;diff=702</id>
		<title>HZC (File Format)</title>
		<link rel="alternate" type="text/html" href="https://wiki.wexosmk.xyz/index.php?title=HZC_(File_Format)&amp;diff=702"/>
		<updated>2026-07-25T21:14:36Z</updated>

		<summary type="html">&lt;p&gt;Atlas: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&#039;&#039;&#039;HZC&#039;&#039;&#039; is a collision format used in &#039;&#039;[https://en.wikipedia.org/wiki/Cartoon_Network_Racing Cartoon Network Racing DS]&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
= File Format =&lt;br /&gt;
The file byte order is always little endian.&lt;br /&gt;
&lt;br /&gt;
== Header ==&lt;br /&gt;
The file starts with the following header:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Offset !! Type !! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x00 || UInt16 || {{Unknown-left|&#039;&#039;&#039;Unknown&#039;&#039;&#039;. Magic or file version? Always 0x0103.}}&lt;br /&gt;
|-&lt;br /&gt;
| 0x02 || UInt16 || &#039;&#039;&#039;Number of vertices&#039;&#039;&#039; (&#039;&#039;&#039;V&#039;&#039;&#039;).&lt;br /&gt;
|-&lt;br /&gt;
| 0x04 || UInt16 || &#039;&#039;&#039;Number of triangles&#039;&#039;&#039; (&#039;&#039;&#039;T&#039;&#039;&#039;).&lt;br /&gt;
|-&lt;br /&gt;
| 0x06 || UInt16 || &#039;&#039;&#039;Number of custom attributes&#039;&#039;&#039; (&#039;&#039;&#039;A&#039;&#039;&#039;).&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Vertex Data ==&lt;br /&gt;
Followed by the header, there&#039;s plain vertex position data stored as a sequence of groups of 3 Int32s (one per axis). The values are divided by 1024.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Offset !! Type !! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x00 || Int32[3][&#039;&#039;&#039;V&#039;&#039;&#039;] || &#039;&#039;&#039;Vertex XYZ coordinates&#039;&#039;&#039;.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Triangle Index Data ==&lt;br /&gt;
After the vertex data, there&#039;s a list of &#039;&#039;&#039;T&#039;&#039;&#039; * 3 UInt16s that correspond to the indices of each triangle.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Offset !! Type !! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x00 || UInt16[3][&#039;&#039;&#039;T&#039;&#039;&#039;] || &#039;&#039;&#039;Triangle indices&#039;&#039;&#039;.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Triangle Normal Data ==&lt;br /&gt;
Directly after the triangle indices there are the triangle&#039;s face normals, consisting of 3 Int32s per triangle. They seem to match the cross product of the triangle&#039;s first two edges with a magnitude of 4096.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Offset !! Type !! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x00 || Int32[3][&#039;&#039;&#039;T&#039;&#039;&#039;] || &#039;&#039;&#039;Triangle XYZ normals&#039;&#039;&#039;.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Grid ==&lt;br /&gt;
Followed by the triangle normal data, there&#039;s a spatial grid consisting of 3D cells used for better collision detection. Each cell corresponds to an index to the [[#Linked List Array|Linked List Array]].&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Offset !! Type !! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x00 || Int32 || &#039;&#039;&#039;Number of cells&#039;&#039;&#039; (&#039;&#039;&#039;C&#039;&#039;&#039;).&lt;br /&gt;
|-&lt;br /&gt;
| 0x04 || UInt16[&#039;&#039;&#039;C&#039;&#039;&#039;] || &#039;&#039;&#039;Cell indices&#039;&#039;&#039;. 0xFFFF if empty.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Grid Info ===&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Offset !! Type !! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x00 || Int32[3] || &#039;&#039;&#039;Number of cells in the grid&#039;s XYZ dimensions&#039;&#039;&#039;.&lt;br /&gt;
|-&lt;br /&gt;
| 0x0C || Int32[3] || &#039;&#039;&#039;Grid bounding box minimum XYZ position&#039;&#039;&#039;.&lt;br /&gt;
|-&lt;br /&gt;
| 0x18 || Int32[3] || &#039;&#039;&#039;Grid bounding box maximum XYZ position&#039;&#039;&#039;.&lt;br /&gt;
|-&lt;br /&gt;
| 0x24 || Int32 || {{Unknown-left|&#039;&#039;&#039;Unknown&#039;&#039;&#039;. Always 0?}}&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Linked List Array ==&lt;br /&gt;
After the grid data there&#039;s an array of triangle/cell links.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Offset !! Type !! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x00 || Int32 || &#039;&#039;&#039;Number of links&#039;&#039;&#039; (&#039;&#039;&#039;L&#039;&#039;&#039;).&lt;br /&gt;
|-&lt;br /&gt;
| 0x04 || UInt16[2][&#039;&#039;&#039;L&#039;&#039;&#039;] || &#039;&#039;&#039;Triangle index&#039;&#039;&#039; and &#039;&#039;&#039;next index&#039;&#039;&#039;. The next index is 0xFFFF at the end of a cell&#039;s chain, otherwise another index into this same array (?)&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Custom Attribute Table ==&lt;br /&gt;
This section is only present if &#039;&#039;&#039;A&#039;&#039;&#039; &amp;gt; 0. It contains a list of &#039;&#039;&#039;T&#039;&#039;&#039; UInt16s that link each triangle to a [[#Key-Value Property|Key-Value Property]] in a string table. Some tracks contain unused attributes.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Offset !! Type !! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x00 || UInt16[&#039;&#039;&#039;T&#039;&#039;&#039;] || &#039;&#039;&#039;Attribute IDs&#039;&#039;&#039;. 0xFFFF if none.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== String Table ===&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Offset !! Type !! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x00 || [[#Key-Value Property|Key-Value Property]][&#039;&#039;&#039;A&#039;&#039;&#039;] || &#039;&#039;&#039;Key-value property strings&#039;&#039;&#039;.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== Key-Value Property ====&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Offset !! Type !! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x00 || UInt16 || &#039;&#039;&#039;Key string length&#039;&#039;&#039; (&#039;&#039;&#039;PK&#039;&#039;&#039;).&lt;br /&gt;
|-&lt;br /&gt;
| 0x02 || String (Char[&#039;&#039;&#039;PK&#039;&#039;&#039;]) || &#039;&#039;&#039;Attribute key&#039;&#039;&#039;.&lt;br /&gt;
|-&lt;br /&gt;
| 0x02 + &#039;&#039;&#039;K&#039;&#039;&#039; || UInt16 || &#039;&#039;&#039;Value string length&#039;&#039;&#039; (&#039;&#039;&#039;PV&#039;&#039;&#039;).&lt;br /&gt;
|-&lt;br /&gt;
| 0x04 + &#039;&#039;&#039;K&#039;&#039;&#039; || String (Char[&#039;&#039;&#039;PV&#039;&#039;&#039;]) || &#039;&#039;&#039;Attribute value&#039;&#039;&#039;. Always &#039;&#039;float(SurfaceType)=&#039;&#039;&#039;X&#039;&#039;&#039;.000000&#039;&#039;.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+ Seen attributes&lt;br /&gt;
! Key !! Value !! Found in&lt;br /&gt;
|-&lt;br /&gt;
| COL_grass&lt;br /&gt;
| float(SurfaceType)=1.000000&lt;br /&gt;
|&lt;br /&gt;
* CrossTown.hzc&lt;br /&gt;
* evilGlade.hzc&lt;br /&gt;
* IslandDash.hzc&lt;br /&gt;
|-&lt;br /&gt;
| grass&lt;br /&gt;
| float(SurfaceType)=1.000000&lt;br /&gt;
| Townsville.hzc&lt;br /&gt;
|-&lt;br /&gt;
| Grass&lt;br /&gt;
| float(SurfaceType)=1.000000&lt;br /&gt;
|&lt;br /&gt;
* AronSpeed.hzc&lt;br /&gt;
* MandarkLab.hzc&lt;br /&gt;
* MidNowhere.hzc&lt;br /&gt;
|-&lt;br /&gt;
| heavyTerrain&lt;br /&gt;
| float(SurfaceType)=2.000000&lt;br /&gt;
|&lt;br /&gt;
* CrossTown.hzc&lt;br /&gt;
* MandarkLab.hzc&lt;br /&gt;
* SnowSunday.hzc&lt;br /&gt;
|-&lt;br /&gt;
| HeavyTerrain&lt;br /&gt;
| float(SurfaceType)=3.000000&lt;br /&gt;
|&lt;br /&gt;
* IslandDash.hzc &lt;br /&gt;
* MandarkLab.hzc&lt;br /&gt;
|-&lt;br /&gt;
| MudPuddle&lt;br /&gt;
| float(SurfaceType)=5.000000&lt;br /&gt;
| IslandDash.hzc&lt;br /&gt;
|-&lt;br /&gt;
| not_track&lt;br /&gt;
|&lt;br /&gt;
* float(SurfaceType)=1.000000&lt;br /&gt;
* float(SurfaceType)=4.000000&lt;br /&gt;
|&lt;br /&gt;
* MandarkLab.hzc&lt;br /&gt;
* MidNowhere.hzc&lt;br /&gt;
* Townsville.hzc&lt;br /&gt;
|-&lt;br /&gt;
| raceTrackFloor&lt;br /&gt;
| {{Unknown-left|&amp;amp;mdash;}}&lt;br /&gt;
| DextersLab.hzc&lt;br /&gt;
|-&lt;br /&gt;
| raceTrackWalls&lt;br /&gt;
| {{Unknown-left|&amp;amp;mdash;}}&lt;br /&gt;
| DextersLab.hzc&lt;br /&gt;
|-&lt;br /&gt;
| RoughGround&lt;br /&gt;
|&lt;br /&gt;
* float(SurfaceType)=0.000000&lt;br /&gt;
* float(SurfaceType)=4.000000&lt;br /&gt;
|&lt;br /&gt;
* AronSpeed.hzc&lt;br /&gt;
* MandarkLab.hzc&lt;br /&gt;
* MidNowhere.hzc&lt;br /&gt;
|-&lt;br /&gt;
| terrainLight&lt;br /&gt;
| float(SurfaceType)=0.000000&lt;br /&gt;
|&lt;br /&gt;
* MandarkLab.hzc&lt;br /&gt;
* MountRush.hzc&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
= Tools =&lt;br /&gt;
The following tools can handle HZC files:&lt;br /&gt;
* (none)&lt;br /&gt;
&lt;br /&gt;
[[Category:Cartoon Network Racing DS File Formats]]&lt;/div&gt;</summary>
		<author><name>Atlas</name></author>
	</entry>
	<entry>
		<id>https://wiki.wexosmk.xyz/index.php?title=Category:Cartoon_Network_Racing_DS_File_Formats&amp;diff=701</id>
		<title>Category:Cartoon Network Racing DS File Formats</title>
		<link rel="alternate" type="text/html" href="https://wiki.wexosmk.xyz/index.php?title=Category:Cartoon_Network_Racing_DS_File_Formats&amp;diff=701"/>
		<updated>2026-07-25T21:14:24Z</updated>

		<summary type="html">&lt;p&gt;Atlas: Created page with &amp;quot;This is a list of file formats used in &amp;#039;&amp;#039;[https://en.wikipedia.org/wiki/Cartoon_Network_Racing Cartoon Network Racing DS]&amp;#039;&amp;#039;.  Category:File Formats&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This is a list of file formats used in &#039;&#039;[https://en.wikipedia.org/wiki/Cartoon_Network_Racing Cartoon Network Racing DS]&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
[[Category:File Formats]]&lt;/div&gt;</summary>
		<author><name>Atlas</name></author>
	</entry>
	<entry>
		<id>https://wiki.wexosmk.xyz/index.php?title=HZC&amp;diff=700</id>
		<title>HZC</title>
		<link rel="alternate" type="text/html" href="https://wiki.wexosmk.xyz/index.php?title=HZC&amp;diff=700"/>
		<updated>2026-07-25T21:13:26Z</updated>

		<summary type="html">&lt;p&gt;Atlas: Redirected page to HZC (File Format)&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;#REDIRECT [[HZC (File Format)]]&lt;/div&gt;</summary>
		<author><name>Atlas</name></author>
	</entry>
	<entry>
		<id>https://wiki.wexosmk.xyz/index.php?title=HZC_(File_Format)&amp;diff=699</id>
		<title>HZC (File Format)</title>
		<link rel="alternate" type="text/html" href="https://wiki.wexosmk.xyz/index.php?title=HZC_(File_Format)&amp;diff=699"/>
		<updated>2026-07-25T21:13:13Z</updated>

		<summary type="html">&lt;p&gt;Atlas: Created page with &amp;quot;&amp;#039;&amp;#039;&amp;#039;HZC&amp;#039;&amp;#039;&amp;#039; is a collision format used in Cartoon Network Racing DS.  = File Format = The file byte order is always little endian.  == Header == The file starts with the following header:  {| class=&amp;quot;wikitable&amp;quot; ! Offset !! Type !! Description |- | 0x00 || UInt16 || {{Unknown-left|&amp;#039;&amp;#039;&amp;#039;Unknown&amp;#039;&amp;#039;&amp;#039;. Magic or file version? Always 0x0103.}} |- | 0x02 || UInt16 || &amp;#039;&amp;#039;&amp;#039;Number of vertices&amp;#039;&amp;#039;&amp;#039; (&amp;#039;&amp;#039;&amp;#039;V&amp;#039;&amp;#039;&amp;#039;). |- | 0x04 || UInt16 || &amp;#039;&amp;#039;&amp;#039;Number of triangles&amp;#039;&amp;#039;&amp;#039; (&amp;#039;&amp;#039;&amp;#039;T&amp;#039;&amp;#039;&amp;#039;). |- | 0x06 || UInt16...&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&#039;&#039;&#039;HZC&#039;&#039;&#039; is a collision format used in [[Cartoon Network Racing DS]].&lt;br /&gt;
&lt;br /&gt;
= File Format =&lt;br /&gt;
The file byte order is always little endian.&lt;br /&gt;
&lt;br /&gt;
== Header ==&lt;br /&gt;
The file starts with the following header:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Offset !! Type !! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x00 || UInt16 || {{Unknown-left|&#039;&#039;&#039;Unknown&#039;&#039;&#039;. Magic or file version? Always 0x0103.}}&lt;br /&gt;
|-&lt;br /&gt;
| 0x02 || UInt16 || &#039;&#039;&#039;Number of vertices&#039;&#039;&#039; (&#039;&#039;&#039;V&#039;&#039;&#039;).&lt;br /&gt;
|-&lt;br /&gt;
| 0x04 || UInt16 || &#039;&#039;&#039;Number of triangles&#039;&#039;&#039; (&#039;&#039;&#039;T&#039;&#039;&#039;).&lt;br /&gt;
|-&lt;br /&gt;
| 0x06 || UInt16 || &#039;&#039;&#039;Number of custom attributes&#039;&#039;&#039; (&#039;&#039;&#039;A&#039;&#039;&#039;).&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Vertex Data ==&lt;br /&gt;
Followed by the header, there&#039;s plain vertex position data stored as a sequence of groups of 3 Int32s (one per axis). The values are divided by 1024.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Offset !! Type !! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x00 || Int32[3][&#039;&#039;&#039;V&#039;&#039;&#039;] || &#039;&#039;&#039;Vertex XYZ coordinates&#039;&#039;&#039;.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Triangle Index Data ==&lt;br /&gt;
After the vertex data, there&#039;s a list of &#039;&#039;&#039;T&#039;&#039;&#039; * 3 UInt16s that correspond to the indices of each triangle.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Offset !! Type !! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x00 || UInt16[3][&#039;&#039;&#039;T&#039;&#039;&#039;] || &#039;&#039;&#039;Triangle indices&#039;&#039;&#039;.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Triangle Normal Data ==&lt;br /&gt;
Directly after the triangle indices there are the triangle&#039;s face normals, consisting of 3 Int32s per triangle. They seem to match the cross product of the triangle&#039;s first two edges with a magnitude of 4096.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Offset !! Type !! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x00 || Int32[3][&#039;&#039;&#039;T&#039;&#039;&#039;] || &#039;&#039;&#039;Triangle XYZ normals&#039;&#039;&#039;.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Grid ==&lt;br /&gt;
Followed by the triangle normal data, there&#039;s a spatial grid consisting of 3D cells used for better collision detection. Each cell corresponds to an index to the [[#Linked List Array|Linked List Array]].&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Offset !! Type !! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x00 || Int32 || &#039;&#039;&#039;Number of cells&#039;&#039;&#039; (&#039;&#039;&#039;C&#039;&#039;&#039;).&lt;br /&gt;
|-&lt;br /&gt;
| 0x04 || UInt16[&#039;&#039;&#039;C&#039;&#039;&#039;] || &#039;&#039;&#039;Cell indices&#039;&#039;&#039;. 0xFFFF if empty.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Grid Info ===&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Offset !! Type !! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x00 || Int32[3] || &#039;&#039;&#039;Number of cells in the grid&#039;s XYZ dimensions&#039;&#039;&#039;.&lt;br /&gt;
|-&lt;br /&gt;
| 0x0C || Int32[3] || &#039;&#039;&#039;Grid bounding box minimum XYZ position&#039;&#039;&#039;.&lt;br /&gt;
|-&lt;br /&gt;
| 0x18 || Int32[3] || &#039;&#039;&#039;Grid bounding box maximum XYZ position&#039;&#039;&#039;.&lt;br /&gt;
|-&lt;br /&gt;
| 0x24 || Int32 || {{Unknown-left|&#039;&#039;&#039;Unknown&#039;&#039;&#039;. Always 0?}}&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Linked List Array ==&lt;br /&gt;
After the grid data there&#039;s an array of triangle/cell links.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Offset !! Type !! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x00 || Int32 || &#039;&#039;&#039;Number of links&#039;&#039;&#039; (&#039;&#039;&#039;L&#039;&#039;&#039;).&lt;br /&gt;
|-&lt;br /&gt;
| 0x04 || UInt16[2][&#039;&#039;&#039;L&#039;&#039;&#039;] || &#039;&#039;&#039;Triangle index&#039;&#039;&#039; and &#039;&#039;&#039;next index&#039;&#039;&#039;. The next index is 0xFFFF at the end of a cell&#039;s chain, otherwise another index into this same array (?)&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Custom Attribute Table ==&lt;br /&gt;
This section is only present if &#039;&#039;&#039;A&#039;&#039;&#039; &amp;gt; 0. It contains a list of &#039;&#039;&#039;T&#039;&#039;&#039; UInt16s that link each triangle to a [[#Key-Value Property|Key-Value Property]] in a string table. Some tracks contain unused attributes.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Offset !! Type !! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x00 || UInt16[&#039;&#039;&#039;T&#039;&#039;&#039;] || &#039;&#039;&#039;Attribute IDs&#039;&#039;&#039;. 0xFFFF if none.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== String Table ===&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Offset !! Type !! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x00 || [[#Key-Value Property|Key-Value Property]][&#039;&#039;&#039;A&#039;&#039;&#039;] || &#039;&#039;&#039;Key-value property strings&#039;&#039;&#039;.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== Key-Value Property ====&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Offset !! Type !! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x00 || UInt16 || &#039;&#039;&#039;Key string length&#039;&#039;&#039; (&#039;&#039;&#039;PK&#039;&#039;&#039;).&lt;br /&gt;
|-&lt;br /&gt;
| 0x02 || String (Char[&#039;&#039;&#039;PK&#039;&#039;&#039;]) || &#039;&#039;&#039;Attribute key&#039;&#039;&#039;.&lt;br /&gt;
|-&lt;br /&gt;
| 0x02 + &#039;&#039;&#039;K&#039;&#039;&#039; || UInt16 || &#039;&#039;&#039;Value string length&#039;&#039;&#039; (&#039;&#039;&#039;PV&#039;&#039;&#039;).&lt;br /&gt;
|-&lt;br /&gt;
| 0x04 + &#039;&#039;&#039;K&#039;&#039;&#039; || String (Char[&#039;&#039;&#039;PV&#039;&#039;&#039;]) || &#039;&#039;&#039;Attribute value&#039;&#039;&#039;. Always &#039;&#039;float(SurfaceType)=&#039;&#039;&#039;X&#039;&#039;&#039;.000000&#039;&#039;.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+ Seen attributes&lt;br /&gt;
! Key !! Value !! Found in&lt;br /&gt;
|-&lt;br /&gt;
| COL_grass&lt;br /&gt;
| float(SurfaceType)=1.000000&lt;br /&gt;
|&lt;br /&gt;
* CrossTown.hzc&lt;br /&gt;
* evilGlade.hzc&lt;br /&gt;
* IslandDash.hzc&lt;br /&gt;
|-&lt;br /&gt;
| grass&lt;br /&gt;
| float(SurfaceType)=1.000000&lt;br /&gt;
| Townsville.hzc&lt;br /&gt;
|-&lt;br /&gt;
| Grass&lt;br /&gt;
| float(SurfaceType)=1.000000&lt;br /&gt;
|&lt;br /&gt;
* AronSpeed.hzc&lt;br /&gt;
* MandarkLab.hzc&lt;br /&gt;
* MidNowhere.hzc&lt;br /&gt;
|-&lt;br /&gt;
| heavyTerrain&lt;br /&gt;
| float(SurfaceType)=2.000000&lt;br /&gt;
|&lt;br /&gt;
* CrossTown.hzc&lt;br /&gt;
* MandarkLab.hzc&lt;br /&gt;
* SnowSunday.hzc&lt;br /&gt;
|-&lt;br /&gt;
| HeavyTerrain&lt;br /&gt;
| float(SurfaceType)=3.000000&lt;br /&gt;
|&lt;br /&gt;
* IslandDash.hzc &lt;br /&gt;
* MandarkLab.hzc&lt;br /&gt;
|-&lt;br /&gt;
| MudPuddle&lt;br /&gt;
| float(SurfaceType)=5.000000&lt;br /&gt;
| IslandDash.hzc&lt;br /&gt;
|-&lt;br /&gt;
| not_track&lt;br /&gt;
|&lt;br /&gt;
* float(SurfaceType)=1.000000&lt;br /&gt;
* float(SurfaceType)=4.000000&lt;br /&gt;
|&lt;br /&gt;
* MandarkLab.hzc&lt;br /&gt;
* MidNowhere.hzc&lt;br /&gt;
* Townsville.hzc&lt;br /&gt;
|-&lt;br /&gt;
| raceTrackFloor&lt;br /&gt;
| {{Unknown-left|&amp;amp;mdash;}}&lt;br /&gt;
| DextersLab.hzc&lt;br /&gt;
|-&lt;br /&gt;
| raceTrackWalls&lt;br /&gt;
| {{Unknown-left|&amp;amp;mdash;}}&lt;br /&gt;
| DextersLab.hzc&lt;br /&gt;
|-&lt;br /&gt;
| RoughGround&lt;br /&gt;
|&lt;br /&gt;
* float(SurfaceType)=0.000000&lt;br /&gt;
* float(SurfaceType)=4.000000&lt;br /&gt;
|&lt;br /&gt;
* AronSpeed.hzc&lt;br /&gt;
* MandarkLab.hzc&lt;br /&gt;
* MidNowhere.hzc&lt;br /&gt;
|-&lt;br /&gt;
| terrainLight&lt;br /&gt;
| float(SurfaceType)=0.000000&lt;br /&gt;
|&lt;br /&gt;
* MandarkLab.hzc&lt;br /&gt;
* MountRush.hzc&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
= Tools =&lt;br /&gt;
The following tools can handle HZC files:&lt;br /&gt;
* (none)&lt;br /&gt;
&lt;br /&gt;
[[Category:Cartoon Network Racing DS File Formats]]&lt;/div&gt;</summary>
		<author><name>Atlas</name></author>
	</entry>
	<entry>
		<id>https://wiki.wexosmk.xyz/index.php?title=ATX_(File_Format)&amp;diff=698</id>
		<title>ATX (File Format)</title>
		<link rel="alternate" type="text/html" href="https://wiki.wexosmk.xyz/index.php?title=ATX_(File_Format)&amp;diff=698"/>
		<updated>2026-07-24T08:53:03Z</updated>

		<summary type="html">&lt;p&gt;Atlas: /* Header */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{under-construction}}&lt;br /&gt;
&#039;&#039;&#039;ATX&#039;&#039;&#039; (&#039;&#039;&#039;A&#039;&#039;&#039;qualead &#039;&#039;&#039;T&#039;&#039;&#039;e&#039;&#039;&#039;X&#039;&#039;&#039;ture) is a texture format developed by [[Aqualead]] and found in some [[Wii]] and [[3DS]] games (and suspected to be used in [[GameCube]] titles as well), such as &#039;&#039;[[One Piece: Unlimited Adventure]]&#039;&#039;, &#039;&#039;[[One Piece: Unlimited Cruise Episode 1 - The Treasure Beneath The Waves]]&#039;&#039;, &#039;&#039;[[One Piece: Unlimited Cruise Episode 2: Awakening of a Hero]]&#039;&#039;, &#039;&#039;[[One Piece: Unlimited Cruise SP]]&#039;&#039; and &#039;&#039;[[One Piece: Unlimited Cruise SP 2]]&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
= File Format =&lt;br /&gt;
The file byte order can be either big endian (Wii) or little endian (3DS).&lt;br /&gt;
&lt;br /&gt;
== Header ==&lt;br /&gt;
The file starts with the following header:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Offset !! Type !! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x00 || Char[4] || &#039;&#039;&#039;File magic&#039;&#039;&#039;. Always &#039;&#039;ALTX&#039;&#039; in ASCII.&lt;br /&gt;
|-&lt;br /&gt;
| 0x04 || Byte || {{Unknown-left|&#039;&#039;&#039;Unknown&#039;&#039;&#039;. Always 0?}}&lt;br /&gt;
|-&lt;br /&gt;
| 0x05 || Byte || {{Unknown-left|&#039;&#039;&#039;Unknown&#039;&#039;&#039;. Possibly bit flags, but files either use 0x80 or 0x81.}}&lt;br /&gt;
|-&lt;br /&gt;
| 0x06 || UInt16 || &#039;&#039;&#039;Number of slicers&#039;&#039;&#039; (&#039;&#039;&#039;N&#039;&#039;&#039;).&lt;br /&gt;
|-&lt;br /&gt;
| 0x08 || UInt32 || &#039;&#039;&#039;[[AIG]] file offset&#039;&#039;&#039;.&lt;br /&gt;
|-&lt;br /&gt;
| 0x0C || UInt16[&#039;&#039;&#039;N&#039;&#039;&#039;] || &#039;&#039;&#039;[[#Slicer|Slicer]] offsets&#039;&#039;&#039;.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Slicer ==&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Offset !! Type !! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x00 || Byte[4] || {{Unknown-left|&#039;&#039;&#039;Unknown&#039;&#039;&#039;. Possibly an asset link identifier.}}&lt;br /&gt;
|-&lt;br /&gt;
| 0x04 || UInt16 || &#039;&#039;&#039;Number of slices&#039;&#039;&#039; (&#039;&#039;&#039;S&#039;&#039;&#039;).&lt;br /&gt;
|-&lt;br /&gt;
| 0x06 || Byte[2] || {{Unknown-left|&#039;&#039;&#039;Unknown&#039;&#039;&#039;. Always 0x0200?}}&lt;br /&gt;
|-&lt;br /&gt;
| 0x08 || Slice[&#039;&#039;&#039;S&#039;&#039;&#039;] || &#039;&#039;&#039;[[#Slice|Slice]]&#039;&#039;&#039; data.&lt;br /&gt;
|-&lt;br /&gt;
| 0x08 + &#039;&#039;&#039;S&#039;&#039;&#039; * 8 || Unknown Data[&#039;&#039;&#039;S&#039;&#039;&#039;] || {{Unknown-left|&#039;&#039;&#039;[[#Unknown Data|Unknown data]]&#039;&#039;&#039;.}}&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Slice ===&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Offset !! Type !! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x00 || UInt16[2] || &#039;&#039;&#039;X and Y position&#039;&#039;&#039; of the slice.&lt;br /&gt;
|-&lt;br /&gt;
| 0x04 || UInt16[2] || &#039;&#039;&#039;Width and height&#039;&#039;&#039; of the slice.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Unknown Data ===&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Offset !! Type !! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x00 || UInt16[2] || {{Unknown-left|&#039;&#039;&#039;Unknown&#039;&#039;&#039;.}}&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
= Tools =&lt;br /&gt;
The following tools can handle ATX files:&lt;br /&gt;
* (none)&lt;br /&gt;
&lt;br /&gt;
[[Category:Aqualead File Formats]]&lt;/div&gt;</summary>
		<author><name>Atlas</name></author>
	</entry>
	<entry>
		<id>https://wiki.wexosmk.xyz/index.php?title=DKRDS_Interactor_(File_Format)&amp;diff=697</id>
		<title>DKRDS Interactor (File Format)</title>
		<link rel="alternate" type="text/html" href="https://wiki.wexosmk.xyz/index.php?title=DKRDS_Interactor_(File_Format)&amp;diff=697"/>
		<updated>2026-07-17T17:48:22Z</updated>

		<summary type="html">&lt;p&gt;Atlas: /* Header */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{under-construction}}&lt;br /&gt;
&#039;&#039;&#039;DKRDS Interactor&#039;&#039;&#039; is the nameless file format used in &#039;&#039;[https://en.wikipedia.org/wiki/Diddy_Kong_Racing_DS Diddy Kong Racing DS]&#039;&#039; that stores a model&#039;s bone hierarchy and indexed keyframe poses for each bone. Bones defined here are referenced by ID from a corresponding [[DKRDS Model]] file&#039;s vertex data. Its type identifier in [[assets.bin]] is &#039;&#039;&#039;0x2E&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
= File Format =&lt;br /&gt;
The file byte order is always little endian.&lt;br /&gt;
&lt;br /&gt;
== Header ==&lt;br /&gt;
The file starts with a header that is 68 bytes long.&lt;br /&gt;
&lt;br /&gt;
{|class=wikitable&lt;br /&gt;
! Offset !! Type !! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x00 || UInt16 || &#039;&#039;&#039;Mode flags&#039;&#039;&#039;. &#039;&#039;&#039;AXXX XXXX XXXX XXBB&#039;&#039;&#039;:&lt;br /&gt;
* &#039;&#039;&#039;A&#039;&#039;&#039;: &#039;&#039;&#039;Identity scale&#039;&#039;&#039;. When set, the scale channel is skipped and every bone&#039;s scale is set to 1.&lt;br /&gt;
* &#039;&#039;&#039;B&#039;&#039;&#039;: &#039;&#039;&#039;Decode mode&#039;&#039;&#039;. Unknown exact usage. The format described here is documented from files that use mode 2.&lt;br /&gt;
|-&lt;br /&gt;
| 0x02 || UInt16 || {{unknown-left|&#039;&#039;&#039;Unknown&#039;&#039;&#039;.}}&lt;br /&gt;
|-&lt;br /&gt;
| 0x04 || Int32 || {{unknown-left|&#039;&#039;&#039;Unknown&#039;&#039;&#039;.}}&lt;br /&gt;
|-&lt;br /&gt;
| 0x08 || Int32 || {{unknown-left|&#039;&#039;&#039;Unknown&#039;&#039;&#039;.}}&lt;br /&gt;
|-&lt;br /&gt;
| 0x0C || Int32 || &#039;&#039;&#039;Number of bones&#039;&#039;&#039; (&#039;&#039;&#039;B&#039;&#039;&#039;).&lt;br /&gt;
|-&lt;br /&gt;
| 0x10 || Int32 || &#039;&#039;&#039;[[#Skeleton Tree|Skeleton Tree]]&#039;&#039;&#039; offset.&lt;br /&gt;
|-&lt;br /&gt;
| 0x14 || Int32 || {{unknown-left|&#039;&#039;&#039;Unknown&#039;&#039;&#039;. Number of bones again?}}&lt;br /&gt;
|-&lt;br /&gt;
| 0x18 || Int32 || {{unknown-left|&#039;&#039;&#039;Unknown&#039;&#039;&#039;.}}&lt;br /&gt;
|-&lt;br /&gt;
| 0x1C || Int32 || &#039;&#039;&#039;Number of frames&#039;&#039;&#039; (&#039;&#039;&#039;F&#039;&#039;&#039;).&lt;br /&gt;
|-&lt;br /&gt;
| 0x20 || Int32 || {{unknown-left|&#039;&#039;&#039;Unknown&#039;&#039;&#039;. Affects interpolation between frames?}}&lt;br /&gt;
|-&lt;br /&gt;
| 0x24 || Int32 || &#039;&#039;&#039;[[#Axis Data|Axis Data]]&#039;&#039;&#039; offset.&lt;br /&gt;
|-&lt;br /&gt;
| 0x28 || UInt16 || &#039;&#039;&#039;Bits per frame&#039;&#039;&#039; (&#039;&#039;&#039;I&#039;&#039;&#039;). Total size in bits of one frame&#039;s worth of keyframe index data across all bones (&#039;&#039;&#039;B&#039;&#039;&#039; * (&#039;&#039;&#039;PIW&#039;&#039;&#039; + &#039;&#039;&#039;RIW&#039;&#039;&#039; + &#039;&#039;&#039;SIW&#039;&#039;&#039;)).&lt;br /&gt;
|-&lt;br /&gt;
| 0x2A || UInt16 || &#039;&#039;&#039;Position Value Width&#039;&#039;&#039; (&#039;&#039;&#039;PVW&#039;&#039;&#039;) in bits per component.&lt;br /&gt;
|-&lt;br /&gt;
| 0x2C || UInt16 || &#039;&#039;&#039;Position Index Width&#039;&#039;&#039; (&#039;&#039;&#039;PIW&#039;&#039;&#039;) in bits.&lt;br /&gt;
|-&lt;br /&gt;
| 0x2E || UInt16 || &#039;&#039;&#039;Rotation Value Width&#039;&#039;&#039; (&#039;&#039;&#039;PVW&#039;&#039;&#039;) in bits per component.&lt;br /&gt;
|-&lt;br /&gt;
| 0x30 || UInt16 || &#039;&#039;&#039;Rotation Index Width&#039;&#039;&#039; (&#039;&#039;&#039;RIW&#039;&#039;&#039;) in bits.&lt;br /&gt;
|-&lt;br /&gt;
| 0x32 || UInt16 || &#039;&#039;&#039;Scale Value Width&#039;&#039;&#039; (&#039;&#039;&#039;SVW&#039;&#039;&#039;) in bits per component.&lt;br /&gt;
|-&lt;br /&gt;
| 0x34 || UInt16 || &#039;&#039;&#039;Scale Index Width&#039;&#039;&#039; (&#039;&#039;&#039;SIW&#039;&#039;&#039;) in bits.&lt;br /&gt;
|-&lt;br /&gt;
| 0x36 || UInt16 || {{unknown-left|&#039;&#039;&#039;Unknown&#039;&#039;&#039;. Maybe padding?}}&lt;br /&gt;
|-&lt;br /&gt;
| 0x38 || Int32 || &#039;&#039;&#039;Position Value Stream offset&#039;&#039;&#039; (&#039;&#039;&#039;PVO&#039;&#039;&#039;), relative to the Axis Data section.&lt;br /&gt;
|-&lt;br /&gt;
| 0x3C || Int32 || &#039;&#039;&#039;Rotation Value Stream offset&#039;&#039;&#039; (&#039;&#039;&#039;RVO&#039;&#039;&#039;), relative to the Axis Data section.&lt;br /&gt;
|-&lt;br /&gt;
| 0x40 || Int32 || &#039;&#039;&#039;Scale Value Stream offset&#039;&#039;&#039; (&#039;&#039;&#039;SVO&#039;&#039;&#039;), relative to the Axis Data section.&lt;br /&gt;
|-&lt;br /&gt;
| 0x44 || colspan=2 {{unknown|End of header}}&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Skeleton Tree ==&lt;br /&gt;
This section defines the hierarchy of the bones, and it&#039;s always 2 * (&#039;&#039;&#039;B&#039;&#039;&#039; + 1) in length. The first entry corresponds to a default root bone and its parent index is always 0xFFFF (no parent).&lt;br /&gt;
&lt;br /&gt;
{|class=wikitable&lt;br /&gt;
! Offset !! Type !! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x00 || UInt16[&#039;&#039;&#039;B&#039;&#039;&#039; + 1] || &#039;&#039;&#039;Parent bone indices&#039;&#039;&#039; for each bone.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Axis Data ==&lt;br /&gt;
This entire section defines up to three channels (position, rotation and scale), each with its own index bit width and value bit width.&lt;br /&gt;
&lt;br /&gt;
{|class=wikitable&lt;br /&gt;
! Offset !! Size !! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x00 || Ceiling(&#039;&#039;&#039;I&#039;&#039;&#039; * &#039;&#039;&#039;F&#039;&#039;&#039; / 32) * 4 || &#039;&#039;&#039;Index Bitstream&#039;&#039;&#039;. For frame &#039;&#039;&#039;F&#039;&#039;&#039;, the bit cursor starts at &#039;&#039;&#039;I&#039;&#039;&#039; * &#039;&#039;&#039;F&#039;&#039;&#039;. Then for each bone in order, read unsigned bits for its keyframe indices in the order &#039;&#039;&#039;PIW&#039;&#039;&#039; + &#039;&#039;&#039;RIW&#039;&#039;&#039; + &#039;&#039;&#039;SIW&#039;&#039;&#039; (this last one skipped if identity scale mode is set in the header).&amp;lt;br&amp;gt;&lt;br /&gt;
Bits are packed with no padding between bones or channels, and multiple bones can share the same index. The end position is aligned by 4.&lt;br /&gt;
|-&lt;br /&gt;
| 0x00 + &#039;&#039;&#039;PVO&#039;&#039;&#039; || Variable || &#039;&#039;&#039;Position Value Stream&#039;&#039;&#039;. A sequence of XYZ signed entries (&#039;&#039;&#039;PVW&#039;&#039;&#039; bits per component). Entry &#039;&#039;&#039;K&#039;&#039;&#039; starts at bit offset &#039;&#039;&#039;K&#039;&#039;&#039; * 3 * &#039;&#039;&#039;PVW&#039;&#039;&#039; within this stream. Same coordinate scale as [[DKRDS Model]]&#039;s vertex positions.&lt;br /&gt;
|-&lt;br /&gt;
| 0x00 + &#039;&#039;&#039;RVO&#039;&#039;&#039; || Variable || &#039;&#039;&#039;Rotation Value Stream&#039;&#039;&#039;. Same layout as the Position Value Stream, using &#039;&#039;&#039;RVW&#039;&#039;&#039; instead of &#039;&#039;&#039;PVW&#039;&#039;&#039;. A full rotation equals 2^&#039;&#039;&#039;RVW&#039;&#039;&#039;; each component is a plain signed angle in units of 1/2^&#039;&#039;&#039;RVW&#039;&#039;&#039; of a full rotation.&lt;br /&gt;
|-&lt;br /&gt;
| 0x00 + &#039;&#039;&#039;SVO&#039;&#039;&#039; || Variable || &#039;&#039;&#039;Scale Value Stream&#039;&#039;&#039;. Same layout as the two previous streams. Final values are divided by 4096. Not present when identity scale mode is set in the header.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
= Tools =&lt;br /&gt;
The following tools can handle DKRDS Interactor:&lt;br /&gt;
* (none)&lt;br /&gt;
&lt;br /&gt;
[[Category:Diddy Kong Racing DS File Formats]]&lt;/div&gt;</summary>
		<author><name>Atlas</name></author>
	</entry>
	<entry>
		<id>https://wiki.wexosmk.xyz/index.php?title=DKRDS_Interactor_(File_Format)&amp;diff=696</id>
		<title>DKRDS Interactor (File Format)</title>
		<link rel="alternate" type="text/html" href="https://wiki.wexosmk.xyz/index.php?title=DKRDS_Interactor_(File_Format)&amp;diff=696"/>
		<updated>2026-07-15T13:02:24Z</updated>

		<summary type="html">&lt;p&gt;Atlas: /* Header */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{under-construction}}&lt;br /&gt;
&#039;&#039;&#039;DKRDS Interactor&#039;&#039;&#039; is the nameless file format used in &#039;&#039;[https://en.wikipedia.org/wiki/Diddy_Kong_Racing_DS Diddy Kong Racing DS]&#039;&#039; that stores a model&#039;s bone hierarchy and indexed keyframe poses for each bone. Bones defined here are referenced by ID from a corresponding [[DKRDS Model]] file&#039;s vertex data. Its type identifier in [[assets.bin]] is &#039;&#039;&#039;0x2E&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
= File Format =&lt;br /&gt;
The file byte order is always little endian.&lt;br /&gt;
&lt;br /&gt;
== Header ==&lt;br /&gt;
The file starts with a header that is 68 bytes long.&lt;br /&gt;
&lt;br /&gt;
{|class=wikitable&lt;br /&gt;
! Offset !! Type !! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x00 || UInt16 || &#039;&#039;&#039;Mode flags&#039;&#039;&#039;. &#039;&#039;&#039;AXXX XXXX XXXX XXBB&#039;&#039;&#039;:&lt;br /&gt;
* &#039;&#039;&#039;A&#039;&#039;&#039;: &#039;&#039;&#039;Identity scale&#039;&#039;&#039;. When set, the scale channel is skipped and every bone&#039;s scale is set to 1.&lt;br /&gt;
* &#039;&#039;&#039;B&#039;&#039;&#039;: &#039;&#039;&#039;Decode mode&#039;&#039;&#039;. Unknown exact usage. The format described here is documented from files that use mode 2.&lt;br /&gt;
|-&lt;br /&gt;
| 0x02 || UInt16 || {{unknown-left|&#039;&#039;&#039;Unknown&#039;&#039;&#039;.}}&lt;br /&gt;
|-&lt;br /&gt;
| 0x04 || Int32 || {{unknown-left|&#039;&#039;&#039;Unknown&#039;&#039;&#039;.}}&lt;br /&gt;
|-&lt;br /&gt;
| 0x08 || Int32 || {{unknown-left|&#039;&#039;&#039;Unknown&#039;&#039;&#039;.}}&lt;br /&gt;
|-&lt;br /&gt;
| 0x0C || Int32 || &#039;&#039;&#039;Number of bones&#039;&#039;&#039; (&#039;&#039;&#039;B&#039;&#039;&#039;).&lt;br /&gt;
|-&lt;br /&gt;
| 0x10 || Int32 || &#039;&#039;&#039;[[#Skeleton Tree|Skeleton Tree]]&#039;&#039;&#039; offset.&lt;br /&gt;
|-&lt;br /&gt;
| 0x14 || Int32 || {{unknown-left|&#039;&#039;&#039;Unknown&#039;&#039;&#039;. Number of bones again?}}&lt;br /&gt;
|-&lt;br /&gt;
| 0x18 || Int32 || {{unknown-left|&#039;&#039;&#039;Unknown&#039;&#039;&#039;.}}&lt;br /&gt;
|-&lt;br /&gt;
| 0x1C || Int32 || &#039;&#039;&#039;Number of frames&#039;&#039;&#039; (&#039;&#039;&#039;F&#039;&#039;&#039;).&lt;br /&gt;
|-&lt;br /&gt;
| 0x20 || Int32 || {{unknown-left|&#039;&#039;&#039;Unknown&#039;&#039;&#039;. Affects interpolation between frames?}}&lt;br /&gt;
|-&lt;br /&gt;
| 0x24 || Int32 || &#039;&#039;&#039;[[#Axis Data|Axis Data]]&#039;&#039;&#039; offset, relative to 0x2.&lt;br /&gt;
|-&lt;br /&gt;
| 0x28 || UInt16 || &#039;&#039;&#039;Bits per frame&#039;&#039;&#039; (&#039;&#039;&#039;I&#039;&#039;&#039;). Total size in bits of one frame&#039;s worth of keyframe index data across all bones (&#039;&#039;&#039;B&#039;&#039;&#039; * (&#039;&#039;&#039;PIW&#039;&#039;&#039; + &#039;&#039;&#039;RIW&#039;&#039;&#039; + &#039;&#039;&#039;SIW&#039;&#039;&#039;)).&lt;br /&gt;
|-&lt;br /&gt;
| 0x2A || UInt16 || &#039;&#039;&#039;Position Value Width&#039;&#039;&#039; (&#039;&#039;&#039;PVW&#039;&#039;&#039;) in bits per component.&lt;br /&gt;
|-&lt;br /&gt;
| 0x2C || UInt16 || &#039;&#039;&#039;Position Index Width&#039;&#039;&#039; (&#039;&#039;&#039;PIW&#039;&#039;&#039;) in bits.&lt;br /&gt;
|-&lt;br /&gt;
| 0x2E || UInt16 || &#039;&#039;&#039;Rotation Value Width&#039;&#039;&#039; (&#039;&#039;&#039;PVW&#039;&#039;&#039;) in bits per component.&lt;br /&gt;
|-&lt;br /&gt;
| 0x30 || UInt16 || &#039;&#039;&#039;Rotation Index Width&#039;&#039;&#039; (&#039;&#039;&#039;RIW&#039;&#039;&#039;) in bits.&lt;br /&gt;
|-&lt;br /&gt;
| 0x32 || UInt16 || &#039;&#039;&#039;Scale Value Width&#039;&#039;&#039; (&#039;&#039;&#039;SVW&#039;&#039;&#039;) in bits per component.&lt;br /&gt;
|-&lt;br /&gt;
| 0x34 || UInt16 || &#039;&#039;&#039;Scale Index Width&#039;&#039;&#039; (&#039;&#039;&#039;SIW&#039;&#039;&#039;) in bits.&lt;br /&gt;
|-&lt;br /&gt;
| 0x36 || UInt16 || {{unknown-left|&#039;&#039;&#039;Unknown&#039;&#039;&#039;. Maybe padding?}}&lt;br /&gt;
|-&lt;br /&gt;
| 0x38 || Int32 || &#039;&#039;&#039;Position Value Stream offset&#039;&#039;&#039; (&#039;&#039;&#039;PVO&#039;&#039;&#039;), relative to the Axis Data section.&lt;br /&gt;
|-&lt;br /&gt;
| 0x3C || Int32 || &#039;&#039;&#039;Rotation Value Stream offset&#039;&#039;&#039; (&#039;&#039;&#039;RVO&#039;&#039;&#039;), relative to the Axis Data section.&lt;br /&gt;
|-&lt;br /&gt;
| 0x40 || Int32 || &#039;&#039;&#039;Scale Value Stream offset&#039;&#039;&#039; (&#039;&#039;&#039;SVO&#039;&#039;&#039;), relative to the Axis Data section.&lt;br /&gt;
|-&lt;br /&gt;
| 0x44 || colspan=2 {{unknown|End of header}}&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Skeleton Tree ==&lt;br /&gt;
This section defines the hierarchy of the bones, and it&#039;s always 2 * (&#039;&#039;&#039;B&#039;&#039;&#039; + 1) in length. The first entry corresponds to a default root bone and its parent index is always 0xFFFF (no parent).&lt;br /&gt;
&lt;br /&gt;
{|class=wikitable&lt;br /&gt;
! Offset !! Type !! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x00 || UInt16[&#039;&#039;&#039;B&#039;&#039;&#039; + 1] || &#039;&#039;&#039;Parent bone indices&#039;&#039;&#039; for each bone.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Axis Data ==&lt;br /&gt;
This entire section defines up to three channels (position, rotation and scale), each with its own index bit width and value bit width.&lt;br /&gt;
&lt;br /&gt;
{|class=wikitable&lt;br /&gt;
! Offset !! Size !! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x00 || Ceiling(&#039;&#039;&#039;I&#039;&#039;&#039; * &#039;&#039;&#039;F&#039;&#039;&#039; / 32) * 4 || &#039;&#039;&#039;Index Bitstream&#039;&#039;&#039;. For frame &#039;&#039;&#039;F&#039;&#039;&#039;, the bit cursor starts at &#039;&#039;&#039;I&#039;&#039;&#039; * &#039;&#039;&#039;F&#039;&#039;&#039;. Then for each bone in order, read unsigned bits for its keyframe indices in the order &#039;&#039;&#039;PIW&#039;&#039;&#039; + &#039;&#039;&#039;RIW&#039;&#039;&#039; + &#039;&#039;&#039;SIW&#039;&#039;&#039; (this last one skipped if identity scale mode is set in the header).&amp;lt;br&amp;gt;&lt;br /&gt;
Bits are packed with no padding between bones or channels, and multiple bones can share the same index. The end position is aligned by 4.&lt;br /&gt;
|-&lt;br /&gt;
| 0x00 + &#039;&#039;&#039;PVO&#039;&#039;&#039; || Variable || &#039;&#039;&#039;Position Value Stream&#039;&#039;&#039;. A sequence of XYZ signed entries (&#039;&#039;&#039;PVW&#039;&#039;&#039; bits per component). Entry &#039;&#039;&#039;K&#039;&#039;&#039; starts at bit offset &#039;&#039;&#039;K&#039;&#039;&#039; * 3 * &#039;&#039;&#039;PVW&#039;&#039;&#039; within this stream. Same coordinate scale as [[DKRDS Model]]&#039;s vertex positions.&lt;br /&gt;
|-&lt;br /&gt;
| 0x00 + &#039;&#039;&#039;RVO&#039;&#039;&#039; || Variable || &#039;&#039;&#039;Rotation Value Stream&#039;&#039;&#039;. Same layout as the Position Value Stream, using &#039;&#039;&#039;RVW&#039;&#039;&#039; instead of &#039;&#039;&#039;PVW&#039;&#039;&#039;. A full rotation equals 2^&#039;&#039;&#039;RVW&#039;&#039;&#039;; each component is a plain signed angle in units of 1/2^&#039;&#039;&#039;RVW&#039;&#039;&#039; of a full rotation.&lt;br /&gt;
|-&lt;br /&gt;
| 0x00 + &#039;&#039;&#039;SVO&#039;&#039;&#039; || Variable || &#039;&#039;&#039;Scale Value Stream&#039;&#039;&#039;. Same layout as the two previous streams. Final values are divided by 4096. Not present when identity scale mode is set in the header.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
= Tools =&lt;br /&gt;
The following tools can handle DKRDS Interactor:&lt;br /&gt;
* (none)&lt;br /&gt;
&lt;br /&gt;
[[Category:Diddy Kong Racing DS File Formats]]&lt;/div&gt;</summary>
		<author><name>Atlas</name></author>
	</entry>
	<entry>
		<id>https://wiki.wexosmk.xyz/index.php?title=DKRDS_Interactor&amp;diff=695</id>
		<title>DKRDS Interactor</title>
		<link rel="alternate" type="text/html" href="https://wiki.wexosmk.xyz/index.php?title=DKRDS_Interactor&amp;diff=695"/>
		<updated>2026-07-15T12:30:25Z</updated>

		<summary type="html">&lt;p&gt;Atlas: Redirected page to DKRDS Interactor (File Format)&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;#REDIRECT [[DKRDS Interactor (File Format)]]&lt;/div&gt;</summary>
		<author><name>Atlas</name></author>
	</entry>
	<entry>
		<id>https://wiki.wexosmk.xyz/index.php?title=DKRDS_Interactor_(File_Format)&amp;diff=694</id>
		<title>DKRDS Interactor (File Format)</title>
		<link rel="alternate" type="text/html" href="https://wiki.wexosmk.xyz/index.php?title=DKRDS_Interactor_(File_Format)&amp;diff=694"/>
		<updated>2026-07-15T12:30:12Z</updated>

		<summary type="html">&lt;p&gt;Atlas: Created page with &amp;quot;{{under-construction}} &amp;#039;&amp;#039;&amp;#039;DKRDS Interactor&amp;#039;&amp;#039;&amp;#039; is the nameless file format used in &amp;#039;&amp;#039;[https://en.wikipedia.org/wiki/Diddy_Kong_Racing_DS Diddy Kong Racing DS]&amp;#039;&amp;#039; that stores a model&amp;#039;s bone hierarchy and indexed keyframe poses for each bone. Bones defined here are referenced by ID from a corresponding DKRDS Model file&amp;#039;s vertex data. Its type identifier in assets.bin is &amp;#039;&amp;#039;&amp;#039;0x2E&amp;#039;&amp;#039;&amp;#039;.  = File Format = The file byte order is always little endian.  == Header == The file s...&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{under-construction}}&lt;br /&gt;
&#039;&#039;&#039;DKRDS Interactor&#039;&#039;&#039; is the nameless file format used in &#039;&#039;[https://en.wikipedia.org/wiki/Diddy_Kong_Racing_DS Diddy Kong Racing DS]&#039;&#039; that stores a model&#039;s bone hierarchy and indexed keyframe poses for each bone. Bones defined here are referenced by ID from a corresponding [[DKRDS Model]] file&#039;s vertex data. Its type identifier in [[assets.bin]] is &#039;&#039;&#039;0x2E&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
= File Format =&lt;br /&gt;
The file byte order is always little endian.&lt;br /&gt;
&lt;br /&gt;
== Header ==&lt;br /&gt;
The file starts with a header that is 68 bytes long.&lt;br /&gt;
&lt;br /&gt;
{|class=wikitable&lt;br /&gt;
! Offset !! Type !! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x00 || UInt16 || &#039;&#039;&#039;Mode flags&#039;&#039;&#039;. &#039;&#039;&#039;AXXX XXXX XXXX XXBB&#039;&#039;&#039;:&lt;br /&gt;
* &#039;&#039;&#039;A&#039;&#039;&#039;: &#039;&#039;&#039;Identity scale&#039;&#039;&#039;. When set, the scale channel is skipped and every bone&#039;s scale is set to 1.&lt;br /&gt;
* &#039;&#039;&#039;B&#039;&#039;&#039;: &#039;&#039;&#039;Decode mode&#039;&#039;&#039;. Unknown exact usage. The format described here is documented from files that use mode 2.&lt;br /&gt;
|-&lt;br /&gt;
| 0x02 || UInt16 || {{unknown-left|&#039;&#039;&#039;Unknown&#039;&#039;&#039;.}}&lt;br /&gt;
|-&lt;br /&gt;
| 0x04 || Int32 || {{unknown-left|&#039;&#039;&#039;Unknown&#039;&#039;&#039;.}}&lt;br /&gt;
|-&lt;br /&gt;
| 0x08 || Int32 || {{unknown-left|&#039;&#039;&#039;Unknown&#039;&#039;&#039;.}}&lt;br /&gt;
|-&lt;br /&gt;
| 0x0C || Int32 || &#039;&#039;&#039;Number of bones&#039;&#039;&#039; (&#039;&#039;&#039;B&#039;&#039;&#039;).&lt;br /&gt;
|-&lt;br /&gt;
| 0x10 || Int32 || &#039;&#039;&#039;[[#Skeleton Tree|Skeleton Tree]]&#039;&#039;&#039; offset.&lt;br /&gt;
|-&lt;br /&gt;
| 0x14 || Int32 || {{unknown-left|&#039;&#039;&#039;Unknown&#039;&#039;&#039;. Number of bones again?}}&lt;br /&gt;
|-&lt;br /&gt;
| 0x18 || Int32 || {{unknown-left|&#039;&#039;&#039;Unknown&#039;&#039;&#039;.}}&lt;br /&gt;
|-&lt;br /&gt;
| 0x1C || Int32 || &#039;&#039;&#039;Number of frames&#039;&#039;&#039; (&#039;&#039;&#039;F&#039;&#039;&#039;).&lt;br /&gt;
|-&lt;br /&gt;
| 0x20 || Int32 || {{unknown-left|&#039;&#039;&#039;Unknown&#039;&#039;&#039;.}}&lt;br /&gt;
|-&lt;br /&gt;
| 0x24 || Int32 || &#039;&#039;&#039;[[#Axis Data|Axis Data]]&#039;&#039;&#039; offset, relative to 0x2.&lt;br /&gt;
|-&lt;br /&gt;
| 0x28 || UInt16 || &#039;&#039;&#039;Bits per frame&#039;&#039;&#039; (&#039;&#039;&#039;I&#039;&#039;&#039;). Total size in bits of one frame&#039;s worth of keyframe index data across all bones (&#039;&#039;&#039;B&#039;&#039;&#039; * (&#039;&#039;&#039;PIW&#039;&#039;&#039; + &#039;&#039;&#039;RIW&#039;&#039;&#039; + &#039;&#039;&#039;SIW&#039;&#039;&#039;)).&lt;br /&gt;
|-&lt;br /&gt;
| 0x2A || UInt16 || &#039;&#039;&#039;Position Value Width&#039;&#039;&#039; (&#039;&#039;&#039;PVW&#039;&#039;&#039;) in bits per component.&lt;br /&gt;
|-&lt;br /&gt;
| 0x2C || UInt16 || &#039;&#039;&#039;Position Index Width&#039;&#039;&#039; (&#039;&#039;&#039;PIW&#039;&#039;&#039;) in bits.&lt;br /&gt;
|-&lt;br /&gt;
| 0x2E || UInt16 || &#039;&#039;&#039;Rotation Value Width&#039;&#039;&#039; (&#039;&#039;&#039;PVW&#039;&#039;&#039;) in bits per component.&lt;br /&gt;
|-&lt;br /&gt;
| 0x30 || UInt16 || &#039;&#039;&#039;Rotation Index Width&#039;&#039;&#039; (&#039;&#039;&#039;RIW&#039;&#039;&#039;) in bits.&lt;br /&gt;
|-&lt;br /&gt;
| 0x32 || UInt16 || &#039;&#039;&#039;Scale Value Width&#039;&#039;&#039; (&#039;&#039;&#039;SVW&#039;&#039;&#039;) in bits per component.&lt;br /&gt;
|-&lt;br /&gt;
| 0x34 || UInt16 || &#039;&#039;&#039;Scale Index Width&#039;&#039;&#039; (&#039;&#039;&#039;SIW&#039;&#039;&#039;) in bits.&lt;br /&gt;
|-&lt;br /&gt;
| 0x36 || UInt16 || {{unknown-left|&#039;&#039;&#039;Unknown&#039;&#039;&#039;. Maybe padding?}}&lt;br /&gt;
|-&lt;br /&gt;
| 0x38 || Int32 || &#039;&#039;&#039;Position Value Stream offset&#039;&#039;&#039; (&#039;&#039;&#039;PVO&#039;&#039;&#039;), relative to the Axis Data section.&lt;br /&gt;
|-&lt;br /&gt;
| 0x3C || Int32 || &#039;&#039;&#039;Rotation Value Stream offset&#039;&#039;&#039; (&#039;&#039;&#039;RVO&#039;&#039;&#039;), relative to the Axis Data section.&lt;br /&gt;
|-&lt;br /&gt;
| 0x40 || Int32 || &#039;&#039;&#039;Scale Value Stream offset&#039;&#039;&#039; (&#039;&#039;&#039;SVO&#039;&#039;&#039;), relative to the Axis Data section.&lt;br /&gt;
|-&lt;br /&gt;
| 0x44 || colspan=2 {{unknown|End of header}}&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Skeleton Tree ==&lt;br /&gt;
This section defines the hierarchy of the bones, and it&#039;s always 2 * (&#039;&#039;&#039;B&#039;&#039;&#039; + 1) in length. The first entry corresponds to a default root bone and its parent index is always 0xFFFF (no parent).&lt;br /&gt;
&lt;br /&gt;
{|class=wikitable&lt;br /&gt;
! Offset !! Type !! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x00 || UInt16[&#039;&#039;&#039;B&#039;&#039;&#039; + 1] || &#039;&#039;&#039;Parent bone indices&#039;&#039;&#039; for each bone.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Axis Data ==&lt;br /&gt;
This entire section defines up to three channels (position, rotation and scale), each with its own index bit width and value bit width.&lt;br /&gt;
&lt;br /&gt;
{|class=wikitable&lt;br /&gt;
! Offset !! Size !! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x00 || Ceiling(&#039;&#039;&#039;I&#039;&#039;&#039; * &#039;&#039;&#039;F&#039;&#039;&#039; / 32) * 4 || &#039;&#039;&#039;Index Bitstream&#039;&#039;&#039;. For frame &#039;&#039;&#039;F&#039;&#039;&#039;, the bit cursor starts at &#039;&#039;&#039;I&#039;&#039;&#039; * &#039;&#039;&#039;F&#039;&#039;&#039;. Then for each bone in order, read unsigned bits for its keyframe indices in the order &#039;&#039;&#039;PIW&#039;&#039;&#039; + &#039;&#039;&#039;RIW&#039;&#039;&#039; + &#039;&#039;&#039;SIW&#039;&#039;&#039; (this last one skipped if identity scale mode is set in the header).&amp;lt;br&amp;gt;&lt;br /&gt;
Bits are packed with no padding between bones or channels, and multiple bones can share the same index. The end position is aligned by 4.&lt;br /&gt;
|-&lt;br /&gt;
| 0x00 + &#039;&#039;&#039;PVO&#039;&#039;&#039; || Variable || &#039;&#039;&#039;Position Value Stream&#039;&#039;&#039;. A sequence of XYZ signed entries (&#039;&#039;&#039;PVW&#039;&#039;&#039; bits per component). Entry &#039;&#039;&#039;K&#039;&#039;&#039; starts at bit offset &#039;&#039;&#039;K&#039;&#039;&#039; * 3 * &#039;&#039;&#039;PVW&#039;&#039;&#039; within this stream. Same coordinate scale as [[DKRDS Model]]&#039;s vertex positions.&lt;br /&gt;
|-&lt;br /&gt;
| 0x00 + &#039;&#039;&#039;RVO&#039;&#039;&#039; || Variable || &#039;&#039;&#039;Rotation Value Stream&#039;&#039;&#039;. Same layout as the Position Value Stream, using &#039;&#039;&#039;RVW&#039;&#039;&#039; instead of &#039;&#039;&#039;PVW&#039;&#039;&#039;. A full rotation equals 2^&#039;&#039;&#039;RVW&#039;&#039;&#039;; each component is a plain signed angle in units of 1/2^&#039;&#039;&#039;RVW&#039;&#039;&#039; of a full rotation.&lt;br /&gt;
|-&lt;br /&gt;
| 0x00 + &#039;&#039;&#039;SVO&#039;&#039;&#039; || Variable || &#039;&#039;&#039;Scale Value Stream&#039;&#039;&#039;. Same layout as the two previous streams. Final values are divided by 4096. Not present when identity scale mode is set in the header.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
= Tools =&lt;br /&gt;
The following tools can handle DKRDS Interactor:&lt;br /&gt;
* (none)&lt;br /&gt;
&lt;br /&gt;
[[Category:Diddy Kong Racing DS File Formats]]&lt;/div&gt;</summary>
		<author><name>Atlas</name></author>
	</entry>
	<entry>
		<id>https://wiki.wexosmk.xyz/index.php?title=DKRDS_Track_(File_Format)&amp;diff=693</id>
		<title>DKRDS Track (File Format)</title>
		<link rel="alternate" type="text/html" href="https://wiki.wexosmk.xyz/index.php?title=DKRDS_Track_(File_Format)&amp;diff=693"/>
		<updated>2026-06-18T18:39:27Z</updated>

		<summary type="html">&lt;p&gt;Atlas: /* Triangle Entry */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&#039;&#039;&#039;DKRDS Track&#039;&#039;&#039; is the nameless file format used in &#039;&#039;[https://en.wikipedia.org/wiki/Diddy_Kong_Racing_DS Diddy Kong Racing DS]&#039;&#039; that stores the tracks&#039; section models, collision and textures. Its type identifier in [[assets.bin]] is &#039;&#039;&#039;0x9A&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
= File Format =&lt;br /&gt;
The file byte order is always little endian.&lt;br /&gt;
&lt;br /&gt;
== Header ==&lt;br /&gt;
The file starts with a header that is 56 bytes long.&lt;br /&gt;
&lt;br /&gt;
{|class=wikitable&lt;br /&gt;
! Offset !! Type !! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x00 || Int32 || &#039;&#039;&#039;Number of sections&#039;&#039;&#039; (&#039;&#039;&#039;N&#039;&#039;&#039;).&lt;br /&gt;
|-&lt;br /&gt;
| 0x04 || Int32 || &#039;&#039;&#039;[[#Track Section Group|Track Section Group]]&#039;&#039;&#039; offset.&lt;br /&gt;
|-&lt;br /&gt;
| 0x08 || Int32 || &#039;&#039;&#039;[[#Terrain Effects|Terrain Effects]]&#039;&#039;&#039; offset.&lt;br /&gt;
|-&lt;br /&gt;
| 0x0C || Byte[4] || {{unknown-left|&#039;&#039;&#039;Unknown&#039;&#039;&#039;. Always 0xCCCCCCCC.}}&lt;br /&gt;
|-&lt;br /&gt;
| 0x10 || Int32 || &#039;&#039;&#039;[[#Culling Groups|Culling Groups]]&#039;&#039;&#039; offset.&lt;br /&gt;
|-&lt;br /&gt;
| 0x14 || Int32 || &#039;&#039;&#039;[[#Culling Groups|Culling Groups]]&#039;&#039;&#039; data type:&lt;br /&gt;
* 1 = 4-byte per &#039;&#039;&#039;N&#039;&#039;&#039; group.&lt;br /&gt;
* 2 = 8-byte per &#039;&#039;&#039;N&#039;&#039;&#039; group.&lt;br /&gt;
|-&lt;br /&gt;
| 0x18 || Int32 || &#039;&#039;&#039;Number of textures&#039;&#039;&#039; (&#039;&#039;&#039;X&#039;&#039;&#039;).&lt;br /&gt;
|-&lt;br /&gt;
| 0x1C || Int32 || &#039;&#039;&#039;[[#Texture Group|Texture Group]]&#039;&#039;&#039; offset.&lt;br /&gt;
|-&lt;br /&gt;
| 0x20 || Int32 || &#039;&#039;&#039;[[#Culling BSP Tree|Culling BSP Tree]]&#039;&#039;&#039; offset.&lt;br /&gt;
|-&lt;br /&gt;
| 0x24 || Int32 || &#039;&#039;&#039;[[#Wish Race Unknown Section|Wish Race Unknown Section]]&#039;&#039;&#039; entry count.&lt;br /&gt;
|-&lt;br /&gt;
| 0x28 || Int32 || &#039;&#039;&#039;[[#Wish Race Unknown Section|Wish Race Unknown Section]]&#039;&#039;&#039; offset.&lt;br /&gt;
|-&lt;br /&gt;
| 0x2C || Byte[4] || {{unknown-left|&#039;&#039;&#039;Unknown&#039;&#039;&#039;. Seems to be some kind of flags.}}&lt;br /&gt;
|-&lt;br /&gt;
| 0x30 || Int32 || {{unknown-left|&#039;&#039;&#039;Unknown&#039;&#039;&#039;.}}&lt;br /&gt;
|-&lt;br /&gt;
| 0x34 || Int32 || &#039;&#039;&#039;File size&#039;&#039;&#039;.&lt;br /&gt;
|-&lt;br /&gt;
| 0x38 || colspan=2 {{unknown|End of header}}&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Track Section Group ==&lt;br /&gt;
This group starts with a list of &#039;&#039;&#039;N&#039;&#039;&#039; offsets.&lt;br /&gt;
&lt;br /&gt;
{|class=wikitable&lt;br /&gt;
|+ Track Section Header&lt;br /&gt;
! Offset !! Type !! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x00 || Int32[&#039;&#039;&#039;N&#039;&#039;&#039;] || &#039;&#039;&#039;[[#Track Section Entry|Track Section Entry]]&#039;&#039;&#039; offsets. Relative to the start of this group.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Track Section Entry ===&lt;br /&gt;
Every section entry defines model and collision data. The entry starts with a 32-byte header. All offsets are relative to the start of this entry.&lt;br /&gt;
&lt;br /&gt;
{|class=wikitable&lt;br /&gt;
|+ Track Section Entry Header&lt;br /&gt;
! Offset !! Type !! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x00 || Byte || &#039;&#039;&#039;Main collision attribute mask&#039;&#039;&#039;. This is an OR of all of the main collision attribute values for all polygon groups in this section.&lt;br /&gt;
|-&lt;br /&gt;
| 0x01 || Byte || &#039;&#039;&#039;Secondary collision attribute mask&#039;&#039;&#039;. This is an OR of all of the secondary collision attribute values for all polygon groups in this section.&lt;br /&gt;
|-&lt;br /&gt;
| 0x02 || UInt16 || &#039;&#039;&#039;Tertiary collision attribute mask&#039;&#039;&#039;. This is an OR of all of the tertiary collision attribute values for all polygon groups in this section.&lt;br /&gt;
|-&lt;br /&gt;
| 0x04 || UInt16 || &#039;&#039;&#039;Number of polygon groups&#039;&#039;&#039; (&#039;&#039;&#039;P&#039;&#039;&#039;).&lt;br /&gt;
|-&lt;br /&gt;
| 0x06 || UInt16 || &#039;&#039;&#039;Number of vertices&#039;&#039;&#039; in [[#Track Section Vertex Data|Track Section Vertex Data]] (&#039;&#039;&#039;V&#039;&#039;&#039;).&lt;br /&gt;
|-&lt;br /&gt;
| 0x08 || UInt16 || &#039;&#039;&#039;Number of UVs&#039;&#039;&#039; in [[#Track Section UV Data|Track Section UV Data]] (&#039;&#039;&#039;U&#039;&#039;&#039;).&lt;br /&gt;
|-&lt;br /&gt;
| 0x0A || UInt16 || &#039;&#039;&#039;Number of colors&#039;&#039;&#039; in [[#Track Section Color Data|Track Section Color Data]] (&#039;&#039;&#039;C&#039;&#039;&#039;).&lt;br /&gt;
|-&lt;br /&gt;
| 0x0C || Int32 || &#039;&#039;&#039;[[#Track Section Triangle Data|Track Section Triangle Data]]&#039;&#039;&#039; offset.&lt;br /&gt;
|-&lt;br /&gt;
| 0x10 || Int32 || &#039;&#039;&#039;[[#Track Section Collision Data|Track Section Collision Data]]&#039;&#039;&#039; offset.&lt;br /&gt;
|-&lt;br /&gt;
| 0x14 || Int32 || &#039;&#039;&#039;[[#Track Section Vertex Data|Track Section Vertex Data]]&#039;&#039;&#039; offset.&lt;br /&gt;
|-&lt;br /&gt;
| 0x18 || Int32 || &#039;&#039;&#039;[[#Track Section UV Data|Track Section UV Data]]&#039;&#039;&#039; offset.&lt;br /&gt;
|-&lt;br /&gt;
| 0x1C || Int32 || &#039;&#039;&#039;[[#Track Section Color Data|Track Section Color Data]]&#039;&#039;&#039; offset.&lt;br /&gt;
|-&lt;br /&gt;
| 0x20 || colspan=2 {{unknown|End of header, start of [[#Track Section Data|Track Section Data]]}}&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== Track Section Data ====&lt;br /&gt;
This data follows directly after the header of the section entry and starts with a 76-byte header.&lt;br /&gt;
&lt;br /&gt;
{|class=wikitable&lt;br /&gt;
! Offset !! Type !! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x00 || Int32 || {{unknown-left|&#039;&#039;&#039;Unknown&#039;&#039;&#039;. Seems to be always 0xFFFFFFFF and set to an address when loaded in memory.}}&lt;br /&gt;
|-&lt;br /&gt;
| 0x04 || Int32[3] || &#039;&#039;&#039;Collision XYZ offset&#039;&#039;&#039;.&lt;br /&gt;
|-&lt;br /&gt;
| 0x10 || Int32[3] || &#039;&#039;&#039;Visual model XYZ offset&#039;&#039;&#039;. The units are not the same as the collision offset.&lt;br /&gt;
|-&lt;br /&gt;
| 0x1C || [[#Track Section AABB|Track Section AABB]][2] || &#039;&#039;&#039;AABB areas&#039;&#039;&#039; of the entire section used for collision detection. The second AABB always seems to be a duplicate of the first.&lt;br /&gt;
|-&lt;br /&gt;
| 0x4C || colspan=2 {{unknown|End of header, start of [[#Track Section Polygon Data|Track Section Polygon Data]]}}&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
===== Track Section AABB =====&lt;br /&gt;
Track sections contain 2 identical AABB areas each. It is unknown why there&#039;s a duplicate, perhaps used during runtime after object space transform. All values need to be divided by 64 in order to obtain the absolute position data and match with the visual models.&lt;br /&gt;
&lt;br /&gt;
{|class=wikitable&lt;br /&gt;
! Offset !! Type !! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x00 || Int32[3] || &#039;&#039;&#039;AABB minimum XYZ position&#039;&#039;&#039;.&lt;br /&gt;
|-&lt;br /&gt;
| 0x0C || Int32[3] || &#039;&#039;&#039;AABB XYZ extent&#039;&#039;&#039;.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
===== Track Section Polygon Data =====&lt;br /&gt;
This section seems to store &#039;&#039;&#039;P&#039;&#039;&#039; polygon groups&#039; attributes.&lt;br /&gt;
&lt;br /&gt;
{|class=wikitable&lt;br /&gt;
! Offset !! Type !! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x00 || [[#Polygon Group Entry|Polygon Group Entry]][&#039;&#039;&#039;P&#039;&#039;&#039;] || &#039;&#039;&#039;Polygon group entries&#039;&#039;&#039;.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
====== Polygon Group Entry ======&lt;br /&gt;
Each polygon group entry is 12 bytes long.&lt;br /&gt;
&lt;br /&gt;
{|class=wikitable&lt;br /&gt;
! Offset !! Type !! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x00 || UInt16 || &#039;&#039;&#039;First triangle ID&#039;&#039;&#039;.&lt;br /&gt;
|-&lt;br /&gt;
| 0x02 || UInt16 || &#039;&#039;&#039;Number of triangles&#039;&#039;&#039;.&lt;br /&gt;
|-&lt;br /&gt;
| 0x04 || Byte || &#039;&#039;&#039;Main collision attribute&#039;&#039;&#039;. &#039;&#039;&#039;AAAA BBBB&#039;&#039;&#039;:&lt;br /&gt;
* &#039;&#039;&#039;A&#039;&#039;&#039;: &#039;&#039;&#039;Shadow level&#039;&#039;&#039;. The higher the value, the darker the character gets.&lt;br /&gt;
* &#039;&#039;&#039;B&#039;&#039;&#039;: &#039;&#039;&#039;Collision flag&#039;&#039;&#039;:&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! ID !! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x01 || Road and effects.&lt;br /&gt;
|-&lt;br /&gt;
| 0x05 || Wall (sparks on collision).&lt;br /&gt;
|-&lt;br /&gt;
| 0x08 || Special effects (turns off visual model).&lt;br /&gt;
|-&lt;br /&gt;
| 0x0C || Invisible wall (no sparks on collision, turns off visual model).&lt;br /&gt;
|}&lt;br /&gt;
|-&lt;br /&gt;
| 0x05 || Byte || &#039;&#039;&#039;Secondary collision attribute&#039;&#039;&#039;:&lt;br /&gt;
* &#039;&#039;&#039;Main flag = 0x01&#039;&#039;&#039;:&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! ID !! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x00 || Special effect? Used for water.&lt;br /&gt;
|-&lt;br /&gt;
| 0x01 || Pass through/no effect.&lt;br /&gt;
|-&lt;br /&gt;
| 0x04 || Road.&lt;br /&gt;
|}&lt;br /&gt;
* &#039;&#039;&#039;Main flag = 0x08&#039;&#039;&#039;:&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! ID !! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x00 || Invisible wall (no sparks on collision).&lt;br /&gt;
|-&lt;br /&gt;
| 0x01 || Water.&lt;br /&gt;
|}&lt;br /&gt;
|-&lt;br /&gt;
| 0x06 || UInt16 || &#039;&#039;&#039;Tertiary collision attribute&#039;&#039;&#039;. Split in bits.&lt;br /&gt;
* &#039;&#039;&#039;Main flag = 0x01&#039;&#039;&#039;:&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! ID !! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x01 || {{unknown-left|&#039;&#039;&#039;Unknown&#039;&#039;&#039;. Used in non-collideable stuff.}}&lt;br /&gt;
|-&lt;br /&gt;
| 0x02 || Water, inflates tires in car.&lt;br /&gt;
|-&lt;br /&gt;
| 0x10 || {{unknown-left|&#039;&#039;&#039;Unknown&#039;&#039;&#039;. Used in non-collideable stuff.}}&lt;br /&gt;
|-&lt;br /&gt;
| 0x20 || {{unknown-left|&#039;&#039;&#039;Unknown&#039;&#039;&#039;. Used in non-collideable stuff.}}&lt;br /&gt;
|-&lt;br /&gt;
| 0x60 || {{unknown-left|&#039;&#039;&#039;Unknown&#039;&#039;&#039;. Used in non-collideable stuff.}}&lt;br /&gt;
|}&lt;br /&gt;
* &#039;&#039;&#039;Main flag = 0x08&#039;&#039;&#039;:&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! ID !! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x30 || {{unknown-left|&#039;&#039;&#039;Unknown&#039;&#039;&#039;. Used in non-collideable stuff.}}&lt;br /&gt;
|}&lt;br /&gt;
* &#039;&#039;&#039;Main flag = 0x0C&#039;&#039;&#039;:&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! ID !! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x04 || Ignore when using plane.&lt;br /&gt;
|}&lt;br /&gt;
|-&lt;br /&gt;
| 0x08 || Byte[4] || &#039;&#039;&#039;Collision grid mask&#039;&#039;&#039;. This is an OR of all of the [[#Track Section Collision Data|collision grids]] for all triangles in this group.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The number of triangles &#039;&#039;&#039;T&#039;&#039;&#039; can be calculated by adding the first triangle ID to the number of triangles of the last polygon group entry.&lt;br /&gt;
&lt;br /&gt;
===== Track Section Triangle Data =====&lt;br /&gt;
This section stores &#039;&#039;&#039;T&#039;&#039;&#039; triangle entries.&lt;br /&gt;
&lt;br /&gt;
{|class=wikitable&lt;br /&gt;
! Offset !! Type !! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x00 || [[#Triangle Entry|Triangle Entry]][&#039;&#039;&#039;T&#039;&#039;&#039;] || &#039;&#039;&#039;Triangle entries&#039;&#039;&#039;.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
====== Triangle Entry ======&lt;br /&gt;
Each triangle entry is 20 bytes long.&lt;br /&gt;
&lt;br /&gt;
{|class=wikitable&lt;br /&gt;
! Offset !! Type !! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x00 || UInt16 || &#039;&#039;&#039;Attribute flags&#039;&#039;&#039;. &#039;&#039;&#039;AAAA AAAA AAAA AAAB&#039;&#039;&#039;:&lt;br /&gt;
* &#039;&#039;&#039;A&#039;&#039;&#039;: &#039;&#039;&#039;Texture ID&#039;&#039;&#039;.&lt;br /&gt;
* &#039;&#039;&#039;B&#039;&#039;&#039;: &#039;&#039;&#039;Dominant normal direction sign&#039;&#039;&#039; used for collision detection. Calculated in the following way:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
bool ComputeNormalSign(Vector3 v0, Vector3 v1, Vector3 v2)&lt;br /&gt;
{&lt;br /&gt;
    Vector3 n = Vector3.Cross(v1 - v0, v2 - v0);&lt;br /&gt;
&lt;br /&gt;
    int ax = (int)Math.Abs(n.X);&lt;br /&gt;
    int ay = (int)Math.Abs(n.Y);&lt;br /&gt;
    int az = (int)Math.Abs(n.Z);&lt;br /&gt;
&lt;br /&gt;
    if (ax &amp;gt;= ay &amp;amp;&amp;amp; ax &amp;gt;= az)&lt;br /&gt;
        return n.X &amp;gt; 0;&lt;br /&gt;
&lt;br /&gt;
    if (az &amp;gt;= ay &amp;amp;&amp;amp; az &amp;gt;= ax)&lt;br /&gt;
        return n.Z &amp;gt; 0;&lt;br /&gt;
&lt;br /&gt;
    return n.Y &amp;lt; 0;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt; &lt;br /&gt;
|-&lt;br /&gt;
| 0x02 || UInt16[3] || &#039;&#039;&#039;Face XYZ normals&#039;&#039;&#039;. Values need to be divided by 4096.&lt;br /&gt;
|-&lt;br /&gt;
| 0x08 || Byte[4] || &#039;&#039;&#039;Vertex position indices&#039;&#039;&#039;. The index for each of the 3 vertices is 10 bits long. 2 last bits are unknown.&lt;br /&gt;
|-&lt;br /&gt;
| 0x0C || Byte[4] || &#039;&#039;&#039;UV indices&#039;&#039;&#039;. The index for each of the 3 vertices is 10 bits long. 2 last bits are unknown.&lt;br /&gt;
|-&lt;br /&gt;
| 0x10 || Byte[4] || &#039;&#039;&#039;Color indices&#039;&#039;&#039;. The index for each of the 3 vertices is 10 bits long. 2 last bits are unknown.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
===== Track Section Collision Data =====&lt;br /&gt;
Each triangle corresponds to a 4-byte set of values to help with collision detection. These values encode local X, Y and Z coordinates that form a grid of cells inside the section&#039;s AABB.&lt;br /&gt;
&lt;br /&gt;
{|class=wikitable&lt;br /&gt;
! Offset !! Type !! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x00 || Byte || &#039;&#039;&#039;Y occupancy&#039;&#039;&#039;. Values correspond to 8 cells of the AABB (AABB&#039;s Y extent / 8).&lt;br /&gt;
|-&lt;br /&gt;
| 0x01 || Byte || &#039;&#039;&#039;Z occupancy&#039;&#039;&#039;. Values correspond to 8 cells of the AABB (AABB&#039;s Z extent / 8).&lt;br /&gt;
|-&lt;br /&gt;
| 0x02 || UInt16 || &#039;&#039;&#039;X occupancy&#039;&#039;&#039;. Values correspond to 16 cells of the AABB (AABB&#039;s X extent / 16).&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The following ARM assembly instructions (@01FF95D0 from the game&#039;s code) demonstrate how the vehicle&#039;s current grid bitmask is compared to the current testing triangle&#039;s collision:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
AND R0, R0, R5 // R0 = triangle&#039;s collision value AND vehicle&#039;s bitmask&lt;br /&gt;
TST R0, #FF // test byte 0 (Y)&lt;br /&gt;
TSTNE R0, #FF00 // if nonzero, test byte 1 (Z)&lt;br /&gt;
MOVNES R0, R0, LSR #10 // if still nonzero, test upper 16 bits (X)&lt;br /&gt;
MOVNE R0, #1 // collidable only if ALL 3 are nonzero&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The following functions in C# compute a triangle&#039;s collision grid from its minimum and maximum positions and its containing section&#039;s AABB:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
uint ComputeCollision(float xMin, float xMax, float yMin, float yMax, float zMin, float zMax, float aabbXMin, float aabbXExt, float aabbYMin, float aabbYExt, float aabbZMin, float aabbZExt)&lt;br /&gt;
{&lt;br /&gt;
    if (aabbXExt &amp;lt;= 0 || aabbYExt &amp;lt;= 0 || aabbZExt &amp;lt;= 0)&lt;br /&gt;
        return 0xFFFFFFFFu;&lt;br /&gt;
&lt;br /&gt;
    uint xBits = ComputeCellBits(xMin - aabbXMin, xMax - aabbXMin, aabbXExt / 16f, 16);&lt;br /&gt;
    uint zBits = ComputeCellBits(zMin - aabbZMin, zMax - aabbZMin, aabbZExt / 8f, 8);&lt;br /&gt;
    uint yBits = ComputeCellBits(yMin - aabbYMin, yMax - aabbYMin, aabbYExt / 8f, 8);&lt;br /&gt;
&lt;br /&gt;
    return (xBits &amp;lt;&amp;lt; 16) | (zBits &amp;lt;&amp;lt; 8) | yBits;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
uint ComputeCellBits(float relMin, float relMax, float cellSize, int nrCells)&lt;br /&gt;
{&lt;br /&gt;
    const float Epsilon = 1e-4f;&lt;br /&gt;
    float faceMin = relMin / cellSize;&lt;br /&gt;
    float faceMax = relMax / cellSize;&lt;br /&gt;
&lt;br /&gt;
    // Special case for degenerate faces (flat faces with zero extent in this axis, e.g. a wall parallel to XZ)&lt;br /&gt;
    if (MathF.Abs(faceMax - faceMin) &amp;lt; Epsilon)&lt;br /&gt;
    {&lt;br /&gt;
        int cell = Math.Max(0, Math.Min(nrCells - 1, (int)MathF.Floor(faceMin)));&lt;br /&gt;
        bool atExact = MathF.Abs(faceMin - MathF.Round(faceMin)) &amp;lt; Epsilon;&lt;br /&gt;
        bool atMaxEdge = cell == nrCells - 1;&lt;br /&gt;
&lt;br /&gt;
        // Include the preceding cell only at an interior exact boundary&lt;br /&gt;
        if (atExact &amp;amp;&amp;amp; cell &amp;gt; 0 &amp;amp;&amp;amp; !atMaxEdge)&lt;br /&gt;
            return (1u &amp;lt;&amp;lt; cell) | (1u &amp;lt;&amp;lt; (cell - 1));&lt;br /&gt;
&lt;br /&gt;
        return 1u &amp;lt;&amp;lt; cell;&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    int cellMin = (int)MathF.Floor(faceMin);&lt;br /&gt;
    int cellMax = (int)MathF.Floor(faceMax - Epsilon); // Exact upper boundary stays in current cell&lt;br /&gt;
&lt;br /&gt;
    // Exact lower boundary stays in the preceding cell&lt;br /&gt;
    bool atExactLow = MathF.Abs(faceMin - MathF.Round(faceMin)) &amp;lt; Epsilon;&lt;br /&gt;
    bool atMaxLow = cellMin == nrCells - 1;&lt;br /&gt;
    if (atExactLow &amp;amp;&amp;amp; cellMin &amp;gt; 0 &amp;amp;&amp;amp; !atMaxLow)&lt;br /&gt;
        cellMin--;&lt;br /&gt;
&lt;br /&gt;
    cellMin = Math.Max(0, cellMin);&lt;br /&gt;
    cellMax = Math.Min(nrCells - 1, cellMax);&lt;br /&gt;
&lt;br /&gt;
    uint bits = 0;&lt;br /&gt;
&lt;br /&gt;
    for (int c = cellMin; c &amp;lt;= cellMax; c++)&lt;br /&gt;
        bits |= 1u &amp;lt;&amp;lt; c;&lt;br /&gt;
&lt;br /&gt;
    return bits;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===== Track Section Vertex Data =====&lt;br /&gt;
Vertex data is stored as 6-byte groups per entry &#039;&#039;&#039;V&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
{|class=wikitable&lt;br /&gt;
! Offset !! Type !! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x00 || Int16[3][&#039;&#039;&#039;V&#039;&#039;&#039;] || &#039;&#039;&#039;Vertex XYZ position&#039;&#039;&#039;.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
===== Track Section UV Data =====&lt;br /&gt;
UV data is stored as 4-byte groups per entry &#039;&#039;&#039;U&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
{|class=wikitable&lt;br /&gt;
! Offset !! Type !! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x00 || Int16[2][&#039;&#039;&#039;U&#039;&#039;&#039;] || &#039;&#039;&#039;Vertex UV position&#039;&#039;&#039;.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
===== Track Section Color Data =====&lt;br /&gt;
Color data is stored as 2-byte groups per entry &#039;&#039;&#039;C&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
{|class=wikitable&lt;br /&gt;
! Offset !! Type !! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x00 || UInt16[&#039;&#039;&#039;C&#039;&#039;&#039;] || &#039;&#039;&#039;RGBA5551 color&#039;&#039;&#039;.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Terrain Effects ==&lt;br /&gt;
Each texture is linked to 2 specific terrain effects that affect the vehicle&#039;s speed, particles and lighting. This section contains 2 blocks of &#039;&#039;&#039;X&#039;&#039;&#039; UInt16s.&lt;br /&gt;
&lt;br /&gt;
{|class=wikitable&lt;br /&gt;
! Offset !! Type !! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x00 || UInt16[&#039;&#039;&#039;X&#039;&#039;&#039;] || &#039;&#039;&#039;Effects&#039;&#039;&#039;, split in bits.&lt;br /&gt;
|-&lt;br /&gt;
| &#039;&#039;&#039;X&#039;&#039;&#039; * 2 || UInt16[&#039;&#039;&#039;X&#039;&#039;&#039;] || {{unknown-left|&#039;&#039;&#039;Unknown&#039;&#039;&#039;. This seems to be a copy of the previous block?}}&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Culling Groups ==&lt;br /&gt;
This section includes a 4-byte or 8-byte per track section values that determine which section models are loaded when entering a specific section. Each section is represented as 1 bit.&lt;br /&gt;
&lt;br /&gt;
{|class=wikitable&lt;br /&gt;
! Offset !! Type !! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x00 || UInt16[&#039;&#039;&#039;N&#039;&#039;&#039;]/UInt32[&#039;&#039;&#039;N&#039;&#039;&#039;] || &#039;&#039;&#039;Culled model sections&#039;&#039;&#039;, represented as &#039;&#039;&#039;N&#039;&#039;&#039; bits, 1 per section, in order from the least to the most significant bit. 0 if culled, 1 if loaded.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Texture Group ==&lt;br /&gt;
See &#039;&#039;&#039;[[DKRDS Texture Group]]&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
== Culling BSP Tree ==&lt;br /&gt;
This section defines a serialized axis-aligned binary space partitioning tree used for culling sections along with the [[#Culling Groups|Culling Groups]] section. The game traverses it to determine which sections are candidates for rendering given the current player&#039;s position, and then performs a secondary [[#Track Section AABB|AABB]] overlap test on each candidate before adding it to the active render list. The section consists of a sequence of variable-length nodes and leaves stored one after another.&lt;br /&gt;
&lt;br /&gt;
=== Interior Node ===&lt;br /&gt;
An interior node is always 8 bytes long and can be identified apart from a leaf node if the first Int16 is not negative.&lt;br /&gt;
&lt;br /&gt;
{|class=wikitable&lt;br /&gt;
! Offset !! Type !! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x00 || Int16 || &#039;&#039;&#039;Axis index&#039;&#039;&#039; into the player position array:&lt;br /&gt;
* &#039;&#039;&#039;0&#039;&#039;&#039; = X axis.&lt;br /&gt;
* &#039;&#039;&#039;1&#039;&#039;&#039; = Y axis. Unused?&lt;br /&gt;
* &#039;&#039;&#039;2&#039;&#039;&#039; = Z axis.&lt;br /&gt;
|-&lt;br /&gt;
| 0x02 || Int16 || &#039;&#039;&#039;Split value high bits&#039;&#039;&#039;.&lt;br /&gt;
|-&lt;br /&gt;
| 0x04 || UInt16 || &#039;&#039;&#039;Split value low bits&#039;&#039;&#039;.&lt;br /&gt;
|-&lt;br /&gt;
| 0x06 || Int16 || &#039;&#039;&#039;Skip count&#039;&#039;&#039;. The right child begins at &amp;lt;code&amp;gt;(node_offset + 8) + skip * 2&amp;lt;/code&amp;gt; bytes from the start of this section. The left child begins immediately at &amp;lt;code&amp;gt;node_offset + 8&amp;lt;/code&amp;gt;.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The split coordinate is reconstructed by the game as a 32-bit signed result, then divided by 64 to obtain the coordinates in world units (the same scale as the [[#Track Section AABB|section AABBs]]):&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
split = ((split_high &amp;lt;&amp;lt; 16) | (split_low &amp;amp; 0xFFFF)) / 64&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To encode a world-coordinate integer back into the two stored fields:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
split_raw = round(split * 64)							   &lt;br /&gt;
(Int16)split_high = (split_raw &amp;gt;&amp;gt; 16) &amp;amp; 0xFFFF&lt;br /&gt;
(UInt16)split_low = split_raw &amp;amp; 0xFFFF&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Leaf Node ===&lt;br /&gt;
Leaf nodes are variable-length.&lt;br /&gt;
 &lt;br /&gt;
{|class=wikitable&lt;br /&gt;
! Offset !! Type !! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x00 || Int16 || &#039;&#039;&#039;Negative count&#039;&#039;&#039; (&#039;&#039;&#039;-L&#039;&#039;&#039;). The value is always negative. Its negation &#039;&#039;&#039;L&#039;&#039;&#039; gives the number of section IDs that follow.&lt;br /&gt;
|-&lt;br /&gt;
| 0x02 || Int16[&#039;&#039;&#039;L&#039;&#039;&#039;] || &#039;&#039;&#039;Section IDs&#039;&#039;&#039;. Zero-based indices into the [[#Track Section Group|Track Section Group]]. A section may appear in more than one leaf when its AABB occupies a split plane.&lt;br /&gt;
|}&lt;br /&gt;
 &lt;br /&gt;
=== Traversal Algorithm ===&lt;br /&gt;
The game calls the function &amp;lt;code&amp;gt;@02006CC4(bsp_ptr, track_sg, position, tolerance, out_list)&amp;lt;/code&amp;gt;:&lt;br /&gt;
* &#039;&#039;&#039;bsp_ptr&#039;&#039;&#039;: pointer to the start of this section in RAM.&lt;br /&gt;
* &#039;&#039;&#039;track_sg&#039;&#039;&#039;: pointer to the [[#Track Section Group|Track Section Group]].&lt;br /&gt;
* &#039;&#039;&#039;position&#039;&#039;&#039;: player XYZ position.&lt;br /&gt;
* &#039;&#039;&#039;tolerance&#039;&#039;&#039;: a proximity radius, observed as &amp;lt;code&amp;gt;0xF00&amp;lt;/code&amp;gt; (60 in world units).&lt;br /&gt;
* &#039;&#039;&#039;out_list&#039;&#039;&#039;: output structure that receives the active section list.&lt;br /&gt;
 &lt;br /&gt;
At each interior node, in world-unit scale:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
pos = position[axis]&lt;br /&gt;
split_raw = (split_high &amp;lt;&amp;lt; 16) | (split_low &amp;amp; 0xFFFF)&lt;br /&gt;
split = split_raw / 64&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If &amp;lt;code&amp;gt;split - pos &amp;gt; tolerance&amp;lt;/code&amp;gt;, visit the left child only; else if &amp;lt;code&amp;gt;pos - split &amp;amp;ge; tolerance&amp;lt;/code&amp;gt;, visit the right child only; otherwise, visit both children.&lt;br /&gt;
&lt;br /&gt;
The left child corresponds to sections whose AABB satisfies &amp;lt;code&amp;gt;min[axis] &amp;amp;le; split&amp;lt;/code&amp;gt;; the right child corresponds to sections whose AABB satisfies &amp;lt;code&amp;gt;max[axis] &amp;amp;ge; split&amp;lt;/code&amp;gt;. Sections satisfying both (i.e. whose AABB traverses the split plane) appear in leaves on both sides.&lt;br /&gt;
&lt;br /&gt;
At each leaf node, for every listed section ID the section&#039;s data pointer is first looked up via the [[#Track Section Group|Track Section Group]]. Then, the player&#039;s bounding box is tested (&amp;lt;code&amp;gt;(X &amp;amp;plusmn; tolerance) * (Z &amp;amp;plusmn; tolerance)&amp;lt;/code&amp;gt;) against the section&#039;s [[#Track Section AABB|AABB]]. If the AABB test passes, add the section to the active render list.&lt;br /&gt;
&lt;br /&gt;
== Wish Race Unknown Section ==&lt;br /&gt;
This section is only used for the Wish Race tracks. Each entry is 0x18 bytes long. &#039;&#039;TBD&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
= Tools =&lt;br /&gt;
The following tools can handle DKRDS Track:&lt;br /&gt;
* (none)&lt;br /&gt;
&lt;br /&gt;
[[Category:Diddy Kong Racing DS File Formats]]&lt;/div&gt;</summary>
		<author><name>Atlas</name></author>
	</entry>
	<entry>
		<id>https://wiki.wexosmk.xyz/index.php?title=Assets.bin_(File_Format)&amp;diff=692</id>
		<title>Assets.bin (File Format)</title>
		<link rel="alternate" type="text/html" href="https://wiki.wexosmk.xyz/index.php?title=Assets.bin_(File_Format)&amp;diff=692"/>
		<updated>2026-06-17T18:37:02Z</updated>

		<summary type="html">&lt;p&gt;Atlas: /* Entry List */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{DISPLAYTITLE:assets.bin (File Format)}}&lt;br /&gt;
{{under-construction}}&lt;br /&gt;
&#039;&#039;&#039;assets.bin&#039;&#039;&#039; is a file from &#039;&#039;[https://en.wikipedia.org/wiki/Diddy_Kong_Racing_DS Diddy Kong Racing DS]&#039;&#039; that contains all the game&#039;s models and textures.&lt;br /&gt;
&lt;br /&gt;
= File Format =&lt;br /&gt;
The file byte order is always little endian.&lt;br /&gt;
&lt;br /&gt;
== Header ==&lt;br /&gt;
The file starts with a header that is 4 bytes long.&lt;br /&gt;
&lt;br /&gt;
{|class=wikitable&lt;br /&gt;
! Offset !! Type !! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x00 || UInt16 || &#039;&#039;&#039;Number of assets (N)&#039;&#039;&#039;. The value is 0x901 (2305).&lt;br /&gt;
|-&lt;br /&gt;
| 0x02 || Byte[2] || Padding.&lt;br /&gt;
|-&lt;br /&gt;
| 0x04 || colspan=2 {{unknown|End of header, start of Asset ID List}}&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Asset ID List ==&lt;br /&gt;
This is a list of all the asset IDs from the game. The purpose of indexing them is because that&#039;s how they&#039;re linked in [[LEV (File Format)|LEV]] files and other internal files.&lt;br /&gt;
&lt;br /&gt;
{|class=wikitable&lt;br /&gt;
! Offset !! Type !! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x00  || UInt16[&#039;&#039;&#039;N&#039;&#039;&#039;] || &#039;&#039;&#039;Asset IDs&#039;&#039;&#039;.&lt;br /&gt;
|-&lt;br /&gt;
| 0x00 + 2 * &#039;&#039;&#039;N&#039;&#039;&#039; || Byte[2] || Padding.&lt;br /&gt;
|-&lt;br /&gt;
| 0x02 + 2 * &#039;&#039;&#039;N&#039;&#039;&#039; || colspan=2 {{unknown|End of this section, start of Entry List}}&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Entry List ==&lt;br /&gt;
Followed by the [[#Asset ID List|Asset ID List]], there&#039;s a list of offsets and sizes for each of the assets. All offsets are absolute.&lt;br /&gt;
&lt;br /&gt;
{|class=wikitable&lt;br /&gt;
|+ Format of an asset.bin entry&lt;br /&gt;
! Offset !! Type !! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x00  || Int32 || &#039;&#039;&#039;Offset to asset data&#039;&#039;&#039;.&lt;br /&gt;
|-&lt;br /&gt;
| 0x04 || Int32 || &#039;&#039;&#039;Asset size&#039;&#039;&#039;.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Asset Data ==&lt;br /&gt;
Each asset consists of a header with some information and the file data.&lt;br /&gt;
&lt;br /&gt;
{|class=wikitable&lt;br /&gt;
|+ Format of an asset.bin entry&lt;br /&gt;
! Offset !! Type !! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x00  || Byte || &#039;&#039;&#039;Compression type:&#039;&#039;&#039;&lt;br /&gt;
* 0 = No compression&lt;br /&gt;
* 1 = Huffman&lt;br /&gt;
* 2 = LZ77&lt;br /&gt;
* 3 = &#039;&#039;&#039;Unknown&#039;&#039;&#039;&lt;br /&gt;
* 4 = RunLength&lt;br /&gt;
|-&lt;br /&gt;
| 0x01 || Byte[3] || &#039;&#039;&#039;Unknown flags&#039;&#039;&#039;. It is only known that they contain information about what type of data is stored.&lt;br /&gt;
|-&lt;br /&gt;
| 0x04 || Int32 || &#039;&#039;&#039;Uncompressed size&#039;&#039;&#039;.&lt;br /&gt;
|-&lt;br /&gt;
| 0x08 || colspan=2 {{unknown|End of this section, start of file data}}&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
= Tools =&lt;br /&gt;
The following tools can handle assets.bin:&lt;br /&gt;
* (none)&lt;br /&gt;
&lt;br /&gt;
[[Category:Diddy Kong Racing DS File Formats]]&lt;/div&gt;</summary>
		<author><name>Atlas</name></author>
	</entry>
	<entry>
		<id>https://wiki.wexosmk.xyz/index.php?title=DKRDS_Model_(File_Format)&amp;diff=691</id>
		<title>DKRDS Model (File Format)</title>
		<link rel="alternate" type="text/html" href="https://wiki.wexosmk.xyz/index.php?title=DKRDS_Model_(File_Format)&amp;diff=691"/>
		<updated>2026-06-17T18:18:40Z</updated>

		<summary type="html">&lt;p&gt;Atlas: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&#039;&#039;&#039;DKRDS Model&#039;&#039;&#039; is the nameless file format used in &#039;&#039;[https://en.wikipedia.org/wiki/Diddy_Kong_Racing_DS Diddy Kong Racing DS]&#039;&#039; that stores models and textures. Its type identifier in [[assets.bin]] is &#039;&#039;&#039;0x18&#039;&#039;&#039;, although it has also been seen in some &#039;&#039;&#039;0x00&#039;&#039;&#039; and &#039;&#039;&#039;0x63&#039;&#039;&#039;-type files.&lt;br /&gt;
&lt;br /&gt;
= File Format =&lt;br /&gt;
The file byte order is always little endian.&lt;br /&gt;
&lt;br /&gt;
== Header ==&lt;br /&gt;
The file starts with a header that is 48 bytes long. Unused models that might use an older version of the format have been seen with a 44-byte long header.&lt;br /&gt;
&lt;br /&gt;
{|class=wikitable&lt;br /&gt;
! Offset !! Type !! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x00 || UInt16 || &#039;&#039;&#039;Size flag&#039;&#039;&#039;. This flag indicates how much the vertex data is divided by in the short-to-float conversion:&lt;br /&gt;
* 0 = Divided by 16 (?)&lt;br /&gt;
* 1 = Divided by 4096 (?)&lt;br /&gt;
|-&lt;br /&gt;
| 0x02 || UInt16 || {{unknown-left|&#039;&#039;&#039;Unknown various flags&#039;&#039;&#039;. Each bit seems to correspond to a different flag:}}&lt;br /&gt;
* 0 = If 1, bone IDs are attached to each vertex&lt;br /&gt;
|-&lt;br /&gt;
| 0x04 || UInt16 || &#039;&#039;&#039;Number of models&#039;&#039;&#039; (&#039;&#039;&#039;M&#039;&#039;&#039;).&lt;br /&gt;
|-&lt;br /&gt;
| 0x06 || UInt16 || {{unknown-left|&#039;&#039;&#039;Unknown&#039;&#039;&#039;.}}&lt;br /&gt;
|-&lt;br /&gt;
| 0x08 || UInt16 || &#039;&#039;&#039;Number of textures&#039;&#039;&#039;.&lt;br /&gt;
|-&lt;br /&gt;
| 0x0A || UInt16 || {{unknown-left|&#039;&#039;&#039;Unknown&#039;&#039;&#039;.}}&lt;br /&gt;
|-&lt;br /&gt;
| 0x0C || Int32 || {{unknown-left|&#039;&#039;&#039;Unknown&#039;&#039;&#039;.}}&lt;br /&gt;
|-&lt;br /&gt;
| 0x10 || Byte[12] || {{unknown-left|&#039;&#039;&#039;Unknown&#039;&#039;&#039;. Padding? In earlier versions this would be an 8-byte padding instead}}&lt;br /&gt;
|-&lt;br /&gt;
| 0x1C || Int32 || &#039;&#039;&#039;[[#Model Group|Model Group]]&#039;&#039;&#039; offset.&lt;br /&gt;
|-&lt;br /&gt;
| 0x20 || Int32 || &#039;&#039;&#039;[[#Texture Group|Texture Group]]&#039;&#039;&#039; offset.&lt;br /&gt;
|-&lt;br /&gt;
| 0x24 || Int32 || &#039;&#039;&#039;[[#Texture Reference Table|Texture Reference Table]]&#039;&#039;&#039; offset.&lt;br /&gt;
|-&lt;br /&gt;
| 0x28 || Int32 || {{unknown-left|&#039;&#039;&#039;Unknown&#039;&#039;&#039;.}}&lt;br /&gt;
|-&lt;br /&gt;
| 0x2C || Int32 || {{unknown-left|&#039;&#039;&#039;Unknown&#039;&#039;&#039;.}}&lt;br /&gt;
|-&lt;br /&gt;
| 0x30 || colspan=2 {{unknown|End of header}}&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Model Group ==&lt;br /&gt;
The model group consists of &#039;&#039;&#039;M&#039;&#039;&#039; model entries.&lt;br /&gt;
&lt;br /&gt;
{|class=wikitable&lt;br /&gt;
! Offset !! Type !! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x00 || Model Entry[&#039;&#039;&#039;M&#039;&#039;&#039;] || &#039;&#039;&#039;Model entries&#039;&#039;&#039;.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Model Entry ===&lt;br /&gt;
Each model entry starts with a 16-byte header. All offsets are relative to the start of this entry.&lt;br /&gt;
&lt;br /&gt;
{|class=wikitable&lt;br /&gt;
|+ Model Entry Header&lt;br /&gt;
! Offset !! Type !! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x00 || UInt16 || &#039;&#039;&#039;Number of vertices&#039;&#039;&#039; (&#039;&#039;&#039;V&#039;&#039;&#039;).&lt;br /&gt;
|-&lt;br /&gt;
| 0x02 || UInt16 || &#039;&#039;&#039;Number of triangles&#039;&#039;&#039; (&#039;&#039;&#039;T&#039;&#039;&#039;).&lt;br /&gt;
|-&lt;br /&gt;
| 0x04 || Int32 || &#039;&#039;&#039;[[#Vertex Data|Vertex Data]]&#039;&#039;&#039; offset.&lt;br /&gt;
|-&lt;br /&gt;
| 0x08 || Int32 || &#039;&#039;&#039;[[#Triangle Data|Triangle Data]]&#039;&#039;&#039; offset.&lt;br /&gt;
|-&lt;br /&gt;
| 0x0C || UInt16 || {{unknown-left|&#039;&#039;&#039;Unknown&#039;&#039;&#039;.}}&lt;br /&gt;
|-&lt;br /&gt;
| 0x0E || UInt16 || {{unknown-left|&#039;&#039;&#039;Unknown&#039;&#039;&#039;.}}&lt;br /&gt;
|-&lt;br /&gt;
| 0x10 || colspan=2 {{unknown|End of header}}&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Vertex Data ===&lt;br /&gt;
Vertex data is stored as either 6-byte or 8-byte groups per vertex &#039;&#039;&#039;V&#039;&#039;&#039;, depending on the file header&#039;s flags.&lt;br /&gt;
&lt;br /&gt;
{|class=wikitable&lt;br /&gt;
! Offset !! Type !! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x00 || Vertex Entry[&#039;&#039;&#039;V&#039;&#039;&#039;] || &#039;&#039;&#039;Vertex entries&#039;&#039;&#039;.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{|class=wikitable&lt;br /&gt;
|+ Vertex Entry&lt;br /&gt;
! Offset !! Type !! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x00 || Int16[3] || &#039;&#039;&#039;Vertex XYZ position&#039;&#039;&#039;.&lt;br /&gt;
|- bgcolor=&amp;quot;#AAFFAA&amp;quot;&lt;br /&gt;
| colspan=&amp;quot;4&amp;quot; align=&amp;quot;center&amp;quot; | &#039;&#039;&#039;If [[#Header|Unknown various flag]] 0 = 1&#039;&#039;&#039;&lt;br /&gt;
|- bgcolor=&amp;quot;#DDFFDD&amp;quot;&lt;br /&gt;
| 0x06 || UInt16 || &#039;&#039;&#039;Bone ID&#039;&#039;&#039;.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Triangle Data ===&lt;br /&gt;
Triangle data is stored as 26-byte groups per triangle &#039;&#039;&#039;T&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
{|class=wikitable&lt;br /&gt;
! Offset !! Type !! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x00 || Triangle Entry[&#039;&#039;&#039;T&#039;&#039;&#039;] || &#039;&#039;&#039;Triangle entries&#039;&#039;&#039;.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{|class=wikitable&lt;br /&gt;
|+ Triangle Entry&lt;br /&gt;
! Offset !! Type !! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x00 || UInt16 || &#039;&#039;&#039;Texture ID&#039;&#039;&#039;. References the index from the [[#Texture Reference Table|Texture Reference Table]].&lt;br /&gt;
|-&lt;br /&gt;
| 0x02 || UInt16[3] || &#039;&#039;&#039;Vertex indices&#039;&#039;&#039;.&lt;br /&gt;
|-&lt;br /&gt;
| 0x08 || UInt16[3] || &#039;&#039;&#039;Vertex colors&#039;&#039;&#039;. One per vertex, in RGBA5551 format.&lt;br /&gt;
|-&lt;br /&gt;
| 0x0E || UInt16[2][3] || &#039;&#039;&#039;UVs&#039;&#039;&#039;. One set per vertex.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Texture Group ==&lt;br /&gt;
See &#039;&#039;&#039;[[DKRDS Texture Group]]&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
== Texture Reference Table ==&lt;br /&gt;
This section lists each 4-byte texture UID directly, in order. The index of each reference is used in the model data to know which texture corresponds to which triangle.&lt;br /&gt;
&lt;br /&gt;
{|class=wikitable&lt;br /&gt;
! Offset !! Type !! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x00 || Byte[4][&#039;&#039;&#039;Number of Textures in [[#Texture Group|Texture Group]]&#039;&#039;&#039;] || &#039;&#039;&#039;Texture UID&#039;&#039;&#039;.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
= Tools =&lt;br /&gt;
The following tools can handle DKRDS Model:&lt;br /&gt;
* (none)&lt;br /&gt;
&lt;br /&gt;
[[Category:Diddy Kong Racing DS File Formats]]&lt;/div&gt;</summary>
		<author><name>Atlas</name></author>
	</entry>
	<entry>
		<id>https://wiki.wexosmk.xyz/index.php?title=Assets.bin_(File_Format)&amp;diff=690</id>
		<title>Assets.bin (File Format)</title>
		<link rel="alternate" type="text/html" href="https://wiki.wexosmk.xyz/index.php?title=Assets.bin_(File_Format)&amp;diff=690"/>
		<updated>2026-06-17T17:33:38Z</updated>

		<summary type="html">&lt;p&gt;Atlas: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{DISPLAYTITLE:assets.bin (File Format)}}&lt;br /&gt;
{{under-construction}}&lt;br /&gt;
&#039;&#039;&#039;assets.bin&#039;&#039;&#039; is a file from &#039;&#039;[https://en.wikipedia.org/wiki/Diddy_Kong_Racing_DS Diddy Kong Racing DS]&#039;&#039; that contains all the game&#039;s models and textures.&lt;br /&gt;
&lt;br /&gt;
= File Format =&lt;br /&gt;
The file byte order is always little endian.&lt;br /&gt;
&lt;br /&gt;
== Header ==&lt;br /&gt;
The file starts with a header that is 4 bytes long.&lt;br /&gt;
&lt;br /&gt;
{|class=wikitable&lt;br /&gt;
! Offset !! Type !! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x00 || UInt16 || &#039;&#039;&#039;Number of assets (N)&#039;&#039;&#039;. The value is 0x901 (2305).&lt;br /&gt;
|-&lt;br /&gt;
| 0x02 || Byte[2] || Padding.&lt;br /&gt;
|-&lt;br /&gt;
| 0x04 || colspan=2 {{unknown|End of header, start of Asset ID List}}&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Asset ID List ==&lt;br /&gt;
This is a list of all the asset IDs from the game. The purpose of indexing them is because that&#039;s how they&#039;re linked in [[LEV (File Format)|LEV]] files and other internal files.&lt;br /&gt;
&lt;br /&gt;
{|class=wikitable&lt;br /&gt;
! Offset !! Type !! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x00  || UInt16[&#039;&#039;&#039;N&#039;&#039;&#039;] || &#039;&#039;&#039;Asset IDs&#039;&#039;&#039;.&lt;br /&gt;
|-&lt;br /&gt;
| 0x00 + 2 * &#039;&#039;&#039;N&#039;&#039;&#039; || Byte[2] || Padding.&lt;br /&gt;
|-&lt;br /&gt;
| 0x02 + 2 * &#039;&#039;&#039;N&#039;&#039;&#039; || colspan=2 {{unknown|End of this section, start of Entry List}}&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Entry List ==&lt;br /&gt;
Followed by the [[#Asset ID List|Asset ID List]], there&#039;s a list of offsets and sizes for each of the assets. All offsets are absolute.&lt;br /&gt;
&lt;br /&gt;
{|class=wikitable&lt;br /&gt;
|+ Format of an asset.bin entry&lt;br /&gt;
! Offset !! Type !! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x00  || Int32 || &#039;&#039;&#039;Offset to asset data&#039;&#039;&#039;.&lt;br /&gt;
|-&lt;br /&gt;
| 0x02 || Int32 || &#039;&#039;&#039;Asset size&#039;&#039;&#039;.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Asset Data ==&lt;br /&gt;
Each asset consists of a header with some information and the file data.&lt;br /&gt;
&lt;br /&gt;
{|class=wikitable&lt;br /&gt;
|+ Format of an asset.bin entry&lt;br /&gt;
! Offset !! Type !! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x00  || Byte || &#039;&#039;&#039;Compression type:&#039;&#039;&#039;&lt;br /&gt;
* 0 = No compression&lt;br /&gt;
* 1 = Huffman&lt;br /&gt;
* 2 = LZ77&lt;br /&gt;
* 3 = &#039;&#039;&#039;Unknown&#039;&#039;&#039;&lt;br /&gt;
* 4 = RunLength&lt;br /&gt;
|-&lt;br /&gt;
| 0x01 || Byte[3] || &#039;&#039;&#039;Unknown flags&#039;&#039;&#039;. It is only known that they contain information about what type of data is stored.&lt;br /&gt;
|-&lt;br /&gt;
| 0x04 || Int32 || &#039;&#039;&#039;Uncompressed size&#039;&#039;&#039;.&lt;br /&gt;
|-&lt;br /&gt;
| 0x08 || colspan=2 {{unknown|End of this section, start of file data}}&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
= Tools =&lt;br /&gt;
The following tools can handle assets.bin:&lt;br /&gt;
* (none)&lt;br /&gt;
&lt;br /&gt;
[[Category:Diddy Kong Racing DS File Formats]]&lt;/div&gt;</summary>
		<author><name>Atlas</name></author>
	</entry>
	<entry>
		<id>https://wiki.wexosmk.xyz/index.php?title=DKRDS_Track_(File_Format)&amp;diff=689</id>
		<title>DKRDS Track (File Format)</title>
		<link rel="alternate" type="text/html" href="https://wiki.wexosmk.xyz/index.php?title=DKRDS_Track_(File_Format)&amp;diff=689"/>
		<updated>2026-06-16T23:50:35Z</updated>

		<summary type="html">&lt;p&gt;Atlas: /* Track Section Entry */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&#039;&#039;&#039;DKRDS Track&#039;&#039;&#039; is the nameless file format used in &#039;&#039;[https://en.wikipedia.org/wiki/Diddy_Kong_Racing_DS Diddy Kong Racing DS]&#039;&#039; that stores the tracks&#039; section models, collision and textures. Its type identifier in [[assets.bin]] is &#039;&#039;&#039;0x9A&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
= File Format =&lt;br /&gt;
The file byte order is always little endian.&lt;br /&gt;
&lt;br /&gt;
== Header ==&lt;br /&gt;
The file starts with a header that is 56 bytes long.&lt;br /&gt;
&lt;br /&gt;
{|class=wikitable&lt;br /&gt;
! Offset !! Type !! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x00 || Int32 || &#039;&#039;&#039;Number of sections&#039;&#039;&#039; (&#039;&#039;&#039;N&#039;&#039;&#039;).&lt;br /&gt;
|-&lt;br /&gt;
| 0x04 || Int32 || &#039;&#039;&#039;[[#Track Section Group|Track Section Group]]&#039;&#039;&#039; offset.&lt;br /&gt;
|-&lt;br /&gt;
| 0x08 || Int32 || &#039;&#039;&#039;[[#Terrain Effects|Terrain Effects]]&#039;&#039;&#039; offset.&lt;br /&gt;
|-&lt;br /&gt;
| 0x0C || Byte[4] || {{unknown-left|&#039;&#039;&#039;Unknown&#039;&#039;&#039;. Always 0xCCCCCCCC.}}&lt;br /&gt;
|-&lt;br /&gt;
| 0x10 || Int32 || &#039;&#039;&#039;[[#Culling Groups|Culling Groups]]&#039;&#039;&#039; offset.&lt;br /&gt;
|-&lt;br /&gt;
| 0x14 || Int32 || &#039;&#039;&#039;[[#Culling Groups|Culling Groups]]&#039;&#039;&#039; data type:&lt;br /&gt;
* 1 = 4-byte per &#039;&#039;&#039;N&#039;&#039;&#039; group.&lt;br /&gt;
* 2 = 8-byte per &#039;&#039;&#039;N&#039;&#039;&#039; group.&lt;br /&gt;
|-&lt;br /&gt;
| 0x18 || Int32 || &#039;&#039;&#039;Number of textures&#039;&#039;&#039; (&#039;&#039;&#039;X&#039;&#039;&#039;).&lt;br /&gt;
|-&lt;br /&gt;
| 0x1C || Int32 || &#039;&#039;&#039;[[#Texture Group|Texture Group]]&#039;&#039;&#039; offset.&lt;br /&gt;
|-&lt;br /&gt;
| 0x20 || Int32 || &#039;&#039;&#039;[[#Culling BSP Tree|Culling BSP Tree]]&#039;&#039;&#039; offset.&lt;br /&gt;
|-&lt;br /&gt;
| 0x24 || Int32 || &#039;&#039;&#039;[[#Wish Race Unknown Section|Wish Race Unknown Section]]&#039;&#039;&#039; entry count.&lt;br /&gt;
|-&lt;br /&gt;
| 0x28 || Int32 || &#039;&#039;&#039;[[#Wish Race Unknown Section|Wish Race Unknown Section]]&#039;&#039;&#039; offset.&lt;br /&gt;
|-&lt;br /&gt;
| 0x2C || Byte[4] || {{unknown-left|&#039;&#039;&#039;Unknown&#039;&#039;&#039;. Seems to be some kind of flags.}}&lt;br /&gt;
|-&lt;br /&gt;
| 0x30 || Int32 || {{unknown-left|&#039;&#039;&#039;Unknown&#039;&#039;&#039;.}}&lt;br /&gt;
|-&lt;br /&gt;
| 0x34 || Int32 || &#039;&#039;&#039;File size&#039;&#039;&#039;.&lt;br /&gt;
|-&lt;br /&gt;
| 0x38 || colspan=2 {{unknown|End of header}}&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Track Section Group ==&lt;br /&gt;
This group starts with a list of &#039;&#039;&#039;N&#039;&#039;&#039; offsets.&lt;br /&gt;
&lt;br /&gt;
{|class=wikitable&lt;br /&gt;
|+ Track Section Header&lt;br /&gt;
! Offset !! Type !! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x00 || Int32[&#039;&#039;&#039;N&#039;&#039;&#039;] || &#039;&#039;&#039;[[#Track Section Entry|Track Section Entry]]&#039;&#039;&#039; offsets. Relative to the start of this group.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Track Section Entry ===&lt;br /&gt;
Every section entry defines model and collision data. The entry starts with a 32-byte header. All offsets are relative to the start of this entry.&lt;br /&gt;
&lt;br /&gt;
{|class=wikitable&lt;br /&gt;
|+ Track Section Entry Header&lt;br /&gt;
! Offset !! Type !! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x00 || Byte || &#039;&#039;&#039;Main collision attribute mask&#039;&#039;&#039;. This is an OR of all of the main collision attribute values for all polygon groups in this section.&lt;br /&gt;
|-&lt;br /&gt;
| 0x01 || Byte || &#039;&#039;&#039;Secondary collision attribute mask&#039;&#039;&#039;. This is an OR of all of the secondary collision attribute values for all polygon groups in this section.&lt;br /&gt;
|-&lt;br /&gt;
| 0x02 || UInt16 || &#039;&#039;&#039;Tertiary collision attribute mask&#039;&#039;&#039;. This is an OR of all of the tertiary collision attribute values for all polygon groups in this section.&lt;br /&gt;
|-&lt;br /&gt;
| 0x04 || UInt16 || &#039;&#039;&#039;Number of polygon groups&#039;&#039;&#039; (&#039;&#039;&#039;P&#039;&#039;&#039;).&lt;br /&gt;
|-&lt;br /&gt;
| 0x06 || UInt16 || &#039;&#039;&#039;Number of vertices&#039;&#039;&#039; in [[#Track Section Vertex Data|Track Section Vertex Data]] (&#039;&#039;&#039;V&#039;&#039;&#039;).&lt;br /&gt;
|-&lt;br /&gt;
| 0x08 || UInt16 || &#039;&#039;&#039;Number of UVs&#039;&#039;&#039; in [[#Track Section UV Data|Track Section UV Data]] (&#039;&#039;&#039;U&#039;&#039;&#039;).&lt;br /&gt;
|-&lt;br /&gt;
| 0x0A || UInt16 || &#039;&#039;&#039;Number of colors&#039;&#039;&#039; in [[#Track Section Color Data|Track Section Color Data]] (&#039;&#039;&#039;C&#039;&#039;&#039;).&lt;br /&gt;
|-&lt;br /&gt;
| 0x0C || Int32 || &#039;&#039;&#039;[[#Track Section Triangle Data|Track Section Triangle Data]]&#039;&#039;&#039; offset.&lt;br /&gt;
|-&lt;br /&gt;
| 0x10 || Int32 || &#039;&#039;&#039;[[#Track Section Collision Data|Track Section Collision Data]]&#039;&#039;&#039; offset.&lt;br /&gt;
|-&lt;br /&gt;
| 0x14 || Int32 || &#039;&#039;&#039;[[#Track Section Vertex Data|Track Section Vertex Data]]&#039;&#039;&#039; offset.&lt;br /&gt;
|-&lt;br /&gt;
| 0x18 || Int32 || &#039;&#039;&#039;[[#Track Section UV Data|Track Section UV Data]]&#039;&#039;&#039; offset.&lt;br /&gt;
|-&lt;br /&gt;
| 0x1C || Int32 || &#039;&#039;&#039;[[#Track Section Color Data|Track Section Color Data]]&#039;&#039;&#039; offset.&lt;br /&gt;
|-&lt;br /&gt;
| 0x20 || colspan=2 {{unknown|End of header, start of [[#Track Section Data|Track Section Data]]}}&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== Track Section Data ====&lt;br /&gt;
This data follows directly after the header of the section entry and starts with a 76-byte header.&lt;br /&gt;
&lt;br /&gt;
{|class=wikitable&lt;br /&gt;
! Offset !! Type !! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x00 || Int32 || {{unknown-left|&#039;&#039;&#039;Unknown&#039;&#039;&#039;. Seems to be always 0xFFFFFFFF and set to an address when loaded in memory.}}&lt;br /&gt;
|-&lt;br /&gt;
| 0x04 || Int32[3] || &#039;&#039;&#039;Collision XYZ offset&#039;&#039;&#039;.&lt;br /&gt;
|-&lt;br /&gt;
| 0x10 || Int32[3] || &#039;&#039;&#039;Visual model XYZ offset&#039;&#039;&#039;. The units are not the same as the collision offset.&lt;br /&gt;
|-&lt;br /&gt;
| 0x1C || [[#Track Section AABB|Track Section AABB]][2] || &#039;&#039;&#039;AABB areas&#039;&#039;&#039; of the entire section used for collision detection. The second AABB always seems to be a duplicate of the first.&lt;br /&gt;
|-&lt;br /&gt;
| 0x4C || colspan=2 {{unknown|End of header, start of [[#Track Section Polygon Data|Track Section Polygon Data]]}}&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
===== Track Section AABB =====&lt;br /&gt;
Track sections contain 2 identical AABB areas each. It is unknown why there&#039;s a duplicate, perhaps used during runtime after object space transform. All values need to be divided by 64 in order to obtain the absolute position data and match with the visual models.&lt;br /&gt;
&lt;br /&gt;
{|class=wikitable&lt;br /&gt;
! Offset !! Type !! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x00 || Int32[3] || &#039;&#039;&#039;AABB minimum XYZ position&#039;&#039;&#039;.&lt;br /&gt;
|-&lt;br /&gt;
| 0x0C || Int32[3] || &#039;&#039;&#039;AABB XYZ extent&#039;&#039;&#039;.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
===== Track Section Polygon Data =====&lt;br /&gt;
This section seems to store &#039;&#039;&#039;P&#039;&#039;&#039; polygon groups&#039; attributes.&lt;br /&gt;
&lt;br /&gt;
{|class=wikitable&lt;br /&gt;
! Offset !! Type !! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x00 || [[#Polygon Group Entry|Polygon Group Entry]][&#039;&#039;&#039;P&#039;&#039;&#039;] || &#039;&#039;&#039;Polygon group entries&#039;&#039;&#039;.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
====== Polygon Group Entry ======&lt;br /&gt;
Each polygon group entry is 12 bytes long.&lt;br /&gt;
&lt;br /&gt;
{|class=wikitable&lt;br /&gt;
! Offset !! Type !! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x00 || UInt16 || &#039;&#039;&#039;First triangle ID&#039;&#039;&#039;.&lt;br /&gt;
|-&lt;br /&gt;
| 0x02 || UInt16 || &#039;&#039;&#039;Number of triangles&#039;&#039;&#039;.&lt;br /&gt;
|-&lt;br /&gt;
| 0x04 || Byte || &#039;&#039;&#039;Main collision attribute&#039;&#039;&#039;. &#039;&#039;&#039;AAAA BBBB&#039;&#039;&#039;:&lt;br /&gt;
* &#039;&#039;&#039;A&#039;&#039;&#039;: &#039;&#039;&#039;Shadow level&#039;&#039;&#039;. The higher the value, the darker the character gets.&lt;br /&gt;
* &#039;&#039;&#039;B&#039;&#039;&#039;: &#039;&#039;&#039;Collision flag&#039;&#039;&#039;:&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! ID !! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x01 || Road and effects.&lt;br /&gt;
|-&lt;br /&gt;
| 0x05 || Wall (sparks on collision).&lt;br /&gt;
|-&lt;br /&gt;
| 0x08 || Special effects (turns off visual model).&lt;br /&gt;
|-&lt;br /&gt;
| 0x0C || Invisible wall (no sparks on collision, turns off visual model).&lt;br /&gt;
|}&lt;br /&gt;
|-&lt;br /&gt;
| 0x05 || Byte || &#039;&#039;&#039;Secondary collision attribute&#039;&#039;&#039;:&lt;br /&gt;
* &#039;&#039;&#039;Main flag = 0x01&#039;&#039;&#039;:&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! ID !! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x00 || Special effect? Used for water.&lt;br /&gt;
|-&lt;br /&gt;
| 0x01 || Pass through/no effect.&lt;br /&gt;
|-&lt;br /&gt;
| 0x04 || Road.&lt;br /&gt;
|}&lt;br /&gt;
* &#039;&#039;&#039;Main flag = 0x08&#039;&#039;&#039;:&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! ID !! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x00 || Invisible wall (no sparks on collision).&lt;br /&gt;
|-&lt;br /&gt;
| 0x01 || Water.&lt;br /&gt;
|}&lt;br /&gt;
|-&lt;br /&gt;
| 0x06 || UInt16 || &#039;&#039;&#039;Tertiary collision attribute&#039;&#039;&#039;. Split in bits.&lt;br /&gt;
* &#039;&#039;&#039;Main flag = 0x01&#039;&#039;&#039;:&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! ID !! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x01 || {{unknown-left|&#039;&#039;&#039;Unknown&#039;&#039;&#039;. Used in non-collideable stuff.}}&lt;br /&gt;
|-&lt;br /&gt;
| 0x02 || Water, inflates tires in car.&lt;br /&gt;
|-&lt;br /&gt;
| 0x10 || {{unknown-left|&#039;&#039;&#039;Unknown&#039;&#039;&#039;. Used in non-collideable stuff.}}&lt;br /&gt;
|-&lt;br /&gt;
| 0x20 || {{unknown-left|&#039;&#039;&#039;Unknown&#039;&#039;&#039;. Used in non-collideable stuff.}}&lt;br /&gt;
|-&lt;br /&gt;
| 0x60 || {{unknown-left|&#039;&#039;&#039;Unknown&#039;&#039;&#039;. Used in non-collideable stuff.}}&lt;br /&gt;
|}&lt;br /&gt;
* &#039;&#039;&#039;Main flag = 0x08&#039;&#039;&#039;:&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! ID !! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x30 || {{unknown-left|&#039;&#039;&#039;Unknown&#039;&#039;&#039;. Used in non-collideable stuff.}}&lt;br /&gt;
|}&lt;br /&gt;
* &#039;&#039;&#039;Main flag = 0x0C&#039;&#039;&#039;:&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! ID !! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x04 || Ignore when using plane.&lt;br /&gt;
|}&lt;br /&gt;
|-&lt;br /&gt;
| 0x08 || Byte[4] || &#039;&#039;&#039;Collision grid mask&#039;&#039;&#039;. This is an OR of all of the [[#Track Section Collision Data|collision grids]] for all triangles in this group.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The number of triangles &#039;&#039;&#039;T&#039;&#039;&#039; can be calculated by adding the first triangle ID to the number of triangles of the last polygon group entry.&lt;br /&gt;
&lt;br /&gt;
===== Track Section Triangle Data =====&lt;br /&gt;
This section stores &#039;&#039;&#039;T&#039;&#039;&#039; triangle entries.&lt;br /&gt;
&lt;br /&gt;
{|class=wikitable&lt;br /&gt;
! Offset !! Type !! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x00 || [[#Triangle Entry|Triangle Entry]][&#039;&#039;&#039;T&#039;&#039;&#039;] || &#039;&#039;&#039;Triangle entries&#039;&#039;&#039;.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
====== Triangle Entry ======&lt;br /&gt;
Each triangle entry is 20 bytes long.&lt;br /&gt;
&lt;br /&gt;
{|class=wikitable&lt;br /&gt;
! Offset !! Type !! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x00 || UInt16 || &#039;&#039;&#039;Attribute flags&#039;&#039;&#039;. &#039;&#039;&#039;AAAA AAAA AAAA AAAB&#039;&#039;&#039;:&lt;br /&gt;
* &#039;&#039;&#039;A&#039;&#039;&#039;: &#039;&#039;&#039;Texture ID&#039;&#039;&#039;.&lt;br /&gt;
* &#039;&#039;&#039;B&#039;&#039;&#039;: Collidable attribute? If 0 in roads, the triangles are not collidable. Unknown meaning in walls.&lt;br /&gt;
|-&lt;br /&gt;
| 0x02 || UInt16[3] || &#039;&#039;&#039;Face XYZ normals&#039;&#039;&#039;. Values need to be divided by 4096.&lt;br /&gt;
|-&lt;br /&gt;
| 0x08 || Byte[4] || &#039;&#039;&#039;Vertex position indices&#039;&#039;&#039;. The index for each of the 3 vertices is 10 bits long. 2 last bits are unknown.&lt;br /&gt;
|-&lt;br /&gt;
| 0x0C || Byte[4] || &#039;&#039;&#039;UV indices&#039;&#039;&#039;. The index for each of the 3 vertices is 10 bits long. 2 last bits are unknown.&lt;br /&gt;
|-&lt;br /&gt;
| 0x10 || Byte[4] || &#039;&#039;&#039;Color indices&#039;&#039;&#039;. The index for each of the 3 vertices is 10 bits long. 2 last bits are unknown.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
===== Track Section Collision Data =====&lt;br /&gt;
Each triangle corresponds to a 4-byte set of values to help with collision detection. These values encode local X, Y and Z coordinates that form a grid of cells inside the section&#039;s AABB.&lt;br /&gt;
&lt;br /&gt;
{|class=wikitable&lt;br /&gt;
! Offset !! Type !! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x00 || Byte || &#039;&#039;&#039;Y occupancy&#039;&#039;&#039;. Values correspond to 8 cells of the AABB (AABB&#039;s Y extent / 8).&lt;br /&gt;
|-&lt;br /&gt;
| 0x01 || Byte || &#039;&#039;&#039;Z occupancy&#039;&#039;&#039;. Values correspond to 8 cells of the AABB (AABB&#039;s Z extent / 8).&lt;br /&gt;
|-&lt;br /&gt;
| 0x02 || UInt16 || &#039;&#039;&#039;X occupancy&#039;&#039;&#039;. Values correspond to 16 cells of the AABB (AABB&#039;s X extent / 16).&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The following ARM assembly instructions (@01FF95D0 from the game&#039;s code) demonstrate how the vehicle&#039;s current grid bitmask is compared to the current testing triangle&#039;s collision:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
AND R0, R0, R5 // R0 = triangle&#039;s collision value AND vehicle&#039;s bitmask&lt;br /&gt;
TST R0, #FF // test byte 0 (Y)&lt;br /&gt;
TSTNE R0, #FF00 // if nonzero, test byte 1 (Z)&lt;br /&gt;
MOVNES R0, R0, LSR #10 // if still nonzero, test upper 16 bits (X)&lt;br /&gt;
MOVNE R0, #1 // collidable only if ALL 3 are nonzero&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The following functions in C# compute a triangle&#039;s collision grid from its minimum and maximum positions and its containing section&#039;s AABB:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
uint ComputeCollision(float xMin, float xMax, float yMin, float yMax, float zMin, float zMax, float aabbXMin, float aabbXExt, float aabbYMin, float aabbYExt, float aabbZMin, float aabbZExt)&lt;br /&gt;
{&lt;br /&gt;
    if (aabbXExt &amp;lt;= 0 || aabbYExt &amp;lt;= 0 || aabbZExt &amp;lt;= 0)&lt;br /&gt;
        return 0xFFFFFFFFu;&lt;br /&gt;
&lt;br /&gt;
    uint xBits = ComputeCellBits(xMin - aabbXMin, xMax - aabbXMin, aabbXExt / 16f, 16);&lt;br /&gt;
    uint zBits = ComputeCellBits(zMin - aabbZMin, zMax - aabbZMin, aabbZExt / 8f, 8);&lt;br /&gt;
    uint yBits = ComputeCellBits(yMin - aabbYMin, yMax - aabbYMin, aabbYExt / 8f, 8);&lt;br /&gt;
&lt;br /&gt;
    return (xBits &amp;lt;&amp;lt; 16) | (zBits &amp;lt;&amp;lt; 8) | yBits;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
uint ComputeCellBits(float relMin, float relMax, float cellSize, int nrCells)&lt;br /&gt;
{&lt;br /&gt;
    const float Epsilon = 1e-4f;&lt;br /&gt;
    float faceMin = relMin / cellSize;&lt;br /&gt;
    float faceMax = relMax / cellSize;&lt;br /&gt;
&lt;br /&gt;
    // Special case for degenerate faces (flat faces with zero extent in this axis, e.g. a wall parallel to XZ)&lt;br /&gt;
    if (MathF.Abs(faceMax - faceMin) &amp;lt; Epsilon)&lt;br /&gt;
    {&lt;br /&gt;
        int cell = Math.Max(0, Math.Min(nrCells - 1, (int)MathF.Floor(faceMin)));&lt;br /&gt;
        bool atExact = MathF.Abs(faceMin - MathF.Round(faceMin)) &amp;lt; Epsilon;&lt;br /&gt;
        bool atMaxEdge = cell == nrCells - 1;&lt;br /&gt;
&lt;br /&gt;
        // Include the preceding cell only at an interior exact boundary&lt;br /&gt;
        if (atExact &amp;amp;&amp;amp; cell &amp;gt; 0 &amp;amp;&amp;amp; !atMaxEdge)&lt;br /&gt;
            return (1u &amp;lt;&amp;lt; cell) | (1u &amp;lt;&amp;lt; (cell - 1));&lt;br /&gt;
&lt;br /&gt;
        return 1u &amp;lt;&amp;lt; cell;&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    int cellMin = (int)MathF.Floor(faceMin);&lt;br /&gt;
    int cellMax = (int)MathF.Floor(faceMax - Epsilon); // Exact upper boundary stays in current cell&lt;br /&gt;
&lt;br /&gt;
    // Exact lower boundary stays in the preceding cell&lt;br /&gt;
    bool atExactLow = MathF.Abs(faceMin - MathF.Round(faceMin)) &amp;lt; Epsilon;&lt;br /&gt;
    bool atMaxLow = cellMin == nrCells - 1;&lt;br /&gt;
    if (atExactLow &amp;amp;&amp;amp; cellMin &amp;gt; 0 &amp;amp;&amp;amp; !atMaxLow)&lt;br /&gt;
        cellMin--;&lt;br /&gt;
&lt;br /&gt;
    cellMin = Math.Max(0, cellMin);&lt;br /&gt;
    cellMax = Math.Min(nrCells - 1, cellMax);&lt;br /&gt;
&lt;br /&gt;
    uint bits = 0;&lt;br /&gt;
&lt;br /&gt;
    for (int c = cellMin; c &amp;lt;= cellMax; c++)&lt;br /&gt;
        bits |= 1u &amp;lt;&amp;lt; c;&lt;br /&gt;
&lt;br /&gt;
    return bits;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===== Track Section Vertex Data =====&lt;br /&gt;
Vertex data is stored as 6-byte groups per entry &#039;&#039;&#039;V&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
{|class=wikitable&lt;br /&gt;
! Offset !! Type !! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x00 || Int16[3][&#039;&#039;&#039;V&#039;&#039;&#039;] || &#039;&#039;&#039;Vertex XYZ position&#039;&#039;&#039;.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
===== Track Section UV Data =====&lt;br /&gt;
UV data is stored as 4-byte groups per entry &#039;&#039;&#039;U&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
{|class=wikitable&lt;br /&gt;
! Offset !! Type !! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x00 || Int16[2][&#039;&#039;&#039;U&#039;&#039;&#039;] || &#039;&#039;&#039;Vertex UV position&#039;&#039;&#039;.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
===== Track Section Color Data =====&lt;br /&gt;
Color data is stored as 2-byte groups per entry &#039;&#039;&#039;C&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
{|class=wikitable&lt;br /&gt;
! Offset !! Type !! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x00 || UInt16[&#039;&#039;&#039;C&#039;&#039;&#039;] || &#039;&#039;&#039;RGBA5551 color&#039;&#039;&#039;.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Terrain Effects ==&lt;br /&gt;
Each texture is linked to 2 specific terrain effects that affect the vehicle&#039;s speed, particles and lighting. This section contains 2 blocks of &#039;&#039;&#039;X&#039;&#039;&#039; UInt16s.&lt;br /&gt;
&lt;br /&gt;
{|class=wikitable&lt;br /&gt;
! Offset !! Type !! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x00 || UInt16[&#039;&#039;&#039;X&#039;&#039;&#039;] || &#039;&#039;&#039;Effects&#039;&#039;&#039;, split in bits.&lt;br /&gt;
|-&lt;br /&gt;
| &#039;&#039;&#039;X&#039;&#039;&#039; * 2 || UInt16[&#039;&#039;&#039;X&#039;&#039;&#039;] || {{unknown-left|&#039;&#039;&#039;Unknown&#039;&#039;&#039;. This seems to be a copy of the previous block?}}&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Culling Groups ==&lt;br /&gt;
This section includes a 4-byte or 8-byte per track section values that determine which section models are loaded when entering a specific section. Each section is represented as 1 bit.&lt;br /&gt;
&lt;br /&gt;
{|class=wikitable&lt;br /&gt;
! Offset !! Type !! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x00 || UInt16[&#039;&#039;&#039;N&#039;&#039;&#039;]/UInt32[&#039;&#039;&#039;N&#039;&#039;&#039;] || &#039;&#039;&#039;Culled model sections&#039;&#039;&#039;, represented as &#039;&#039;&#039;N&#039;&#039;&#039; bits, 1 per section, in order from the least to the most significant bit. 0 if culled, 1 if loaded.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Texture Group ==&lt;br /&gt;
See &#039;&#039;&#039;[[DKRDS Texture Group]]&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
== Culling BSP Tree ==&lt;br /&gt;
This section defines a serialized axis-aligned binary space partitioning tree used for culling sections along with the [[#Culling Groups|Culling Groups]] section. The game traverses it to determine which sections are candidates for rendering given the current player&#039;s position, and then performs a secondary [[#Track Section AABB|AABB]] overlap test on each candidate before adding it to the active render list. The section consists of a sequence of variable-length nodes and leaves stored one after another.&lt;br /&gt;
&lt;br /&gt;
=== Interior Node ===&lt;br /&gt;
An interior node is always 8 bytes long and can be identified apart from a leaf node if the first Int16 is not negative.&lt;br /&gt;
&lt;br /&gt;
{|class=wikitable&lt;br /&gt;
! Offset !! Type !! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x00 || Int16 || &#039;&#039;&#039;Axis index&#039;&#039;&#039; into the player position array:&lt;br /&gt;
* &#039;&#039;&#039;0&#039;&#039;&#039; = X axis.&lt;br /&gt;
* &#039;&#039;&#039;1&#039;&#039;&#039; = Y axis. Unused?&lt;br /&gt;
* &#039;&#039;&#039;2&#039;&#039;&#039; = Z axis.&lt;br /&gt;
|-&lt;br /&gt;
| 0x02 || Int16 || &#039;&#039;&#039;Split value high bits&#039;&#039;&#039;.&lt;br /&gt;
|-&lt;br /&gt;
| 0x04 || UInt16 || &#039;&#039;&#039;Split value low bits&#039;&#039;&#039;.&lt;br /&gt;
|-&lt;br /&gt;
| 0x06 || Int16 || &#039;&#039;&#039;Skip count&#039;&#039;&#039;. The right child begins at &amp;lt;code&amp;gt;(node_offset + 8) + skip * 2&amp;lt;/code&amp;gt; bytes from the start of this section. The left child begins immediately at &amp;lt;code&amp;gt;node_offset + 8&amp;lt;/code&amp;gt;.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The split coordinate is reconstructed by the game as a 32-bit signed result, then divided by 64 to obtain the coordinates in world units (the same scale as the [[#Track Section AABB|section AABBs]]):&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
split = ((split_high &amp;lt;&amp;lt; 16) | (split_low &amp;amp; 0xFFFF)) / 64&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To encode a world-coordinate integer back into the two stored fields:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
split_raw = round(split * 64)							   &lt;br /&gt;
(Int16)split_high = (split_raw &amp;gt;&amp;gt; 16) &amp;amp; 0xFFFF&lt;br /&gt;
(UInt16)split_low = split_raw &amp;amp; 0xFFFF&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Leaf Node ===&lt;br /&gt;
Leaf nodes are variable-length.&lt;br /&gt;
 &lt;br /&gt;
{|class=wikitable&lt;br /&gt;
! Offset !! Type !! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x00 || Int16 || &#039;&#039;&#039;Negative count&#039;&#039;&#039; (&#039;&#039;&#039;-L&#039;&#039;&#039;). The value is always negative. Its negation &#039;&#039;&#039;L&#039;&#039;&#039; gives the number of section IDs that follow.&lt;br /&gt;
|-&lt;br /&gt;
| 0x02 || Int16[&#039;&#039;&#039;L&#039;&#039;&#039;] || &#039;&#039;&#039;Section IDs&#039;&#039;&#039;. Zero-based indices into the [[#Track Section Group|Track Section Group]]. A section may appear in more than one leaf when its AABB occupies a split plane.&lt;br /&gt;
|}&lt;br /&gt;
 &lt;br /&gt;
=== Traversal Algorithm ===&lt;br /&gt;
The game calls the function &amp;lt;code&amp;gt;@02006CC4(bsp_ptr, track_sg, position, tolerance, out_list)&amp;lt;/code&amp;gt;:&lt;br /&gt;
* &#039;&#039;&#039;bsp_ptr&#039;&#039;&#039;: pointer to the start of this section in RAM.&lt;br /&gt;
* &#039;&#039;&#039;track_sg&#039;&#039;&#039;: pointer to the [[#Track Section Group|Track Section Group]].&lt;br /&gt;
* &#039;&#039;&#039;position&#039;&#039;&#039;: player XYZ position.&lt;br /&gt;
* &#039;&#039;&#039;tolerance&#039;&#039;&#039;: a proximity radius, observed as &amp;lt;code&amp;gt;0xF00&amp;lt;/code&amp;gt; (60 in world units).&lt;br /&gt;
* &#039;&#039;&#039;out_list&#039;&#039;&#039;: output structure that receives the active section list.&lt;br /&gt;
 &lt;br /&gt;
At each interior node, in world-unit scale:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
pos = position[axis]&lt;br /&gt;
split_raw = (split_high &amp;lt;&amp;lt; 16) | (split_low &amp;amp; 0xFFFF)&lt;br /&gt;
split = split_raw / 64&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If &amp;lt;code&amp;gt;split - pos &amp;gt; tolerance&amp;lt;/code&amp;gt;, visit the left child only; else if &amp;lt;code&amp;gt;pos - split &amp;amp;ge; tolerance&amp;lt;/code&amp;gt;, visit the right child only; otherwise, visit both children.&lt;br /&gt;
&lt;br /&gt;
The left child corresponds to sections whose AABB satisfies &amp;lt;code&amp;gt;min[axis] &amp;amp;le; split&amp;lt;/code&amp;gt;; the right child corresponds to sections whose AABB satisfies &amp;lt;code&amp;gt;max[axis] &amp;amp;ge; split&amp;lt;/code&amp;gt;. Sections satisfying both (i.e. whose AABB traverses the split plane) appear in leaves on both sides.&lt;br /&gt;
&lt;br /&gt;
At each leaf node, for every listed section ID the section&#039;s data pointer is first looked up via the [[#Track Section Group|Track Section Group]]. Then, the player&#039;s bounding box is tested (&amp;lt;code&amp;gt;(X &amp;amp;plusmn; tolerance) * (Z &amp;amp;plusmn; tolerance)&amp;lt;/code&amp;gt;) against the section&#039;s [[#Track Section AABB|AABB]]. If the AABB test passes, add the section to the active render list.&lt;br /&gt;
&lt;br /&gt;
== Wish Race Unknown Section ==&lt;br /&gt;
This section is only used for the Wish Race tracks. Each entry is 0x18 bytes long. &#039;&#039;TBD&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
= Tools =&lt;br /&gt;
The following tools can handle DKRDS Track:&lt;br /&gt;
* (none)&lt;br /&gt;
&lt;br /&gt;
[[Category:Diddy Kong Racing DS File Formats]]&lt;/div&gt;</summary>
		<author><name>Atlas</name></author>
	</entry>
	<entry>
		<id>https://wiki.wexosmk.xyz/index.php?title=Assets.bin_(File_Format)&amp;diff=688</id>
		<title>Assets.bin (File Format)</title>
		<link rel="alternate" type="text/html" href="https://wiki.wexosmk.xyz/index.php?title=Assets.bin_(File_Format)&amp;diff=688"/>
		<updated>2026-06-16T23:15:20Z</updated>

		<summary type="html">&lt;p&gt;Atlas: /* Header */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{DISPLAYTITLE:assets.bin (File Format)}}&lt;br /&gt;
{{under-construction}}&lt;br /&gt;
&#039;&#039;&#039;assets.bin&#039;&#039;&#039; is a file from &#039;&#039;[https://en.wikipedia.org/wiki/Diddy_Kong_Racing_DS Diddy Kong Racing DS]&#039;&#039; that contains all the game&#039;s models and textures.&lt;br /&gt;
&lt;br /&gt;
= File Format =&lt;br /&gt;
The file byte order is always little endian.&lt;br /&gt;
&lt;br /&gt;
== Header ==&lt;br /&gt;
The file starts with a header that is 4 bytes long.&lt;br /&gt;
&lt;br /&gt;
{|class=wikitable&lt;br /&gt;
! Offset !! Type !! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x00 || UInt16 || &#039;&#039;&#039;Number of assets (N)&#039;&#039;&#039;. The value is 0x901 (2305).&lt;br /&gt;
|-&lt;br /&gt;
| 0x02 || Byte[2] || Padding.&lt;br /&gt;
|-&lt;br /&gt;
| 0x08 || colspan=2 {{unknown|End of header, start of Asset ID List}}&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Asset ID List ==&lt;br /&gt;
This is a list of all the asset IDs from the game. The purpose of indexing them is because that&#039;s how they&#039;re linked on [[LEV (File Format)|LEV]] files and other internal files.&lt;br /&gt;
&lt;br /&gt;
{|class=wikitable&lt;br /&gt;
! Offset !! Type !! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x00  || UInt16[&#039;&#039;&#039;N&#039;&#039;&#039;] || &#039;&#039;&#039;Asset IDs&#039;&#039;&#039;.&lt;br /&gt;
|-&lt;br /&gt;
| 0x00 + 2 * &#039;&#039;&#039;N&#039;&#039;&#039; || Byte[2] || Padding.&lt;br /&gt;
|-&lt;br /&gt;
| 0x02 + 2 * &#039;&#039;&#039;N&#039;&#039;&#039; || colspan=2 {{unknown|End of this section, start of Entry List}}&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Entry List ==&lt;br /&gt;
Followed by the [[#Asset ID List|Asset ID List]], there&#039;s a list of offsets and sizes for each of the assets. All offsets are absolute.&lt;br /&gt;
&lt;br /&gt;
{|class=wikitable&lt;br /&gt;
|+ Format of an asset.bin entry&lt;br /&gt;
! Offset !! Type !! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x00  || Int32 || &#039;&#039;&#039;Offset to asset data&#039;&#039;&#039;.&lt;br /&gt;
|-&lt;br /&gt;
| 0x02 || Int32 || &#039;&#039;&#039;Asset size&#039;&#039;&#039;.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Asset Data ==&lt;br /&gt;
Each asset consists of a header with some information and the file data.&lt;br /&gt;
&lt;br /&gt;
{|class=wikitable&lt;br /&gt;
|+ Format of an asset.bin entry&lt;br /&gt;
! Offset !! Type !! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x00  || Byte || &#039;&#039;&#039;Compression type:&#039;&#039;&#039;&lt;br /&gt;
* 0 = No compression&lt;br /&gt;
* 1 = Huffman&lt;br /&gt;
* 2 = LZ77&lt;br /&gt;
* 3 = &#039;&#039;&#039;Unknown&#039;&#039;&#039;&lt;br /&gt;
* 4 = RunLength&lt;br /&gt;
|-&lt;br /&gt;
| 0x01 || Byte[3] || &#039;&#039;&#039;Unknown flags&#039;&#039;&#039;. It is only known that they contain information about what type of data is stored.&lt;br /&gt;
|-&lt;br /&gt;
| 0x04 || Int32 || &#039;&#039;&#039;Uncompressed size&#039;&#039;&#039;.&lt;br /&gt;
|-&lt;br /&gt;
| 0x08 || colspan=2 {{unknown|End of this section, start of file data}}&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
= Tools =&lt;br /&gt;
The following tools can handle assets.bin:&lt;br /&gt;
* (none)&lt;br /&gt;
&lt;br /&gt;
[[Category:Diddy Kong Racing DS File Formats]]&lt;/div&gt;</summary>
		<author><name>Atlas</name></author>
	</entry>
	<entry>
		<id>https://wiki.wexosmk.xyz/index.php?title=DKRDS_Track_(File_Format)&amp;diff=687</id>
		<title>DKRDS Track (File Format)</title>
		<link rel="alternate" type="text/html" href="https://wiki.wexosmk.xyz/index.php?title=DKRDS_Track_(File_Format)&amp;diff=687"/>
		<updated>2026-06-16T18:29:30Z</updated>

		<summary type="html">&lt;p&gt;Atlas: /* Wish Race Unknown Section */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&#039;&#039;&#039;DKRDS Track&#039;&#039;&#039; is the nameless file format used in &#039;&#039;[https://en.wikipedia.org/wiki/Diddy_Kong_Racing_DS Diddy Kong Racing DS]&#039;&#039; that stores the tracks&#039; section models, collision and textures. Its type identifier in [[assets.bin]] is &#039;&#039;&#039;0x9A&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
= File Format =&lt;br /&gt;
The file byte order is always little endian.&lt;br /&gt;
&lt;br /&gt;
== Header ==&lt;br /&gt;
The file starts with a header that is 56 bytes long.&lt;br /&gt;
&lt;br /&gt;
{|class=wikitable&lt;br /&gt;
! Offset !! Type !! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x00 || Int32 || &#039;&#039;&#039;Number of sections&#039;&#039;&#039; (&#039;&#039;&#039;N&#039;&#039;&#039;).&lt;br /&gt;
|-&lt;br /&gt;
| 0x04 || Int32 || &#039;&#039;&#039;[[#Track Section Group|Track Section Group]]&#039;&#039;&#039; offset.&lt;br /&gt;
|-&lt;br /&gt;
| 0x08 || Int32 || &#039;&#039;&#039;[[#Terrain Effects|Terrain Effects]]&#039;&#039;&#039; offset.&lt;br /&gt;
|-&lt;br /&gt;
| 0x0C || Byte[4] || {{unknown-left|&#039;&#039;&#039;Unknown&#039;&#039;&#039;. Always 0xCCCCCCCC.}}&lt;br /&gt;
|-&lt;br /&gt;
| 0x10 || Int32 || &#039;&#039;&#039;[[#Culling Groups|Culling Groups]]&#039;&#039;&#039; offset.&lt;br /&gt;
|-&lt;br /&gt;
| 0x14 || Int32 || &#039;&#039;&#039;[[#Culling Groups|Culling Groups]]&#039;&#039;&#039; data type:&lt;br /&gt;
* 1 = 4-byte per &#039;&#039;&#039;N&#039;&#039;&#039; group.&lt;br /&gt;
* 2 = 8-byte per &#039;&#039;&#039;N&#039;&#039;&#039; group.&lt;br /&gt;
|-&lt;br /&gt;
| 0x18 || Int32 || &#039;&#039;&#039;Number of textures&#039;&#039;&#039; (&#039;&#039;&#039;X&#039;&#039;&#039;).&lt;br /&gt;
|-&lt;br /&gt;
| 0x1C || Int32 || &#039;&#039;&#039;[[#Texture Group|Texture Group]]&#039;&#039;&#039; offset.&lt;br /&gt;
|-&lt;br /&gt;
| 0x20 || Int32 || &#039;&#039;&#039;[[#Culling BSP Tree|Culling BSP Tree]]&#039;&#039;&#039; offset.&lt;br /&gt;
|-&lt;br /&gt;
| 0x24 || Int32 || &#039;&#039;&#039;[[#Wish Race Unknown Section|Wish Race Unknown Section]]&#039;&#039;&#039; entry count.&lt;br /&gt;
|-&lt;br /&gt;
| 0x28 || Int32 || &#039;&#039;&#039;[[#Wish Race Unknown Section|Wish Race Unknown Section]]&#039;&#039;&#039; offset.&lt;br /&gt;
|-&lt;br /&gt;
| 0x2C || Byte[4] || {{unknown-left|&#039;&#039;&#039;Unknown&#039;&#039;&#039;. Seems to be some kind of flags.}}&lt;br /&gt;
|-&lt;br /&gt;
| 0x30 || Int32 || {{unknown-left|&#039;&#039;&#039;Unknown&#039;&#039;&#039;.}}&lt;br /&gt;
|-&lt;br /&gt;
| 0x34 || Int32 || &#039;&#039;&#039;File size&#039;&#039;&#039;.&lt;br /&gt;
|-&lt;br /&gt;
| 0x38 || colspan=2 {{unknown|End of header}}&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Track Section Group ==&lt;br /&gt;
This group starts with a list of &#039;&#039;&#039;N&#039;&#039;&#039; offsets.&lt;br /&gt;
&lt;br /&gt;
{|class=wikitable&lt;br /&gt;
|+ Track Section Header&lt;br /&gt;
! Offset !! Type !! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x00 || Int32[&#039;&#039;&#039;N&#039;&#039;&#039;] || &#039;&#039;&#039;[[#Track Section Entry|Track Section Entry]]&#039;&#039;&#039; offsets. Relative to the start of this group.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Track Section Entry ===&lt;br /&gt;
Every section entry defines model and collision data. The entry starts with a 32-byte header. All offsets are relative to the start of this entry.&lt;br /&gt;
&lt;br /&gt;
{|class=wikitable&lt;br /&gt;
|+ Track Section Entry Header&lt;br /&gt;
! Offset !! Type !! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x00 || Byte || {{unknown-left|&#039;&#039;&#039;Unknown&#039;&#039;&#039;.}}&lt;br /&gt;
|-&lt;br /&gt;
| 0x01 || Byte || {{unknown-left|&#039;&#039;&#039;Unknown&#039;&#039;&#039;.}}&lt;br /&gt;
|-&lt;br /&gt;
| 0x02 || UInt16 || {{unknown-left|&#039;&#039;&#039;Unknown&#039;&#039;&#039;.}}&lt;br /&gt;
|-&lt;br /&gt;
| 0x04 || UInt16 || &#039;&#039;&#039;Number of polygon groups&#039;&#039;&#039; (&#039;&#039;&#039;P&#039;&#039;&#039;).&lt;br /&gt;
|-&lt;br /&gt;
| 0x06 || UInt16 || &#039;&#039;&#039;Number of vertices&#039;&#039;&#039; in [[#Track Section Vertex Data|Track Section Vertex Data]] (&#039;&#039;&#039;V&#039;&#039;&#039;).&lt;br /&gt;
|-&lt;br /&gt;
| 0x08 || UInt16 || &#039;&#039;&#039;Number of UVs&#039;&#039;&#039; in [[#Track Section UV Data|Track Section UV Data]] (&#039;&#039;&#039;U&#039;&#039;&#039;).&lt;br /&gt;
|-&lt;br /&gt;
| 0x0A || UInt16 || &#039;&#039;&#039;Number of colors&#039;&#039;&#039; in [[#Track Section Color Data|Track Section Color Data]] (&#039;&#039;&#039;C&#039;&#039;&#039;).&lt;br /&gt;
|-&lt;br /&gt;
| 0x0C || Int32 || &#039;&#039;&#039;[[#Track Section Triangle Data|Track Section Triangle Data]]&#039;&#039;&#039; offset.&lt;br /&gt;
|-&lt;br /&gt;
| 0x10 || Int32 || &#039;&#039;&#039;[[#Track Section Collision Data|Track Section Collision Data]]&#039;&#039;&#039; offset.&lt;br /&gt;
|-&lt;br /&gt;
| 0x14 || Int32 || &#039;&#039;&#039;[[#Track Section Vertex Data|Track Section Vertex Data]]&#039;&#039;&#039; offset.&lt;br /&gt;
|-&lt;br /&gt;
| 0x18 || Int32 || &#039;&#039;&#039;[[#Track Section UV Data|Track Section UV Data]]&#039;&#039;&#039; offset.&lt;br /&gt;
|-&lt;br /&gt;
| 0x1C || Int32 || &#039;&#039;&#039;[[#Track Section Color Data|Track Section Color Data]]&#039;&#039;&#039; offset.&lt;br /&gt;
|-&lt;br /&gt;
| 0x20 || colspan=2 {{unknown|End of header, start of [[#Track Section Data|Track Section Data]]}}&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== Track Section Data ====&lt;br /&gt;
This data follows directly after the header of the section entry and starts with a 76-byte header.&lt;br /&gt;
&lt;br /&gt;
{|class=wikitable&lt;br /&gt;
! Offset !! Type !! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x00 || Int32 || {{unknown-left|&#039;&#039;&#039;Unknown&#039;&#039;&#039;. Seems to be always 0xFFFFFFFF and set to an address when loaded in memory.}}&lt;br /&gt;
|-&lt;br /&gt;
| 0x04 || Int32[3] || &#039;&#039;&#039;Collision XYZ offset&#039;&#039;&#039;.&lt;br /&gt;
|-&lt;br /&gt;
| 0x10 || Int32[3] || &#039;&#039;&#039;Visual model XYZ offset&#039;&#039;&#039;. The units are not the same as the collision offset.&lt;br /&gt;
|-&lt;br /&gt;
| 0x1C || [[#Track Section AABB|Track Section AABB]][2] || &#039;&#039;&#039;AABB areas&#039;&#039;&#039; of the entire section used for collision detection. The second AABB always seems to be a duplicate of the first.&lt;br /&gt;
|-&lt;br /&gt;
| 0x4C || colspan=2 {{unknown|End of header, start of [[#Track Section Polygon Data|Track Section Polygon Data]]}}&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
===== Track Section AABB =====&lt;br /&gt;
Track sections contain 2 identical AABB areas each. It is unknown why there&#039;s a duplicate, perhaps used during runtime after object space transform. All values need to be divided by 64 in order to obtain the absolute position data and match with the visual models.&lt;br /&gt;
&lt;br /&gt;
{|class=wikitable&lt;br /&gt;
! Offset !! Type !! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x00 || Int32[3] || &#039;&#039;&#039;AABB minimum XYZ position&#039;&#039;&#039;.&lt;br /&gt;
|-&lt;br /&gt;
| 0x0C || Int32[3] || &#039;&#039;&#039;AABB XYZ extent&#039;&#039;&#039;.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
===== Track Section Polygon Data =====&lt;br /&gt;
This section seems to store &#039;&#039;&#039;P&#039;&#039;&#039; polygon groups&#039; attributes.&lt;br /&gt;
&lt;br /&gt;
{|class=wikitable&lt;br /&gt;
! Offset !! Type !! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x00 || [[#Polygon Group Entry|Polygon Group Entry]][&#039;&#039;&#039;P&#039;&#039;&#039;] || &#039;&#039;&#039;Polygon group entries&#039;&#039;&#039;.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
====== Polygon Group Entry ======&lt;br /&gt;
Each polygon group entry is 12 bytes long.&lt;br /&gt;
&lt;br /&gt;
{|class=wikitable&lt;br /&gt;
! Offset !! Type !! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x00 || UInt16 || &#039;&#039;&#039;First triangle ID&#039;&#039;&#039;.&lt;br /&gt;
|-&lt;br /&gt;
| 0x02 || UInt16 || &#039;&#039;&#039;Number of triangles&#039;&#039;&#039;.&lt;br /&gt;
|-&lt;br /&gt;
| 0x04 || Byte || &#039;&#039;&#039;Main collision attribute&#039;&#039;&#039;. &#039;&#039;&#039;AAAA BBBB&#039;&#039;&#039;:&lt;br /&gt;
* &#039;&#039;&#039;A&#039;&#039;&#039;: &#039;&#039;&#039;Shadow level&#039;&#039;&#039;. The higher the value, the darker the character gets.&lt;br /&gt;
* &#039;&#039;&#039;B&#039;&#039;&#039;: &#039;&#039;&#039;Collision flag&#039;&#039;&#039;:&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! ID !! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x01 || Road and effects.&lt;br /&gt;
|-&lt;br /&gt;
| 0x05 || Wall (sparks on collision).&lt;br /&gt;
|-&lt;br /&gt;
| 0x08 || Special effects (turns off visual model).&lt;br /&gt;
|-&lt;br /&gt;
| 0x0C || Invisible wall (no sparks on collision, turns off visual model).&lt;br /&gt;
|}&lt;br /&gt;
|-&lt;br /&gt;
| 0x05 || Byte || &#039;&#039;&#039;Secondary collision attribute&#039;&#039;&#039;:&lt;br /&gt;
* &#039;&#039;&#039;Main flag = 0x01&#039;&#039;&#039;:&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! ID !! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x00 || Special effect? Used for water.&lt;br /&gt;
|-&lt;br /&gt;
| 0x01 || Pass through/no effect.&lt;br /&gt;
|-&lt;br /&gt;
| 0x04 || Road.&lt;br /&gt;
|}&lt;br /&gt;
* &#039;&#039;&#039;Main flag = 0x08&#039;&#039;&#039;:&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! ID !! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x00 || Invisible wall (no sparks on collision).&lt;br /&gt;
|-&lt;br /&gt;
| 0x01 || Water.&lt;br /&gt;
|}&lt;br /&gt;
|-&lt;br /&gt;
| 0x06 || UInt16 || &#039;&#039;&#039;Tertiary collision attribute&#039;&#039;&#039;. Split in bits.&lt;br /&gt;
* &#039;&#039;&#039;Main flag = 0x01&#039;&#039;&#039;:&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! ID !! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x01 || {{unknown-left|&#039;&#039;&#039;Unknown&#039;&#039;&#039;. Used in non-collideable stuff.}}&lt;br /&gt;
|-&lt;br /&gt;
| 0x02 || Water, inflates tires in car.&lt;br /&gt;
|-&lt;br /&gt;
| 0x10 || {{unknown-left|&#039;&#039;&#039;Unknown&#039;&#039;&#039;. Used in non-collideable stuff.}}&lt;br /&gt;
|-&lt;br /&gt;
| 0x20 || {{unknown-left|&#039;&#039;&#039;Unknown&#039;&#039;&#039;. Used in non-collideable stuff.}}&lt;br /&gt;
|-&lt;br /&gt;
| 0x60 || {{unknown-left|&#039;&#039;&#039;Unknown&#039;&#039;&#039;. Used in non-collideable stuff.}}&lt;br /&gt;
|}&lt;br /&gt;
* &#039;&#039;&#039;Main flag = 0x08&#039;&#039;&#039;:&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! ID !! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x30 || {{unknown-left|&#039;&#039;&#039;Unknown&#039;&#039;&#039;. Used in non-collideable stuff.}}&lt;br /&gt;
|}&lt;br /&gt;
* &#039;&#039;&#039;Main flag = 0x0C&#039;&#039;&#039;:&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! ID !! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x04 || Ignore when using plane.&lt;br /&gt;
|}&lt;br /&gt;
|-&lt;br /&gt;
| 0x08 || Byte[4] || &#039;&#039;&#039;Collision grid mask&#039;&#039;&#039;. This is an OR of all of the [[#Track Section Collision Data|collision grids]] for all triangles in this group.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The number of triangles &#039;&#039;&#039;T&#039;&#039;&#039; can be calculated by adding the first triangle ID to the number of triangles of the last polygon group entry.&lt;br /&gt;
&lt;br /&gt;
===== Track Section Triangle Data =====&lt;br /&gt;
This section stores &#039;&#039;&#039;T&#039;&#039;&#039; triangle entries.&lt;br /&gt;
&lt;br /&gt;
{|class=wikitable&lt;br /&gt;
! Offset !! Type !! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x00 || [[#Triangle Entry|Triangle Entry]][&#039;&#039;&#039;T&#039;&#039;&#039;] || &#039;&#039;&#039;Triangle entries&#039;&#039;&#039;.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
====== Triangle Entry ======&lt;br /&gt;
Each triangle entry is 20 bytes long.&lt;br /&gt;
&lt;br /&gt;
{|class=wikitable&lt;br /&gt;
! Offset !! Type !! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x00 || UInt16 || &#039;&#039;&#039;Attribute flags&#039;&#039;&#039;. &#039;&#039;&#039;AAAA AAAA AAAA AAAB&#039;&#039;&#039;:&lt;br /&gt;
* &#039;&#039;&#039;A&#039;&#039;&#039;: &#039;&#039;&#039;Texture ID&#039;&#039;&#039;.&lt;br /&gt;
* &#039;&#039;&#039;B&#039;&#039;&#039;: Collidable attribute? If 0 in roads, the triangles are not collidable. Unknown meaning in walls.&lt;br /&gt;
|-&lt;br /&gt;
| 0x02 || UInt16[3] || &#039;&#039;&#039;Face XYZ normals&#039;&#039;&#039;. Values need to be divided by 4096.&lt;br /&gt;
|-&lt;br /&gt;
| 0x08 || Byte[4] || &#039;&#039;&#039;Vertex position indices&#039;&#039;&#039;. The index for each of the 3 vertices is 10 bits long. 2 last bits are unknown.&lt;br /&gt;
|-&lt;br /&gt;
| 0x0C || Byte[4] || &#039;&#039;&#039;UV indices&#039;&#039;&#039;. The index for each of the 3 vertices is 10 bits long. 2 last bits are unknown.&lt;br /&gt;
|-&lt;br /&gt;
| 0x10 || Byte[4] || &#039;&#039;&#039;Color indices&#039;&#039;&#039;. The index for each of the 3 vertices is 10 bits long. 2 last bits are unknown.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
===== Track Section Collision Data =====&lt;br /&gt;
Each triangle corresponds to a 4-byte set of values to help with collision detection. These values encode local X, Y and Z coordinates that form a grid of cells inside the section&#039;s AABB.&lt;br /&gt;
&lt;br /&gt;
{|class=wikitable&lt;br /&gt;
! Offset !! Type !! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x00 || Byte || &#039;&#039;&#039;Y occupancy&#039;&#039;&#039;. Values correspond to 8 cells of the AABB (AABB&#039;s Y extent / 8).&lt;br /&gt;
|-&lt;br /&gt;
| 0x01 || Byte || &#039;&#039;&#039;Z occupancy&#039;&#039;&#039;. Values correspond to 8 cells of the AABB (AABB&#039;s Z extent / 8).&lt;br /&gt;
|-&lt;br /&gt;
| 0x02 || UInt16 || &#039;&#039;&#039;X occupancy&#039;&#039;&#039;. Values correspond to 16 cells of the AABB (AABB&#039;s X extent / 16).&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The following ARM assembly instructions (@01FF95D0 from the game&#039;s code) demonstrate how the vehicle&#039;s current grid bitmask is compared to the current testing triangle&#039;s collision:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
AND R0, R0, R5 // R0 = triangle&#039;s collision value AND vehicle&#039;s bitmask&lt;br /&gt;
TST R0, #FF // test byte 0 (Y)&lt;br /&gt;
TSTNE R0, #FF00 // if nonzero, test byte 1 (Z)&lt;br /&gt;
MOVNES R0, R0, LSR #10 // if still nonzero, test upper 16 bits (X)&lt;br /&gt;
MOVNE R0, #1 // collidable only if ALL 3 are nonzero&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The following functions in C# compute a triangle&#039;s collision grid from its minimum and maximum positions and its containing section&#039;s AABB:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
uint ComputeCollision(float xMin, float xMax, float yMin, float yMax, float zMin, float zMax, float aabbXMin, float aabbXExt, float aabbYMin, float aabbYExt, float aabbZMin, float aabbZExt)&lt;br /&gt;
{&lt;br /&gt;
    if (aabbXExt &amp;lt;= 0 || aabbYExt &amp;lt;= 0 || aabbZExt &amp;lt;= 0)&lt;br /&gt;
        return 0xFFFFFFFFu;&lt;br /&gt;
&lt;br /&gt;
    uint xBits = ComputeCellBits(xMin - aabbXMin, xMax - aabbXMin, aabbXExt / 16f, 16);&lt;br /&gt;
    uint zBits = ComputeCellBits(zMin - aabbZMin, zMax - aabbZMin, aabbZExt / 8f, 8);&lt;br /&gt;
    uint yBits = ComputeCellBits(yMin - aabbYMin, yMax - aabbYMin, aabbYExt / 8f, 8);&lt;br /&gt;
&lt;br /&gt;
    return (xBits &amp;lt;&amp;lt; 16) | (zBits &amp;lt;&amp;lt; 8) | yBits;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
uint ComputeCellBits(float relMin, float relMax, float cellSize, int nrCells)&lt;br /&gt;
{&lt;br /&gt;
    const float Epsilon = 1e-4f;&lt;br /&gt;
    float faceMin = relMin / cellSize;&lt;br /&gt;
    float faceMax = relMax / cellSize;&lt;br /&gt;
&lt;br /&gt;
    // Special case for degenerate faces (flat faces with zero extent in this axis, e.g. a wall parallel to XZ)&lt;br /&gt;
    if (MathF.Abs(faceMax - faceMin) &amp;lt; Epsilon)&lt;br /&gt;
    {&lt;br /&gt;
        int cell = Math.Max(0, Math.Min(nrCells - 1, (int)MathF.Floor(faceMin)));&lt;br /&gt;
        bool atExact = MathF.Abs(faceMin - MathF.Round(faceMin)) &amp;lt; Epsilon;&lt;br /&gt;
        bool atMaxEdge = cell == nrCells - 1;&lt;br /&gt;
&lt;br /&gt;
        // Include the preceding cell only at an interior exact boundary&lt;br /&gt;
        if (atExact &amp;amp;&amp;amp; cell &amp;gt; 0 &amp;amp;&amp;amp; !atMaxEdge)&lt;br /&gt;
            return (1u &amp;lt;&amp;lt; cell) | (1u &amp;lt;&amp;lt; (cell - 1));&lt;br /&gt;
&lt;br /&gt;
        return 1u &amp;lt;&amp;lt; cell;&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    int cellMin = (int)MathF.Floor(faceMin);&lt;br /&gt;
    int cellMax = (int)MathF.Floor(faceMax - Epsilon); // Exact upper boundary stays in current cell&lt;br /&gt;
&lt;br /&gt;
    // Exact lower boundary stays in the preceding cell&lt;br /&gt;
    bool atExactLow = MathF.Abs(faceMin - MathF.Round(faceMin)) &amp;lt; Epsilon;&lt;br /&gt;
    bool atMaxLow = cellMin == nrCells - 1;&lt;br /&gt;
    if (atExactLow &amp;amp;&amp;amp; cellMin &amp;gt; 0 &amp;amp;&amp;amp; !atMaxLow)&lt;br /&gt;
        cellMin--;&lt;br /&gt;
&lt;br /&gt;
    cellMin = Math.Max(0, cellMin);&lt;br /&gt;
    cellMax = Math.Min(nrCells - 1, cellMax);&lt;br /&gt;
&lt;br /&gt;
    uint bits = 0;&lt;br /&gt;
&lt;br /&gt;
    for (int c = cellMin; c &amp;lt;= cellMax; c++)&lt;br /&gt;
        bits |= 1u &amp;lt;&amp;lt; c;&lt;br /&gt;
&lt;br /&gt;
    return bits;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===== Track Section Vertex Data =====&lt;br /&gt;
Vertex data is stored as 6-byte groups per entry &#039;&#039;&#039;V&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
{|class=wikitable&lt;br /&gt;
! Offset !! Type !! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x00 || Int16[3][&#039;&#039;&#039;V&#039;&#039;&#039;] || &#039;&#039;&#039;Vertex XYZ position&#039;&#039;&#039;.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
===== Track Section UV Data =====&lt;br /&gt;
UV data is stored as 4-byte groups per entry &#039;&#039;&#039;U&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
{|class=wikitable&lt;br /&gt;
! Offset !! Type !! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x00 || Int16[2][&#039;&#039;&#039;U&#039;&#039;&#039;] || &#039;&#039;&#039;Vertex UV position&#039;&#039;&#039;.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
===== Track Section Color Data =====&lt;br /&gt;
Color data is stored as 2-byte groups per entry &#039;&#039;&#039;C&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
{|class=wikitable&lt;br /&gt;
! Offset !! Type !! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x00 || UInt16[&#039;&#039;&#039;C&#039;&#039;&#039;] || &#039;&#039;&#039;RGBA5551 color&#039;&#039;&#039;.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Terrain Effects ==&lt;br /&gt;
Each texture is linked to 2 specific terrain effects that affect the vehicle&#039;s speed, particles and lighting. This section contains 2 blocks of &#039;&#039;&#039;X&#039;&#039;&#039; UInt16s.&lt;br /&gt;
&lt;br /&gt;
{|class=wikitable&lt;br /&gt;
! Offset !! Type !! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x00 || UInt16[&#039;&#039;&#039;X&#039;&#039;&#039;] || &#039;&#039;&#039;Effects&#039;&#039;&#039;, split in bits.&lt;br /&gt;
|-&lt;br /&gt;
| &#039;&#039;&#039;X&#039;&#039;&#039; * 2 || UInt16[&#039;&#039;&#039;X&#039;&#039;&#039;] || {{unknown-left|&#039;&#039;&#039;Unknown&#039;&#039;&#039;. This seems to be a copy of the previous block?}}&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Culling Groups ==&lt;br /&gt;
This section includes a 4-byte or 8-byte per track section values that determine which section models are loaded when entering a specific section. Each section is represented as 1 bit.&lt;br /&gt;
&lt;br /&gt;
{|class=wikitable&lt;br /&gt;
! Offset !! Type !! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x00 || UInt16[&#039;&#039;&#039;N&#039;&#039;&#039;]/UInt32[&#039;&#039;&#039;N&#039;&#039;&#039;] || &#039;&#039;&#039;Culled model sections&#039;&#039;&#039;, represented as &#039;&#039;&#039;N&#039;&#039;&#039; bits, 1 per section, in order from the least to the most significant bit. 0 if culled, 1 if loaded.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Texture Group ==&lt;br /&gt;
See &#039;&#039;&#039;[[DKRDS Texture Group]]&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
== Culling BSP Tree ==&lt;br /&gt;
This section defines a serialized axis-aligned binary space partitioning tree used for culling sections along with the [[#Culling Groups|Culling Groups]] section. The game traverses it to determine which sections are candidates for rendering given the current player&#039;s position, and then performs a secondary [[#Track Section AABB|AABB]] overlap test on each candidate before adding it to the active render list. The section consists of a sequence of variable-length nodes and leaves stored one after another.&lt;br /&gt;
&lt;br /&gt;
=== Interior Node ===&lt;br /&gt;
An interior node is always 8 bytes long and can be identified apart from a leaf node if the first Int16 is not negative.&lt;br /&gt;
&lt;br /&gt;
{|class=wikitable&lt;br /&gt;
! Offset !! Type !! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x00 || Int16 || &#039;&#039;&#039;Axis index&#039;&#039;&#039; into the player position array:&lt;br /&gt;
* &#039;&#039;&#039;0&#039;&#039;&#039; = X axis.&lt;br /&gt;
* &#039;&#039;&#039;1&#039;&#039;&#039; = Y axis. Unused?&lt;br /&gt;
* &#039;&#039;&#039;2&#039;&#039;&#039; = Z axis.&lt;br /&gt;
|-&lt;br /&gt;
| 0x02 || Int16 || &#039;&#039;&#039;Split value high bits&#039;&#039;&#039;.&lt;br /&gt;
|-&lt;br /&gt;
| 0x04 || UInt16 || &#039;&#039;&#039;Split value low bits&#039;&#039;&#039;.&lt;br /&gt;
|-&lt;br /&gt;
| 0x06 || Int16 || &#039;&#039;&#039;Skip count&#039;&#039;&#039;. The right child begins at &amp;lt;code&amp;gt;(node_offset + 8) + skip * 2&amp;lt;/code&amp;gt; bytes from the start of this section. The left child begins immediately at &amp;lt;code&amp;gt;node_offset + 8&amp;lt;/code&amp;gt;.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The split coordinate is reconstructed by the game as a 32-bit signed result, then divided by 64 to obtain the coordinates in world units (the same scale as the [[#Track Section AABB|section AABBs]]):&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
split = ((split_high &amp;lt;&amp;lt; 16) | (split_low &amp;amp; 0xFFFF)) / 64&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To encode a world-coordinate integer back into the two stored fields:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
split_raw = round(split * 64)							   &lt;br /&gt;
(Int16)split_high = (split_raw &amp;gt;&amp;gt; 16) &amp;amp; 0xFFFF&lt;br /&gt;
(UInt16)split_low = split_raw &amp;amp; 0xFFFF&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Leaf Node ===&lt;br /&gt;
Leaf nodes are variable-length.&lt;br /&gt;
 &lt;br /&gt;
{|class=wikitable&lt;br /&gt;
! Offset !! Type !! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x00 || Int16 || &#039;&#039;&#039;Negative count&#039;&#039;&#039; (&#039;&#039;&#039;-L&#039;&#039;&#039;). The value is always negative. Its negation &#039;&#039;&#039;L&#039;&#039;&#039; gives the number of section IDs that follow.&lt;br /&gt;
|-&lt;br /&gt;
| 0x02 || Int16[&#039;&#039;&#039;L&#039;&#039;&#039;] || &#039;&#039;&#039;Section IDs&#039;&#039;&#039;. Zero-based indices into the [[#Track Section Group|Track Section Group]]. A section may appear in more than one leaf when its AABB occupies a split plane.&lt;br /&gt;
|}&lt;br /&gt;
 &lt;br /&gt;
=== Traversal Algorithm ===&lt;br /&gt;
The game calls the function &amp;lt;code&amp;gt;@02006CC4(bsp_ptr, track_sg, position, tolerance, out_list)&amp;lt;/code&amp;gt;:&lt;br /&gt;
* &#039;&#039;&#039;bsp_ptr&#039;&#039;&#039;: pointer to the start of this section in RAM.&lt;br /&gt;
* &#039;&#039;&#039;track_sg&#039;&#039;&#039;: pointer to the [[#Track Section Group|Track Section Group]].&lt;br /&gt;
* &#039;&#039;&#039;position&#039;&#039;&#039;: player XYZ position.&lt;br /&gt;
* &#039;&#039;&#039;tolerance&#039;&#039;&#039;: a proximity radius, observed as &amp;lt;code&amp;gt;0xF00&amp;lt;/code&amp;gt; (60 in world units).&lt;br /&gt;
* &#039;&#039;&#039;out_list&#039;&#039;&#039;: output structure that receives the active section list.&lt;br /&gt;
 &lt;br /&gt;
At each interior node, in world-unit scale:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
pos = position[axis]&lt;br /&gt;
split_raw = (split_high &amp;lt;&amp;lt; 16) | (split_low &amp;amp; 0xFFFF)&lt;br /&gt;
split = split_raw / 64&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If &amp;lt;code&amp;gt;split - pos &amp;gt; tolerance&amp;lt;/code&amp;gt;, visit the left child only; else if &amp;lt;code&amp;gt;pos - split &amp;amp;ge; tolerance&amp;lt;/code&amp;gt;, visit the right child only; otherwise, visit both children.&lt;br /&gt;
&lt;br /&gt;
The left child corresponds to sections whose AABB satisfies &amp;lt;code&amp;gt;min[axis] &amp;amp;le; split&amp;lt;/code&amp;gt;; the right child corresponds to sections whose AABB satisfies &amp;lt;code&amp;gt;max[axis] &amp;amp;ge; split&amp;lt;/code&amp;gt;. Sections satisfying both (i.e. whose AABB traverses the split plane) appear in leaves on both sides.&lt;br /&gt;
&lt;br /&gt;
At each leaf node, for every listed section ID the section&#039;s data pointer is first looked up via the [[#Track Section Group|Track Section Group]]. Then, the player&#039;s bounding box is tested (&amp;lt;code&amp;gt;(X &amp;amp;plusmn; tolerance) * (Z &amp;amp;plusmn; tolerance)&amp;lt;/code&amp;gt;) against the section&#039;s [[#Track Section AABB|AABB]]. If the AABB test passes, add the section to the active render list.&lt;br /&gt;
&lt;br /&gt;
== Wish Race Unknown Section ==&lt;br /&gt;
This section is only used for the Wish Race tracks. Each entry is 0x18 bytes long. &#039;&#039;TBD&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
= Tools =&lt;br /&gt;
The following tools can handle DKRDS Track:&lt;br /&gt;
* (none)&lt;br /&gt;
&lt;br /&gt;
[[Category:Diddy Kong Racing DS File Formats]]&lt;/div&gt;</summary>
		<author><name>Atlas</name></author>
	</entry>
	<entry>
		<id>https://wiki.wexosmk.xyz/index.php?title=DKRDS_Track_(File_Format)&amp;diff=686</id>
		<title>DKRDS Track (File Format)</title>
		<link rel="alternate" type="text/html" href="https://wiki.wexosmk.xyz/index.php?title=DKRDS_Track_(File_Format)&amp;diff=686"/>
		<updated>2026-06-15T20:15:15Z</updated>

		<summary type="html">&lt;p&gt;Atlas: /* Track Section Entry */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&#039;&#039;&#039;DKRDS Track&#039;&#039;&#039; is the nameless file format used in &#039;&#039;[https://en.wikipedia.org/wiki/Diddy_Kong_Racing_DS Diddy Kong Racing DS]&#039;&#039; that stores the tracks&#039; section models, collision and textures. Its type identifier in [[assets.bin]] is &#039;&#039;&#039;0x9A&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
= File Format =&lt;br /&gt;
The file byte order is always little endian.&lt;br /&gt;
&lt;br /&gt;
== Header ==&lt;br /&gt;
The file starts with a header that is 56 bytes long.&lt;br /&gt;
&lt;br /&gt;
{|class=wikitable&lt;br /&gt;
! Offset !! Type !! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x00 || Int32 || &#039;&#039;&#039;Number of sections&#039;&#039;&#039; (&#039;&#039;&#039;N&#039;&#039;&#039;).&lt;br /&gt;
|-&lt;br /&gt;
| 0x04 || Int32 || &#039;&#039;&#039;[[#Track Section Group|Track Section Group]]&#039;&#039;&#039; offset.&lt;br /&gt;
|-&lt;br /&gt;
| 0x08 || Int32 || &#039;&#039;&#039;[[#Terrain Effects|Terrain Effects]]&#039;&#039;&#039; offset.&lt;br /&gt;
|-&lt;br /&gt;
| 0x0C || Byte[4] || {{unknown-left|&#039;&#039;&#039;Unknown&#039;&#039;&#039;. Always 0xCCCCCCCC.}}&lt;br /&gt;
|-&lt;br /&gt;
| 0x10 || Int32 || &#039;&#039;&#039;[[#Culling Groups|Culling Groups]]&#039;&#039;&#039; offset.&lt;br /&gt;
|-&lt;br /&gt;
| 0x14 || Int32 || &#039;&#039;&#039;[[#Culling Groups|Culling Groups]]&#039;&#039;&#039; data type:&lt;br /&gt;
* 1 = 4-byte per &#039;&#039;&#039;N&#039;&#039;&#039; group.&lt;br /&gt;
* 2 = 8-byte per &#039;&#039;&#039;N&#039;&#039;&#039; group.&lt;br /&gt;
|-&lt;br /&gt;
| 0x18 || Int32 || &#039;&#039;&#039;Number of textures&#039;&#039;&#039; (&#039;&#039;&#039;X&#039;&#039;&#039;).&lt;br /&gt;
|-&lt;br /&gt;
| 0x1C || Int32 || &#039;&#039;&#039;[[#Texture Group|Texture Group]]&#039;&#039;&#039; offset.&lt;br /&gt;
|-&lt;br /&gt;
| 0x20 || Int32 || &#039;&#039;&#039;[[#Culling BSP Tree|Culling BSP Tree]]&#039;&#039;&#039; offset.&lt;br /&gt;
|-&lt;br /&gt;
| 0x24 || Int32 || &#039;&#039;&#039;[[#Wish Race Unknown Section|Wish Race Unknown Section]]&#039;&#039;&#039; entry count.&lt;br /&gt;
|-&lt;br /&gt;
| 0x28 || Int32 || &#039;&#039;&#039;[[#Wish Race Unknown Section|Wish Race Unknown Section]]&#039;&#039;&#039; offset.&lt;br /&gt;
|-&lt;br /&gt;
| 0x2C || Byte[4] || {{unknown-left|&#039;&#039;&#039;Unknown&#039;&#039;&#039;. Seems to be some kind of flags.}}&lt;br /&gt;
|-&lt;br /&gt;
| 0x30 || Int32 || {{unknown-left|&#039;&#039;&#039;Unknown&#039;&#039;&#039;.}}&lt;br /&gt;
|-&lt;br /&gt;
| 0x34 || Int32 || &#039;&#039;&#039;File size&#039;&#039;&#039;.&lt;br /&gt;
|-&lt;br /&gt;
| 0x38 || colspan=2 {{unknown|End of header}}&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Track Section Group ==&lt;br /&gt;
This group starts with a list of &#039;&#039;&#039;N&#039;&#039;&#039; offsets.&lt;br /&gt;
&lt;br /&gt;
{|class=wikitable&lt;br /&gt;
|+ Track Section Header&lt;br /&gt;
! Offset !! Type !! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x00 || Int32[&#039;&#039;&#039;N&#039;&#039;&#039;] || &#039;&#039;&#039;[[#Track Section Entry|Track Section Entry]]&#039;&#039;&#039; offsets. Relative to the start of this group.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Track Section Entry ===&lt;br /&gt;
Every section entry defines model and collision data. The entry starts with a 32-byte header. All offsets are relative to the start of this entry.&lt;br /&gt;
&lt;br /&gt;
{|class=wikitable&lt;br /&gt;
|+ Track Section Entry Header&lt;br /&gt;
! Offset !! Type !! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x00 || Byte || {{unknown-left|&#039;&#039;&#039;Unknown&#039;&#039;&#039;.}}&lt;br /&gt;
|-&lt;br /&gt;
| 0x01 || Byte || {{unknown-left|&#039;&#039;&#039;Unknown&#039;&#039;&#039;.}}&lt;br /&gt;
|-&lt;br /&gt;
| 0x02 || UInt16 || {{unknown-left|&#039;&#039;&#039;Unknown&#039;&#039;&#039;.}}&lt;br /&gt;
|-&lt;br /&gt;
| 0x04 || UInt16 || &#039;&#039;&#039;Number of polygon groups&#039;&#039;&#039; (&#039;&#039;&#039;P&#039;&#039;&#039;).&lt;br /&gt;
|-&lt;br /&gt;
| 0x06 || UInt16 || &#039;&#039;&#039;Number of vertices&#039;&#039;&#039; in [[#Track Section Vertex Data|Track Section Vertex Data]] (&#039;&#039;&#039;V&#039;&#039;&#039;).&lt;br /&gt;
|-&lt;br /&gt;
| 0x08 || UInt16 || &#039;&#039;&#039;Number of UVs&#039;&#039;&#039; in [[#Track Section UV Data|Track Section UV Data]] (&#039;&#039;&#039;U&#039;&#039;&#039;).&lt;br /&gt;
|-&lt;br /&gt;
| 0x0A || UInt16 || &#039;&#039;&#039;Number of colors&#039;&#039;&#039; in [[#Track Section Color Data|Track Section Color Data]] (&#039;&#039;&#039;C&#039;&#039;&#039;).&lt;br /&gt;
|-&lt;br /&gt;
| 0x0C || Int32 || &#039;&#039;&#039;[[#Track Section Triangle Data|Track Section Triangle Data]]&#039;&#039;&#039; offset.&lt;br /&gt;
|-&lt;br /&gt;
| 0x10 || Int32 || &#039;&#039;&#039;[[#Track Section Collision Data|Track Section Collision Data]]&#039;&#039;&#039; offset.&lt;br /&gt;
|-&lt;br /&gt;
| 0x14 || Int32 || &#039;&#039;&#039;[[#Track Section Vertex Data|Track Section Vertex Data]]&#039;&#039;&#039; offset.&lt;br /&gt;
|-&lt;br /&gt;
| 0x18 || Int32 || &#039;&#039;&#039;[[#Track Section UV Data|Track Section UV Data]]&#039;&#039;&#039; offset.&lt;br /&gt;
|-&lt;br /&gt;
| 0x1C || Int32 || &#039;&#039;&#039;[[#Track Section Color Data|Track Section Color Data]]&#039;&#039;&#039; offset.&lt;br /&gt;
|-&lt;br /&gt;
| 0x20 || colspan=2 {{unknown|End of header, start of [[#Track Section Data|Track Section Data]]}}&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== Track Section Data ====&lt;br /&gt;
This data follows directly after the header of the section entry and starts with a 76-byte header.&lt;br /&gt;
&lt;br /&gt;
{|class=wikitable&lt;br /&gt;
! Offset !! Type !! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x00 || Int32 || {{unknown-left|&#039;&#039;&#039;Unknown&#039;&#039;&#039;. Seems to be always 0xFFFFFFFF and set to an address when loaded in memory.}}&lt;br /&gt;
|-&lt;br /&gt;
| 0x04 || Int32[3] || &#039;&#039;&#039;Collision XYZ offset&#039;&#039;&#039;.&lt;br /&gt;
|-&lt;br /&gt;
| 0x10 || Int32[3] || &#039;&#039;&#039;Visual model XYZ offset&#039;&#039;&#039;. The units are not the same as the collision offset.&lt;br /&gt;
|-&lt;br /&gt;
| 0x1C || [[#Track Section AABB|Track Section AABB]][2] || &#039;&#039;&#039;AABB areas&#039;&#039;&#039; of the entire section used for collision detection. The second AABB always seems to be a duplicate of the first.&lt;br /&gt;
|-&lt;br /&gt;
| 0x4C || colspan=2 {{unknown|End of header, start of [[#Track Section Polygon Data|Track Section Polygon Data]]}}&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
===== Track Section AABB =====&lt;br /&gt;
Track sections contain 2 identical AABB areas each. It is unknown why there&#039;s a duplicate, perhaps used during runtime after object space transform. All values need to be divided by 64 in order to obtain the absolute position data and match with the visual models.&lt;br /&gt;
&lt;br /&gt;
{|class=wikitable&lt;br /&gt;
! Offset !! Type !! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x00 || Int32[3] || &#039;&#039;&#039;AABB minimum XYZ position&#039;&#039;&#039;.&lt;br /&gt;
|-&lt;br /&gt;
| 0x0C || Int32[3] || &#039;&#039;&#039;AABB XYZ extent&#039;&#039;&#039;.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
===== Track Section Polygon Data =====&lt;br /&gt;
This section seems to store &#039;&#039;&#039;P&#039;&#039;&#039; polygon groups&#039; attributes.&lt;br /&gt;
&lt;br /&gt;
{|class=wikitable&lt;br /&gt;
! Offset !! Type !! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x00 || [[#Polygon Group Entry|Polygon Group Entry]][&#039;&#039;&#039;P&#039;&#039;&#039;] || &#039;&#039;&#039;Polygon group entries&#039;&#039;&#039;.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
====== Polygon Group Entry ======&lt;br /&gt;
Each polygon group entry is 12 bytes long.&lt;br /&gt;
&lt;br /&gt;
{|class=wikitable&lt;br /&gt;
! Offset !! Type !! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x00 || UInt16 || &#039;&#039;&#039;First triangle ID&#039;&#039;&#039;.&lt;br /&gt;
|-&lt;br /&gt;
| 0x02 || UInt16 || &#039;&#039;&#039;Number of triangles&#039;&#039;&#039;.&lt;br /&gt;
|-&lt;br /&gt;
| 0x04 || Byte || &#039;&#039;&#039;Main collision attribute&#039;&#039;&#039;. &#039;&#039;&#039;AAAA BBBB&#039;&#039;&#039;:&lt;br /&gt;
* &#039;&#039;&#039;A&#039;&#039;&#039;: &#039;&#039;&#039;Shadow level&#039;&#039;&#039;. The higher the value, the darker the character gets.&lt;br /&gt;
* &#039;&#039;&#039;B&#039;&#039;&#039;: &#039;&#039;&#039;Collision flag&#039;&#039;&#039;:&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! ID !! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x01 || Road and effects.&lt;br /&gt;
|-&lt;br /&gt;
| 0x05 || Wall (sparks on collision).&lt;br /&gt;
|-&lt;br /&gt;
| 0x08 || Special effects (turns off visual model).&lt;br /&gt;
|-&lt;br /&gt;
| 0x0C || Invisible wall (no sparks on collision, turns off visual model).&lt;br /&gt;
|}&lt;br /&gt;
|-&lt;br /&gt;
| 0x05 || Byte || &#039;&#039;&#039;Secondary collision attribute&#039;&#039;&#039;:&lt;br /&gt;
* &#039;&#039;&#039;Main flag = 0x01&#039;&#039;&#039;:&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! ID !! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x00 || Special effect? Used for water.&lt;br /&gt;
|-&lt;br /&gt;
| 0x01 || Pass through/no effect.&lt;br /&gt;
|-&lt;br /&gt;
| 0x04 || Road.&lt;br /&gt;
|}&lt;br /&gt;
* &#039;&#039;&#039;Main flag = 0x08&#039;&#039;&#039;:&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! ID !! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x00 || Invisible wall (no sparks on collision).&lt;br /&gt;
|-&lt;br /&gt;
| 0x01 || Water.&lt;br /&gt;
|}&lt;br /&gt;
|-&lt;br /&gt;
| 0x06 || UInt16 || &#039;&#039;&#039;Tertiary collision attribute&#039;&#039;&#039;. Split in bits.&lt;br /&gt;
* &#039;&#039;&#039;Main flag = 0x01&#039;&#039;&#039;:&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! ID !! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x01 || {{unknown-left|&#039;&#039;&#039;Unknown&#039;&#039;&#039;. Used in non-collideable stuff.}}&lt;br /&gt;
|-&lt;br /&gt;
| 0x02 || Water, inflates tires in car.&lt;br /&gt;
|-&lt;br /&gt;
| 0x10 || {{unknown-left|&#039;&#039;&#039;Unknown&#039;&#039;&#039;. Used in non-collideable stuff.}}&lt;br /&gt;
|-&lt;br /&gt;
| 0x20 || {{unknown-left|&#039;&#039;&#039;Unknown&#039;&#039;&#039;. Used in non-collideable stuff.}}&lt;br /&gt;
|-&lt;br /&gt;
| 0x60 || {{unknown-left|&#039;&#039;&#039;Unknown&#039;&#039;&#039;. Used in non-collideable stuff.}}&lt;br /&gt;
|}&lt;br /&gt;
* &#039;&#039;&#039;Main flag = 0x08&#039;&#039;&#039;:&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! ID !! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x30 || {{unknown-left|&#039;&#039;&#039;Unknown&#039;&#039;&#039;. Used in non-collideable stuff.}}&lt;br /&gt;
|}&lt;br /&gt;
* &#039;&#039;&#039;Main flag = 0x0C&#039;&#039;&#039;:&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! ID !! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x04 || Ignore when using plane.&lt;br /&gt;
|}&lt;br /&gt;
|-&lt;br /&gt;
| 0x08 || Byte[4] || &#039;&#039;&#039;Collision grid mask&#039;&#039;&#039;. This is an OR of all of the [[#Track Section Collision Data|collision grids]] for all triangles in this group.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The number of triangles &#039;&#039;&#039;T&#039;&#039;&#039; can be calculated by adding the first triangle ID to the number of triangles of the last polygon group entry.&lt;br /&gt;
&lt;br /&gt;
===== Track Section Triangle Data =====&lt;br /&gt;
This section stores &#039;&#039;&#039;T&#039;&#039;&#039; triangle entries.&lt;br /&gt;
&lt;br /&gt;
{|class=wikitable&lt;br /&gt;
! Offset !! Type !! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x00 || [[#Triangle Entry|Triangle Entry]][&#039;&#039;&#039;T&#039;&#039;&#039;] || &#039;&#039;&#039;Triangle entries&#039;&#039;&#039;.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
====== Triangle Entry ======&lt;br /&gt;
Each triangle entry is 20 bytes long.&lt;br /&gt;
&lt;br /&gt;
{|class=wikitable&lt;br /&gt;
! Offset !! Type !! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x00 || UInt16 || &#039;&#039;&#039;Attribute flags&#039;&#039;&#039;. &#039;&#039;&#039;AAAA AAAA AAAA AAAB&#039;&#039;&#039;:&lt;br /&gt;
* &#039;&#039;&#039;A&#039;&#039;&#039;: &#039;&#039;&#039;Texture ID&#039;&#039;&#039;.&lt;br /&gt;
* &#039;&#039;&#039;B&#039;&#039;&#039;: Collidable attribute? If 0 in roads, the triangles are not collidable. Unknown meaning in walls.&lt;br /&gt;
|-&lt;br /&gt;
| 0x02 || UInt16[3] || &#039;&#039;&#039;Face XYZ normals&#039;&#039;&#039;. Values need to be divided by 4096.&lt;br /&gt;
|-&lt;br /&gt;
| 0x08 || Byte[4] || &#039;&#039;&#039;Vertex position indices&#039;&#039;&#039;. The index for each of the 3 vertices is 10 bits long. 2 last bits are unknown.&lt;br /&gt;
|-&lt;br /&gt;
| 0x0C || Byte[4] || &#039;&#039;&#039;UV indices&#039;&#039;&#039;. The index for each of the 3 vertices is 10 bits long. 2 last bits are unknown.&lt;br /&gt;
|-&lt;br /&gt;
| 0x10 || Byte[4] || &#039;&#039;&#039;Color indices&#039;&#039;&#039;. The index for each of the 3 vertices is 10 bits long. 2 last bits are unknown.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
===== Track Section Collision Data =====&lt;br /&gt;
Each triangle corresponds to a 4-byte set of values to help with collision detection. These values encode local X, Y and Z coordinates that form a grid of cells inside the section&#039;s AABB.&lt;br /&gt;
&lt;br /&gt;
{|class=wikitable&lt;br /&gt;
! Offset !! Type !! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x00 || Byte || &#039;&#039;&#039;Y occupancy&#039;&#039;&#039;. Values correspond to 8 cells of the AABB (AABB&#039;s Y extent / 8).&lt;br /&gt;
|-&lt;br /&gt;
| 0x01 || Byte || &#039;&#039;&#039;Z occupancy&#039;&#039;&#039;. Values correspond to 8 cells of the AABB (AABB&#039;s Z extent / 8).&lt;br /&gt;
|-&lt;br /&gt;
| 0x02 || UInt16 || &#039;&#039;&#039;X occupancy&#039;&#039;&#039;. Values correspond to 16 cells of the AABB (AABB&#039;s X extent / 16).&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The following ARM assembly instructions (@01FF95D0 from the game&#039;s code) demonstrate how the vehicle&#039;s current grid bitmask is compared to the current testing triangle&#039;s collision:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
AND R0, R0, R5 // R0 = triangle&#039;s collision value AND vehicle&#039;s bitmask&lt;br /&gt;
TST R0, #FF // test byte 0 (Y)&lt;br /&gt;
TSTNE R0, #FF00 // if nonzero, test byte 1 (Z)&lt;br /&gt;
MOVNES R0, R0, LSR #10 // if still nonzero, test upper 16 bits (X)&lt;br /&gt;
MOVNE R0, #1 // collidable only if ALL 3 are nonzero&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The following functions in C# compute a triangle&#039;s collision grid from its minimum and maximum positions and its containing section&#039;s AABB:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
uint ComputeCollision(float xMin, float xMax, float yMin, float yMax, float zMin, float zMax, float aabbXMin, float aabbXExt, float aabbYMin, float aabbYExt, float aabbZMin, float aabbZExt)&lt;br /&gt;
{&lt;br /&gt;
    if (aabbXExt &amp;lt;= 0 || aabbYExt &amp;lt;= 0 || aabbZExt &amp;lt;= 0)&lt;br /&gt;
        return 0xFFFFFFFFu;&lt;br /&gt;
&lt;br /&gt;
    uint xBits = ComputeCellBits(xMin - aabbXMin, xMax - aabbXMin, aabbXExt / 16f, 16);&lt;br /&gt;
    uint zBits = ComputeCellBits(zMin - aabbZMin, zMax - aabbZMin, aabbZExt / 8f, 8);&lt;br /&gt;
    uint yBits = ComputeCellBits(yMin - aabbYMin, yMax - aabbYMin, aabbYExt / 8f, 8);&lt;br /&gt;
&lt;br /&gt;
    return (xBits &amp;lt;&amp;lt; 16) | (zBits &amp;lt;&amp;lt; 8) | yBits;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
uint ComputeCellBits(float relMin, float relMax, float cellSize, int nrCells)&lt;br /&gt;
{&lt;br /&gt;
    const float Epsilon = 1e-4f;&lt;br /&gt;
    float faceMin = relMin / cellSize;&lt;br /&gt;
    float faceMax = relMax / cellSize;&lt;br /&gt;
&lt;br /&gt;
    // Special case for degenerate faces (flat faces with zero extent in this axis, e.g. a wall parallel to XZ)&lt;br /&gt;
    if (MathF.Abs(faceMax - faceMin) &amp;lt; Epsilon)&lt;br /&gt;
    {&lt;br /&gt;
        int cell = Math.Max(0, Math.Min(nrCells - 1, (int)MathF.Floor(faceMin)));&lt;br /&gt;
        bool atExact = MathF.Abs(faceMin - MathF.Round(faceMin)) &amp;lt; Epsilon;&lt;br /&gt;
        bool atMaxEdge = cell == nrCells - 1;&lt;br /&gt;
&lt;br /&gt;
        // Include the preceding cell only at an interior exact boundary&lt;br /&gt;
        if (atExact &amp;amp;&amp;amp; cell &amp;gt; 0 &amp;amp;&amp;amp; !atMaxEdge)&lt;br /&gt;
            return (1u &amp;lt;&amp;lt; cell) | (1u &amp;lt;&amp;lt; (cell - 1));&lt;br /&gt;
&lt;br /&gt;
        return 1u &amp;lt;&amp;lt; cell;&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    int cellMin = (int)MathF.Floor(faceMin);&lt;br /&gt;
    int cellMax = (int)MathF.Floor(faceMax - Epsilon); // Exact upper boundary stays in current cell&lt;br /&gt;
&lt;br /&gt;
    // Exact lower boundary stays in the preceding cell&lt;br /&gt;
    bool atExactLow = MathF.Abs(faceMin - MathF.Round(faceMin)) &amp;lt; Epsilon;&lt;br /&gt;
    bool atMaxLow = cellMin == nrCells - 1;&lt;br /&gt;
    if (atExactLow &amp;amp;&amp;amp; cellMin &amp;gt; 0 &amp;amp;&amp;amp; !atMaxLow)&lt;br /&gt;
        cellMin--;&lt;br /&gt;
&lt;br /&gt;
    cellMin = Math.Max(0, cellMin);&lt;br /&gt;
    cellMax = Math.Min(nrCells - 1, cellMax);&lt;br /&gt;
&lt;br /&gt;
    uint bits = 0;&lt;br /&gt;
&lt;br /&gt;
    for (int c = cellMin; c &amp;lt;= cellMax; c++)&lt;br /&gt;
        bits |= 1u &amp;lt;&amp;lt; c;&lt;br /&gt;
&lt;br /&gt;
    return bits;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===== Track Section Vertex Data =====&lt;br /&gt;
Vertex data is stored as 6-byte groups per entry &#039;&#039;&#039;V&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
{|class=wikitable&lt;br /&gt;
! Offset !! Type !! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x00 || Int16[3][&#039;&#039;&#039;V&#039;&#039;&#039;] || &#039;&#039;&#039;Vertex XYZ position&#039;&#039;&#039;.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
===== Track Section UV Data =====&lt;br /&gt;
UV data is stored as 4-byte groups per entry &#039;&#039;&#039;U&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
{|class=wikitable&lt;br /&gt;
! Offset !! Type !! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x00 || Int16[2][&#039;&#039;&#039;U&#039;&#039;&#039;] || &#039;&#039;&#039;Vertex UV position&#039;&#039;&#039;.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
===== Track Section Color Data =====&lt;br /&gt;
Color data is stored as 2-byte groups per entry &#039;&#039;&#039;C&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
{|class=wikitable&lt;br /&gt;
! Offset !! Type !! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x00 || UInt16[&#039;&#039;&#039;C&#039;&#039;&#039;] || &#039;&#039;&#039;RGBA5551 color&#039;&#039;&#039;.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Terrain Effects ==&lt;br /&gt;
Each texture is linked to 2 specific terrain effects that affect the vehicle&#039;s speed, particles and lighting. This section contains 2 blocks of &#039;&#039;&#039;X&#039;&#039;&#039; UInt16s.&lt;br /&gt;
&lt;br /&gt;
{|class=wikitable&lt;br /&gt;
! Offset !! Type !! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x00 || UInt16[&#039;&#039;&#039;X&#039;&#039;&#039;] || &#039;&#039;&#039;Effects&#039;&#039;&#039;, split in bits.&lt;br /&gt;
|-&lt;br /&gt;
| &#039;&#039;&#039;X&#039;&#039;&#039; * 2 || UInt16[&#039;&#039;&#039;X&#039;&#039;&#039;] || {{unknown-left|&#039;&#039;&#039;Unknown&#039;&#039;&#039;. This seems to be a copy of the previous block?}}&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Culling Groups ==&lt;br /&gt;
This section includes a 4-byte or 8-byte per track section values that determine which section models are loaded when entering a specific section. Each section is represented as 1 bit.&lt;br /&gt;
&lt;br /&gt;
{|class=wikitable&lt;br /&gt;
! Offset !! Type !! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x00 || UInt16[&#039;&#039;&#039;N&#039;&#039;&#039;]/UInt32[&#039;&#039;&#039;N&#039;&#039;&#039;] || &#039;&#039;&#039;Culled model sections&#039;&#039;&#039;, represented as &#039;&#039;&#039;N&#039;&#039;&#039; bits, 1 per section, in order from the least to the most significant bit. 0 if culled, 1 if loaded.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Texture Group ==&lt;br /&gt;
See &#039;&#039;&#039;[[DKRDS Texture Group]]&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
== Culling BSP Tree ==&lt;br /&gt;
This section defines a serialized axis-aligned binary space partitioning tree used for culling sections along with the [[#Culling Groups|Culling Groups]] section. The game traverses it to determine which sections are candidates for rendering given the current player&#039;s position, and then performs a secondary [[#Track Section AABB|AABB]] overlap test on each candidate before adding it to the active render list. The section consists of a sequence of variable-length nodes and leaves stored one after another.&lt;br /&gt;
&lt;br /&gt;
=== Interior Node ===&lt;br /&gt;
An interior node is always 8 bytes long and can be identified apart from a leaf node if the first Int16 is not negative.&lt;br /&gt;
&lt;br /&gt;
{|class=wikitable&lt;br /&gt;
! Offset !! Type !! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x00 || Int16 || &#039;&#039;&#039;Axis index&#039;&#039;&#039; into the player position array:&lt;br /&gt;
* &#039;&#039;&#039;0&#039;&#039;&#039; = X axis.&lt;br /&gt;
* &#039;&#039;&#039;1&#039;&#039;&#039; = Y axis. Unused?&lt;br /&gt;
* &#039;&#039;&#039;2&#039;&#039;&#039; = Z axis.&lt;br /&gt;
|-&lt;br /&gt;
| 0x02 || Int16 || &#039;&#039;&#039;Split value high bits&#039;&#039;&#039;.&lt;br /&gt;
|-&lt;br /&gt;
| 0x04 || UInt16 || &#039;&#039;&#039;Split value low bits&#039;&#039;&#039;.&lt;br /&gt;
|-&lt;br /&gt;
| 0x06 || Int16 || &#039;&#039;&#039;Skip count&#039;&#039;&#039;. The right child begins at &amp;lt;code&amp;gt;(node_offset + 8) + skip * 2&amp;lt;/code&amp;gt; bytes from the start of this section. The left child begins immediately at &amp;lt;code&amp;gt;node_offset + 8&amp;lt;/code&amp;gt;.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The split coordinate is reconstructed by the game as a 32-bit signed result, then divided by 64 to obtain the coordinates in world units (the same scale as the [[#Track Section AABB|section AABBs]]):&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
split = ((split_high &amp;lt;&amp;lt; 16) | (split_low &amp;amp; 0xFFFF)) / 64&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To encode a world-coordinate integer back into the two stored fields:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
split_raw = round(split * 64)							   &lt;br /&gt;
(Int16)split_high = (split_raw &amp;gt;&amp;gt; 16) &amp;amp; 0xFFFF&lt;br /&gt;
(UInt16)split_low = split_raw &amp;amp; 0xFFFF&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Leaf Node ===&lt;br /&gt;
Leaf nodes are variable-length.&lt;br /&gt;
 &lt;br /&gt;
{|class=wikitable&lt;br /&gt;
! Offset !! Type !! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x00 || Int16 || &#039;&#039;&#039;Negative count&#039;&#039;&#039; (&#039;&#039;&#039;-L&#039;&#039;&#039;). The value is always negative. Its negation &#039;&#039;&#039;L&#039;&#039;&#039; gives the number of section IDs that follow.&lt;br /&gt;
|-&lt;br /&gt;
| 0x02 || Int16[&#039;&#039;&#039;L&#039;&#039;&#039;] || &#039;&#039;&#039;Section IDs&#039;&#039;&#039;. Zero-based indices into the [[#Track Section Group|Track Section Group]]. A section may appear in more than one leaf when its AABB occupies a split plane.&lt;br /&gt;
|}&lt;br /&gt;
 &lt;br /&gt;
=== Traversal Algorithm ===&lt;br /&gt;
The game calls the function &amp;lt;code&amp;gt;@02006CC4(bsp_ptr, track_sg, position, tolerance, out_list)&amp;lt;/code&amp;gt;:&lt;br /&gt;
* &#039;&#039;&#039;bsp_ptr&#039;&#039;&#039;: pointer to the start of this section in RAM.&lt;br /&gt;
* &#039;&#039;&#039;track_sg&#039;&#039;&#039;: pointer to the [[#Track Section Group|Track Section Group]].&lt;br /&gt;
* &#039;&#039;&#039;position&#039;&#039;&#039;: player XYZ position.&lt;br /&gt;
* &#039;&#039;&#039;tolerance&#039;&#039;&#039;: a proximity radius, observed as &amp;lt;code&amp;gt;0xF00&amp;lt;/code&amp;gt; (60 in world units).&lt;br /&gt;
* &#039;&#039;&#039;out_list&#039;&#039;&#039;: output structure that receives the active section list.&lt;br /&gt;
 &lt;br /&gt;
At each interior node, in world-unit scale:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
pos = position[axis]&lt;br /&gt;
split_raw = (split_high &amp;lt;&amp;lt; 16) | (split_low &amp;amp; 0xFFFF)&lt;br /&gt;
split = split_raw / 64&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If &amp;lt;code&amp;gt;split - pos &amp;gt; tolerance&amp;lt;/code&amp;gt;, visit the left child only; else if &amp;lt;code&amp;gt;pos - split &amp;amp;ge; tolerance&amp;lt;/code&amp;gt;, visit the right child only; otherwise, visit both children.&lt;br /&gt;
&lt;br /&gt;
The left child corresponds to sections whose AABB satisfies &amp;lt;code&amp;gt;min[axis] &amp;amp;le; split&amp;lt;/code&amp;gt;; the right child corresponds to sections whose AABB satisfies &amp;lt;code&amp;gt;max[axis] &amp;amp;ge; split&amp;lt;/code&amp;gt;. Sections satisfying both (i.e. whose AABB traverses the split plane) appear in leaves on both sides.&lt;br /&gt;
&lt;br /&gt;
At each leaf node, for every listed section ID the section&#039;s data pointer is first looked up via the [[#Track Section Group|Track Section Group]]. Then, the player&#039;s bounding box is tested (&amp;lt;code&amp;gt;(X &amp;amp;plusmn; tolerance) * (Z &amp;amp;plusmn; tolerance)&amp;lt;/code&amp;gt;) against the section&#039;s [[#Track Section AABB|AABB]]. If the AABB test passes, add the section to the active render list.&lt;br /&gt;
&lt;br /&gt;
== Wish Race Unknown Section ==&lt;br /&gt;
This section is only used for the Wish Race tracks. &#039;&#039;TBD&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
= Tools =&lt;br /&gt;
The following tools can handle DKRDS Track:&lt;br /&gt;
* (none)&lt;br /&gt;
&lt;br /&gt;
[[Category:Diddy Kong Racing DS File Formats]]&lt;/div&gt;</summary>
		<author><name>Atlas</name></author>
	</entry>
	<entry>
		<id>https://wiki.wexosmk.xyz/index.php?title=DKRDS_Track_(File_Format)&amp;diff=685</id>
		<title>DKRDS Track (File Format)</title>
		<link rel="alternate" type="text/html" href="https://wiki.wexosmk.xyz/index.php?title=DKRDS_Track_(File_Format)&amp;diff=685"/>
		<updated>2026-06-15T19:52:35Z</updated>

		<summary type="html">&lt;p&gt;Atlas: /* Track Section Entry */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&#039;&#039;&#039;DKRDS Track&#039;&#039;&#039; is the nameless file format used in &#039;&#039;[https://en.wikipedia.org/wiki/Diddy_Kong_Racing_DS Diddy Kong Racing DS]&#039;&#039; that stores the tracks&#039; section models, collision and textures. Its type identifier in [[assets.bin]] is &#039;&#039;&#039;0x9A&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
= File Format =&lt;br /&gt;
The file byte order is always little endian.&lt;br /&gt;
&lt;br /&gt;
== Header ==&lt;br /&gt;
The file starts with a header that is 56 bytes long.&lt;br /&gt;
&lt;br /&gt;
{|class=wikitable&lt;br /&gt;
! Offset !! Type !! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x00 || Int32 || &#039;&#039;&#039;Number of sections&#039;&#039;&#039; (&#039;&#039;&#039;N&#039;&#039;&#039;).&lt;br /&gt;
|-&lt;br /&gt;
| 0x04 || Int32 || &#039;&#039;&#039;[[#Track Section Group|Track Section Group]]&#039;&#039;&#039; offset.&lt;br /&gt;
|-&lt;br /&gt;
| 0x08 || Int32 || &#039;&#039;&#039;[[#Terrain Effects|Terrain Effects]]&#039;&#039;&#039; offset.&lt;br /&gt;
|-&lt;br /&gt;
| 0x0C || Byte[4] || {{unknown-left|&#039;&#039;&#039;Unknown&#039;&#039;&#039;. Always 0xCCCCCCCC.}}&lt;br /&gt;
|-&lt;br /&gt;
| 0x10 || Int32 || &#039;&#039;&#039;[[#Culling Groups|Culling Groups]]&#039;&#039;&#039; offset.&lt;br /&gt;
|-&lt;br /&gt;
| 0x14 || Int32 || &#039;&#039;&#039;[[#Culling Groups|Culling Groups]]&#039;&#039;&#039; data type:&lt;br /&gt;
* 1 = 4-byte per &#039;&#039;&#039;N&#039;&#039;&#039; group.&lt;br /&gt;
* 2 = 8-byte per &#039;&#039;&#039;N&#039;&#039;&#039; group.&lt;br /&gt;
|-&lt;br /&gt;
| 0x18 || Int32 || &#039;&#039;&#039;Number of textures&#039;&#039;&#039; (&#039;&#039;&#039;X&#039;&#039;&#039;).&lt;br /&gt;
|-&lt;br /&gt;
| 0x1C || Int32 || &#039;&#039;&#039;[[#Texture Group|Texture Group]]&#039;&#039;&#039; offset.&lt;br /&gt;
|-&lt;br /&gt;
| 0x20 || Int32 || &#039;&#039;&#039;[[#Culling BSP Tree|Culling BSP Tree]]&#039;&#039;&#039; offset.&lt;br /&gt;
|-&lt;br /&gt;
| 0x24 || Int32 || &#039;&#039;&#039;[[#Wish Race Unknown Section|Wish Race Unknown Section]]&#039;&#039;&#039; entry count.&lt;br /&gt;
|-&lt;br /&gt;
| 0x28 || Int32 || &#039;&#039;&#039;[[#Wish Race Unknown Section|Wish Race Unknown Section]]&#039;&#039;&#039; offset.&lt;br /&gt;
|-&lt;br /&gt;
| 0x2C || Byte[4] || {{unknown-left|&#039;&#039;&#039;Unknown&#039;&#039;&#039;. Seems to be some kind of flags.}}&lt;br /&gt;
|-&lt;br /&gt;
| 0x30 || Int32 || {{unknown-left|&#039;&#039;&#039;Unknown&#039;&#039;&#039;.}}&lt;br /&gt;
|-&lt;br /&gt;
| 0x34 || Int32 || &#039;&#039;&#039;File size&#039;&#039;&#039;.&lt;br /&gt;
|-&lt;br /&gt;
| 0x38 || colspan=2 {{unknown|End of header}}&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Track Section Group ==&lt;br /&gt;
This group starts with a list of &#039;&#039;&#039;N&#039;&#039;&#039; offsets.&lt;br /&gt;
&lt;br /&gt;
{|class=wikitable&lt;br /&gt;
|+ Track Section Header&lt;br /&gt;
! Offset !! Type !! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x00 || Int32[&#039;&#039;&#039;N&#039;&#039;&#039;] || &#039;&#039;&#039;[[#Track Section Entry|Track Section Entry]]&#039;&#039;&#039; offsets. Relative to the start of this group.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Track Section Entry ===&lt;br /&gt;
Every section entry defines model and collision data. The entry starts with a 32-byte header.&lt;br /&gt;
&lt;br /&gt;
{|class=wikitable&lt;br /&gt;
|+ Track Section Entry Header&lt;br /&gt;
! Offset !! Type !! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x00 || Byte || {{unknown-left|&#039;&#039;&#039;Unknown&#039;&#039;&#039;.}}&lt;br /&gt;
|-&lt;br /&gt;
| 0x01 || Byte || {{unknown-left|&#039;&#039;&#039;Unknown&#039;&#039;&#039;.}}&lt;br /&gt;
|-&lt;br /&gt;
| 0x02 || UInt16 || {{unknown-left|&#039;&#039;&#039;Unknown&#039;&#039;&#039;.}}&lt;br /&gt;
|-&lt;br /&gt;
| 0x04 || UInt16 || &#039;&#039;&#039;Number of polygon groups&#039;&#039;&#039; (&#039;&#039;&#039;P&#039;&#039;&#039;).&lt;br /&gt;
|-&lt;br /&gt;
| 0x06 || UInt16 || &#039;&#039;&#039;Number of vertices&#039;&#039;&#039; in [[#Track Section Vertex Data|Track Section Vertex Data]] (&#039;&#039;&#039;V&#039;&#039;&#039;).&lt;br /&gt;
|-&lt;br /&gt;
| 0x08 || UInt16 || &#039;&#039;&#039;Number of UVs&#039;&#039;&#039; in [[#Track Section UV Data|Track Section UV Data]] (&#039;&#039;&#039;U&#039;&#039;&#039;).&lt;br /&gt;
|-&lt;br /&gt;
| 0x0A || UInt16 || &#039;&#039;&#039;Number of colors&#039;&#039;&#039; in [[#Track Section Color Data|Track Section Color Data]] (&#039;&#039;&#039;C&#039;&#039;&#039;).&lt;br /&gt;
|-&lt;br /&gt;
| 0x0C || Int32 || &#039;&#039;&#039;[[#Track Section Triangle Data|Track Section Triangle Data]]&#039;&#039;&#039; offset.&lt;br /&gt;
|-&lt;br /&gt;
| 0x10 || Int32 || &#039;&#039;&#039;[[#Track Section Collision Data|Track Section Collision Data]]&#039;&#039;&#039; offset.&lt;br /&gt;
|-&lt;br /&gt;
| 0x14 || Int32 || &#039;&#039;&#039;[[#Track Section Vertex Data|Track Section Vertex Data]]&#039;&#039;&#039; offset.&lt;br /&gt;
|-&lt;br /&gt;
| 0x18 || Int32 || &#039;&#039;&#039;[[#Track Section UV Data|Track Section UV Data]]&#039;&#039;&#039; offset.&lt;br /&gt;
|-&lt;br /&gt;
| 0x1C || Int32 || &#039;&#039;&#039;[[#Track Section Color Data|Track Section Color Data]]&#039;&#039;&#039; offset.&lt;br /&gt;
|-&lt;br /&gt;
| 0x20 || colspan=2 {{unknown|End of header, start of [[#Track Section Data|Track Section Data]]}}&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== Track Section Data ====&lt;br /&gt;
This data follows directly after the header of the section entry and starts with a 76-byte header.&lt;br /&gt;
&lt;br /&gt;
{|class=wikitable&lt;br /&gt;
! Offset !! Type !! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x00 || Int32 || {{unknown-left|&#039;&#039;&#039;Unknown&#039;&#039;&#039;. Seems to be always 0xFFFFFFFF and set to an address when loaded in memory.}}&lt;br /&gt;
|-&lt;br /&gt;
| 0x04 || Int32[3] || &#039;&#039;&#039;Collision XYZ offset&#039;&#039;&#039;.&lt;br /&gt;
|-&lt;br /&gt;
| 0x10 || Int32[3] || &#039;&#039;&#039;Visual model XYZ offset&#039;&#039;&#039;. The units are not the same as the collision offset.&lt;br /&gt;
|-&lt;br /&gt;
| 0x1C || [[#Track Section AABB|Track Section AABB]][2] || &#039;&#039;&#039;AABB areas&#039;&#039;&#039; of the entire section used for collision detection. The second AABB always seems to be a duplicate of the first.&lt;br /&gt;
|-&lt;br /&gt;
| 0x4C || colspan=2 {{unknown|End of header, start of [[#Track Section Polygon Data|Track Section Polygon Data]]}}&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
===== Track Section AABB =====&lt;br /&gt;
Track sections contain 2 identical AABB areas each. It is unknown why there&#039;s a duplicate, perhaps used during runtime after object space transform. All values need to be divided by 64 in order to obtain the absolute position data and match with the visual models.&lt;br /&gt;
&lt;br /&gt;
{|class=wikitable&lt;br /&gt;
! Offset !! Type !! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x00 || Int32[3] || &#039;&#039;&#039;AABB minimum XYZ position&#039;&#039;&#039;.&lt;br /&gt;
|-&lt;br /&gt;
| 0x0C || Int32[3] || &#039;&#039;&#039;AABB XYZ extent&#039;&#039;&#039;.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
===== Track Section Polygon Data =====&lt;br /&gt;
This section seems to store &#039;&#039;&#039;P&#039;&#039;&#039; polygon groups&#039; attributes.&lt;br /&gt;
&lt;br /&gt;
{|class=wikitable&lt;br /&gt;
! Offset !! Type !! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x00 || [[#Polygon Group Entry|Polygon Group Entry]][&#039;&#039;&#039;P&#039;&#039;&#039;] || &#039;&#039;&#039;Polygon group entries&#039;&#039;&#039;.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
====== Polygon Group Entry ======&lt;br /&gt;
Each polygon group entry is 12 bytes long.&lt;br /&gt;
&lt;br /&gt;
{|class=wikitable&lt;br /&gt;
! Offset !! Type !! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x00 || UInt16 || &#039;&#039;&#039;First triangle ID&#039;&#039;&#039;.&lt;br /&gt;
|-&lt;br /&gt;
| 0x02 || UInt16 || &#039;&#039;&#039;Number of triangles&#039;&#039;&#039;.&lt;br /&gt;
|-&lt;br /&gt;
| 0x04 || Byte || &#039;&#039;&#039;Main collision attribute&#039;&#039;&#039;. &#039;&#039;&#039;AAAA BBBB&#039;&#039;&#039;:&lt;br /&gt;
* &#039;&#039;&#039;A&#039;&#039;&#039;: &#039;&#039;&#039;Shadow level&#039;&#039;&#039;. The higher the value, the darker the character gets.&lt;br /&gt;
* &#039;&#039;&#039;B&#039;&#039;&#039;: &#039;&#039;&#039;Collision flag&#039;&#039;&#039;:&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! ID !! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x01 || Road and effects.&lt;br /&gt;
|-&lt;br /&gt;
| 0x05 || Wall (sparks on collision).&lt;br /&gt;
|-&lt;br /&gt;
| 0x08 || Special effects (turns off visual model).&lt;br /&gt;
|-&lt;br /&gt;
| 0x0C || Invisible wall (no sparks on collision, turns off visual model).&lt;br /&gt;
|}&lt;br /&gt;
|-&lt;br /&gt;
| 0x05 || Byte || &#039;&#039;&#039;Secondary collision attribute&#039;&#039;&#039;:&lt;br /&gt;
* &#039;&#039;&#039;Main flag = 0x01&#039;&#039;&#039;:&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! ID !! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x00 || Special effect? Used for water.&lt;br /&gt;
|-&lt;br /&gt;
| 0x01 || Pass through/no effect.&lt;br /&gt;
|-&lt;br /&gt;
| 0x04 || Road.&lt;br /&gt;
|}&lt;br /&gt;
* &#039;&#039;&#039;Main flag = 0x08&#039;&#039;&#039;:&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! ID !! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x00 || Invisible wall (no sparks on collision).&lt;br /&gt;
|-&lt;br /&gt;
| 0x01 || Water.&lt;br /&gt;
|}&lt;br /&gt;
|-&lt;br /&gt;
| 0x06 || UInt16 || &#039;&#039;&#039;Tertiary collision attribute&#039;&#039;&#039;. Split in bits.&lt;br /&gt;
* &#039;&#039;&#039;Main flag = 0x01&#039;&#039;&#039;:&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! ID !! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x01 || {{unknown-left|&#039;&#039;&#039;Unknown&#039;&#039;&#039;. Used in non-collideable stuff.}}&lt;br /&gt;
|-&lt;br /&gt;
| 0x02 || Water, inflates tires in car.&lt;br /&gt;
|-&lt;br /&gt;
| 0x10 || {{unknown-left|&#039;&#039;&#039;Unknown&#039;&#039;&#039;. Used in non-collideable stuff.}}&lt;br /&gt;
|-&lt;br /&gt;
| 0x20 || {{unknown-left|&#039;&#039;&#039;Unknown&#039;&#039;&#039;. Used in non-collideable stuff.}}&lt;br /&gt;
|-&lt;br /&gt;
| 0x60 || {{unknown-left|&#039;&#039;&#039;Unknown&#039;&#039;&#039;. Used in non-collideable stuff.}}&lt;br /&gt;
|}&lt;br /&gt;
* &#039;&#039;&#039;Main flag = 0x08&#039;&#039;&#039;:&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! ID !! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x30 || {{unknown-left|&#039;&#039;&#039;Unknown&#039;&#039;&#039;. Used in non-collideable stuff.}}&lt;br /&gt;
|}&lt;br /&gt;
* &#039;&#039;&#039;Main flag = 0x0C&#039;&#039;&#039;:&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! ID !! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x04 || Ignore when using plane.&lt;br /&gt;
|}&lt;br /&gt;
|-&lt;br /&gt;
| 0x08 || Byte[4] || &#039;&#039;&#039;Collision grid mask&#039;&#039;&#039;. This is an OR of all of the [[#Track Section Collision Data|collision grids]] for all triangles in this group.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The number of triangles &#039;&#039;&#039;T&#039;&#039;&#039; can be calculated by adding the first triangle ID to the number of triangles of the last polygon group entry.&lt;br /&gt;
&lt;br /&gt;
===== Track Section Triangle Data =====&lt;br /&gt;
This section stores &#039;&#039;&#039;T&#039;&#039;&#039; triangle entries.&lt;br /&gt;
&lt;br /&gt;
{|class=wikitable&lt;br /&gt;
! Offset !! Type !! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x00 || [[#Triangle Entry|Triangle Entry]][&#039;&#039;&#039;T&#039;&#039;&#039;] || &#039;&#039;&#039;Triangle entries&#039;&#039;&#039;.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
====== Triangle Entry ======&lt;br /&gt;
Each triangle entry is 20 bytes long.&lt;br /&gt;
&lt;br /&gt;
{|class=wikitable&lt;br /&gt;
! Offset !! Type !! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x00 || UInt16 || &#039;&#039;&#039;Attribute flags&#039;&#039;&#039;. &#039;&#039;&#039;AAAA AAAA AAAA AAAB&#039;&#039;&#039;:&lt;br /&gt;
* &#039;&#039;&#039;A&#039;&#039;&#039;: &#039;&#039;&#039;Texture ID&#039;&#039;&#039;.&lt;br /&gt;
* &#039;&#039;&#039;B&#039;&#039;&#039;: Collidable attribute? If 0 in roads, the triangles are not collidable. Unknown meaning in walls.&lt;br /&gt;
|-&lt;br /&gt;
| 0x02 || UInt16[3] || &#039;&#039;&#039;Face XYZ normals&#039;&#039;&#039;. Values need to be divided by 4096.&lt;br /&gt;
|-&lt;br /&gt;
| 0x08 || Byte[4] || &#039;&#039;&#039;Vertex position indices&#039;&#039;&#039;. The index for each of the 3 vertices is 10 bits long. 2 last bits are unknown.&lt;br /&gt;
|-&lt;br /&gt;
| 0x0C || Byte[4] || &#039;&#039;&#039;UV indices&#039;&#039;&#039;. The index for each of the 3 vertices is 10 bits long. 2 last bits are unknown.&lt;br /&gt;
|-&lt;br /&gt;
| 0x10 || Byte[4] || &#039;&#039;&#039;Color indices&#039;&#039;&#039;. The index for each of the 3 vertices is 10 bits long. 2 last bits are unknown.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
===== Track Section Collision Data =====&lt;br /&gt;
Each triangle corresponds to a 4-byte set of values to help with collision detection. These values encode local X, Y and Z coordinates that form a grid of cells inside the section&#039;s AABB.&lt;br /&gt;
&lt;br /&gt;
{|class=wikitable&lt;br /&gt;
! Offset !! Type !! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x00 || Byte || &#039;&#039;&#039;Y occupancy&#039;&#039;&#039;. Values correspond to 8 cells of the AABB (AABB&#039;s Y extent / 8).&lt;br /&gt;
|-&lt;br /&gt;
| 0x01 || Byte || &#039;&#039;&#039;Z occupancy&#039;&#039;&#039;. Values correspond to 8 cells of the AABB (AABB&#039;s Z extent / 8).&lt;br /&gt;
|-&lt;br /&gt;
| 0x02 || UInt16 || &#039;&#039;&#039;X occupancy&#039;&#039;&#039;. Values correspond to 16 cells of the AABB (AABB&#039;s X extent / 16).&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The following ARM assembly instructions (@01FF95D0 from the game&#039;s code) demonstrate how the vehicle&#039;s current grid bitmask is compared to the current testing triangle&#039;s collision:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
AND R0, R0, R5 // R0 = triangle&#039;s collision value AND vehicle&#039;s bitmask&lt;br /&gt;
TST R0, #FF // test byte 0 (Y)&lt;br /&gt;
TSTNE R0, #FF00 // if nonzero, test byte 1 (Z)&lt;br /&gt;
MOVNES R0, R0, LSR #10 // if still nonzero, test upper 16 bits (X)&lt;br /&gt;
MOVNE R0, #1 // collidable only if ALL 3 are nonzero&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The following functions in C# compute a triangle&#039;s collision grid from its minimum and maximum positions and its containing section&#039;s AABB:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
uint ComputeCollision(float xMin, float xMax, float yMin, float yMax, float zMin, float zMax, float aabbXMin, float aabbXExt, float aabbYMin, float aabbYExt, float aabbZMin, float aabbZExt)&lt;br /&gt;
{&lt;br /&gt;
    if (aabbXExt &amp;lt;= 0 || aabbYExt &amp;lt;= 0 || aabbZExt &amp;lt;= 0)&lt;br /&gt;
        return 0xFFFFFFFFu;&lt;br /&gt;
&lt;br /&gt;
    uint xBits = ComputeCellBits(xMin - aabbXMin, xMax - aabbXMin, aabbXExt / 16f, 16);&lt;br /&gt;
    uint zBits = ComputeCellBits(zMin - aabbZMin, zMax - aabbZMin, aabbZExt / 8f, 8);&lt;br /&gt;
    uint yBits = ComputeCellBits(yMin - aabbYMin, yMax - aabbYMin, aabbYExt / 8f, 8);&lt;br /&gt;
&lt;br /&gt;
    return (xBits &amp;lt;&amp;lt; 16) | (zBits &amp;lt;&amp;lt; 8) | yBits;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
uint ComputeCellBits(float relMin, float relMax, float cellSize, int nrCells)&lt;br /&gt;
{&lt;br /&gt;
    const float Epsilon = 1e-4f;&lt;br /&gt;
    float faceMin = relMin / cellSize;&lt;br /&gt;
    float faceMax = relMax / cellSize;&lt;br /&gt;
&lt;br /&gt;
    // Special case for degenerate faces (flat faces with zero extent in this axis, e.g. a wall parallel to XZ)&lt;br /&gt;
    if (MathF.Abs(faceMax - faceMin) &amp;lt; Epsilon)&lt;br /&gt;
    {&lt;br /&gt;
        int cell = Math.Max(0, Math.Min(nrCells - 1, (int)MathF.Floor(faceMin)));&lt;br /&gt;
        bool atExact = MathF.Abs(faceMin - MathF.Round(faceMin)) &amp;lt; Epsilon;&lt;br /&gt;
        bool atMaxEdge = cell == nrCells - 1;&lt;br /&gt;
&lt;br /&gt;
        // Include the preceding cell only at an interior exact boundary&lt;br /&gt;
        if (atExact &amp;amp;&amp;amp; cell &amp;gt; 0 &amp;amp;&amp;amp; !atMaxEdge)&lt;br /&gt;
            return (1u &amp;lt;&amp;lt; cell) | (1u &amp;lt;&amp;lt; (cell - 1));&lt;br /&gt;
&lt;br /&gt;
        return 1u &amp;lt;&amp;lt; cell;&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    int cellMin = (int)MathF.Floor(faceMin);&lt;br /&gt;
    int cellMax = (int)MathF.Floor(faceMax - Epsilon); // Exact upper boundary stays in current cell&lt;br /&gt;
&lt;br /&gt;
    // Exact lower boundary stays in the preceding cell&lt;br /&gt;
    bool atExactLow = MathF.Abs(faceMin - MathF.Round(faceMin)) &amp;lt; Epsilon;&lt;br /&gt;
    bool atMaxLow = cellMin == nrCells - 1;&lt;br /&gt;
    if (atExactLow &amp;amp;&amp;amp; cellMin &amp;gt; 0 &amp;amp;&amp;amp; !atMaxLow)&lt;br /&gt;
        cellMin--;&lt;br /&gt;
&lt;br /&gt;
    cellMin = Math.Max(0, cellMin);&lt;br /&gt;
    cellMax = Math.Min(nrCells - 1, cellMax);&lt;br /&gt;
&lt;br /&gt;
    uint bits = 0;&lt;br /&gt;
&lt;br /&gt;
    for (int c = cellMin; c &amp;lt;= cellMax; c++)&lt;br /&gt;
        bits |= 1u &amp;lt;&amp;lt; c;&lt;br /&gt;
&lt;br /&gt;
    return bits;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===== Track Section Vertex Data =====&lt;br /&gt;
Vertex data is stored as 6-byte groups per entry &#039;&#039;&#039;V&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
{|class=wikitable&lt;br /&gt;
! Offset !! Type !! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x00 || Int16[3][&#039;&#039;&#039;V&#039;&#039;&#039;] || &#039;&#039;&#039;Vertex XYZ position&#039;&#039;&#039;.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
===== Track Section UV Data =====&lt;br /&gt;
UV data is stored as 4-byte groups per entry &#039;&#039;&#039;U&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
{|class=wikitable&lt;br /&gt;
! Offset !! Type !! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x00 || Int16[2][&#039;&#039;&#039;U&#039;&#039;&#039;] || &#039;&#039;&#039;Vertex UV position&#039;&#039;&#039;.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
===== Track Section Color Data =====&lt;br /&gt;
Color data is stored as 2-byte groups per entry &#039;&#039;&#039;C&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
{|class=wikitable&lt;br /&gt;
! Offset !! Type !! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x00 || UInt16[&#039;&#039;&#039;C&#039;&#039;&#039;] || &#039;&#039;&#039;RGBA5551 color&#039;&#039;&#039;.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Terrain Effects ==&lt;br /&gt;
Each texture is linked to 2 specific terrain effects that affect the vehicle&#039;s speed, particles and lighting. This section contains 2 blocks of &#039;&#039;&#039;X&#039;&#039;&#039; UInt16s.&lt;br /&gt;
&lt;br /&gt;
{|class=wikitable&lt;br /&gt;
! Offset !! Type !! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x00 || UInt16[&#039;&#039;&#039;X&#039;&#039;&#039;] || &#039;&#039;&#039;Effects&#039;&#039;&#039;, split in bits.&lt;br /&gt;
|-&lt;br /&gt;
| &#039;&#039;&#039;X&#039;&#039;&#039; * 2 || UInt16[&#039;&#039;&#039;X&#039;&#039;&#039;] || {{unknown-left|&#039;&#039;&#039;Unknown&#039;&#039;&#039;. This seems to be a copy of the previous block?}}&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Culling Groups ==&lt;br /&gt;
This section includes a 4-byte or 8-byte per track section values that determine which section models are loaded when entering a specific section. Each section is represented as 1 bit.&lt;br /&gt;
&lt;br /&gt;
{|class=wikitable&lt;br /&gt;
! Offset !! Type !! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x00 || UInt16[&#039;&#039;&#039;N&#039;&#039;&#039;]/UInt32[&#039;&#039;&#039;N&#039;&#039;&#039;] || &#039;&#039;&#039;Culled model sections&#039;&#039;&#039;, represented as &#039;&#039;&#039;N&#039;&#039;&#039; bits, 1 per section, in order from the least to the most significant bit. 0 if culled, 1 if loaded.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Texture Group ==&lt;br /&gt;
See &#039;&#039;&#039;[[DKRDS Texture Group]]&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
== Culling BSP Tree ==&lt;br /&gt;
This section defines a serialized axis-aligned binary space partitioning tree used for culling sections along with the [[#Culling Groups|Culling Groups]] section. The game traverses it to determine which sections are candidates for rendering given the current player&#039;s position, and then performs a secondary [[#Track Section AABB|AABB]] overlap test on each candidate before adding it to the active render list. The section consists of a sequence of variable-length nodes and leaves stored one after another.&lt;br /&gt;
&lt;br /&gt;
=== Interior Node ===&lt;br /&gt;
An interior node is always 8 bytes long and can be identified apart from a leaf node if the first Int16 is not negative.&lt;br /&gt;
&lt;br /&gt;
{|class=wikitable&lt;br /&gt;
! Offset !! Type !! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x00 || Int16 || &#039;&#039;&#039;Axis index&#039;&#039;&#039; into the player position array:&lt;br /&gt;
* &#039;&#039;&#039;0&#039;&#039;&#039; = X axis.&lt;br /&gt;
* &#039;&#039;&#039;1&#039;&#039;&#039; = Y axis. Unused?&lt;br /&gt;
* &#039;&#039;&#039;2&#039;&#039;&#039; = Z axis.&lt;br /&gt;
|-&lt;br /&gt;
| 0x02 || Int16 || &#039;&#039;&#039;Split value high bits&#039;&#039;&#039;.&lt;br /&gt;
|-&lt;br /&gt;
| 0x04 || UInt16 || &#039;&#039;&#039;Split value low bits&#039;&#039;&#039;.&lt;br /&gt;
|-&lt;br /&gt;
| 0x06 || Int16 || &#039;&#039;&#039;Skip count&#039;&#039;&#039;. The right child begins at &amp;lt;code&amp;gt;(node_offset + 8) + skip * 2&amp;lt;/code&amp;gt; bytes from the start of this section. The left child begins immediately at &amp;lt;code&amp;gt;node_offset + 8&amp;lt;/code&amp;gt;.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The split coordinate is reconstructed by the game as a 32-bit signed result, then divided by 64 to obtain the coordinates in world units (the same scale as the [[#Track Section AABB|section AABBs]]):&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
split = ((split_high &amp;lt;&amp;lt; 16) | (split_low &amp;amp; 0xFFFF)) / 64&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To encode a world-coordinate integer back into the two stored fields:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
split_raw = round(split * 64)							   &lt;br /&gt;
(Int16)split_high = (split_raw &amp;gt;&amp;gt; 16) &amp;amp; 0xFFFF&lt;br /&gt;
(UInt16)split_low = split_raw &amp;amp; 0xFFFF&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Leaf Node ===&lt;br /&gt;
Leaf nodes are variable-length.&lt;br /&gt;
 &lt;br /&gt;
{|class=wikitable&lt;br /&gt;
! Offset !! Type !! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x00 || Int16 || &#039;&#039;&#039;Negative count&#039;&#039;&#039; (&#039;&#039;&#039;-L&#039;&#039;&#039;). The value is always negative. Its negation &#039;&#039;&#039;L&#039;&#039;&#039; gives the number of section IDs that follow.&lt;br /&gt;
|-&lt;br /&gt;
| 0x02 || Int16[&#039;&#039;&#039;L&#039;&#039;&#039;] || &#039;&#039;&#039;Section IDs&#039;&#039;&#039;. Zero-based indices into the [[#Track Section Group|Track Section Group]]. A section may appear in more than one leaf when its AABB occupies a split plane.&lt;br /&gt;
|}&lt;br /&gt;
 &lt;br /&gt;
=== Traversal Algorithm ===&lt;br /&gt;
The game calls the function &amp;lt;code&amp;gt;@02006CC4(bsp_ptr, track_sg, position, tolerance, out_list)&amp;lt;/code&amp;gt;:&lt;br /&gt;
* &#039;&#039;&#039;bsp_ptr&#039;&#039;&#039;: pointer to the start of this section in RAM.&lt;br /&gt;
* &#039;&#039;&#039;track_sg&#039;&#039;&#039;: pointer to the [[#Track Section Group|Track Section Group]].&lt;br /&gt;
* &#039;&#039;&#039;position&#039;&#039;&#039;: player XYZ position.&lt;br /&gt;
* &#039;&#039;&#039;tolerance&#039;&#039;&#039;: a proximity radius, observed as &amp;lt;code&amp;gt;0xF00&amp;lt;/code&amp;gt; (60 in world units).&lt;br /&gt;
* &#039;&#039;&#039;out_list&#039;&#039;&#039;: output structure that receives the active section list.&lt;br /&gt;
 &lt;br /&gt;
At each interior node, in world-unit scale:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
pos = position[axis]&lt;br /&gt;
split_raw = (split_high &amp;lt;&amp;lt; 16) | (split_low &amp;amp; 0xFFFF)&lt;br /&gt;
split = split_raw / 64&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If &amp;lt;code&amp;gt;split - pos &amp;gt; tolerance&amp;lt;/code&amp;gt;, visit the left child only; else if &amp;lt;code&amp;gt;pos - split &amp;amp;ge; tolerance&amp;lt;/code&amp;gt;, visit the right child only; otherwise, visit both children.&lt;br /&gt;
&lt;br /&gt;
The left child corresponds to sections whose AABB satisfies &amp;lt;code&amp;gt;min[axis] &amp;amp;le; split&amp;lt;/code&amp;gt;; the right child corresponds to sections whose AABB satisfies &amp;lt;code&amp;gt;max[axis] &amp;amp;ge; split&amp;lt;/code&amp;gt;. Sections satisfying both (i.e. whose AABB traverses the split plane) appear in leaves on both sides.&lt;br /&gt;
&lt;br /&gt;
At each leaf node, for every listed section ID the section&#039;s data pointer is first looked up via the [[#Track Section Group|Track Section Group]]. Then, the player&#039;s bounding box is tested (&amp;lt;code&amp;gt;(X &amp;amp;plusmn; tolerance) * (Z &amp;amp;plusmn; tolerance)&amp;lt;/code&amp;gt;) against the section&#039;s [[#Track Section AABB|AABB]]. If the AABB test passes, add the section to the active render list.&lt;br /&gt;
&lt;br /&gt;
== Wish Race Unknown Section ==&lt;br /&gt;
This section is only used for the Wish Race tracks. &#039;&#039;TBD&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
= Tools =&lt;br /&gt;
The following tools can handle DKRDS Track:&lt;br /&gt;
* (none)&lt;br /&gt;
&lt;br /&gt;
[[Category:Diddy Kong Racing DS File Formats]]&lt;/div&gt;</summary>
		<author><name>Atlas</name></author>
	</entry>
	<entry>
		<id>https://wiki.wexosmk.xyz/index.php?title=DKRDS_Track_(File_Format)&amp;diff=684</id>
		<title>DKRDS Track (File Format)</title>
		<link rel="alternate" type="text/html" href="https://wiki.wexosmk.xyz/index.php?title=DKRDS_Track_(File_Format)&amp;diff=684"/>
		<updated>2026-06-15T19:03:59Z</updated>

		<summary type="html">&lt;p&gt;Atlas: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&#039;&#039;&#039;DKRDS Track&#039;&#039;&#039; is the nameless file format used in &#039;&#039;[https://en.wikipedia.org/wiki/Diddy_Kong_Racing_DS Diddy Kong Racing DS]&#039;&#039; that stores the tracks&#039; section models, collision and textures. Its type identifier in [[assets.bin]] is &#039;&#039;&#039;0x9A&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
= File Format =&lt;br /&gt;
The file byte order is always little endian.&lt;br /&gt;
&lt;br /&gt;
== Header ==&lt;br /&gt;
The file starts with a header that is 56 bytes long.&lt;br /&gt;
&lt;br /&gt;
{|class=wikitable&lt;br /&gt;
! Offset !! Type !! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x00 || Int32 || &#039;&#039;&#039;Number of sections&#039;&#039;&#039; (&#039;&#039;&#039;N&#039;&#039;&#039;).&lt;br /&gt;
|-&lt;br /&gt;
| 0x04 || Int32 || &#039;&#039;&#039;[[#Track Section Group|Track Section Group]]&#039;&#039;&#039; offset.&lt;br /&gt;
|-&lt;br /&gt;
| 0x08 || Int32 || &#039;&#039;&#039;[[#Terrain Effects|Terrain Effects]]&#039;&#039;&#039; offset.&lt;br /&gt;
|-&lt;br /&gt;
| 0x0C || Byte[4] || {{unknown-left|&#039;&#039;&#039;Unknown&#039;&#039;&#039;. Always 0xCCCCCCCC.}}&lt;br /&gt;
|-&lt;br /&gt;
| 0x10 || Int32 || &#039;&#039;&#039;[[#Culling Groups|Culling Groups]]&#039;&#039;&#039; offset.&lt;br /&gt;
|-&lt;br /&gt;
| 0x14 || Int32 || &#039;&#039;&#039;[[#Culling Groups|Culling Groups]]&#039;&#039;&#039; data type:&lt;br /&gt;
* 1 = 4-byte per &#039;&#039;&#039;N&#039;&#039;&#039; group.&lt;br /&gt;
* 2 = 8-byte per &#039;&#039;&#039;N&#039;&#039;&#039; group.&lt;br /&gt;
|-&lt;br /&gt;
| 0x18 || Int32 || &#039;&#039;&#039;Number of textures&#039;&#039;&#039; (&#039;&#039;&#039;X&#039;&#039;&#039;).&lt;br /&gt;
|-&lt;br /&gt;
| 0x1C || Int32 || &#039;&#039;&#039;[[#Texture Group|Texture Group]]&#039;&#039;&#039; offset.&lt;br /&gt;
|-&lt;br /&gt;
| 0x20 || Int32 || &#039;&#039;&#039;[[#Culling BSP Tree|Culling BSP Tree]]&#039;&#039;&#039; offset.&lt;br /&gt;
|-&lt;br /&gt;
| 0x24 || Int32 || &#039;&#039;&#039;[[#Wish Race Unknown Section|Wish Race Unknown Section]]&#039;&#039;&#039; entry count.&lt;br /&gt;
|-&lt;br /&gt;
| 0x28 || Int32 || &#039;&#039;&#039;[[#Wish Race Unknown Section|Wish Race Unknown Section]]&#039;&#039;&#039; offset.&lt;br /&gt;
|-&lt;br /&gt;
| 0x2C || Byte[4] || {{unknown-left|&#039;&#039;&#039;Unknown&#039;&#039;&#039;. Seems to be some kind of flags.}}&lt;br /&gt;
|-&lt;br /&gt;
| 0x30 || Int32 || {{unknown-left|&#039;&#039;&#039;Unknown&#039;&#039;&#039;.}}&lt;br /&gt;
|-&lt;br /&gt;
| 0x34 || Int32 || &#039;&#039;&#039;File size&#039;&#039;&#039;.&lt;br /&gt;
|-&lt;br /&gt;
| 0x38 || colspan=2 {{unknown|End of header}}&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Track Section Group ==&lt;br /&gt;
This group starts with a list of &#039;&#039;&#039;N&#039;&#039;&#039; offsets.&lt;br /&gt;
&lt;br /&gt;
{|class=wikitable&lt;br /&gt;
|+ Track Section Header&lt;br /&gt;
! Offset !! Type !! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x00 || Int32[&#039;&#039;&#039;N&#039;&#039;&#039;] || &#039;&#039;&#039;[[#Track Section Entry|Track Section Entry]]&#039;&#039;&#039; offsets. Relative to the start of this group.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Track Section Entry ===&lt;br /&gt;
Every section entry defines model and collision data. The entry starts with a 32-byte header.&lt;br /&gt;
&lt;br /&gt;
{|class=wikitable&lt;br /&gt;
|+ Track Section Entry Header&lt;br /&gt;
! Offset !! Type !! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x00 || Byte || {{unknown-left|&#039;&#039;&#039;Unknown&#039;&#039;&#039;.}}&lt;br /&gt;
|-&lt;br /&gt;
| 0x01 || Byte || {{unknown-left|&#039;&#039;&#039;Unknown&#039;&#039;&#039;. Always 5?}}&lt;br /&gt;
|-&lt;br /&gt;
| 0x02 || UInt16 || {{unknown-left|&#039;&#039;&#039;Unknown&#039;&#039;&#039;.}}&lt;br /&gt;
|-&lt;br /&gt;
| 0x04 || UInt16 || &#039;&#039;&#039;Number of polygon groups&#039;&#039;&#039; (&#039;&#039;&#039;P&#039;&#039;&#039;).&lt;br /&gt;
|-&lt;br /&gt;
| 0x06 || UInt16 || &#039;&#039;&#039;Number of vertices&#039;&#039;&#039; in [[#Track Section Vertex Data|Track Section Vertex Data]] (&#039;&#039;&#039;V&#039;&#039;&#039;).&lt;br /&gt;
|-&lt;br /&gt;
| 0x08 || UInt16 || &#039;&#039;&#039;Number of UVs&#039;&#039;&#039; in [[#Track Section UV|Track Section UV Data]] (&#039;&#039;&#039;U&#039;&#039;&#039;).&lt;br /&gt;
|-&lt;br /&gt;
| 0x0A || UInt16 || &#039;&#039;&#039;Number of colors&#039;&#039;&#039; in [[#Track Section Color Data|Track Section Color Data]] (&#039;&#039;&#039;C&#039;&#039;&#039;).&lt;br /&gt;
|-&lt;br /&gt;
| 0x0C || Int32 || &#039;&#039;&#039;[[#Track Section Triangle Data|Track Section Triangle Data]]&#039;&#039;&#039; offset.&lt;br /&gt;
|-&lt;br /&gt;
| 0x10 || Int32 || &#039;&#039;&#039;[[#Track Section Collision Data|Track Section Collision Data]]&#039;&#039;&#039; offset.&lt;br /&gt;
|-&lt;br /&gt;
| 0x14 || Int32 || &#039;&#039;&#039;[[#Track Section Vertex Data|Track Section Vertex Data]]&#039;&#039;&#039; offset.&lt;br /&gt;
|-&lt;br /&gt;
| 0x18 || Int32 || &#039;&#039;&#039;[[#Track Section UV Data|Track Section UV Data]]&#039;&#039;&#039; offset.&lt;br /&gt;
|-&lt;br /&gt;
| 0x1C || Int32 || &#039;&#039;&#039;[[#Track Section Color Data|Track Section Color Data]]&#039;&#039;&#039; offset.&lt;br /&gt;
|-&lt;br /&gt;
| 0x20 || colspan=2 {{unknown|End of header, start of [[#Track Section Data|Track Section Data]]}}&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== Track Section Data ====&lt;br /&gt;
This data follows directly after the header of the section entry and starts with a 76-byte header.&lt;br /&gt;
&lt;br /&gt;
{|class=wikitable&lt;br /&gt;
! Offset !! Type !! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x00 || Int32 || {{unknown-left|&#039;&#039;&#039;Unknown&#039;&#039;&#039;. Seems to be always 0xFFFFFFFF and set to an address when loaded in memory.}}&lt;br /&gt;
|-&lt;br /&gt;
| 0x04 || Int32[3] || &#039;&#039;&#039;Collision XYZ offset&#039;&#039;&#039;.&lt;br /&gt;
|-&lt;br /&gt;
| 0x10 || Int32[3] || &#039;&#039;&#039;Visual model XYZ offset&#039;&#039;&#039;. The units are not the same as the collision offset.&lt;br /&gt;
|-&lt;br /&gt;
| 0x1C || [[#Track Section AABB|Track Section AABB]][2] || &#039;&#039;&#039;AABB areas&#039;&#039;&#039; of the entire section used for collision detection. The second AABB always seems to be a duplicate of the first.&lt;br /&gt;
|-&lt;br /&gt;
| 0x4C || colspan=2 {{unknown|End of header, start of [[#Track Section Polygon Data|Track Section Polygon Data]]}}&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
===== Track Section AABB =====&lt;br /&gt;
Track sections contain 2 identical AABB areas each. It is unknown why there&#039;s a duplicate, perhaps used during runtime after object space transform. All values need to be divided by 64 in order to obtain the absolute position data and match with the visual models.&lt;br /&gt;
&lt;br /&gt;
{|class=wikitable&lt;br /&gt;
! Offset !! Type !! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x00 || Int32[3] || &#039;&#039;&#039;AABB minimum XYZ position&#039;&#039;&#039;.&lt;br /&gt;
|-&lt;br /&gt;
| 0x0C || Int32[3] || &#039;&#039;&#039;AABB XYZ extent&#039;&#039;&#039;.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
===== Track Section Polygon Data =====&lt;br /&gt;
This section seems to store &#039;&#039;&#039;P&#039;&#039;&#039; polygon groups&#039; attributes.&lt;br /&gt;
&lt;br /&gt;
{|class=wikitable&lt;br /&gt;
! Offset !! Type !! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x00 || [[#Polygon Group Entry|Polygon Group Entry]][&#039;&#039;&#039;P&#039;&#039;&#039;] || &#039;&#039;&#039;Polygon group entries&#039;&#039;&#039;.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
====== Polygon Group Entry ======&lt;br /&gt;
Each polygon group entry is 12 bytes long.&lt;br /&gt;
&lt;br /&gt;
{|class=wikitable&lt;br /&gt;
! Offset !! Type !! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x00 || UInt16 || &#039;&#039;&#039;First triangle ID&#039;&#039;&#039;.&lt;br /&gt;
|-&lt;br /&gt;
| 0x02 || UInt16 || &#039;&#039;&#039;Number of triangles&#039;&#039;&#039;.&lt;br /&gt;
|-&lt;br /&gt;
| 0x04 || Byte || &#039;&#039;&#039;Main collision attribute&#039;&#039;&#039;. &#039;&#039;&#039;AAAA BBBB&#039;&#039;&#039;:&lt;br /&gt;
* &#039;&#039;&#039;A&#039;&#039;&#039;: &#039;&#039;&#039;Shadow level&#039;&#039;&#039;. The higher the value, the darker the character gets.&lt;br /&gt;
* &#039;&#039;&#039;B&#039;&#039;&#039;: &#039;&#039;&#039;Collision flag&#039;&#039;&#039;:&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! ID !! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x01 || Road and effects.&lt;br /&gt;
|-&lt;br /&gt;
| 0x05 || Wall (sparks on collision).&lt;br /&gt;
|-&lt;br /&gt;
| 0x08 || Special effects (turns off visual model).&lt;br /&gt;
|-&lt;br /&gt;
| 0x0C || Invisible wall (no sparks on collision, turns off visual model).&lt;br /&gt;
|}&lt;br /&gt;
|-&lt;br /&gt;
| 0x05 || Byte || &#039;&#039;&#039;Secondary collision attribute&#039;&#039;&#039;:&lt;br /&gt;
* &#039;&#039;&#039;Main flag = 0x01&#039;&#039;&#039;:&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! ID !! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x00 || Special effect? Used for water.&lt;br /&gt;
|-&lt;br /&gt;
| 0x01 || Pass through/no effect.&lt;br /&gt;
|-&lt;br /&gt;
| 0x04 || Road.&lt;br /&gt;
|}&lt;br /&gt;
* &#039;&#039;&#039;Main flag = 0x08&#039;&#039;&#039;:&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! ID !! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x00 || Invisible wall (no sparks on collision).&lt;br /&gt;
|-&lt;br /&gt;
| 0x01 || Water.&lt;br /&gt;
|}&lt;br /&gt;
|-&lt;br /&gt;
| 0x06 || UInt16 || &#039;&#039;&#039;Tertiary collision attribute&#039;&#039;&#039;. Split in bits.&lt;br /&gt;
* &#039;&#039;&#039;Main flag = 0x01&#039;&#039;&#039;:&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! ID !! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x01 || {{unknown-left|&#039;&#039;&#039;Unknown&#039;&#039;&#039;. Used in non-collideable stuff.}}&lt;br /&gt;
|-&lt;br /&gt;
| 0x02 || Water, inflates tires in car.&lt;br /&gt;
|-&lt;br /&gt;
| 0x10 || {{unknown-left|&#039;&#039;&#039;Unknown&#039;&#039;&#039;. Used in non-collideable stuff.}}&lt;br /&gt;
|-&lt;br /&gt;
| 0x20 || {{unknown-left|&#039;&#039;&#039;Unknown&#039;&#039;&#039;. Used in non-collideable stuff.}}&lt;br /&gt;
|-&lt;br /&gt;
| 0x60 || {{unknown-left|&#039;&#039;&#039;Unknown&#039;&#039;&#039;. Used in non-collideable stuff.}}&lt;br /&gt;
|}&lt;br /&gt;
* &#039;&#039;&#039;Main flag = 0x08&#039;&#039;&#039;:&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! ID !! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x30 || {{unknown-left|&#039;&#039;&#039;Unknown&#039;&#039;&#039;. Used in non-collideable stuff.}}&lt;br /&gt;
|}&lt;br /&gt;
* &#039;&#039;&#039;Main flag = 0x0C&#039;&#039;&#039;:&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! ID !! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x04 || Ignore when using plane.&lt;br /&gt;
|}&lt;br /&gt;
|-&lt;br /&gt;
| 0x08 || Byte[4] || &#039;&#039;&#039;Collision grid mask&#039;&#039;&#039;. This is an OR of all of the [[#Track Section Collision Data|collision grids]] for all triangles in this group.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The number of triangles &#039;&#039;&#039;T&#039;&#039;&#039; can be calculated by adding the first triangle ID to the number of triangles of the last polygon group entry.&lt;br /&gt;
&lt;br /&gt;
===== Track Section Triangle Data =====&lt;br /&gt;
This section stores &#039;&#039;&#039;T&#039;&#039;&#039; triangle entries.&lt;br /&gt;
&lt;br /&gt;
{|class=wikitable&lt;br /&gt;
! Offset !! Type !! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x00 || [[#Triangle Entry|Triangle Entry]][&#039;&#039;&#039;T&#039;&#039;&#039;] || &#039;&#039;&#039;Triangle entries&#039;&#039;&#039;.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
====== Triangle Entry ======&lt;br /&gt;
Each triangle entry is 20 bytes long.&lt;br /&gt;
&lt;br /&gt;
{|class=wikitable&lt;br /&gt;
! Offset !! Type !! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x00 || UInt16 || &#039;&#039;&#039;Attribute flags&#039;&#039;&#039;. &#039;&#039;&#039;AAAA AAAA AAAA AAAB&#039;&#039;&#039;:&lt;br /&gt;
* &#039;&#039;&#039;A&#039;&#039;&#039;: &#039;&#039;&#039;Texture ID&#039;&#039;&#039;.&lt;br /&gt;
* &#039;&#039;&#039;B&#039;&#039;&#039;: Collidable attribute? If 0 in roads, the triangles are not collidable. Unknown meaning in walls.&lt;br /&gt;
|-&lt;br /&gt;
| 0x02 || UInt16[3] || &#039;&#039;&#039;Face XYZ normals&#039;&#039;&#039;. Values need to be divided by 4096.&lt;br /&gt;
|-&lt;br /&gt;
| 0x08 || Byte[4] || &#039;&#039;&#039;Vertex position indices&#039;&#039;&#039;. The index for each of the 3 vertices is 10 bits long. 2 last bits are unknown.&lt;br /&gt;
|-&lt;br /&gt;
| 0x0C || Byte[4] || &#039;&#039;&#039;UV indices&#039;&#039;&#039;. The index for each of the 3 vertices is 10 bits long. 2 last bits are unknown.&lt;br /&gt;
|-&lt;br /&gt;
| 0x10 || Byte[4] || &#039;&#039;&#039;Color indices&#039;&#039;&#039;. The index for each of the 3 vertices is 10 bits long. 2 last bits are unknown.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
===== Track Section Collision Data =====&lt;br /&gt;
Each triangle corresponds to a 4-byte set of values to help with collision detection. These values encode local X, Y and Z coordinates that form a grid of cells inside the section&#039;s AABB.&lt;br /&gt;
&lt;br /&gt;
{|class=wikitable&lt;br /&gt;
! Offset !! Type !! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x00 || Byte || &#039;&#039;&#039;Y occupancy&#039;&#039;&#039;. Values correspond to 8 cells of the AABB (AABB&#039;s Y extent / 8).&lt;br /&gt;
|-&lt;br /&gt;
| 0x01 || Byte || &#039;&#039;&#039;Z occupancy&#039;&#039;&#039;. Values correspond to 8 cells of the AABB (AABB&#039;s Z extent / 8).&lt;br /&gt;
|-&lt;br /&gt;
| 0x02 || UInt16 || &#039;&#039;&#039;X occupancy&#039;&#039;&#039;. Values correspond to 16 cells of the AABB (AABB&#039;s X extent / 16).&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The following ARM assembly instructions (@01FF95D0 from the game&#039;s code) demonstrate how the vehicle&#039;s current grid bitmask is compared to the current testing triangle&#039;s collision:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
AND R0, R0, R5 // R0 = triangle&#039;s collision value AND vehicle&#039;s bitmask&lt;br /&gt;
TST R0, #FF // test byte 0 (Y)&lt;br /&gt;
TSTNE R0, #FF00 // if nonzero, test byte 1 (Z)&lt;br /&gt;
MOVNES R0, R0, LSR #10 // if still nonzero, test upper 16 bits (X)&lt;br /&gt;
MOVNE R0, #1 // collidable only if ALL 3 are nonzero&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The following functions in C# compute a triangle&#039;s collision grid from its minimum and maximum positions and its containing section&#039;s AABB:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
uint ComputeCollision(float xMin, float xMax, float yMin, float yMax, float zMin, float zMax, float aabbXMin, float aabbXExt, float aabbYMin, float aabbYExt, float aabbZMin, float aabbZExt)&lt;br /&gt;
{&lt;br /&gt;
    if (aabbXExt &amp;lt;= 0 || aabbYExt &amp;lt;= 0 || aabbZExt &amp;lt;= 0)&lt;br /&gt;
        return 0xFFFFFFFFu;&lt;br /&gt;
&lt;br /&gt;
    uint xBits = ComputeCellBits(xMin - aabbXMin, xMax - aabbXMin, aabbXExt / 16f, 16);&lt;br /&gt;
    uint zBits = ComputeCellBits(zMin - aabbZMin, zMax - aabbZMin, aabbZExt / 8f, 8);&lt;br /&gt;
    uint yBits = ComputeCellBits(yMin - aabbYMin, yMax - aabbYMin, aabbYExt / 8f, 8);&lt;br /&gt;
&lt;br /&gt;
    return (xBits &amp;lt;&amp;lt; 16) | (zBits &amp;lt;&amp;lt; 8) | yBits;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
uint ComputeCellBits(float relMin, float relMax, float cellSize, int nrCells)&lt;br /&gt;
{&lt;br /&gt;
    const float Epsilon = 1e-4f;&lt;br /&gt;
    float faceMin = relMin / cellSize;&lt;br /&gt;
    float faceMax = relMax / cellSize;&lt;br /&gt;
&lt;br /&gt;
    // Special case for degenerate faces (flat faces with zero extent in this axis, e.g. a wall parallel to XZ)&lt;br /&gt;
    if (MathF.Abs(faceMax - faceMin) &amp;lt; Epsilon)&lt;br /&gt;
    {&lt;br /&gt;
        int cell = Math.Max(0, Math.Min(nrCells - 1, (int)MathF.Floor(faceMin)));&lt;br /&gt;
        bool atExact = MathF.Abs(faceMin - MathF.Round(faceMin)) &amp;lt; Epsilon;&lt;br /&gt;
        bool atMaxEdge = cell == nrCells - 1;&lt;br /&gt;
&lt;br /&gt;
        // Include the preceding cell only at an interior exact boundary&lt;br /&gt;
        if (atExact &amp;amp;&amp;amp; cell &amp;gt; 0 &amp;amp;&amp;amp; !atMaxEdge)&lt;br /&gt;
            return (1u &amp;lt;&amp;lt; cell) | (1u &amp;lt;&amp;lt; (cell - 1));&lt;br /&gt;
&lt;br /&gt;
        return 1u &amp;lt;&amp;lt; cell;&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    int cellMin = (int)MathF.Floor(faceMin);&lt;br /&gt;
    int cellMax = (int)MathF.Floor(faceMax - Epsilon); // Exact upper boundary stays in current cell&lt;br /&gt;
&lt;br /&gt;
    // Exact lower boundary stays in the preceding cell&lt;br /&gt;
    bool atExactLow = MathF.Abs(faceMin - MathF.Round(faceMin)) &amp;lt; Epsilon;&lt;br /&gt;
    bool atMaxLow = cellMin == nrCells - 1;&lt;br /&gt;
    if (atExactLow &amp;amp;&amp;amp; cellMin &amp;gt; 0 &amp;amp;&amp;amp; !atMaxLow)&lt;br /&gt;
        cellMin--;&lt;br /&gt;
&lt;br /&gt;
    cellMin = Math.Max(0, cellMin);&lt;br /&gt;
    cellMax = Math.Min(nrCells - 1, cellMax);&lt;br /&gt;
&lt;br /&gt;
    uint bits = 0;&lt;br /&gt;
&lt;br /&gt;
    for (int c = cellMin; c &amp;lt;= cellMax; c++)&lt;br /&gt;
        bits |= 1u &amp;lt;&amp;lt; c;&lt;br /&gt;
&lt;br /&gt;
    return bits;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===== Track Section Vertex Data =====&lt;br /&gt;
Vertex data is stored as 6-byte groups per entry &#039;&#039;&#039;V&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
{|class=wikitable&lt;br /&gt;
! Offset !! Type !! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x00 || Int16[3][&#039;&#039;&#039;V&#039;&#039;&#039;] || &#039;&#039;&#039;Vertex XYZ position&#039;&#039;&#039;.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
===== Track Section UV Data =====&lt;br /&gt;
UV data is stored as 4-byte groups per entry &#039;&#039;&#039;U&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
{|class=wikitable&lt;br /&gt;
! Offset !! Type !! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x00 || Int16[2][&#039;&#039;&#039;U&#039;&#039;&#039;] || &#039;&#039;&#039;Vertex UV position&#039;&#039;&#039;.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
===== Track Section Color Data =====&lt;br /&gt;
Color data is stored as 2-byte groups per entry &#039;&#039;&#039;C&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
{|class=wikitable&lt;br /&gt;
! Offset !! Type !! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x00 || UInt16[&#039;&#039;&#039;C&#039;&#039;&#039;] || &#039;&#039;&#039;RGBA5551 color&#039;&#039;&#039;.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Terrain Effects ==&lt;br /&gt;
Each texture is linked to 2 specific terrain effects that affect the vehicle&#039;s speed, particles and lighting. This section contains 2 blocks of &#039;&#039;&#039;X&#039;&#039;&#039; UInt16s.&lt;br /&gt;
&lt;br /&gt;
{|class=wikitable&lt;br /&gt;
! Offset !! Type !! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x00 || UInt16[&#039;&#039;&#039;X&#039;&#039;&#039;] || &#039;&#039;&#039;Effects&#039;&#039;&#039;, split in bits.&lt;br /&gt;
|-&lt;br /&gt;
| &#039;&#039;&#039;X&#039;&#039;&#039; * 2 || UInt16[&#039;&#039;&#039;X&#039;&#039;&#039;] || {{unknown-left|&#039;&#039;&#039;Unknown&#039;&#039;&#039;. This seems to be a copy of the previous block?}}&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Culling Groups ==&lt;br /&gt;
This section includes a 4-byte or 8-byte per track section values that determine which section models are loaded when entering a specific section. Each section is represented as 1 bit.&lt;br /&gt;
&lt;br /&gt;
{|class=wikitable&lt;br /&gt;
! Offset !! Type !! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x00 || UInt16[&#039;&#039;&#039;N&#039;&#039;&#039;]/UInt32[&#039;&#039;&#039;N&#039;&#039;&#039;] || &#039;&#039;&#039;Culled model sections&#039;&#039;&#039;, represented as &#039;&#039;&#039;N&#039;&#039;&#039; bits, 1 per section, in order from the least to the most significant bit. 0 if culled, 1 if loaded.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Texture Group ==&lt;br /&gt;
See &#039;&#039;&#039;[[DKRDS Texture Group]]&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
== Culling BSP Tree ==&lt;br /&gt;
This section defines a serialized axis-aligned binary space partitioning tree used for culling sections along with the [[#Culling Groups|Culling Groups]] section. The game traverses it to determine which sections are candidates for rendering given the current player&#039;s position, and then performs a secondary [[#Track Section AABB|AABB]] overlap test on each candidate before adding it to the active render list. The section consists of a sequence of variable-length nodes and leaves stored one after another.&lt;br /&gt;
&lt;br /&gt;
=== Interior Node ===&lt;br /&gt;
An interior node is always 8 bytes long and can be identified apart from a leaf node if the first Int16 is not negative.&lt;br /&gt;
&lt;br /&gt;
{|class=wikitable&lt;br /&gt;
! Offset !! Type !! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x00 || Int16 || &#039;&#039;&#039;Axis index&#039;&#039;&#039; into the player position array:&lt;br /&gt;
* &#039;&#039;&#039;0&#039;&#039;&#039; = X axis.&lt;br /&gt;
* &#039;&#039;&#039;1&#039;&#039;&#039; = Y axis. Unused?&lt;br /&gt;
* &#039;&#039;&#039;2&#039;&#039;&#039; = Z axis.&lt;br /&gt;
|-&lt;br /&gt;
| 0x02 || Int16 || &#039;&#039;&#039;Split value high bits&#039;&#039;&#039;.&lt;br /&gt;
|-&lt;br /&gt;
| 0x04 || UInt16 || &#039;&#039;&#039;Split value low bits&#039;&#039;&#039;.&lt;br /&gt;
|-&lt;br /&gt;
| 0x06 || Int16 || &#039;&#039;&#039;Skip count&#039;&#039;&#039;. The right child begins at &amp;lt;code&amp;gt;(node_offset + 8) + skip * 2&amp;lt;/code&amp;gt; bytes from the start of this section. The left child begins immediately at &amp;lt;code&amp;gt;node_offset + 8&amp;lt;/code&amp;gt;.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The split coordinate is reconstructed by the game as a 32-bit signed result, then divided by 64 to obtain the coordinates in world units (the same scale as the [[#Track Section AABB|section AABBs]]):&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
split = ((split_high &amp;lt;&amp;lt; 16) | (split_low &amp;amp; 0xFFFF)) / 64&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To encode a world-coordinate integer back into the two stored fields:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
split_raw = round(split * 64)							   &lt;br /&gt;
(Int16)split_high = (split_raw &amp;gt;&amp;gt; 16) &amp;amp; 0xFFFF&lt;br /&gt;
(UInt16)split_low = split_raw &amp;amp; 0xFFFF&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Leaf Node ===&lt;br /&gt;
Leaf nodes are variable-length.&lt;br /&gt;
 &lt;br /&gt;
{|class=wikitable&lt;br /&gt;
! Offset !! Type !! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x00 || Int16 || &#039;&#039;&#039;Negative count&#039;&#039;&#039; (&#039;&#039;&#039;-L&#039;&#039;&#039;). The value is always negative. Its negation &#039;&#039;&#039;L&#039;&#039;&#039; gives the number of section IDs that follow.&lt;br /&gt;
|-&lt;br /&gt;
| 0x02 || Int16[&#039;&#039;&#039;L&#039;&#039;&#039;] || &#039;&#039;&#039;Section IDs&#039;&#039;&#039;. Zero-based indices into the [[#Track Section Group|Track Section Group]]. A section may appear in more than one leaf when its AABB occupies a split plane.&lt;br /&gt;
|}&lt;br /&gt;
 &lt;br /&gt;
=== Traversal Algorithm ===&lt;br /&gt;
The game calls the function &amp;lt;code&amp;gt;@02006CC4(bsp_ptr, track_sg, position, tolerance, out_list)&amp;lt;/code&amp;gt;:&lt;br /&gt;
* &#039;&#039;&#039;bsp_ptr&#039;&#039;&#039;: pointer to the start of this section in RAM.&lt;br /&gt;
* &#039;&#039;&#039;track_sg&#039;&#039;&#039;: pointer to the [[#Track Section Group|Track Section Group]].&lt;br /&gt;
* &#039;&#039;&#039;position&#039;&#039;&#039;: player XYZ position.&lt;br /&gt;
* &#039;&#039;&#039;tolerance&#039;&#039;&#039;: a proximity radius, observed as &amp;lt;code&amp;gt;0xF00&amp;lt;/code&amp;gt; (60 in world units).&lt;br /&gt;
* &#039;&#039;&#039;out_list&#039;&#039;&#039;: output structure that receives the active section list.&lt;br /&gt;
 &lt;br /&gt;
At each interior node, in world-unit scale:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
pos = position[axis]&lt;br /&gt;
split_raw = (split_high &amp;lt;&amp;lt; 16) | (split_low &amp;amp; 0xFFFF)&lt;br /&gt;
split = split_raw / 64&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If &amp;lt;code&amp;gt;split - pos &amp;gt; tolerance&amp;lt;/code&amp;gt;, visit the left child only; else if &amp;lt;code&amp;gt;pos - split &amp;amp;ge; tolerance&amp;lt;/code&amp;gt;, visit the right child only; otherwise, visit both children.&lt;br /&gt;
&lt;br /&gt;
The left child corresponds to sections whose AABB satisfies &amp;lt;code&amp;gt;min[axis] &amp;amp;le; split&amp;lt;/code&amp;gt;; the right child corresponds to sections whose AABB satisfies &amp;lt;code&amp;gt;max[axis] &amp;amp;ge; split&amp;lt;/code&amp;gt;. Sections satisfying both (i.e. whose AABB traverses the split plane) appear in leaves on both sides.&lt;br /&gt;
&lt;br /&gt;
At each leaf node, for every listed section ID the section&#039;s data pointer is first looked up via the [[#Track Section Group|Track Section Group]]. Then, the player&#039;s bounding box is tested (&amp;lt;code&amp;gt;(X &amp;amp;plusmn; tolerance) * (Z &amp;amp;plusmn; tolerance)&amp;lt;/code&amp;gt;) against the section&#039;s [[#Track Section AABB|AABB]]. If the AABB test passes, add the section to the active render list.&lt;br /&gt;
&lt;br /&gt;
== Wish Race Unknown Section ==&lt;br /&gt;
This section is only used for the Wish Race tracks. &#039;&#039;TBD&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
= Tools =&lt;br /&gt;
The following tools can handle DKRDS Track:&lt;br /&gt;
* (none)&lt;br /&gt;
&lt;br /&gt;
[[Category:Diddy Kong Racing DS File Formats]]&lt;/div&gt;</summary>
		<author><name>Atlas</name></author>
	</entry>
	<entry>
		<id>https://wiki.wexosmk.xyz/index.php?title=DKRDS_Track_(File_Format)&amp;diff=683</id>
		<title>DKRDS Track (File Format)</title>
		<link rel="alternate" type="text/html" href="https://wiki.wexosmk.xyz/index.php?title=DKRDS_Track_(File_Format)&amp;diff=683"/>
		<updated>2026-06-15T10:37:14Z</updated>

		<summary type="html">&lt;p&gt;Atlas: /* Culling BSP Tree */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&#039;&#039;&#039;DKRDS Track&#039;&#039;&#039; is the nameless file format used in &#039;&#039;[https://en.wikipedia.org/wiki/Diddy_Kong_Racing_DS Diddy Kong Racing DS]&#039;&#039; that stores the tracks&#039; section models, collision and textures. Its type identifier in [[assets.bin]] is &#039;&#039;&#039;0x9A&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
= File Format =&lt;br /&gt;
The file byte order is always little endian.&lt;br /&gt;
&lt;br /&gt;
== Header ==&lt;br /&gt;
The file starts with a header that is 56 bytes long.&lt;br /&gt;
&lt;br /&gt;
{|class=wikitable&lt;br /&gt;
! Offset !! Type !! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x00 || Int32 || &#039;&#039;&#039;Number of sections&#039;&#039;&#039; (&#039;&#039;&#039;N&#039;&#039;&#039;).&lt;br /&gt;
|-&lt;br /&gt;
| 0x04 || Int32 || &#039;&#039;&#039;[[#Track Section Group|Track Section Group]]&#039;&#039;&#039; offset.&lt;br /&gt;
|-&lt;br /&gt;
| 0x08 || Int32 || &#039;&#039;&#039;[[#Collision Effects|Collision Effects]]&#039;&#039;&#039; offset.&lt;br /&gt;
|-&lt;br /&gt;
| 0x0C || Byte[4] || {{unknown-left|&#039;&#039;&#039;Unknown&#039;&#039;&#039;. Always 0xCCCCCCCC.}}&lt;br /&gt;
|-&lt;br /&gt;
| 0x10 || Int32 || &#039;&#039;&#039;[[#Culling Groups|Culling Groups]]&#039;&#039;&#039; offset.&lt;br /&gt;
|-&lt;br /&gt;
| 0x14 || Int32 || &#039;&#039;&#039;[[#Culling Groups|Culling Groups]]&#039;&#039;&#039; data type:&lt;br /&gt;
* 1 = 4-byte per &#039;&#039;&#039;N&#039;&#039;&#039; group.&lt;br /&gt;
* 2 = 8-byte per &#039;&#039;&#039;N&#039;&#039;&#039; group.&lt;br /&gt;
|-&lt;br /&gt;
| 0x18 || Int32 || &#039;&#039;&#039;Number of textures&#039;&#039;&#039; (&#039;&#039;&#039;X&#039;&#039;&#039;).&lt;br /&gt;
|-&lt;br /&gt;
| 0x1C || Int32 || &#039;&#039;&#039;[[#Texture Group|Texture Group]]&#039;&#039;&#039; offset.&lt;br /&gt;
|-&lt;br /&gt;
| 0x20 || Int32 || &#039;&#039;&#039;[[#Culling BSP Tree|Culling BSP Tree]]&#039;&#039;&#039; offset.&lt;br /&gt;
|-&lt;br /&gt;
| 0x24 || Int32 || &#039;&#039;&#039;[[#Wish Race Unknown Section|Wish Race Unknown Section]]&#039;&#039;&#039; entry count.&lt;br /&gt;
|-&lt;br /&gt;
| 0x28 || Int32 || &#039;&#039;&#039;[[#Wish Race Unknown Section|Wish Race Unknown Section]]&#039;&#039;&#039; offset.&lt;br /&gt;
|-&lt;br /&gt;
| 0x2C || Byte[4] || {{unknown-left|&#039;&#039;&#039;Unknown&#039;&#039;&#039;. Seems to be some kind of flags.}}&lt;br /&gt;
|-&lt;br /&gt;
| 0x30 || Int32 || {{unknown-left|&#039;&#039;&#039;Unknown&#039;&#039;&#039;.}}&lt;br /&gt;
|-&lt;br /&gt;
| 0x34 || Int32 || &#039;&#039;&#039;File size&#039;&#039;&#039;.&lt;br /&gt;
|-&lt;br /&gt;
| 0x38 || colspan=2 {{unknown|End of header}}&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Track Section Group ==&lt;br /&gt;
This group starts with a list of &#039;&#039;&#039;N&#039;&#039;&#039; offsets.&lt;br /&gt;
&lt;br /&gt;
{|class=wikitable&lt;br /&gt;
|+ Track Section Header&lt;br /&gt;
! Offset !! Type !! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x00 || Int32[&#039;&#039;&#039;N&#039;&#039;&#039;] || &#039;&#039;&#039;[[#Track Section Entry|Track Section Entry]]&#039;&#039;&#039; offsets. Relative to the start of this group.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Track Section Entry ===&lt;br /&gt;
Every section entry defines model and collision data. The entry starts with a 32-byte header.&lt;br /&gt;
&lt;br /&gt;
{|class=wikitable&lt;br /&gt;
|+ Track Section Entry Header&lt;br /&gt;
! Offset !! Type !! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x00 || Byte || {{unknown-left|&#039;&#039;&#039;Unknown&#039;&#039;&#039;.}}&lt;br /&gt;
|-&lt;br /&gt;
| 0x01 || Byte || {{unknown-left|&#039;&#039;&#039;Unknown&#039;&#039;&#039;. Always 5?}}&lt;br /&gt;
|-&lt;br /&gt;
| 0x02 || UInt16 || {{unknown-left|&#039;&#039;&#039;Unknown&#039;&#039;&#039;.}}&lt;br /&gt;
|-&lt;br /&gt;
| 0x04 || UInt16 || &#039;&#039;&#039;Number of polygon groups&#039;&#039;&#039; (&#039;&#039;&#039;P&#039;&#039;&#039;).&lt;br /&gt;
|-&lt;br /&gt;
| 0x06 || UInt16 || &#039;&#039;&#039;Number of vertices&#039;&#039;&#039; in [[#Track Section Vertex Data|Track Section Vertex Data]] (&#039;&#039;&#039;V&#039;&#039;&#039;).&lt;br /&gt;
|-&lt;br /&gt;
| 0x08 || UInt16 || &#039;&#039;&#039;Number of UVs&#039;&#039;&#039; in [[#Track Section UV|Track Section UV Data]] (&#039;&#039;&#039;U&#039;&#039;&#039;).&lt;br /&gt;
|-&lt;br /&gt;
| 0x0A || UInt16 || &#039;&#039;&#039;Number of colors&#039;&#039;&#039; in [[#Track Section Color Data|Track Section Color Data]] (&#039;&#039;&#039;C&#039;&#039;&#039;).&lt;br /&gt;
|-&lt;br /&gt;
| 0x0C || Int32 || &#039;&#039;&#039;[[#Track Section Triangle Data|Track Section Triangle Data]]&#039;&#039;&#039; offset.&lt;br /&gt;
|-&lt;br /&gt;
| 0x10 || Int32 || &#039;&#039;&#039;[[#Track Section Collision Data|Track Section Collision Data]]&#039;&#039;&#039; offset.&lt;br /&gt;
|-&lt;br /&gt;
| 0x14 || Int32 || &#039;&#039;&#039;[[#Track Section Vertex Data|Track Section Vertex Data]]&#039;&#039;&#039; offset.&lt;br /&gt;
|-&lt;br /&gt;
| 0x18 || Int32 || &#039;&#039;&#039;[[#Track Section UV Data|Track Section UV Data]]&#039;&#039;&#039; offset.&lt;br /&gt;
|-&lt;br /&gt;
| 0x1C || Int32 || &#039;&#039;&#039;[[#Track Section Color Data|Track Section Color Data]]&#039;&#039;&#039; offset.&lt;br /&gt;
|-&lt;br /&gt;
| 0x20 || colspan=2 {{unknown|End of header, start of [[#Track Section Data|Track Section Data]]}}&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== Track Section Data ====&lt;br /&gt;
This data follows directly after the header of the section entry and starts with a 76-byte header.&lt;br /&gt;
&lt;br /&gt;
{|class=wikitable&lt;br /&gt;
! Offset !! Type !! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x00 || Int32 || {{unknown-left|&#039;&#039;&#039;Unknown&#039;&#039;&#039;. Seems to be always 0xFFFFFFFF and set to an address when loaded in memory.}}&lt;br /&gt;
|-&lt;br /&gt;
| 0x04 || Int32[3] || &#039;&#039;&#039;Collision XYZ offset&#039;&#039;&#039;.&lt;br /&gt;
|-&lt;br /&gt;
| 0x10 || Int32[3] || &#039;&#039;&#039;Visual model XYZ offset&#039;&#039;&#039;. The units are not the same as the collision offset.&lt;br /&gt;
|-&lt;br /&gt;
| 0x1C || [[#Track Section AABB|Track Section AABB]][2] || &#039;&#039;&#039;AABB areas&#039;&#039;&#039; of the entire section used for collision detection. The second AABB always seems to be a duplicate of the first.&lt;br /&gt;
|-&lt;br /&gt;
| 0x4C || colspan=2 {{unknown|End of header, start of [[#Track Section Polygon Data|Track Section Polygon Data]]}}&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
===== Track Section AABB =====&lt;br /&gt;
Track sections contain 2 identical AABB areas each. It is unknown why there&#039;s a duplicate, perhaps used during runtime after object space transform. All values need to be divided by 64 in order to obtain the absolute position data and match with the visual models.&lt;br /&gt;
&lt;br /&gt;
{|class=wikitable&lt;br /&gt;
! Offset !! Type !! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x00 || Int32[3] || &#039;&#039;&#039;AABB minimum XYZ position&#039;&#039;&#039;.&lt;br /&gt;
|-&lt;br /&gt;
| 0x0C || Int32[3] || &#039;&#039;&#039;AABB XYZ extent&#039;&#039;&#039;.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
===== Track Section Polygon Data =====&lt;br /&gt;
This section seems to store &#039;&#039;&#039;P&#039;&#039;&#039; polygon groups&#039; attributes.&lt;br /&gt;
&lt;br /&gt;
{|class=wikitable&lt;br /&gt;
! Offset !! Type !! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x00 || [[#Polygon Group Entry|Polygon Group Entry]][&#039;&#039;&#039;P&#039;&#039;&#039;] || &#039;&#039;&#039;Polygon group entries&#039;&#039;&#039;.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
====== Polygon Group Entry ======&lt;br /&gt;
Each polygon group entry is 12 bytes long.&lt;br /&gt;
&lt;br /&gt;
{|class=wikitable&lt;br /&gt;
! Offset !! Type !! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x00 || UInt16 || &#039;&#039;&#039;First triangle ID&#039;&#039;&#039;.&lt;br /&gt;
|-&lt;br /&gt;
| 0x02 || UInt16 || &#039;&#039;&#039;Number of triangles&#039;&#039;&#039;.&lt;br /&gt;
|-&lt;br /&gt;
| 0x04 || Byte || &#039;&#039;&#039;Main collision attribute&#039;&#039;&#039;. &#039;&#039;&#039;AAAA BBBB&#039;&#039;&#039;:&lt;br /&gt;
* &#039;&#039;&#039;A&#039;&#039;&#039;: &#039;&#039;&#039;Shadow level&#039;&#039;&#039;. The higher the value, the darker the character gets.&lt;br /&gt;
* &#039;&#039;&#039;B&#039;&#039;&#039;: &#039;&#039;&#039;Collision flag&#039;&#039;&#039;:&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! ID !! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x01 || Road and effects.&lt;br /&gt;
|-&lt;br /&gt;
| 0x05 || Wall (sparks on collision).&lt;br /&gt;
|-&lt;br /&gt;
| 0x08 || Special effects (turns off visual model).&lt;br /&gt;
|-&lt;br /&gt;
| 0x0C || Invisible wall (no sparks on collision, turns off visual model).&lt;br /&gt;
|}&lt;br /&gt;
|-&lt;br /&gt;
| 0x05 || Byte || &#039;&#039;&#039;Secondary collision attribute&#039;&#039;&#039;:&lt;br /&gt;
* &#039;&#039;&#039;Main flag = 0x01&#039;&#039;&#039;:&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! ID !! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x00 || Special effect? Used for water.&lt;br /&gt;
|-&lt;br /&gt;
| 0x01 || Pass through/no effect.&lt;br /&gt;
|-&lt;br /&gt;
| 0x04 || Road.&lt;br /&gt;
|}&lt;br /&gt;
* &#039;&#039;&#039;Main flag = 0x08&#039;&#039;&#039;:&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! ID !! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x00 || Invisible wall (no sparks on collision).&lt;br /&gt;
|-&lt;br /&gt;
| 0x01 || Water.&lt;br /&gt;
|}&lt;br /&gt;
|-&lt;br /&gt;
| 0x06 || UInt16 || &#039;&#039;&#039;Tertiary collision attribute&#039;&#039;&#039;. Split in bits.&lt;br /&gt;
* &#039;&#039;&#039;Main flag = 0x01&#039;&#039;&#039;:&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! ID !! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x01 || {{unknown-left|&#039;&#039;&#039;Unknown&#039;&#039;&#039;. Used in non-collideable stuff.}}&lt;br /&gt;
|-&lt;br /&gt;
| 0x02 || Water, inflates tires in car.&lt;br /&gt;
|-&lt;br /&gt;
| 0x10 || {{unknown-left|&#039;&#039;&#039;Unknown&#039;&#039;&#039;. Used in non-collideable stuff.}}&lt;br /&gt;
|-&lt;br /&gt;
| 0x20 || {{unknown-left|&#039;&#039;&#039;Unknown&#039;&#039;&#039;. Used in non-collideable stuff.}}&lt;br /&gt;
|-&lt;br /&gt;
| 0x60 || {{unknown-left|&#039;&#039;&#039;Unknown&#039;&#039;&#039;. Used in non-collideable stuff.}}&lt;br /&gt;
|}&lt;br /&gt;
* &#039;&#039;&#039;Main flag = 0x08&#039;&#039;&#039;:&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! ID !! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x30 || {{unknown-left|&#039;&#039;&#039;Unknown&#039;&#039;&#039;. Used in non-collideable stuff.}}&lt;br /&gt;
|}&lt;br /&gt;
* &#039;&#039;&#039;Main flag = 0x0C&#039;&#039;&#039;:&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! ID !! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x04 || Ignore when using plane.&lt;br /&gt;
|}&lt;br /&gt;
|-&lt;br /&gt;
| 0x08 || Byte[4] || &#039;&#039;&#039;Collision grid mask&#039;&#039;&#039;. This is an OR of all of the [[#Track Section Collision Data|collision grids]] for all triangles in this group.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The number of triangles &#039;&#039;&#039;T&#039;&#039;&#039; can be calculated by adding the first triangle ID to the number of triangles of the last polygon group entry.&lt;br /&gt;
&lt;br /&gt;
===== Track Section Triangle Data =====&lt;br /&gt;
This section stores &#039;&#039;&#039;T&#039;&#039;&#039; triangle entries.&lt;br /&gt;
&lt;br /&gt;
{|class=wikitable&lt;br /&gt;
! Offset !! Type !! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x00 || [[#Triangle Entry|Triangle Entry]][&#039;&#039;&#039;T&#039;&#039;&#039;] || &#039;&#039;&#039;Triangle entries&#039;&#039;&#039;.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
====== Triangle Entry ======&lt;br /&gt;
Each triangle entry is 20 bytes long.&lt;br /&gt;
&lt;br /&gt;
{|class=wikitable&lt;br /&gt;
! Offset !! Type !! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x00 || UInt16 || &#039;&#039;&#039;Attribute flags&#039;&#039;&#039;. &#039;&#039;&#039;AAAA AAAA AAAA AAAB&#039;&#039;&#039;:&lt;br /&gt;
* &#039;&#039;&#039;A&#039;&#039;&#039;: &#039;&#039;&#039;Texture ID&#039;&#039;&#039;.&lt;br /&gt;
* &#039;&#039;&#039;B&#039;&#039;&#039;: Collidable attribute? If 0 in roads, the triangles are not collidable. Unknown meaning in walls.&lt;br /&gt;
|-&lt;br /&gt;
| 0x02 || UInt16[3] || &#039;&#039;&#039;Face XYZ normals&#039;&#039;&#039;. Values need to be divided by 4096.&lt;br /&gt;
|-&lt;br /&gt;
| 0x08 || Byte[4] || &#039;&#039;&#039;Vertex position indices&#039;&#039;&#039;. The index for each of the 3 vertices is 10 bits long. 2 last bits are unknown.&lt;br /&gt;
|-&lt;br /&gt;
| 0x0C || Byte[4] || &#039;&#039;&#039;UV indices&#039;&#039;&#039;. The index for each of the 3 vertices is 10 bits long. 2 last bits are unknown.&lt;br /&gt;
|-&lt;br /&gt;
| 0x10 || Byte[4] || &#039;&#039;&#039;Color indices&#039;&#039;&#039;. The index for each of the 3 vertices is 10 bits long. 2 last bits are unknown.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
===== Track Section Collision Data =====&lt;br /&gt;
Each triangle corresponds to a 4-byte set of values to help with collision detection. These values encode local X, Y and Z coordinates that form a grid of cells inside the section&#039;s AABB.&lt;br /&gt;
&lt;br /&gt;
{|class=wikitable&lt;br /&gt;
! Offset !! Type !! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x00 || Byte || &#039;&#039;&#039;Y occupancy&#039;&#039;&#039;. Values correspond to 8 cells of the AABB (AABB&#039;s Y extent / 8).&lt;br /&gt;
|-&lt;br /&gt;
| 0x01 || Byte || &#039;&#039;&#039;Z occupancy&#039;&#039;&#039;. Values correspond to 8 cells of the AABB (AABB&#039;s Z extent / 8).&lt;br /&gt;
|-&lt;br /&gt;
| 0x02 || UInt16 || &#039;&#039;&#039;X occupancy&#039;&#039;&#039;. Values correspond to 16 cells of the AABB (AABB&#039;s X extent / 16).&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The following ARM assembly instructions (@01FF95D0 from the game&#039;s code) demonstrate how the vehicle&#039;s current grid bitmask is compared to the current testing triangle&#039;s collision:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
AND R0, R0, R5 // R0 = triangle&#039;s collision value AND vehicle&#039;s bitmask&lt;br /&gt;
TST R0, #FF // test byte 0 (Y)&lt;br /&gt;
TSTNE R0, #FF00 // if nonzero, test byte 1 (Z)&lt;br /&gt;
MOVNES R0, R0, LSR #10 // if still nonzero, test upper 16 bits (X)&lt;br /&gt;
MOVNE R0, #1 // collidable only if ALL 3 are nonzero&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The following functions in C# compute a triangle&#039;s collision grid from its minimum and maximum positions and its containing section&#039;s AABB:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
uint ComputeCollision(float xMin, float xMax, float yMin, float yMax, float zMin, float zMax, float aabbXMin, float aabbXExt, float aabbYMin, float aabbYExt, float aabbZMin, float aabbZExt)&lt;br /&gt;
{&lt;br /&gt;
    if (aabbXExt &amp;lt;= 0 || aabbYExt &amp;lt;= 0 || aabbZExt &amp;lt;= 0)&lt;br /&gt;
        return 0xFFFFFFFFu;&lt;br /&gt;
&lt;br /&gt;
    uint xBits = ComputeCellBits(xMin - aabbXMin, xMax - aabbXMin, aabbXExt / 16f, 16);&lt;br /&gt;
    uint zBits = ComputeCellBits(zMin - aabbZMin, zMax - aabbZMin, aabbZExt / 8f, 8);&lt;br /&gt;
    uint yBits = ComputeCellBits(yMin - aabbYMin, yMax - aabbYMin, aabbYExt / 8f, 8);&lt;br /&gt;
&lt;br /&gt;
    return (xBits &amp;lt;&amp;lt; 16) | (zBits &amp;lt;&amp;lt; 8) | yBits;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
uint ComputeCellBits(float relMin, float relMax, float cellSize, int nrCells)&lt;br /&gt;
{&lt;br /&gt;
    const float Epsilon = 1e-4f;&lt;br /&gt;
    float faceMin = relMin / cellSize;&lt;br /&gt;
    float faceMax = relMax / cellSize;&lt;br /&gt;
&lt;br /&gt;
    // Special case for degenerate faces (flat faces with zero extent in this axis, e.g. a wall parallel to XZ)&lt;br /&gt;
    if (MathF.Abs(faceMax - faceMin) &amp;lt; Epsilon)&lt;br /&gt;
    {&lt;br /&gt;
        int cell = Math.Max(0, Math.Min(nrCells - 1, (int)MathF.Floor(faceMin)));&lt;br /&gt;
        bool atExact = MathF.Abs(faceMin - MathF.Round(faceMin)) &amp;lt; Epsilon;&lt;br /&gt;
        bool atMaxEdge = cell == nrCells - 1;&lt;br /&gt;
&lt;br /&gt;
        // Include the preceding cell only at an interior exact boundary&lt;br /&gt;
        if (atExact &amp;amp;&amp;amp; cell &amp;gt; 0 &amp;amp;&amp;amp; !atMaxEdge)&lt;br /&gt;
            return (1u &amp;lt;&amp;lt; cell) | (1u &amp;lt;&amp;lt; (cell - 1));&lt;br /&gt;
&lt;br /&gt;
        return 1u &amp;lt;&amp;lt; cell;&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    int cellMin = (int)MathF.Floor(faceMin);&lt;br /&gt;
    int cellMax = (int)MathF.Floor(faceMax - Epsilon); // Exact upper boundary stays in current cell&lt;br /&gt;
&lt;br /&gt;
    // Exact lower boundary stays in the preceding cell&lt;br /&gt;
    bool atExactLow = MathF.Abs(faceMin - MathF.Round(faceMin)) &amp;lt; Epsilon;&lt;br /&gt;
    bool atMaxLow = cellMin == nrCells - 1;&lt;br /&gt;
    if (atExactLow &amp;amp;&amp;amp; cellMin &amp;gt; 0 &amp;amp;&amp;amp; !atMaxLow)&lt;br /&gt;
        cellMin--;&lt;br /&gt;
&lt;br /&gt;
    cellMin = Math.Max(0, cellMin);&lt;br /&gt;
    cellMax = Math.Min(nrCells - 1, cellMax);&lt;br /&gt;
&lt;br /&gt;
    uint bits = 0;&lt;br /&gt;
&lt;br /&gt;
    for (int c = cellMin; c &amp;lt;= cellMax; c++)&lt;br /&gt;
        bits |= 1u &amp;lt;&amp;lt; c;&lt;br /&gt;
&lt;br /&gt;
    return bits;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===== Track Section Vertex Data =====&lt;br /&gt;
Vertex data is stored as 6-byte groups per entry &#039;&#039;&#039;V&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
{|class=wikitable&lt;br /&gt;
! Offset !! Type !! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x00 || Int16[3][&#039;&#039;&#039;V&#039;&#039;&#039;] || &#039;&#039;&#039;Vertex XYZ position&#039;&#039;&#039;.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
===== Track Section UV Data =====&lt;br /&gt;
UV data is stored as 4-byte groups per entry &#039;&#039;&#039;U&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
{|class=wikitable&lt;br /&gt;
! Offset !! Type !! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x00 || Int16[2][&#039;&#039;&#039;U&#039;&#039;&#039;] || &#039;&#039;&#039;Vertex UV position&#039;&#039;&#039;.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
===== Track Section Color Data =====&lt;br /&gt;
Color data is stored as 2-byte groups per entry &#039;&#039;&#039;C&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
{|class=wikitable&lt;br /&gt;
! Offset !! Type !! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x00 || UInt16[&#039;&#039;&#039;C&#039;&#039;&#039;] || &#039;&#039;&#039;RGBA5551 color&#039;&#039;&#039;.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Collision Effects ==&lt;br /&gt;
Each texture is linked to 2 specific collision effects that affect the vehicle&#039;s speed, particles and lighting. This section contains 2 blocks of &#039;&#039;&#039;X&#039;&#039;&#039; UInt16s.&lt;br /&gt;
&lt;br /&gt;
{|class=wikitable&lt;br /&gt;
! Offset !! Type !! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x00 || UInt16[&#039;&#039;&#039;X&#039;&#039;&#039;] || &#039;&#039;&#039;Effects&#039;&#039;&#039;, split in bits.&lt;br /&gt;
|-&lt;br /&gt;
| &#039;&#039;&#039;X&#039;&#039;&#039; * 2 || UInt16[&#039;&#039;&#039;X&#039;&#039;&#039;] || {{unknown-left|&#039;&#039;&#039;Unknown&#039;&#039;&#039;. This seems to be a copy of the previous block?}}&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Culling Groups ==&lt;br /&gt;
This section includes a 4-byte or 8-byte per track section values that determine which section models are loaded when entering a specific section. Each section is represented as 1 bit.&lt;br /&gt;
&lt;br /&gt;
{|class=wikitable&lt;br /&gt;
! Offset !! Type !! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x00 || UInt16[&#039;&#039;&#039;N&#039;&#039;&#039;]/UInt32[&#039;&#039;&#039;N&#039;&#039;&#039;] || &#039;&#039;&#039;Culled model sections&#039;&#039;&#039;, represented as &#039;&#039;&#039;N&#039;&#039;&#039; bits, 1 per section, in order from the least to the most significant bit. 0 if culled, 1 if loaded.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Texture Group ==&lt;br /&gt;
See &#039;&#039;&#039;[[DKRDS Texture Group]]&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
== Culling BSP Tree ==&lt;br /&gt;
This section defines a serialized axis-aligned binary space partitioning tree used for culling sections along with the [[#Culling Groups|Culling Groups]] section. The game traverses it to determine which sections are candidates for rendering given the current player&#039;s position, and then performs a secondary [[#Track Section AABB|AABB]] overlap test on each candidate before adding it to the active render list. The section consists of a sequence of variable-length nodes and leaves stored one after another.&lt;br /&gt;
&lt;br /&gt;
=== Interior Node ===&lt;br /&gt;
An interior node is always 8 bytes long and can be identified apart from a leaf node if the first Int16 is not negative.&lt;br /&gt;
&lt;br /&gt;
{|class=wikitable&lt;br /&gt;
! Offset !! Type !! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x00 || Int16 || &#039;&#039;&#039;Axis index&#039;&#039;&#039; into the player position array:&lt;br /&gt;
* &#039;&#039;&#039;0&#039;&#039;&#039; = X axis.&lt;br /&gt;
* &#039;&#039;&#039;1&#039;&#039;&#039; = Y axis. Unused?&lt;br /&gt;
* &#039;&#039;&#039;2&#039;&#039;&#039; = Z axis.&lt;br /&gt;
|-&lt;br /&gt;
| 0x02 || Int16 || &#039;&#039;&#039;Split value high bits&#039;&#039;&#039;.&lt;br /&gt;
|-&lt;br /&gt;
| 0x04 || UInt16 || &#039;&#039;&#039;Split value low bits&#039;&#039;&#039;.&lt;br /&gt;
|-&lt;br /&gt;
| 0x06 || Int16 || &#039;&#039;&#039;Skip count&#039;&#039;&#039;. The right child begins at &amp;lt;code&amp;gt;(node_offset + 8) + skip * 2&amp;lt;/code&amp;gt; bytes from the start of this section. The left child begins immediately at &amp;lt;code&amp;gt;node_offset + 8&amp;lt;/code&amp;gt;.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The split coordinate is reconstructed by the game as a 32-bit signed result, then divided by 64 to obtain the coordinates in world units (the same scale as the [[#Track Section AABB|section AABBs]]):&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
split = ((split_high &amp;lt;&amp;lt; 16) | (split_low &amp;amp; 0xFFFF)) / 64&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To encode a world-coordinate integer back into the two stored fields:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
split_raw = round(split * 64)							   &lt;br /&gt;
(Int16)split_high = (split_raw &amp;gt;&amp;gt; 16) &amp;amp; 0xFFFF&lt;br /&gt;
(UInt16)split_low = split_raw &amp;amp; 0xFFFF&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Leaf Node ===&lt;br /&gt;
Leaf nodes are variable-length.&lt;br /&gt;
 &lt;br /&gt;
{|class=wikitable&lt;br /&gt;
! Offset !! Type !! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x00 || Int16 || &#039;&#039;&#039;Negative count&#039;&#039;&#039; (&#039;&#039;&#039;-L&#039;&#039;&#039;). The value is always negative. Its negation &#039;&#039;&#039;L&#039;&#039;&#039; gives the number of section IDs that follow.&lt;br /&gt;
|-&lt;br /&gt;
| 0x02 || Int16[&#039;&#039;&#039;L&#039;&#039;&#039;] || &#039;&#039;&#039;Section IDs&#039;&#039;&#039;. Zero-based indices into the [[#Track Section Group|Track Section Group]]. A section may appear in more than one leaf when its AABB occupies a split plane.&lt;br /&gt;
|}&lt;br /&gt;
 &lt;br /&gt;
=== Traversal Algorithm ===&lt;br /&gt;
The game calls the function &amp;lt;code&amp;gt;@02006CC4(bsp_ptr, track_sg, position, tolerance, out_list)&amp;lt;/code&amp;gt;:&lt;br /&gt;
* &#039;&#039;&#039;bsp_ptr&#039;&#039;&#039;: pointer to the start of this section in RAM.&lt;br /&gt;
* &#039;&#039;&#039;track_sg&#039;&#039;&#039;: pointer to the [[#Track Section Group|Track Section Group]].&lt;br /&gt;
* &#039;&#039;&#039;position&#039;&#039;&#039;: player XYZ position.&lt;br /&gt;
* &#039;&#039;&#039;tolerance&#039;&#039;&#039;: a proximity radius, observed as &amp;lt;code&amp;gt;0xF00&amp;lt;/code&amp;gt; (60 in world units).&lt;br /&gt;
* &#039;&#039;&#039;out_list&#039;&#039;&#039;: output structure that receives the active section list.&lt;br /&gt;
 &lt;br /&gt;
At each interior node, in world-unit scale:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
pos = position[axis]&lt;br /&gt;
split_raw = (split_high &amp;lt;&amp;lt; 16) | (split_low &amp;amp; 0xFFFF)&lt;br /&gt;
split = split_raw / 64&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If &amp;lt;code&amp;gt;split - pos &amp;gt; tolerance&amp;lt;/code&amp;gt;, visit the left child only; else if &amp;lt;code&amp;gt;pos - split &amp;amp;ge; tolerance&amp;lt;/code&amp;gt;, visit the right child only; otherwise, visit both children.&lt;br /&gt;
&lt;br /&gt;
The left child corresponds to sections whose AABB satisfies &amp;lt;code&amp;gt;min[axis] &amp;amp;le; split&amp;lt;/code&amp;gt;; the right child corresponds to sections whose AABB satisfies &amp;lt;code&amp;gt;max[axis] &amp;amp;ge; split&amp;lt;/code&amp;gt;. Sections satisfying both (i.e. whose AABB traverses the split plane) appear in leaves on both sides.&lt;br /&gt;
&lt;br /&gt;
At each leaf node, for every listed section ID the section&#039;s data pointer is first looked up via the [[#Track Section Group|Track Section Group]]. Then, the player&#039;s bounding box is tested (&amp;lt;code&amp;gt;(X &amp;amp;plusmn; tolerance) * (Z &amp;amp;plusmn; tolerance)&amp;lt;/code&amp;gt;) against the section&#039;s [[#Track Section AABB|AABB]]. If the AABB test passes, add the section to the active render list.&lt;br /&gt;
&lt;br /&gt;
== Wish Race Unknown Section ==&lt;br /&gt;
This section is only used for the Wish Race tracks. &#039;&#039;TBD&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
= Tools =&lt;br /&gt;
The following tools can handle DKRDS Track:&lt;br /&gt;
* (none)&lt;br /&gt;
&lt;br /&gt;
[[Category:Diddy Kong Racing DS File Formats]]&lt;/div&gt;</summary>
		<author><name>Atlas</name></author>
	</entry>
	<entry>
		<id>https://wiki.wexosmk.xyz/index.php?title=DKRDS_Track_(File_Format)&amp;diff=682</id>
		<title>DKRDS Track (File Format)</title>
		<link rel="alternate" type="text/html" href="https://wiki.wexosmk.xyz/index.php?title=DKRDS_Track_(File_Format)&amp;diff=682"/>
		<updated>2026-06-12T22:03:16Z</updated>

		<summary type="html">&lt;p&gt;Atlas: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&#039;&#039;&#039;DKRDS Track&#039;&#039;&#039; is the nameless file format used in &#039;&#039;[https://en.wikipedia.org/wiki/Diddy_Kong_Racing_DS Diddy Kong Racing DS]&#039;&#039; that stores the tracks&#039; section models, collision and textures. Its type identifier in [[assets.bin]] is &#039;&#039;&#039;0x9A&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
= File Format =&lt;br /&gt;
The file byte order is always little endian.&lt;br /&gt;
&lt;br /&gt;
== Header ==&lt;br /&gt;
The file starts with a header that is 56 bytes long.&lt;br /&gt;
&lt;br /&gt;
{|class=wikitable&lt;br /&gt;
! Offset !! Type !! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x00 || Int32 || &#039;&#039;&#039;Number of sections&#039;&#039;&#039; (&#039;&#039;&#039;N&#039;&#039;&#039;).&lt;br /&gt;
|-&lt;br /&gt;
| 0x04 || Int32 || &#039;&#039;&#039;[[#Track Section Group|Track Section Group]]&#039;&#039;&#039; offset.&lt;br /&gt;
|-&lt;br /&gt;
| 0x08 || Int32 || &#039;&#039;&#039;[[#Collision Effects|Collision Effects]]&#039;&#039;&#039; offset.&lt;br /&gt;
|-&lt;br /&gt;
| 0x0C || Byte[4] || {{unknown-left|&#039;&#039;&#039;Unknown&#039;&#039;&#039;. Always 0xCCCCCCCC.}}&lt;br /&gt;
|-&lt;br /&gt;
| 0x10 || Int32 || &#039;&#039;&#039;[[#Culling Groups|Culling Groups]]&#039;&#039;&#039; offset.&lt;br /&gt;
|-&lt;br /&gt;
| 0x14 || Int32 || &#039;&#039;&#039;[[#Culling Groups|Culling Groups]]&#039;&#039;&#039; data type:&lt;br /&gt;
* 1 = 4-byte per &#039;&#039;&#039;N&#039;&#039;&#039; group.&lt;br /&gt;
* 2 = 8-byte per &#039;&#039;&#039;N&#039;&#039;&#039; group.&lt;br /&gt;
|-&lt;br /&gt;
| 0x18 || Int32 || &#039;&#039;&#039;Number of textures&#039;&#039;&#039; (&#039;&#039;&#039;X&#039;&#039;&#039;).&lt;br /&gt;
|-&lt;br /&gt;
| 0x1C || Int32 || &#039;&#039;&#039;[[#Texture Group|Texture Group]]&#039;&#039;&#039; offset.&lt;br /&gt;
|-&lt;br /&gt;
| 0x20 || Int32 || &#039;&#039;&#039;[[#Culling BSP Tree|Culling BSP Tree]]&#039;&#039;&#039; offset.&lt;br /&gt;
|-&lt;br /&gt;
| 0x24 || Int32 || &#039;&#039;&#039;[[#Wish Race Unknown Section|Wish Race Unknown Section]]&#039;&#039;&#039; entry count.&lt;br /&gt;
|-&lt;br /&gt;
| 0x28 || Int32 || &#039;&#039;&#039;[[#Wish Race Unknown Section|Wish Race Unknown Section]]&#039;&#039;&#039; offset.&lt;br /&gt;
|-&lt;br /&gt;
| 0x2C || Byte[4] || {{unknown-left|&#039;&#039;&#039;Unknown&#039;&#039;&#039;. Seems to be some kind of flags.}}&lt;br /&gt;
|-&lt;br /&gt;
| 0x30 || Int32 || {{unknown-left|&#039;&#039;&#039;Unknown&#039;&#039;&#039;.}}&lt;br /&gt;
|-&lt;br /&gt;
| 0x34 || Int32 || &#039;&#039;&#039;File size&#039;&#039;&#039;.&lt;br /&gt;
|-&lt;br /&gt;
| 0x38 || colspan=2 {{unknown|End of header}}&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Track Section Group ==&lt;br /&gt;
This group starts with a list of &#039;&#039;&#039;N&#039;&#039;&#039; offsets.&lt;br /&gt;
&lt;br /&gt;
{|class=wikitable&lt;br /&gt;
|+ Track Section Header&lt;br /&gt;
! Offset !! Type !! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x00 || Int32[&#039;&#039;&#039;N&#039;&#039;&#039;] || &#039;&#039;&#039;[[#Track Section Entry|Track Section Entry]]&#039;&#039;&#039; offsets. Relative to the start of this group.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Track Section Entry ===&lt;br /&gt;
Every section entry defines model and collision data. The entry starts with a 32-byte header.&lt;br /&gt;
&lt;br /&gt;
{|class=wikitable&lt;br /&gt;
|+ Track Section Entry Header&lt;br /&gt;
! Offset !! Type !! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x00 || Byte || {{unknown-left|&#039;&#039;&#039;Unknown&#039;&#039;&#039;.}}&lt;br /&gt;
|-&lt;br /&gt;
| 0x01 || Byte || {{unknown-left|&#039;&#039;&#039;Unknown&#039;&#039;&#039;. Always 5?}}&lt;br /&gt;
|-&lt;br /&gt;
| 0x02 || UInt16 || {{unknown-left|&#039;&#039;&#039;Unknown&#039;&#039;&#039;.}}&lt;br /&gt;
|-&lt;br /&gt;
| 0x04 || UInt16 || &#039;&#039;&#039;Number of polygon groups&#039;&#039;&#039; (&#039;&#039;&#039;P&#039;&#039;&#039;).&lt;br /&gt;
|-&lt;br /&gt;
| 0x06 || UInt16 || &#039;&#039;&#039;Number of vertices&#039;&#039;&#039; in [[#Track Section Vertex Data|Track Section Vertex Data]] (&#039;&#039;&#039;V&#039;&#039;&#039;).&lt;br /&gt;
|-&lt;br /&gt;
| 0x08 || UInt16 || &#039;&#039;&#039;Number of UVs&#039;&#039;&#039; in [[#Track Section UV|Track Section UV Data]] (&#039;&#039;&#039;U&#039;&#039;&#039;).&lt;br /&gt;
|-&lt;br /&gt;
| 0x0A || UInt16 || &#039;&#039;&#039;Number of colors&#039;&#039;&#039; in [[#Track Section Color Data|Track Section Color Data]] (&#039;&#039;&#039;C&#039;&#039;&#039;).&lt;br /&gt;
|-&lt;br /&gt;
| 0x0C || Int32 || &#039;&#039;&#039;[[#Track Section Triangle Data|Track Section Triangle Data]]&#039;&#039;&#039; offset.&lt;br /&gt;
|-&lt;br /&gt;
| 0x10 || Int32 || &#039;&#039;&#039;[[#Track Section Collision Data|Track Section Collision Data]]&#039;&#039;&#039; offset.&lt;br /&gt;
|-&lt;br /&gt;
| 0x14 || Int32 || &#039;&#039;&#039;[[#Track Section Vertex Data|Track Section Vertex Data]]&#039;&#039;&#039; offset.&lt;br /&gt;
|-&lt;br /&gt;
| 0x18 || Int32 || &#039;&#039;&#039;[[#Track Section UV Data|Track Section UV Data]]&#039;&#039;&#039; offset.&lt;br /&gt;
|-&lt;br /&gt;
| 0x1C || Int32 || &#039;&#039;&#039;[[#Track Section Color Data|Track Section Color Data]]&#039;&#039;&#039; offset.&lt;br /&gt;
|-&lt;br /&gt;
| 0x20 || colspan=2 {{unknown|End of header, start of [[#Track Section Data|Track Section Data]]}}&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== Track Section Data ====&lt;br /&gt;
This data follows directly after the header of the section entry and starts with a 76-byte header.&lt;br /&gt;
&lt;br /&gt;
{|class=wikitable&lt;br /&gt;
! Offset !! Type !! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x00 || Int32 || {{unknown-left|&#039;&#039;&#039;Unknown&#039;&#039;&#039;. Seems to be always 0xFFFFFFFF and set to an address when loaded in memory.}}&lt;br /&gt;
|-&lt;br /&gt;
| 0x04 || Int32[3] || &#039;&#039;&#039;Collision XYZ offset&#039;&#039;&#039;.&lt;br /&gt;
|-&lt;br /&gt;
| 0x10 || Int32[3] || &#039;&#039;&#039;Visual model XYZ offset&#039;&#039;&#039;. The units are not the same as the collision offset.&lt;br /&gt;
|-&lt;br /&gt;
| 0x1C || [[#Track Section AABB|Track Section AABB]][2] || &#039;&#039;&#039;AABB areas&#039;&#039;&#039; of the entire section used for collision detection. The second AABB always seems to be a duplicate of the first.&lt;br /&gt;
|-&lt;br /&gt;
| 0x4C || colspan=2 {{unknown|End of header, start of [[#Track Section Polygon Data|Track Section Polygon Data]]}}&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
===== Track Section AABB =====&lt;br /&gt;
Track sections contain 2 identical AABB areas each. It is unknown why there&#039;s a duplicate, perhaps used during runtime after object space transform. All values need to be divided by 64 in order to obtain the absolute position data and match with the visual models.&lt;br /&gt;
&lt;br /&gt;
{|class=wikitable&lt;br /&gt;
! Offset !! Type !! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x00 || Int32[3] || &#039;&#039;&#039;AABB minimum XYZ position&#039;&#039;&#039;.&lt;br /&gt;
|-&lt;br /&gt;
| 0x0C || Int32[3] || &#039;&#039;&#039;AABB XYZ extent&#039;&#039;&#039;.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
===== Track Section Polygon Data =====&lt;br /&gt;
This section seems to store &#039;&#039;&#039;P&#039;&#039;&#039; polygon groups&#039; attributes.&lt;br /&gt;
&lt;br /&gt;
{|class=wikitable&lt;br /&gt;
! Offset !! Type !! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x00 || [[#Polygon Group Entry|Polygon Group Entry]][&#039;&#039;&#039;P&#039;&#039;&#039;] || &#039;&#039;&#039;Polygon group entries&#039;&#039;&#039;.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
====== Polygon Group Entry ======&lt;br /&gt;
Each polygon group entry is 12 bytes long.&lt;br /&gt;
&lt;br /&gt;
{|class=wikitable&lt;br /&gt;
! Offset !! Type !! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x00 || UInt16 || &#039;&#039;&#039;First triangle ID&#039;&#039;&#039;.&lt;br /&gt;
|-&lt;br /&gt;
| 0x02 || UInt16 || &#039;&#039;&#039;Number of triangles&#039;&#039;&#039;.&lt;br /&gt;
|-&lt;br /&gt;
| 0x04 || Byte || &#039;&#039;&#039;Main collision attribute&#039;&#039;&#039;. &#039;&#039;&#039;AAAA BBBB&#039;&#039;&#039;:&lt;br /&gt;
* &#039;&#039;&#039;A&#039;&#039;&#039;: &#039;&#039;&#039;Shadow level&#039;&#039;&#039;. The higher the value, the darker the character gets.&lt;br /&gt;
* &#039;&#039;&#039;B&#039;&#039;&#039;: &#039;&#039;&#039;Collision flag&#039;&#039;&#039;:&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! ID !! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x01 || Road and effects.&lt;br /&gt;
|-&lt;br /&gt;
| 0x05 || Wall (sparks on collision).&lt;br /&gt;
|-&lt;br /&gt;
| 0x08 || Special effects (turns off visual model).&lt;br /&gt;
|-&lt;br /&gt;
| 0x0C || Invisible wall (no sparks on collision, turns off visual model).&lt;br /&gt;
|}&lt;br /&gt;
|-&lt;br /&gt;
| 0x05 || Byte || &#039;&#039;&#039;Secondary collision attribute&#039;&#039;&#039;:&lt;br /&gt;
* &#039;&#039;&#039;Main flag = 0x01&#039;&#039;&#039;:&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! ID !! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x00 || Special effect? Used for water.&lt;br /&gt;
|-&lt;br /&gt;
| 0x01 || Pass through/no effect.&lt;br /&gt;
|-&lt;br /&gt;
| 0x04 || Road.&lt;br /&gt;
|}&lt;br /&gt;
* &#039;&#039;&#039;Main flag = 0x08&#039;&#039;&#039;:&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! ID !! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x00 || Invisible wall (no sparks on collision).&lt;br /&gt;
|-&lt;br /&gt;
| 0x01 || Water.&lt;br /&gt;
|}&lt;br /&gt;
|-&lt;br /&gt;
| 0x06 || UInt16 || &#039;&#039;&#039;Tertiary collision attribute&#039;&#039;&#039;. Split in bits.&lt;br /&gt;
* &#039;&#039;&#039;Main flag = 0x01&#039;&#039;&#039;:&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! ID !! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x01 || {{unknown-left|&#039;&#039;&#039;Unknown&#039;&#039;&#039;. Used in non-collideable stuff.}}&lt;br /&gt;
|-&lt;br /&gt;
| 0x02 || Water, inflates tires in car.&lt;br /&gt;
|-&lt;br /&gt;
| 0x10 || {{unknown-left|&#039;&#039;&#039;Unknown&#039;&#039;&#039;. Used in non-collideable stuff.}}&lt;br /&gt;
|-&lt;br /&gt;
| 0x20 || {{unknown-left|&#039;&#039;&#039;Unknown&#039;&#039;&#039;. Used in non-collideable stuff.}}&lt;br /&gt;
|-&lt;br /&gt;
| 0x60 || {{unknown-left|&#039;&#039;&#039;Unknown&#039;&#039;&#039;. Used in non-collideable stuff.}}&lt;br /&gt;
|}&lt;br /&gt;
* &#039;&#039;&#039;Main flag = 0x08&#039;&#039;&#039;:&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! ID !! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x30 || {{unknown-left|&#039;&#039;&#039;Unknown&#039;&#039;&#039;. Used in non-collideable stuff.}}&lt;br /&gt;
|}&lt;br /&gt;
* &#039;&#039;&#039;Main flag = 0x0C&#039;&#039;&#039;:&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! ID !! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x04 || Ignore when using plane.&lt;br /&gt;
|}&lt;br /&gt;
|-&lt;br /&gt;
| 0x08 || Byte[4] || &#039;&#039;&#039;Collision grid mask&#039;&#039;&#039;. This is an OR of all of the [[#Track Section Collision Data|collision grids]] for all triangles in this group.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The number of triangles &#039;&#039;&#039;T&#039;&#039;&#039; can be calculated by adding the first triangle ID to the number of triangles of the last polygon group entry.&lt;br /&gt;
&lt;br /&gt;
===== Track Section Triangle Data =====&lt;br /&gt;
This section stores &#039;&#039;&#039;T&#039;&#039;&#039; triangle entries.&lt;br /&gt;
&lt;br /&gt;
{|class=wikitable&lt;br /&gt;
! Offset !! Type !! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x00 || [[#Triangle Entry|Triangle Entry]][&#039;&#039;&#039;T&#039;&#039;&#039;] || &#039;&#039;&#039;Triangle entries&#039;&#039;&#039;.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
====== Triangle Entry ======&lt;br /&gt;
Each triangle entry is 20 bytes long.&lt;br /&gt;
&lt;br /&gt;
{|class=wikitable&lt;br /&gt;
! Offset !! Type !! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x00 || UInt16 || &#039;&#039;&#039;Attribute flags&#039;&#039;&#039;. &#039;&#039;&#039;AAAA AAAA AAAA AAAB&#039;&#039;&#039;:&lt;br /&gt;
* &#039;&#039;&#039;A&#039;&#039;&#039;: &#039;&#039;&#039;Texture ID&#039;&#039;&#039;.&lt;br /&gt;
* &#039;&#039;&#039;B&#039;&#039;&#039;: Collidable attribute? If 0 in roads, the triangles are not collidable. Unknown meaning in walls.&lt;br /&gt;
|-&lt;br /&gt;
| 0x02 || UInt16[3] || &#039;&#039;&#039;Face XYZ normals&#039;&#039;&#039;. Values need to be divided by 4096.&lt;br /&gt;
|-&lt;br /&gt;
| 0x08 || Byte[4] || &#039;&#039;&#039;Vertex position indices&#039;&#039;&#039;. The index for each of the 3 vertices is 10 bits long. 2 last bits are unknown.&lt;br /&gt;
|-&lt;br /&gt;
| 0x0C || Byte[4] || &#039;&#039;&#039;UV indices&#039;&#039;&#039;. The index for each of the 3 vertices is 10 bits long. 2 last bits are unknown.&lt;br /&gt;
|-&lt;br /&gt;
| 0x10 || Byte[4] || &#039;&#039;&#039;Color indices&#039;&#039;&#039;. The index for each of the 3 vertices is 10 bits long. 2 last bits are unknown.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
===== Track Section Collision Data =====&lt;br /&gt;
Each triangle corresponds to a 4-byte set of values to help with collision detection. These values encode local X, Y and Z coordinates that form a grid of cells inside the section&#039;s AABB.&lt;br /&gt;
&lt;br /&gt;
{|class=wikitable&lt;br /&gt;
! Offset !! Type !! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x00 || Byte || &#039;&#039;&#039;Y occupancy&#039;&#039;&#039;. Values correspond to 8 cells of the AABB (AABB&#039;s Y extent / 8).&lt;br /&gt;
|-&lt;br /&gt;
| 0x01 || Byte || &#039;&#039;&#039;Z occupancy&#039;&#039;&#039;. Values correspond to 8 cells of the AABB (AABB&#039;s Z extent / 8).&lt;br /&gt;
|-&lt;br /&gt;
| 0x02 || UInt16 || &#039;&#039;&#039;X occupancy&#039;&#039;&#039;. Values correspond to 16 cells of the AABB (AABB&#039;s X extent / 16).&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The following ARM assembly instructions (@01FF95D0 from the game&#039;s code) demonstrate how the vehicle&#039;s current grid bitmask is compared to the current testing triangle&#039;s collision:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
AND R0, R0, R5 // R0 = triangle&#039;s collision value AND vehicle&#039;s bitmask&lt;br /&gt;
TST R0, #FF // test byte 0 (Y)&lt;br /&gt;
TSTNE R0, #FF00 // if nonzero, test byte 1 (Z)&lt;br /&gt;
MOVNES R0, R0, LSR #10 // if still nonzero, test upper 16 bits (X)&lt;br /&gt;
MOVNE R0, #1 // collidable only if ALL 3 are nonzero&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The following functions in C# compute a triangle&#039;s collision grid from its minimum and maximum positions and its containing section&#039;s AABB:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
uint ComputeCollision(float xMin, float xMax, float yMin, float yMax, float zMin, float zMax, float aabbXMin, float aabbXExt, float aabbYMin, float aabbYExt, float aabbZMin, float aabbZExt)&lt;br /&gt;
{&lt;br /&gt;
    if (aabbXExt &amp;lt;= 0 || aabbYExt &amp;lt;= 0 || aabbZExt &amp;lt;= 0)&lt;br /&gt;
        return 0xFFFFFFFFu;&lt;br /&gt;
&lt;br /&gt;
    uint xBits = ComputeCellBits(xMin - aabbXMin, xMax - aabbXMin, aabbXExt / 16f, 16);&lt;br /&gt;
    uint zBits = ComputeCellBits(zMin - aabbZMin, zMax - aabbZMin, aabbZExt / 8f, 8);&lt;br /&gt;
    uint yBits = ComputeCellBits(yMin - aabbYMin, yMax - aabbYMin, aabbYExt / 8f, 8);&lt;br /&gt;
&lt;br /&gt;
    return (xBits &amp;lt;&amp;lt; 16) | (zBits &amp;lt;&amp;lt; 8) | yBits;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
uint ComputeCellBits(float relMin, float relMax, float cellSize, int nrCells)&lt;br /&gt;
{&lt;br /&gt;
    const float Epsilon = 1e-4f;&lt;br /&gt;
    float faceMin = relMin / cellSize;&lt;br /&gt;
    float faceMax = relMax / cellSize;&lt;br /&gt;
&lt;br /&gt;
    // Special case for degenerate faces (flat faces with zero extent in this axis, e.g. a wall parallel to XZ)&lt;br /&gt;
    if (MathF.Abs(faceMax - faceMin) &amp;lt; Epsilon)&lt;br /&gt;
    {&lt;br /&gt;
        int cell = Math.Max(0, Math.Min(nrCells - 1, (int)MathF.Floor(faceMin)));&lt;br /&gt;
        bool atExact = MathF.Abs(faceMin - MathF.Round(faceMin)) &amp;lt; Epsilon;&lt;br /&gt;
        bool atMaxEdge = cell == nrCells - 1;&lt;br /&gt;
&lt;br /&gt;
        // Include the preceding cell only at an interior exact boundary&lt;br /&gt;
        if (atExact &amp;amp;&amp;amp; cell &amp;gt; 0 &amp;amp;&amp;amp; !atMaxEdge)&lt;br /&gt;
            return (1u &amp;lt;&amp;lt; cell) | (1u &amp;lt;&amp;lt; (cell - 1));&lt;br /&gt;
&lt;br /&gt;
        return 1u &amp;lt;&amp;lt; cell;&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    int cellMin = (int)MathF.Floor(faceMin);&lt;br /&gt;
    int cellMax = (int)MathF.Floor(faceMax - Epsilon); // Exact upper boundary stays in current cell&lt;br /&gt;
&lt;br /&gt;
    // Exact lower boundary stays in the preceding cell&lt;br /&gt;
    bool atExactLow = MathF.Abs(faceMin - MathF.Round(faceMin)) &amp;lt; Epsilon;&lt;br /&gt;
    bool atMaxLow = cellMin == nrCells - 1;&lt;br /&gt;
    if (atExactLow &amp;amp;&amp;amp; cellMin &amp;gt; 0 &amp;amp;&amp;amp; !atMaxLow)&lt;br /&gt;
        cellMin--;&lt;br /&gt;
&lt;br /&gt;
    cellMin = Math.Max(0, cellMin);&lt;br /&gt;
    cellMax = Math.Min(nrCells - 1, cellMax);&lt;br /&gt;
&lt;br /&gt;
    uint bits = 0;&lt;br /&gt;
&lt;br /&gt;
    for (int c = cellMin; c &amp;lt;= cellMax; c++)&lt;br /&gt;
        bits |= 1u &amp;lt;&amp;lt; c;&lt;br /&gt;
&lt;br /&gt;
    return bits;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===== Track Section Vertex Data =====&lt;br /&gt;
Vertex data is stored as 6-byte groups per entry &#039;&#039;&#039;V&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
{|class=wikitable&lt;br /&gt;
! Offset !! Type !! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x00 || Int16[3][&#039;&#039;&#039;V&#039;&#039;&#039;] || &#039;&#039;&#039;Vertex XYZ position&#039;&#039;&#039;.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
===== Track Section UV Data =====&lt;br /&gt;
UV data is stored as 4-byte groups per entry &#039;&#039;&#039;U&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
{|class=wikitable&lt;br /&gt;
! Offset !! Type !! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x00 || Int16[2][&#039;&#039;&#039;U&#039;&#039;&#039;] || &#039;&#039;&#039;Vertex UV position&#039;&#039;&#039;.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
===== Track Section Color Data =====&lt;br /&gt;
Color data is stored as 2-byte groups per entry &#039;&#039;&#039;C&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
{|class=wikitable&lt;br /&gt;
! Offset !! Type !! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x00 || UInt16[&#039;&#039;&#039;C&#039;&#039;&#039;] || &#039;&#039;&#039;RGBA5551 color&#039;&#039;&#039;.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Collision Effects ==&lt;br /&gt;
Each texture is linked to 2 specific collision effects that affect the vehicle&#039;s speed, particles and lighting. This section contains 2 blocks of &#039;&#039;&#039;X&#039;&#039;&#039; UInt16s.&lt;br /&gt;
&lt;br /&gt;
{|class=wikitable&lt;br /&gt;
! Offset !! Type !! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x00 || UInt16[&#039;&#039;&#039;X&#039;&#039;&#039;] || &#039;&#039;&#039;Effects&#039;&#039;&#039;, split in bits.&lt;br /&gt;
|-&lt;br /&gt;
| &#039;&#039;&#039;X&#039;&#039;&#039; * 2 || UInt16[&#039;&#039;&#039;X&#039;&#039;&#039;] || {{unknown-left|&#039;&#039;&#039;Unknown&#039;&#039;&#039;. This seems to be a copy of the previous block?}}&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Culling Groups ==&lt;br /&gt;
This section includes a 4-byte or 8-byte per track section values that determine which section models are loaded when entering a specific section. Each section is represented as 1 bit.&lt;br /&gt;
&lt;br /&gt;
{|class=wikitable&lt;br /&gt;
! Offset !! Type !! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x00 || UInt16[&#039;&#039;&#039;N&#039;&#039;&#039;]/UInt32[&#039;&#039;&#039;N&#039;&#039;&#039;] || &#039;&#039;&#039;Culled model sections&#039;&#039;&#039;, represented as &#039;&#039;&#039;N&#039;&#039;&#039; bits, 1 per section, in order from the least to the most significant bit. 0 if culled, 1 if loaded.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Texture Group ==&lt;br /&gt;
See &#039;&#039;&#039;[[DKRDS Texture Group]]&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
== Culling BSP Tree ==&lt;br /&gt;
This section defines a serialized axis-aligned binary space partitioning tree used for culling sections along with the [[#Culling Groups|Culling Groups]] section. The game traverses it to determine which sections are candidates for rendering given the current player&#039;s position, and then performs a secondary [[#Track Section AABB|AABB]] overlap test on each candidate before adding it to the active render list. The section consists of a sequence of variable-length nodes and leaves stored one after another.&lt;br /&gt;
&lt;br /&gt;
=== Interior Node ===&lt;br /&gt;
An interior node is always 8 bytes long and can be identified apart from a leaf node if the first Int16 is not negative.&lt;br /&gt;
&lt;br /&gt;
{|class=wikitable&lt;br /&gt;
! Offset !! Type !! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x00 || Int16 || &#039;&#039;&#039;Axis index&#039;&#039;&#039; into the player position array:&lt;br /&gt;
* &#039;&#039;&#039;0&#039;&#039;&#039; = X axis.&lt;br /&gt;
* &#039;&#039;&#039;1&#039;&#039;&#039; = Y axis. Unused?&lt;br /&gt;
* &#039;&#039;&#039;2&#039;&#039;&#039; = Z axis.&lt;br /&gt;
|-&lt;br /&gt;
| 0x02 || Int16 || &#039;&#039;&#039;Split value low bits&#039;&#039;&#039;.&lt;br /&gt;
|-&lt;br /&gt;
| 0x04 || UInt16 || &#039;&#039;&#039;Split value high bits&#039;&#039;&#039;.&lt;br /&gt;
|-&lt;br /&gt;
| 0x06 || Int16 || &#039;&#039;&#039;Skip count&#039;&#039;&#039;. The right child begins at &amp;lt;code&amp;gt;(node_offset + 8) + skip * 2&amp;lt;/code&amp;gt; bytes from the start of this section. The left child begins immediately at &amp;lt;code&amp;gt;node_offset + 8&amp;lt;/code&amp;gt;.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The split coordinate in world units is reconstructed by the game as a 32-bit signed result:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
split = (split_low &amp;lt;&amp;lt; 10) | split_high&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To encode a world-coordinate integer back into the two stored fields:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
(Int16)split_low = split &amp;gt;&amp;gt; 10&lt;br /&gt;
(UInt16)split_high = split &amp;amp; 0xFFFF&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The split values are in the same coordinate scale as the [[#Track Section AABB|section AABBs]], divided by 64.&lt;br /&gt;
&lt;br /&gt;
The stored &#039;&#039;split_high&#039;&#039; in original game files often differs from the canonical &amp;lt;code&amp;gt;split &amp;amp; 0xFFFF&amp;lt;/code&amp;gt; decomposition. The extra bits in positions 10-15 of &#039;&#039;split_high&#039;&#039; are ORed with bits already set by the sign extension of &#039;&#039;split_low&#039;&#039; and therefore have no effect on the reconstructed split. Their origin is unknown.&lt;br /&gt;
&lt;br /&gt;
=== Leaf Node ===&lt;br /&gt;
Leaf nodes are variable-length.&lt;br /&gt;
 &lt;br /&gt;
{|class=wikitable&lt;br /&gt;
! Offset !! Type !! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x00 || Int16 || &#039;&#039;&#039;Negative count&#039;&#039;&#039; (&#039;&#039;&#039;-L&#039;&#039;&#039;). The value is always negative. Its negation &#039;&#039;&#039;L&#039;&#039;&#039; gives the number of section IDs that follow.&lt;br /&gt;
|-&lt;br /&gt;
| 0x02 || Int16[&#039;&#039;&#039;L&#039;&#039;&#039;] || &#039;&#039;&#039;Section IDs&#039;&#039;&#039;. Zero-based indices into the [[#Track Section Group|Track Section Group]]. A section may appear in more than one leaf when its AABB occupies a split plane.&lt;br /&gt;
|}&lt;br /&gt;
 &lt;br /&gt;
=== Traversal Algorithm ===&lt;br /&gt;
The game calls the function &amp;lt;code&amp;gt;@02006CC4(bsp_ptr, track_sg, position, tolerance, out_list)&amp;lt;/code&amp;gt;:&lt;br /&gt;
* &#039;&#039;&#039;bsp_ptr&#039;&#039;&#039;: pointer to the start of this section in RAM.&lt;br /&gt;
* &#039;&#039;&#039;track_sg&#039;&#039;&#039;: pointer to the [[#Track Section Group|Track Section Group]].&lt;br /&gt;
* &#039;&#039;&#039;position&#039;&#039;&#039;: player XYZ position.&lt;br /&gt;
* &#039;&#039;&#039;tolerance&#039;&#039;&#039;: a proximity radius in world units, observed as &amp;lt;code&amp;gt;0xF00&amp;lt;/code&amp;gt;.&lt;br /&gt;
* &#039;&#039;&#039;out_list&#039;&#039;&#039;: output structure that receives the active section list.&lt;br /&gt;
 &lt;br /&gt;
At each interior node:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
pos = position[axis]&lt;br /&gt;
split = (split_low &amp;lt;&amp;lt; 10) | split_high&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If &amp;lt;code&amp;gt;split - pos &amp;gt; tolerance&amp;lt;/code&amp;gt;, visit left child only; else if &amp;lt;code&amp;gt;pos - split &amp;amp;ge; tolerance&amp;lt;/code&amp;gt;, visit right child only; otherwise, visit both cildren.&lt;br /&gt;
 &lt;br /&gt;
At each leaf node, for every listed section ID the section&#039;s data pointer is first looked up via the [[#Track Section Group|Track Section Group]]. Then, the player&#039;s bounding box is tested (&amp;lt;code&amp;gt;(X &amp;amp;plusmn; tolerance) * (Z &amp;amp;plusmn; tolerance)&amp;lt;/code&amp;gt;) against the section&#039;s [[#Track Section AABB|AABB]]. If the AABB test passes, add the section to the active render list.&lt;br /&gt;
&lt;br /&gt;
== Wish Race Unknown Section ==&lt;br /&gt;
This section is only used for the Wish Race tracks. &#039;&#039;TBD&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
= Tools =&lt;br /&gt;
The following tools can handle DKRDS Track:&lt;br /&gt;
* (none)&lt;br /&gt;
&lt;br /&gt;
[[Category:Diddy Kong Racing DS File Formats]]&lt;/div&gt;</summary>
		<author><name>Atlas</name></author>
	</entry>
	<entry>
		<id>https://wiki.wexosmk.xyz/index.php?title=DKRDS_Track_(File_Format)&amp;diff=681</id>
		<title>DKRDS Track (File Format)</title>
		<link rel="alternate" type="text/html" href="https://wiki.wexosmk.xyz/index.php?title=DKRDS_Track_(File_Format)&amp;diff=681"/>
		<updated>2026-06-12T21:15:32Z</updated>

		<summary type="html">&lt;p&gt;Atlas: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{under-construction}}&lt;br /&gt;
&#039;&#039;&#039;DKRDS Track&#039;&#039;&#039; is the nameless file format used in &#039;&#039;[https://en.wikipedia.org/wiki/Diddy_Kong_Racing_DS Diddy Kong Racing DS]&#039;&#039; that stores the tracks&#039; section models, collision and textures. Its type identifier in [[assets.bin]] is &#039;&#039;&#039;0x9A&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
= File Format =&lt;br /&gt;
The file byte order is always little endian.&lt;br /&gt;
&lt;br /&gt;
== Header ==&lt;br /&gt;
The file starts with a header that is 56 bytes long.&lt;br /&gt;
&lt;br /&gt;
{|class=wikitable&lt;br /&gt;
! Offset !! Type !! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x00 || Int32 || &#039;&#039;&#039;Number of sections&#039;&#039;&#039; (&#039;&#039;&#039;N&#039;&#039;&#039;).&lt;br /&gt;
|-&lt;br /&gt;
| 0x04 || Int32 || &#039;&#039;&#039;[[#Track Section Group|Track Section Group]]&#039;&#039;&#039; offset.&lt;br /&gt;
|-&lt;br /&gt;
| 0x08 || Int32 || &#039;&#039;&#039;[[#Collision Effects|Collision Effects]]&#039;&#039;&#039; offset.&lt;br /&gt;
|-&lt;br /&gt;
| 0x0C || Byte[4] || {{unknown-left|&#039;&#039;&#039;Unknown&#039;&#039;&#039;. Always 0xCCCCCCCC.}}&lt;br /&gt;
|-&lt;br /&gt;
| 0x10 || Int32 || &#039;&#039;&#039;[[#Culling Groups|Culling Groups]]&#039;&#039;&#039; offset.&lt;br /&gt;
|-&lt;br /&gt;
| 0x14 || Int32 || &#039;&#039;&#039;[[#Culling Groups|Culling Groups]]&#039;&#039;&#039; data type:&lt;br /&gt;
* 1 = 4-byte per &#039;&#039;&#039;N&#039;&#039;&#039; group.&lt;br /&gt;
* 2 = 8-byte per &#039;&#039;&#039;N&#039;&#039;&#039; group.&lt;br /&gt;
|-&lt;br /&gt;
| 0x18 || Int32 || &#039;&#039;&#039;Number of textures&#039;&#039;&#039; (&#039;&#039;&#039;X&#039;&#039;&#039;).&lt;br /&gt;
|-&lt;br /&gt;
| 0x1C || Int32 || &#039;&#039;&#039;[[#Texture Group|Texture Group]]&#039;&#039;&#039; offset.&lt;br /&gt;
|-&lt;br /&gt;
| 0x20 || Int32 || &#039;&#039;&#039;[[#Culling BSP Tree|Culling BSP Tree]]&#039;&#039;&#039; offset.&lt;br /&gt;
|-&lt;br /&gt;
| 0x24 || Int32 || &#039;&#039;&#039;[[#Wish Race Unknown Section|Wish Race Unknown Section]]&#039;&#039;&#039; entry count.&lt;br /&gt;
|-&lt;br /&gt;
| 0x28 || Int32 || &#039;&#039;&#039;[[#Wish Race Unknown Section|Wish Race Unknown Section]]&#039;&#039;&#039; offset.&lt;br /&gt;
|-&lt;br /&gt;
| 0x2C || Byte[4] || {{unknown-left|&#039;&#039;&#039;Unknown&#039;&#039;&#039;. Seems to be some kind of flags.}}&lt;br /&gt;
|-&lt;br /&gt;
| 0x30 || Int32 || {{unknown-left|&#039;&#039;&#039;Unknown&#039;&#039;&#039;.}}&lt;br /&gt;
|-&lt;br /&gt;
| 0x34 || Int32 || &#039;&#039;&#039;File size&#039;&#039;&#039;.&lt;br /&gt;
|-&lt;br /&gt;
| 0x38 || colspan=2 {{unknown|End of header}}&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Track Section Group ==&lt;br /&gt;
This group starts with a list of &#039;&#039;&#039;N&#039;&#039;&#039; offsets.&lt;br /&gt;
&lt;br /&gt;
{|class=wikitable&lt;br /&gt;
|+ Track Section Header&lt;br /&gt;
! Offset !! Type !! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x00 || Int32[&#039;&#039;&#039;N&#039;&#039;&#039;] || &#039;&#039;&#039;[[#Track Section Entry|Track Section Entry]]&#039;&#039;&#039; offsets. Relative to the start of this group.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Track Section Entry ===&lt;br /&gt;
Every section entry defines model and collision data. The entry starts with a 32-byte header.&lt;br /&gt;
&lt;br /&gt;
{|class=wikitable&lt;br /&gt;
|+ Track Section Entry Header&lt;br /&gt;
! Offset !! Type !! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x00 || Byte || {{unknown-left|&#039;&#039;&#039;Unknown&#039;&#039;&#039;.}}&lt;br /&gt;
|-&lt;br /&gt;
| 0x01 || Byte || {{unknown-left|&#039;&#039;&#039;Unknown&#039;&#039;&#039;. Always 5?}}&lt;br /&gt;
|-&lt;br /&gt;
| 0x02 || UInt16 || {{unknown-left|&#039;&#039;&#039;Unknown&#039;&#039;&#039;.}}&lt;br /&gt;
|-&lt;br /&gt;
| 0x04 || UInt16 || &#039;&#039;&#039;Number of polygon groups&#039;&#039;&#039; (&#039;&#039;&#039;P&#039;&#039;&#039;).&lt;br /&gt;
|-&lt;br /&gt;
| 0x06 || UInt16 || &#039;&#039;&#039;Number of vertices&#039;&#039;&#039; in [[#Track Section Vertex Data|Track Section Vertex Data]] (&#039;&#039;&#039;V&#039;&#039;&#039;).&lt;br /&gt;
|-&lt;br /&gt;
| 0x08 || UInt16 || &#039;&#039;&#039;Number of UVs&#039;&#039;&#039; in [[#Track Section UV|Track Section UV Data]] (&#039;&#039;&#039;U&#039;&#039;&#039;).&lt;br /&gt;
|-&lt;br /&gt;
| 0x0A || UInt16 || &#039;&#039;&#039;Number of colors&#039;&#039;&#039; in [[#Track Section Color Data|Track Section Color Data]] (&#039;&#039;&#039;C&#039;&#039;&#039;).&lt;br /&gt;
|-&lt;br /&gt;
| 0x0C || Int32 || &#039;&#039;&#039;[[#Track Section Triangle Data|Track Section Triangle Data]]&#039;&#039;&#039; offset.&lt;br /&gt;
|-&lt;br /&gt;
| 0x10 || Int32 || &#039;&#039;&#039;[[#Track Section Collision Data|Track Section Collision Data]]&#039;&#039;&#039; offset.&lt;br /&gt;
|-&lt;br /&gt;
| 0x14 || Int32 || &#039;&#039;&#039;[[#Track Section Vertex Data|Track Section Vertex Data]]&#039;&#039;&#039; offset.&lt;br /&gt;
|-&lt;br /&gt;
| 0x18 || Int32 || &#039;&#039;&#039;[[#Track Section UV Data|Track Section UV Data]]&#039;&#039;&#039; offset.&lt;br /&gt;
|-&lt;br /&gt;
| 0x1C || Int32 || &#039;&#039;&#039;[[#Track Section Color Data|Track Section Color Data]]&#039;&#039;&#039; offset.&lt;br /&gt;
|-&lt;br /&gt;
| 0x20 || colspan=2 {{unknown|End of header, start of [[#Track Section Data|Track Section Data]]}}&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== Track Section Data ====&lt;br /&gt;
This data follows directly after the header of the section entry and starts with a 76-byte header.&lt;br /&gt;
&lt;br /&gt;
{|class=wikitable&lt;br /&gt;
! Offset !! Type !! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x00 || Int32 || {{unknown-left|&#039;&#039;&#039;Unknown&#039;&#039;&#039;. Seems to be always 0xFFFFFFFF and set to an address when loaded in memory.}}&lt;br /&gt;
|-&lt;br /&gt;
| 0x04 || Int32[3] || &#039;&#039;&#039;Collision XYZ offset&#039;&#039;&#039;.&lt;br /&gt;
|-&lt;br /&gt;
| 0x10 || Int32[3] || &#039;&#039;&#039;Visual model XYZ offset&#039;&#039;&#039;. The units are not the same as the collision offset.&lt;br /&gt;
|-&lt;br /&gt;
| 0x1C || [[#Track Section AABB|Track Section AABB]][2] || &#039;&#039;&#039;AABB areas&#039;&#039;&#039; of the entire section used for collision detection. The second AABB always seems to be a duplicate of the first.&lt;br /&gt;
|-&lt;br /&gt;
| 0x4C || colspan=2 {{unknown|End of header, start of [[#Track Section Polygon Data|Track Section Polygon Data]]}}&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
===== Track Section AABB =====&lt;br /&gt;
Track sections contain 2 identical AABB areas each. It is unknown why there&#039;s a duplicate, perhaps used during runtime after object space transform. All values need to be divided by 64 in order to obtain the absolute position data and match with the visual models.&lt;br /&gt;
&lt;br /&gt;
{|class=wikitable&lt;br /&gt;
! Offset !! Type !! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x00 || Int32[3] || &#039;&#039;&#039;AABB minimum XYZ position&#039;&#039;&#039;.&lt;br /&gt;
|-&lt;br /&gt;
| 0x0C || Int32[3] || &#039;&#039;&#039;AABB XYZ extent&#039;&#039;&#039;.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
===== Track Section Polygon Data =====&lt;br /&gt;
This section seems to store &#039;&#039;&#039;P&#039;&#039;&#039; polygon groups&#039; attributes.&lt;br /&gt;
&lt;br /&gt;
{|class=wikitable&lt;br /&gt;
! Offset !! Type !! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x00 || [[#Polygon Group Entry|Polygon Group Entry]][&#039;&#039;&#039;P&#039;&#039;&#039;] || &#039;&#039;&#039;Polygon group entries&#039;&#039;&#039;.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
====== Polygon Group Entry ======&lt;br /&gt;
Each polygon group entry is 12 bytes long.&lt;br /&gt;
&lt;br /&gt;
{|class=wikitable&lt;br /&gt;
! Offset !! Type !! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x00 || UInt16 || &#039;&#039;&#039;First triangle ID&#039;&#039;&#039;.&lt;br /&gt;
|-&lt;br /&gt;
| 0x02 || UInt16 || &#039;&#039;&#039;Number of triangles&#039;&#039;&#039;.&lt;br /&gt;
|-&lt;br /&gt;
| 0x04 || Byte || &#039;&#039;&#039;Main collision attribute&#039;&#039;&#039;. &#039;&#039;&#039;AAAA BBBB&#039;&#039;&#039;:&lt;br /&gt;
* &#039;&#039;&#039;A&#039;&#039;&#039;: &#039;&#039;&#039;Shadow level&#039;&#039;&#039;. The higher the value, the darker the character gets.&lt;br /&gt;
* &#039;&#039;&#039;B&#039;&#039;&#039;: &#039;&#039;&#039;Collision flag&#039;&#039;&#039;:&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! ID !! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x01 || Road and effects.&lt;br /&gt;
|-&lt;br /&gt;
| 0x05 || Wall (sparks on collision).&lt;br /&gt;
|-&lt;br /&gt;
| 0x08 || Special effects (turns off visual model).&lt;br /&gt;
|-&lt;br /&gt;
| 0x0C || Invisible wall (no sparks on collision, turns off visual model).&lt;br /&gt;
|}&lt;br /&gt;
|-&lt;br /&gt;
| 0x05 || Byte || &#039;&#039;&#039;Secondary collision attribute&#039;&#039;&#039;:&lt;br /&gt;
* &#039;&#039;&#039;Main flag = 0x01&#039;&#039;&#039;:&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! ID !! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x00 || Special effect? Used for water.&lt;br /&gt;
|-&lt;br /&gt;
| 0x01 || Pass through/no effect.&lt;br /&gt;
|-&lt;br /&gt;
| 0x04 || Road.&lt;br /&gt;
|}&lt;br /&gt;
* &#039;&#039;&#039;Main flag = 0x08&#039;&#039;&#039;:&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! ID !! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x00 || Invisible wall (no sparks on collision).&lt;br /&gt;
|-&lt;br /&gt;
| 0x01 || Water.&lt;br /&gt;
|}&lt;br /&gt;
|-&lt;br /&gt;
| 0x06 || UInt16 || &#039;&#039;&#039;Tertiary collision attribute&#039;&#039;&#039;. Split in bits.&lt;br /&gt;
* &#039;&#039;&#039;Main flag = 0x01&#039;&#039;&#039;:&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! ID !! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x01 || {{unknown-left|&#039;&#039;&#039;Unknown&#039;&#039;&#039;. Used in non-collideable stuff.}}&lt;br /&gt;
|-&lt;br /&gt;
| 0x02 || Water, inflates tires in car.&lt;br /&gt;
|-&lt;br /&gt;
| 0x10 || {{unknown-left|&#039;&#039;&#039;Unknown&#039;&#039;&#039;. Used in non-collideable stuff.}}&lt;br /&gt;
|-&lt;br /&gt;
| 0x20 || {{unknown-left|&#039;&#039;&#039;Unknown&#039;&#039;&#039;. Used in non-collideable stuff.}}&lt;br /&gt;
|-&lt;br /&gt;
| 0x60 || {{unknown-left|&#039;&#039;&#039;Unknown&#039;&#039;&#039;. Used in non-collideable stuff.}}&lt;br /&gt;
|}&lt;br /&gt;
* &#039;&#039;&#039;Main flag = 0x08&#039;&#039;&#039;:&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! ID !! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x30 || {{unknown-left|&#039;&#039;&#039;Unknown&#039;&#039;&#039;. Used in non-collideable stuff.}}&lt;br /&gt;
|}&lt;br /&gt;
* &#039;&#039;&#039;Main flag = 0x0C&#039;&#039;&#039;:&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! ID !! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x04 || Ignore when using plane.&lt;br /&gt;
|}&lt;br /&gt;
|-&lt;br /&gt;
| 0x08 || Byte[4] || &#039;&#039;&#039;Collision grid mask&#039;&#039;&#039;. This is an OR of all of the [[#Track Section Collision Data|collision grids]] for all triangles in this group.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The number of triangles &#039;&#039;&#039;T&#039;&#039;&#039; can be calculated by adding the first triangle ID to the number of triangles of the last polygon group entry.&lt;br /&gt;
&lt;br /&gt;
===== Track Section Triangle Data =====&lt;br /&gt;
This section stores &#039;&#039;&#039;T&#039;&#039;&#039; triangle entries.&lt;br /&gt;
&lt;br /&gt;
{|class=wikitable&lt;br /&gt;
! Offset !! Type !! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x00 || [[#Triangle Entry|Triangle Entry]][&#039;&#039;&#039;T&#039;&#039;&#039;] || &#039;&#039;&#039;Triangle entries&#039;&#039;&#039;.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
====== Triangle Entry ======&lt;br /&gt;
Each triangle entry is 20 bytes long.&lt;br /&gt;
&lt;br /&gt;
{|class=wikitable&lt;br /&gt;
! Offset !! Type !! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x00 || UInt16 || &#039;&#039;&#039;Attribute flags&#039;&#039;&#039;. &#039;&#039;&#039;AAAA AAAA AAAA AAAB&#039;&#039;&#039;:&lt;br /&gt;
* &#039;&#039;&#039;A&#039;&#039;&#039;: &#039;&#039;&#039;Texture ID&#039;&#039;&#039;.&lt;br /&gt;
* &#039;&#039;&#039;B&#039;&#039;&#039;: Collidable attribute? If 0 in roads, the triangles are not collidable. Unknown meaning in walls.&lt;br /&gt;
|-&lt;br /&gt;
| 0x02 || UInt16[3] || &#039;&#039;&#039;Face XYZ normals&#039;&#039;&#039;. Values need to be divided by 4096.&lt;br /&gt;
|-&lt;br /&gt;
| 0x08 || Byte[4] || &#039;&#039;&#039;Vertex position indices&#039;&#039;&#039;. The index for each of the 3 vertices is 10 bits long. 2 last bits are unknown.&lt;br /&gt;
|-&lt;br /&gt;
| 0x0C || Byte[4] || &#039;&#039;&#039;UV indices&#039;&#039;&#039;. The index for each of the 3 vertices is 10 bits long. 2 last bits are unknown.&lt;br /&gt;
|-&lt;br /&gt;
| 0x10 || Byte[4] || &#039;&#039;&#039;Color indices&#039;&#039;&#039;. The index for each of the 3 vertices is 10 bits long. 2 last bits are unknown.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
===== Track Section Collision Data =====&lt;br /&gt;
Each triangle corresponds to a 4-byte set of values to help with collision detection. These values encode local X, Y and Z coordinates that form a grid of cells inside the section&#039;s AABB.&lt;br /&gt;
&lt;br /&gt;
{|class=wikitable&lt;br /&gt;
! Offset !! Type !! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x00 || Byte || &#039;&#039;&#039;Y occupancy&#039;&#039;&#039;. Values correspond to 8 cells of the AABB (AABB&#039;s Y extent / 8).&lt;br /&gt;
|-&lt;br /&gt;
| 0x01 || Byte || &#039;&#039;&#039;Z occupancy&#039;&#039;&#039;. Values correspond to 8 cells of the AABB (AABB&#039;s Z extent / 8).&lt;br /&gt;
|-&lt;br /&gt;
| 0x02 || UInt16 || &#039;&#039;&#039;X occupancy&#039;&#039;&#039;. Values correspond to 16 cells of the AABB (AABB&#039;s X extent / 16).&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The following ARM assembly instructions (@01FF95D0 from the game&#039;s code) demonstrate how the vehicle&#039;s current grid bitmask is compared to the current testing triangle&#039;s collision:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
AND R0, R0, R5 // R0 = triangle&#039;s collision value AND vehicle&#039;s bitmask&lt;br /&gt;
TST R0, #FF // test byte 0 (Y)&lt;br /&gt;
TSTNE R0, #FF00 // if nonzero, test byte 1 (Z)&lt;br /&gt;
MOVNES R0, R0, LSR #10 // if still nonzero, test upper 16 bits (X)&lt;br /&gt;
MOVNE R0, #1 // collidable only if ALL 3 are nonzero&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The following functions in C# compute a triangle&#039;s collision grid from its minimum and maximum positions and its containing section&#039;s AABB:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
uint ComputeCollision(float xMin, float xMax, float yMin, float yMax, float zMin, float zMax, float aabbXMin, float aabbXExt, float aabbYMin, float aabbYExt, float aabbZMin, float aabbZExt)&lt;br /&gt;
{&lt;br /&gt;
    if (aabbXExt &amp;lt;= 0 || aabbYExt &amp;lt;= 0 || aabbZExt &amp;lt;= 0)&lt;br /&gt;
        return 0xFFFFFFFFu;&lt;br /&gt;
&lt;br /&gt;
    uint xBits = ComputeCellBits(xMin - aabbXMin, xMax - aabbXMin, aabbXExt / 16f, 16);&lt;br /&gt;
    uint zBits = ComputeCellBits(zMin - aabbZMin, zMax - aabbZMin, aabbZExt / 8f, 8);&lt;br /&gt;
    uint yBits = ComputeCellBits(yMin - aabbYMin, yMax - aabbYMin, aabbYExt / 8f, 8);&lt;br /&gt;
&lt;br /&gt;
    return (xBits &amp;lt;&amp;lt; 16) | (zBits &amp;lt;&amp;lt; 8) | yBits;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
uint ComputeCellBits(float relMin, float relMax, float cellSize, int nrCells)&lt;br /&gt;
{&lt;br /&gt;
    const float Epsilon = 1e-4f;&lt;br /&gt;
    float faceMin = relMin / cellSize;&lt;br /&gt;
    float faceMax = relMax / cellSize;&lt;br /&gt;
&lt;br /&gt;
    // Special case for degenerate faces (flat faces with zero extent in this axis, e.g. a wall parallel to XZ)&lt;br /&gt;
    if (MathF.Abs(faceMax - faceMin) &amp;lt; Epsilon)&lt;br /&gt;
    {&lt;br /&gt;
        int cell = Math.Max(0, Math.Min(nrCells - 1, (int)MathF.Floor(faceMin)));&lt;br /&gt;
        bool atExact  = MathF.Abs(faceMin - MathF.Round(faceMin)) &amp;lt; Epsilon;&lt;br /&gt;
        bool atMaxEdge = cell == nrCells - 1;&lt;br /&gt;
&lt;br /&gt;
        // Include the preceding cell only at an interior exact boundary&lt;br /&gt;
        if (atExact &amp;amp;&amp;amp; cell &amp;gt; 0 &amp;amp;&amp;amp; !atMaxEdge)&lt;br /&gt;
            return (1u &amp;lt;&amp;lt; cell) | (1u &amp;lt;&amp;lt; (cell - 1));&lt;br /&gt;
&lt;br /&gt;
        return 1u &amp;lt;&amp;lt; cell;&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    int cellMin = (int)MathF.Floor(faceMin);&lt;br /&gt;
    int cellMax = (int)MathF.Floor(faceMax - Epsilon); // Exact upper boundary stays in current cell&lt;br /&gt;
&lt;br /&gt;
    // Exact lower boundary stays in the preceding cell&lt;br /&gt;
    bool atExactLow = MathF.Abs(faceMin - MathF.Round(faceMin)) &amp;lt; Epsilon;&lt;br /&gt;
    bool atMaxLow = cellMin == nrCells - 1;&lt;br /&gt;
    if (atExactLow &amp;amp;&amp;amp; cellMin &amp;gt; 0 &amp;amp;&amp;amp; !atMaxLow)&lt;br /&gt;
        cellMin--;&lt;br /&gt;
&lt;br /&gt;
    cellMin = Math.Max(0, cellMin);&lt;br /&gt;
    cellMax = Math.Min(nrCells - 1, cellMax);&lt;br /&gt;
&lt;br /&gt;
    uint bits = 0;&lt;br /&gt;
&lt;br /&gt;
    for (int c = cellMin; c &amp;lt;= cellMax; c++)&lt;br /&gt;
        bits |= 1u &amp;lt;&amp;lt; c;&lt;br /&gt;
&lt;br /&gt;
    return bits;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===== Track Section Vertex Data =====&lt;br /&gt;
Vertex data is stored as 6-byte groups per entry &#039;&#039;&#039;V&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
{|class=wikitable&lt;br /&gt;
! Offset !! Type !! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x00 || Int16[3][&#039;&#039;&#039;V&#039;&#039;&#039;] || &#039;&#039;&#039;Vertex XYZ position&#039;&#039;&#039;.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
===== Track Section UV Data =====&lt;br /&gt;
UV data is stored as 4-byte groups per entry &#039;&#039;&#039;U&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
{|class=wikitable&lt;br /&gt;
! Offset !! Type !! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x00 || Int16[2][&#039;&#039;&#039;U&#039;&#039;&#039;] || &#039;&#039;&#039;Vertex UV position&#039;&#039;&#039;.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
===== Track Section Color Data =====&lt;br /&gt;
Color data is stored as 2-byte groups per entry &#039;&#039;&#039;C&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
{|class=wikitable&lt;br /&gt;
! Offset !! Type !! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x00 || UInt16[&#039;&#039;&#039;C&#039;&#039;&#039;] || &#039;&#039;&#039;RGBA5551 color&#039;&#039;&#039;.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Collision Effects ==&lt;br /&gt;
Each texture is linked to 2 specific collision effects that affect the vehicle&#039;s speed, particles and lighting. This section contains 2 blocks of &#039;&#039;&#039;X&#039;&#039;&#039; UInt16s.&lt;br /&gt;
&lt;br /&gt;
{|class=wikitable&lt;br /&gt;
! Offset !! Type !! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x00 || UInt16[&#039;&#039;&#039;X&#039;&#039;&#039;] || &#039;&#039;&#039;Effects&#039;&#039;&#039;, split in bits.&lt;br /&gt;
|-&lt;br /&gt;
| &#039;&#039;&#039;X&#039;&#039;&#039; * 2 || UInt16[&#039;&#039;&#039;X&#039;&#039;&#039;] || {{unknown-left|&#039;&#039;&#039;Unknown&#039;&#039;&#039;. This seems to be a copy of the previous block?}}&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Culling Groups ==&lt;br /&gt;
This section includes a 4-byte or 8-byte per track section values that determine which section models are loaded when entering a specific section. Each section is represented as 1 bit.&lt;br /&gt;
&lt;br /&gt;
{|class=wikitable&lt;br /&gt;
! Offset !! Type !! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x00 || UInt16[&#039;&#039;&#039;N&#039;&#039;&#039;]/UInt32[&#039;&#039;&#039;N&#039;&#039;&#039;] || &#039;&#039;&#039;Culled model sections&#039;&#039;&#039;, represented as &#039;&#039;&#039;N&#039;&#039;&#039; bits, 1 per section, in order from the least to the most significant bit. 0 if culled, 1 if loaded.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Texture Group ==&lt;br /&gt;
See &#039;&#039;&#039;[[DKRDS Texture Group]]&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
== Culling BSP Tree ==&lt;br /&gt;
&#039;&#039;TBD&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
== Wish Race Unknown Section ==&lt;br /&gt;
This section is only used for the Wish Race tracks. &#039;&#039;TBD&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
= Tools =&lt;br /&gt;
The following tools can handle DKRDS Track:&lt;br /&gt;
* (none)&lt;br /&gt;
&lt;br /&gt;
[[Category:Diddy Kong Racing DS File Formats]]&lt;/div&gt;</summary>
		<author><name>Atlas</name></author>
	</entry>
	<entry>
		<id>https://wiki.wexosmk.xyz/index.php?title=DKRDS_Texture_Group_(File_Format)&amp;diff=680</id>
		<title>DKRDS Texture Group (File Format)</title>
		<link rel="alternate" type="text/html" href="https://wiki.wexosmk.xyz/index.php?title=DKRDS_Texture_Group_(File_Format)&amp;diff=680"/>
		<updated>2026-06-10T13:08:21Z</updated>

		<summary type="html">&lt;p&gt;Atlas: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&#039;&#039;&#039;DKRDS Texture Group&#039;&#039;&#039; is the nameless file format used in &#039;&#039;[https://en.wikipedia.org/wiki/Diddy_Kong_Racing_DS Diddy Kong Racing DS]&#039;&#039; that stores texture and palette data. This format is also implemented inside other files, such as [[DKRDS Model]] and [[DKRDS Track]]. Its type identifier in [[assets.bin]] is &#039;&#039;&#039;0x0C&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
== Header ==&lt;br /&gt;
The file starts with a header that is 4 bytes long.&lt;br /&gt;
&lt;br /&gt;
{|class=wikitable&lt;br /&gt;
! Offset !! Type !! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x00  || UInt16 || &#039;&#039;&#039;Number of textures&#039;&#039;&#039;.&lt;br /&gt;
|-&lt;br /&gt;
| 0x02 || UInt16 || &#039;&#039;&#039;Number of palettes&#039;&#039;&#039;.&lt;br /&gt;
|-&lt;br /&gt;
| 0x04 || colspan=2 {{unknown|End of header, start of Texture Entries}}&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Texture Entry ===&lt;br /&gt;
After the header there&#039;s an entry for each texture. This entry consists of a 20-byte header followed by the texture data. In [[DKRDS Model]] files, the textures are referenced in the [[DKRDS Model#Texture Reference Table|Texture Reference Table]] using 4-byte UIDs.&lt;br /&gt;
&lt;br /&gt;
{|class=wikitable&lt;br /&gt;
|+ Texture Entry Header&lt;br /&gt;
! Offset !! Type !! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x00  || Byte[4] || &#039;&#039;&#039;Texture UID&#039;&#039;&#039;. Presumably the checksum of its original file name.&lt;br /&gt;
|-&lt;br /&gt;
| 0x04 || Byte[4] || &#039;&#039;&#039;Palette UID&#039;&#039;&#039;.&lt;br /&gt;
|-&lt;br /&gt;
| 0x08 || UInt16 || &#039;&#039;&#039;Texture format&#039;&#039;&#039;:&lt;br /&gt;
* 0 = &#039;&#039;&#039;Unknown&#039;&#039;&#039;. 8 bits per texel and no palette data&lt;br /&gt;
* 1 = A3I5&lt;br /&gt;
* 2 = 4-Color Palette&lt;br /&gt;
* 3 = 16-Color Palette&lt;br /&gt;
* 4 = 256-Color Palette&lt;br /&gt;
* 5 = 4x4-Texel Compressed (unused?)&lt;br /&gt;
* 6 = A5I3&lt;br /&gt;
* 7 = Direct Color (RGB5551)&lt;br /&gt;
|-&lt;br /&gt;
| 0x0A || UInt16 || &#039;&#039;&#039;Flags&#039;&#039;&#039;:&lt;br /&gt;
* 0 = If 1, the texture S component repeats, if 0, it clamps&lt;br /&gt;
* 1 = If 1, the texture T component repeats, if 0, it clamps&lt;br /&gt;
* 2 = &#039;&#039;&#039;Unknown&#039;&#039;&#039;. Has something to do with texture animations?&lt;br /&gt;
* 3 = &#039;&#039;&#039;Unknown&#039;&#039;&#039;. Has something to do with textures than can be replaced by in-game decals?&lt;br /&gt;
* 4 = &#039;&#039;&#039;Unknown&#039;&#039;&#039;. Seen as 1 when there&#039;s an external texture reference&lt;br /&gt;
* 14 = &#039;&#039;&#039;Unknown&#039;&#039;&#039;. Seen as 1 when there&#039;s an external texture reference&lt;br /&gt;
|-&lt;br /&gt;
| 0x0C || UInt16 || {{unknown-left|&#039;&#039;&#039;Unknown&#039;&#039;&#039;. Maybe TexGen, always 0?}}&lt;br /&gt;
|-&lt;br /&gt;
| 0x0E || UInt16 || &#039;&#039;&#039;Number of texture blocks&#039;&#039;&#039;, which is the texture data size divided by 0x10.&lt;br /&gt;
|-&lt;br /&gt;
| 0x10 || UInt16[2] || &#039;&#039;&#039;Texture dimensions&#039;&#039;&#039; (width and height).&lt;br /&gt;
|-&lt;br /&gt;
| 0x14 || colspan=2 {{unknown|End of Texture Entry header, start of texture data}}&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Palette Entry ===&lt;br /&gt;
After all the texture entries there&#039;s an entry for each palette. This entry consists of an 8-byte header followed by the RGBA5551 palette data. The first color will always be used for transparency except for formats 1 (A3I5) and 6 (A5I3).&lt;br /&gt;
&lt;br /&gt;
{|class=wikitable&lt;br /&gt;
|+ Palette Entry Header&lt;br /&gt;
! Offset !! Type !! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x00 || Byte[4] || &#039;&#039;&#039;Palette UID&#039;&#039;&#039;. Presumably the checksum of its original file name.&lt;br /&gt;
|-&lt;br /&gt;
| 0x04 || UInt16 || &#039;&#039;&#039;Palette size&#039;&#039;&#039; in bytes.&lt;br /&gt;
|-&lt;br /&gt;
| 0x06 || UInt16 || {{unknown-left|&#039;&#039;&#039;Unknown&#039;&#039;&#039;. Seen as 1 when there&#039;s an external texture reference.}}&lt;br /&gt;
|-&lt;br /&gt;
| 0x08 || colspan=2 {{unknown|End of Palette Entry header, start of palette data}}&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
= Tools =&lt;br /&gt;
The following tools can handle DKRDS Texture Group:&lt;br /&gt;
* (none)&lt;br /&gt;
&lt;br /&gt;
[[Category:Diddy Kong Racing DS File Formats]]&lt;/div&gt;</summary>
		<author><name>Atlas</name></author>
	</entry>
	<entry>
		<id>https://wiki.wexosmk.xyz/index.php?title=DKRDS_Texture_Group_(File_Format)&amp;diff=679</id>
		<title>DKRDS Texture Group (File Format)</title>
		<link rel="alternate" type="text/html" href="https://wiki.wexosmk.xyz/index.php?title=DKRDS_Texture_Group_(File_Format)&amp;diff=679"/>
		<updated>2026-06-08T23:16:35Z</updated>

		<summary type="html">&lt;p&gt;Atlas: /* Palette Entry */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&#039;&#039;&#039;DKRDS Texture Group&#039;&#039;&#039; is the nameless file format used in &#039;&#039;[https://en.wikipedia.org/wiki/Diddy_Kong_Racing_DS Diddy Kong Racing DS]&#039;&#039; that stores texture and palette data. This format is also implemented inside other files, such as [[DKRDS Model]] and [[DKRDS Track]]. Its type identifier in [[assets.bin]] is &#039;&#039;&#039;0x0C&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
== Header ==&lt;br /&gt;
The file starts with a header that is 4 bytes long.&lt;br /&gt;
&lt;br /&gt;
{|class=wikitable&lt;br /&gt;
! Offset !! Type !! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x00  || UInt16 || &#039;&#039;&#039;Number of textures&#039;&#039;&#039;.&lt;br /&gt;
|-&lt;br /&gt;
| 0x02 || UInt16 || &#039;&#039;&#039;Number of palettes&#039;&#039;&#039;.&lt;br /&gt;
|-&lt;br /&gt;
| 0x04 || colspan=2 {{unknown|End of header, start of Texture Entries}}&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Texture Entry ===&lt;br /&gt;
After the header there&#039;s an entry for each texture. This entry consists of a 20-byte header followed by the texture data. In [[DKRDS Model]] files, the textures are referenced in the [[DKRDS Model#Texture Reference Table|Texture Reference Table]] using 4-byte UIDs.&lt;br /&gt;
&lt;br /&gt;
{|class=wikitable&lt;br /&gt;
|+ Texture Entry Header&lt;br /&gt;
! Offset !! Type !! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x00  || Byte[4] || &#039;&#039;&#039;Texture UID&#039;&#039;&#039;. Presumably the checksum of its original file name.&lt;br /&gt;
|-&lt;br /&gt;
| 0x04 || Byte[4] || &#039;&#039;&#039;Palette UID&#039;&#039;&#039;.&lt;br /&gt;
|-&lt;br /&gt;
| 0x08 || UInt16 || &#039;&#039;&#039;Texture format&#039;&#039;&#039;:&lt;br /&gt;
* 0 = &#039;&#039;&#039;Unknown&#039;&#039;&#039;. 8 bits per texel and no palette data&lt;br /&gt;
* 1 = A3I5&lt;br /&gt;
* 2 = 4-Color Palette&lt;br /&gt;
* 3 = 16-Color Palette&lt;br /&gt;
* 4 = 256-Color Palette&lt;br /&gt;
* 5 = 4x4-Texel Compressed (unused?)&lt;br /&gt;
* 6 = A5I3&lt;br /&gt;
* 7 = Direct Color (RGB5551)&lt;br /&gt;
|-&lt;br /&gt;
| 0x0A || UInt16 || &#039;&#039;&#039;Flags&#039;&#039;&#039;:&lt;br /&gt;
* 0 = If 1, the texture S component repeats, if 0, it clamps&lt;br /&gt;
* 1 = If 1, the texture T component repeats, if 0, it clamps&lt;br /&gt;
* 2 = &#039;&#039;&#039;Unknown&#039;&#039;&#039;. Has something to do with texture animations?&lt;br /&gt;
* 3 = &#039;&#039;&#039;Unknown&#039;&#039;&#039;. Has something to do with textures than can be replaced by in-game decals?&lt;br /&gt;
* 4 = &#039;&#039;&#039;Unknown&#039;&#039;&#039;. Seen as 1 when there&#039;s an external texture reference&lt;br /&gt;
* 14 = &#039;&#039;&#039;Unknown&#039;&#039;&#039;. Seen as 1 when there&#039;s an external texture reference&lt;br /&gt;
|-&lt;br /&gt;
| 0x0C || UInt16 || {{unknown-left|&#039;&#039;&#039;Unknown&#039;&#039;&#039;. Maybe TexGen, always 0?}}&lt;br /&gt;
|-&lt;br /&gt;
| 0x0E || UInt16 || &#039;&#039;&#039;Number of texture blocks&#039;&#039;&#039;, which is the texture data size divided by 0x10.&lt;br /&gt;
|-&lt;br /&gt;
| 0x10 || UInt16[2] || &#039;&#039;&#039;Texture dimensions&#039;&#039;&#039; (width and height).&lt;br /&gt;
|-&lt;br /&gt;
| 0x14 || colspan=2 {{unknown|End of Texture Entry header, start of texture data}}&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Palette Entry ===&lt;br /&gt;
After all the texture entries there&#039;s an entry for each palette. This entry consists of an 8-byte header followed by the RGBA5551 palette data.&lt;br /&gt;
&lt;br /&gt;
{|class=wikitable&lt;br /&gt;
|+ Palette Entry Header&lt;br /&gt;
! Offset !! Type !! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x00 || Byte[4] || &#039;&#039;&#039;Palette UID&#039;&#039;&#039;. Presumably the checksum of its original file name.&lt;br /&gt;
|-&lt;br /&gt;
| 0x04 || UInt16 || &#039;&#039;&#039;Palette size&#039;&#039;&#039; in bytes.&lt;br /&gt;
|-&lt;br /&gt;
| 0x06 || UInt16 || {{unknown-left|&#039;&#039;&#039;Unknown&#039;&#039;&#039;. Seen as 1 when there&#039;s an external texture reference.}}&lt;br /&gt;
|-&lt;br /&gt;
| 0x08 || colspan=2 {{unknown|End of Palette Entry header, start of palette data}}&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
= Tools =&lt;br /&gt;
The following tools can handle DKRDS Texture Group:&lt;br /&gt;
* (none)&lt;br /&gt;
&lt;br /&gt;
[[Category:Diddy Kong Racing DS File Formats]]&lt;/div&gt;</summary>
		<author><name>Atlas</name></author>
	</entry>
	<entry>
		<id>https://wiki.wexosmk.xyz/index.php?title=DKRDS_Track_(File_Format)&amp;diff=678</id>
		<title>DKRDS Track (File Format)</title>
		<link rel="alternate" type="text/html" href="https://wiki.wexosmk.xyz/index.php?title=DKRDS_Track_(File_Format)&amp;diff=678"/>
		<updated>2026-06-04T14:38:04Z</updated>

		<summary type="html">&lt;p&gt;Atlas: /* Polygon Group Entry */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{under-construction}}&lt;br /&gt;
&#039;&#039;&#039;DKRDS Track&#039;&#039;&#039; is the nameless file format used in &#039;&#039;[https://en.wikipedia.org/wiki/Diddy_Kong_Racing_DS Diddy Kong Racing DS]&#039;&#039; that stores the tracks&#039; section models, collision and textures. Its type identifier in [[assets.bin]] is &#039;&#039;&#039;0x9A&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
= File Format =&lt;br /&gt;
The file byte order is always little endian.&lt;br /&gt;
&lt;br /&gt;
== Header ==&lt;br /&gt;
The file starts with a header that is 56 bytes long.&lt;br /&gt;
&lt;br /&gt;
{|class=wikitable&lt;br /&gt;
! Offset !! Type !! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x00 || Int32 || &#039;&#039;&#039;Number of sections&#039;&#039;&#039; (&#039;&#039;&#039;N&#039;&#039;&#039;).&lt;br /&gt;
|-&lt;br /&gt;
| 0x04 || Int32 || &#039;&#039;&#039;[[#Track Section Group|Track Section Group]]&#039;&#039;&#039; offset.&lt;br /&gt;
|-&lt;br /&gt;
| 0x08 || Int32 || &#039;&#039;&#039;[[#Collision Effects|Collision Effects]]&#039;&#039;&#039; offset.&lt;br /&gt;
|-&lt;br /&gt;
| 0x0C || Byte[4] || {{unknown-left|&#039;&#039;&#039;Unknown&#039;&#039;&#039;. Always 0xCCCCCCCC.}}&lt;br /&gt;
|-&lt;br /&gt;
| 0x10 || Int32 || &#039;&#039;&#039;[[#Culling Groups|Culling Groups]]&#039;&#039;&#039; offset.&lt;br /&gt;
|-&lt;br /&gt;
| 0x14 || Int32 || &#039;&#039;&#039;[[#Culling Groups|Culling Groups]]&#039;&#039;&#039; data type:&lt;br /&gt;
* 1 = 4-byte per &#039;&#039;&#039;N&#039;&#039;&#039; group.&lt;br /&gt;
* 2 = 8-byte per &#039;&#039;&#039;N&#039;&#039;&#039; group.&lt;br /&gt;
|-&lt;br /&gt;
| 0x18 || Int32 || &#039;&#039;&#039;Number of textures&#039;&#039;&#039; (&#039;&#039;&#039;X&#039;&#039;&#039;).&lt;br /&gt;
|-&lt;br /&gt;
| 0x1C || Int32 || &#039;&#039;&#039;[[#Texture Group|Texture Group]]&#039;&#039;&#039; offset.&lt;br /&gt;
|-&lt;br /&gt;
| 0x20 || Int32 || &#039;&#039;&#039;[[#Unknown Section 1|Unknown Section 1]]&#039;&#039;&#039; offset.&lt;br /&gt;
|-&lt;br /&gt;
| 0x24 || Int32 || &#039;&#039;&#039;[[#Wish Race Unknown Section|Wish Race Unknown Section]]&#039;&#039;&#039; entry count.&lt;br /&gt;
|-&lt;br /&gt;
| 0x28 || Int32 || &#039;&#039;&#039;[[#Wish Race Unknown Section|Wish Race Unknown Section]]&#039;&#039;&#039; offset.&lt;br /&gt;
|-&lt;br /&gt;
| 0x2C || Byte[4] || {{unknown-left|&#039;&#039;&#039;Unknown&#039;&#039;&#039;. Seems to be some kind of flags.}}&lt;br /&gt;
|-&lt;br /&gt;
| 0x30 || Int32 || {{unknown-left|&#039;&#039;&#039;Unknown&#039;&#039;&#039;.}}&lt;br /&gt;
|-&lt;br /&gt;
| 0x34 || Int32 || &#039;&#039;&#039;File size&#039;&#039;&#039;.&lt;br /&gt;
|-&lt;br /&gt;
| 0x38 || colspan=2 {{unknown|End of header}}&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Track Section Group ==&lt;br /&gt;
This group starts with a list of &#039;&#039;&#039;N&#039;&#039;&#039; offsets.&lt;br /&gt;
&lt;br /&gt;
{|class=wikitable&lt;br /&gt;
|+ Track Section Header&lt;br /&gt;
! Offset !! Type !! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x00 || Int32[&#039;&#039;&#039;N&#039;&#039;&#039;] || &#039;&#039;&#039;[[#Track Section Entry|Track Section Entry]]&#039;&#039;&#039; offsets. Relative to the start of this group.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Track Section Entry ===&lt;br /&gt;
Every section entry defines model and collision data. The entry starts with a 32-byte header.&lt;br /&gt;
&lt;br /&gt;
{|class=wikitable&lt;br /&gt;
|+ Track Section Entry Header&lt;br /&gt;
! Offset !! Type !! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x00 || Byte || {{unknown-left|&#039;&#039;&#039;Unknown&#039;&#039;&#039;.}}&lt;br /&gt;
|-&lt;br /&gt;
| 0x01 || Byte || {{unknown-left|&#039;&#039;&#039;Unknown&#039;&#039;&#039;. Always 5?}}&lt;br /&gt;
|-&lt;br /&gt;
| 0x02 || UInt16 || {{unknown-left|&#039;&#039;&#039;Unknown&#039;&#039;&#039;.}}&lt;br /&gt;
|-&lt;br /&gt;
| 0x04 || UInt16 || &#039;&#039;&#039;Number of polygon groups&#039;&#039;&#039; (&#039;&#039;&#039;P&#039;&#039;&#039;).&lt;br /&gt;
|-&lt;br /&gt;
| 0x06 || UInt16 || &#039;&#039;&#039;Number of vertices&#039;&#039;&#039; in [[#Track Section Vertex Data|Track Section Vertex Data]] (&#039;&#039;&#039;V&#039;&#039;&#039;).&lt;br /&gt;
|-&lt;br /&gt;
| 0x08 || UInt16 || &#039;&#039;&#039;Number of UVs&#039;&#039;&#039; in [[#Track Section UV|Track Section UV Data]] (&#039;&#039;&#039;U&#039;&#039;&#039;).&lt;br /&gt;
|-&lt;br /&gt;
| 0x0A || UInt16 || &#039;&#039;&#039;Number of colors&#039;&#039;&#039; in [[#Track Section Color Data|Track Section Color Data]] (&#039;&#039;&#039;C&#039;&#039;&#039;).&lt;br /&gt;
|-&lt;br /&gt;
| 0x0C || Int32 || &#039;&#039;&#039;[[#Track Section Triangle Data|Track Section Triangle Data]]&#039;&#039;&#039; offset.&lt;br /&gt;
|-&lt;br /&gt;
| 0x10 || Int32 || &#039;&#039;&#039;[[#Track Section Collision Data|Track Section Collision Data]]&#039;&#039;&#039; offset.&lt;br /&gt;
|-&lt;br /&gt;
| 0x14 || Int32 || &#039;&#039;&#039;[[#Track Section Vertex Data|Track Section Vertex Data]]&#039;&#039;&#039; offset.&lt;br /&gt;
|-&lt;br /&gt;
| 0x18 || Int32 || &#039;&#039;&#039;[[#Track Section UV Data|Track Section UV Data]]&#039;&#039;&#039; offset.&lt;br /&gt;
|-&lt;br /&gt;
| 0x1C || Int32 || &#039;&#039;&#039;[[#Track Section Color Data|Track Section Color Data]]&#039;&#039;&#039; offset.&lt;br /&gt;
|-&lt;br /&gt;
| 0x20 || colspan=2 {{unknown|End of header, start of [[#Track Section Data|Track Section Data]]}}&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== Track Section Data ====&lt;br /&gt;
This data follows directly after the header of the section entry and starts with a 76-byte header.&lt;br /&gt;
&lt;br /&gt;
{|class=wikitable&lt;br /&gt;
! Offset !! Type !! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x00 || Int32 || {{unknown-left|&#039;&#039;&#039;Unknown&#039;&#039;&#039;. Seems to be always 0xFFFFFFFF and set to an address when loaded in memory.}}&lt;br /&gt;
|-&lt;br /&gt;
| 0x04 || Int32[3] || &#039;&#039;&#039;Collision XYZ offset&#039;&#039;&#039;.&lt;br /&gt;
|-&lt;br /&gt;
| 0x10 || Int32[3] || &#039;&#039;&#039;Visual model XYZ offset&#039;&#039;&#039;. The units are not the same as the collision offset.&lt;br /&gt;
|-&lt;br /&gt;
| 0x1C || [[#Track Section AABB|Track Section AABB]][2] || &#039;&#039;&#039;AABB areas&#039;&#039;&#039; of the entire section used for collision detection. The second AABB always seems to be a duplicate of the first.&lt;br /&gt;
|-&lt;br /&gt;
| 0x4C || colspan=2 {{unknown|End of header, start of [[#Track Section Polygon Data|Track Section Polygon Data]]}}&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
===== Track Section AABB =====&lt;br /&gt;
Track sections contain 2 identical AABB areas each. It is unknown why there&#039;s a duplicate, perhaps used during runtime after object space transform. All values need to be divided by 64 in order to obtain the absolute position data and match with the visual models.&lt;br /&gt;
&lt;br /&gt;
{|class=wikitable&lt;br /&gt;
! Offset !! Type !! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x00 || Int32[3] || &#039;&#039;&#039;AABB minimum XYZ position&#039;&#039;&#039;.&lt;br /&gt;
|-&lt;br /&gt;
| 0x0C || Int32[3] || &#039;&#039;&#039;AABB XYZ extent&#039;&#039;&#039;.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
===== Track Section Polygon Data =====&lt;br /&gt;
This section seems to store &#039;&#039;&#039;P&#039;&#039;&#039; polygon groups&#039; attributes.&lt;br /&gt;
&lt;br /&gt;
{|class=wikitable&lt;br /&gt;
! Offset !! Type !! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x00 || [[#Polygon Group Entry|Polygon Group Entry]][&#039;&#039;&#039;P&#039;&#039;&#039;] || &#039;&#039;&#039;Polygon group entries&#039;&#039;&#039;.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
====== Polygon Group Entry ======&lt;br /&gt;
Each polygon group entry is 12 bytes long.&lt;br /&gt;
&lt;br /&gt;
{|class=wikitable&lt;br /&gt;
! Offset !! Type !! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x00 || UInt16 || &#039;&#039;&#039;First triangle ID&#039;&#039;&#039;.&lt;br /&gt;
|-&lt;br /&gt;
| 0x02 || UInt16 || &#039;&#039;&#039;Number of triangles&#039;&#039;&#039;.&lt;br /&gt;
|-&lt;br /&gt;
| 0x04 || Byte || &#039;&#039;&#039;Main collision attribute&#039;&#039;&#039;. &#039;&#039;&#039;AAAA BBBB&#039;&#039;&#039;:&lt;br /&gt;
* &#039;&#039;&#039;A&#039;&#039;&#039;: &#039;&#039;&#039;Shadow level&#039;&#039;&#039;. The higher the value, the darker the character gets.&lt;br /&gt;
* &#039;&#039;&#039;B&#039;&#039;&#039;: &#039;&#039;&#039;Collision flag&#039;&#039;&#039;:&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! ID !! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x01 || Road and effects.&lt;br /&gt;
|-&lt;br /&gt;
| 0x05 || Wall (sparks on collision).&lt;br /&gt;
|-&lt;br /&gt;
| 0x08 || Special effects (turns off visual model).&lt;br /&gt;
|-&lt;br /&gt;
| 0x0C || Invisible wall (no sparks on collision, turns off visual model).&lt;br /&gt;
|}&lt;br /&gt;
|-&lt;br /&gt;
| 0x05 || Byte || &#039;&#039;&#039;Secondary collision attribute&#039;&#039;&#039;:&lt;br /&gt;
* &#039;&#039;&#039;Main flag = 0x01&#039;&#039;&#039;:&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! ID !! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x00 || Special effect? Used for water.&lt;br /&gt;
|-&lt;br /&gt;
| 0x01 || Pass through/no effect.&lt;br /&gt;
|-&lt;br /&gt;
| 0x04 || Road.&lt;br /&gt;
|}&lt;br /&gt;
* &#039;&#039;&#039;Main flag = 0x08&#039;&#039;&#039;:&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! ID !! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x00 || Invisible wall (no sparks on collision).&lt;br /&gt;
|-&lt;br /&gt;
| 0x01 || Water.&lt;br /&gt;
|}&lt;br /&gt;
|-&lt;br /&gt;
| 0x06 || UInt16 || &#039;&#039;&#039;Tertiary collision attribute&#039;&#039;&#039;. Split in bits.&lt;br /&gt;
* &#039;&#039;&#039;Main flag = 0x01&#039;&#039;&#039;:&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! ID !! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x01 || {{unknown-left|&#039;&#039;&#039;Unknown&#039;&#039;&#039;. Used in non-collideable stuff.}}&lt;br /&gt;
|-&lt;br /&gt;
| 0x02 || Water, inflates tires in car.&lt;br /&gt;
|-&lt;br /&gt;
| 0x10 || {{unknown-left|&#039;&#039;&#039;Unknown&#039;&#039;&#039;. Used in non-collideable stuff.}}&lt;br /&gt;
|-&lt;br /&gt;
| 0x20 || {{unknown-left|&#039;&#039;&#039;Unknown&#039;&#039;&#039;. Used in non-collideable stuff.}}&lt;br /&gt;
|-&lt;br /&gt;
| 0x60 || {{unknown-left|&#039;&#039;&#039;Unknown&#039;&#039;&#039;. Used in non-collideable stuff.}}&lt;br /&gt;
|}&lt;br /&gt;
* &#039;&#039;&#039;Main flag = 0x08&#039;&#039;&#039;:&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! ID !! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x30 || {{unknown-left|&#039;&#039;&#039;Unknown&#039;&#039;&#039;. Used in non-collideable stuff.}}&lt;br /&gt;
|}&lt;br /&gt;
* &#039;&#039;&#039;Main flag = 0x0C&#039;&#039;&#039;:&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! ID !! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x04 || Ignore when using plane.&lt;br /&gt;
|}&lt;br /&gt;
|-&lt;br /&gt;
| 0x08 || Byte[4] || {{unknown-left|&#039;&#039;&#039;Unknown&#039;&#039;&#039;.}}&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The number of triangles &#039;&#039;&#039;T&#039;&#039;&#039; can be calculated by adding the first triangle ID to the number of triangles of the last polygon group entry.&lt;br /&gt;
&lt;br /&gt;
===== Track Section Triangle Data =====&lt;br /&gt;
This section stores &#039;&#039;&#039;T&#039;&#039;&#039; triangle entries.&lt;br /&gt;
&lt;br /&gt;
{|class=wikitable&lt;br /&gt;
! Offset !! Type !! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x00 || [[#Triangle Entry|Triangle Entry]][&#039;&#039;&#039;T&#039;&#039;&#039;] || &#039;&#039;&#039;Triangle entries&#039;&#039;&#039;.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
====== Triangle Entry ======&lt;br /&gt;
Each triangle entry is 20 bytes long.&lt;br /&gt;
&lt;br /&gt;
{|class=wikitable&lt;br /&gt;
! Offset !! Type !! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x00 || UInt16 || &#039;&#039;&#039;Attribute flags&#039;&#039;&#039;. &#039;&#039;&#039;AAAA AAAA AAAA AAAB&#039;&#039;&#039;:&lt;br /&gt;
* &#039;&#039;&#039;A&#039;&#039;&#039;: &#039;&#039;&#039;Texture ID&#039;&#039;&#039;.&lt;br /&gt;
* &#039;&#039;&#039;B&#039;&#039;&#039;: &#039;&#039;&#039;Is collidable&#039;&#039;&#039;.&lt;br /&gt;
|-&lt;br /&gt;
| 0x02 || UInt16[3] || &#039;&#039;&#039;Face XYZ normals&#039;&#039;&#039;. Values need to be divided by 4096.&lt;br /&gt;
|-&lt;br /&gt;
| 0x08 || Byte[4] || &#039;&#039;&#039;Vertex position indices&#039;&#039;&#039;. The index for each of the 3 vertices is 10 bits long. 2 last bits are unknown.&lt;br /&gt;
|-&lt;br /&gt;
| 0x0C || Byte[4] || &#039;&#039;&#039;UV indices&#039;&#039;&#039;. The index for each of the 3 vertices is 10 bits long. 2 last bits are unknown.&lt;br /&gt;
|-&lt;br /&gt;
| 0x10 || Byte[4] || &#039;&#039;&#039;Color indices&#039;&#039;&#039;. The index for each of the 3 vertices is 10 bits long. 2 last bits are unknown.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
===== Track Section Collision Data =====&lt;br /&gt;
4-byte data per triangle (?). &#039;&#039;TBD&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
===== Track Section Vertex Data =====&lt;br /&gt;
Vertex data is stored as 6-byte groups per entry &#039;&#039;&#039;V&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
{|class=wikitable&lt;br /&gt;
! Offset !! Type !! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x00 || Int16[3][&#039;&#039;&#039;V&#039;&#039;&#039;] || &#039;&#039;&#039;Vertex XYZ position&#039;&#039;&#039;.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
===== Track Section UV Data =====&lt;br /&gt;
UV data is stored as 4-byte groups per entry &#039;&#039;&#039;U&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
{|class=wikitable&lt;br /&gt;
! Offset !! Type !! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x00 || Int16[2][&#039;&#039;&#039;U&#039;&#039;&#039;] || &#039;&#039;&#039;Vertex UV position&#039;&#039;&#039;.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
===== Track Section Color Data =====&lt;br /&gt;
Color data is stored as 2-byte groups per entry &#039;&#039;&#039;C&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
{|class=wikitable&lt;br /&gt;
! Offset !! Type !! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x00 || UInt16[&#039;&#039;&#039;C&#039;&#039;&#039;] || &#039;&#039;&#039;RGBA5551 color&#039;&#039;&#039;.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Collision Effects ==&lt;br /&gt;
Each texture is linked to 2 specific collision effects that affect the vehicle&#039;s speed, particles and lighting. This section contains 2 blocks of &#039;&#039;&#039;X&#039;&#039;&#039; UInt16s.&lt;br /&gt;
&lt;br /&gt;
{|class=wikitable&lt;br /&gt;
! Offset !! Type !! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x00 || UInt16[&#039;&#039;&#039;X&#039;&#039;&#039;] || &#039;&#039;&#039;Effects&#039;&#039;&#039;, split in bits.&lt;br /&gt;
|-&lt;br /&gt;
| &#039;&#039;&#039;X&#039;&#039;&#039; * 2 || UInt16[&#039;&#039;&#039;X&#039;&#039;&#039;] || {{unknown-left|&#039;&#039;&#039;Unknown&#039;&#039;&#039;. This seems to be a copy of the previous block?}}&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Culling Groups ==&lt;br /&gt;
This section includes a 4-byte or 8-byte per track section values that determine which section models are loaded when entering a specific section. Each section is represented as 1 bit.&lt;br /&gt;
&lt;br /&gt;
{|class=wikitable&lt;br /&gt;
! Offset !! Type !! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x00 || UInt16[&#039;&#039;&#039;N&#039;&#039;&#039;]/UInt32[&#039;&#039;&#039;N&#039;&#039;&#039;] || &#039;&#039;&#039;Culled model sections&#039;&#039;&#039;, represented as &#039;&#039;&#039;N&#039;&#039;&#039; bits, 1 per section, in order from the least to the most significant bit. 0 if culled, 1 if loaded.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Texture Group ==&lt;br /&gt;
See &#039;&#039;&#039;[[DKRDS Texture Group]]&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
== Unknown Section 1 ==&lt;br /&gt;
&#039;&#039;TBD&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
== Wish Race Unknown Section ==&lt;br /&gt;
This section is only used for the Wish Race tracks. &#039;&#039;TBD&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
= Tools =&lt;br /&gt;
The following tools can handle DKRDS Track:&lt;br /&gt;
* (none)&lt;br /&gt;
&lt;br /&gt;
[[Category:Diddy Kong Racing DS File Formats]]&lt;/div&gt;</summary>
		<author><name>Atlas</name></author>
	</entry>
	<entry>
		<id>https://wiki.wexosmk.xyz/index.php?title=DKRDS_Track_(File_Format)&amp;diff=677</id>
		<title>DKRDS Track (File Format)</title>
		<link rel="alternate" type="text/html" href="https://wiki.wexosmk.xyz/index.php?title=DKRDS_Track_(File_Format)&amp;diff=677"/>
		<updated>2026-06-03T18:22:25Z</updated>

		<summary type="html">&lt;p&gt;Atlas: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{under-construction}}&lt;br /&gt;
&#039;&#039;&#039;DKRDS Track&#039;&#039;&#039; is the nameless file format used in &#039;&#039;[https://en.wikipedia.org/wiki/Diddy_Kong_Racing_DS Diddy Kong Racing DS]&#039;&#039; that stores the tracks&#039; section models, collision and textures. Its type identifier in [[assets.bin]] is &#039;&#039;&#039;0x9A&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
= File Format =&lt;br /&gt;
The file byte order is always little endian.&lt;br /&gt;
&lt;br /&gt;
== Header ==&lt;br /&gt;
The file starts with a header that is 56 bytes long.&lt;br /&gt;
&lt;br /&gt;
{|class=wikitable&lt;br /&gt;
! Offset !! Type !! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x00 || Int32 || &#039;&#039;&#039;Number of sections&#039;&#039;&#039; (&#039;&#039;&#039;N&#039;&#039;&#039;).&lt;br /&gt;
|-&lt;br /&gt;
| 0x04 || Int32 || &#039;&#039;&#039;[[#Track Section Group|Track Section Group]]&#039;&#039;&#039; offset.&lt;br /&gt;
|-&lt;br /&gt;
| 0x08 || Int32 || &#039;&#039;&#039;[[#Collision Effects|Collision Effects]]&#039;&#039;&#039; offset.&lt;br /&gt;
|-&lt;br /&gt;
| 0x0C || Byte[4] || {{unknown-left|&#039;&#039;&#039;Unknown&#039;&#039;&#039;. Always 0xCCCCCCCC.}}&lt;br /&gt;
|-&lt;br /&gt;
| 0x10 || Int32 || &#039;&#039;&#039;[[#Culling Groups|Culling Groups]]&#039;&#039;&#039; offset.&lt;br /&gt;
|-&lt;br /&gt;
| 0x14 || Int32 || &#039;&#039;&#039;[[#Culling Groups|Culling Groups]]&#039;&#039;&#039; data type:&lt;br /&gt;
* 1 = 4-byte per &#039;&#039;&#039;N&#039;&#039;&#039; group.&lt;br /&gt;
* 2 = 8-byte per &#039;&#039;&#039;N&#039;&#039;&#039; group.&lt;br /&gt;
|-&lt;br /&gt;
| 0x18 || Int32 || &#039;&#039;&#039;Number of textures&#039;&#039;&#039; (&#039;&#039;&#039;X&#039;&#039;&#039;).&lt;br /&gt;
|-&lt;br /&gt;
| 0x1C || Int32 || &#039;&#039;&#039;[[#Texture Group|Texture Group]]&#039;&#039;&#039; offset.&lt;br /&gt;
|-&lt;br /&gt;
| 0x20 || Int32 || &#039;&#039;&#039;[[#Unknown Section 1|Unknown Section 1]]&#039;&#039;&#039; offset.&lt;br /&gt;
|-&lt;br /&gt;
| 0x24 || Int32 || &#039;&#039;&#039;[[#Wish Race Unknown Section|Wish Race Unknown Section]]&#039;&#039;&#039; entry count.&lt;br /&gt;
|-&lt;br /&gt;
| 0x28 || Int32 || &#039;&#039;&#039;[[#Wish Race Unknown Section|Wish Race Unknown Section]]&#039;&#039;&#039; offset.&lt;br /&gt;
|-&lt;br /&gt;
| 0x2C || Byte[4] || {{unknown-left|&#039;&#039;&#039;Unknown&#039;&#039;&#039;. Seems to be some kind of flags.}}&lt;br /&gt;
|-&lt;br /&gt;
| 0x30 || Int32 || {{unknown-left|&#039;&#039;&#039;Unknown&#039;&#039;&#039;.}}&lt;br /&gt;
|-&lt;br /&gt;
| 0x34 || Int32 || &#039;&#039;&#039;File size&#039;&#039;&#039;.&lt;br /&gt;
|-&lt;br /&gt;
| 0x38 || colspan=2 {{unknown|End of header}}&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Track Section Group ==&lt;br /&gt;
This group starts with a list of &#039;&#039;&#039;N&#039;&#039;&#039; offsets.&lt;br /&gt;
&lt;br /&gt;
{|class=wikitable&lt;br /&gt;
|+ Track Section Header&lt;br /&gt;
! Offset !! Type !! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x00 || Int32[&#039;&#039;&#039;N&#039;&#039;&#039;] || &#039;&#039;&#039;[[#Track Section Entry|Track Section Entry]]&#039;&#039;&#039; offsets. Relative to the start of this group.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Track Section Entry ===&lt;br /&gt;
Every section entry defines model and collision data. The entry starts with a 32-byte header.&lt;br /&gt;
&lt;br /&gt;
{|class=wikitable&lt;br /&gt;
|+ Track Section Entry Header&lt;br /&gt;
! Offset !! Type !! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x00 || Byte || {{unknown-left|&#039;&#039;&#039;Unknown&#039;&#039;&#039;.}}&lt;br /&gt;
|-&lt;br /&gt;
| 0x01 || Byte || {{unknown-left|&#039;&#039;&#039;Unknown&#039;&#039;&#039;. Always 5?}}&lt;br /&gt;
|-&lt;br /&gt;
| 0x02 || UInt16 || {{unknown-left|&#039;&#039;&#039;Unknown&#039;&#039;&#039;.}}&lt;br /&gt;
|-&lt;br /&gt;
| 0x04 || UInt16 || &#039;&#039;&#039;Number of polygon groups&#039;&#039;&#039; (&#039;&#039;&#039;P&#039;&#039;&#039;).&lt;br /&gt;
|-&lt;br /&gt;
| 0x06 || UInt16 || &#039;&#039;&#039;Number of vertices&#039;&#039;&#039; in [[#Track Section Vertex Data|Track Section Vertex Data]] (&#039;&#039;&#039;V&#039;&#039;&#039;).&lt;br /&gt;
|-&lt;br /&gt;
| 0x08 || UInt16 || &#039;&#039;&#039;Number of UVs&#039;&#039;&#039; in [[#Track Section UV|Track Section UV Data]] (&#039;&#039;&#039;U&#039;&#039;&#039;).&lt;br /&gt;
|-&lt;br /&gt;
| 0x0A || UInt16 || &#039;&#039;&#039;Number of colors&#039;&#039;&#039; in [[#Track Section Color Data|Track Section Color Data]] (&#039;&#039;&#039;C&#039;&#039;&#039;).&lt;br /&gt;
|-&lt;br /&gt;
| 0x0C || Int32 || &#039;&#039;&#039;[[#Track Section Triangle Data|Track Section Triangle Data]]&#039;&#039;&#039; offset.&lt;br /&gt;
|-&lt;br /&gt;
| 0x10 || Int32 || &#039;&#039;&#039;[[#Track Section Collision Data|Track Section Collision Data]]&#039;&#039;&#039; offset.&lt;br /&gt;
|-&lt;br /&gt;
| 0x14 || Int32 || &#039;&#039;&#039;[[#Track Section Vertex Data|Track Section Vertex Data]]&#039;&#039;&#039; offset.&lt;br /&gt;
|-&lt;br /&gt;
| 0x18 || Int32 || &#039;&#039;&#039;[[#Track Section UV Data|Track Section UV Data]]&#039;&#039;&#039; offset.&lt;br /&gt;
|-&lt;br /&gt;
| 0x1C || Int32 || &#039;&#039;&#039;[[#Track Section Color Data|Track Section Color Data]]&#039;&#039;&#039; offset.&lt;br /&gt;
|-&lt;br /&gt;
| 0x20 || colspan=2 {{unknown|End of header, start of [[#Track Section Data|Track Section Data]]}}&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== Track Section Data ====&lt;br /&gt;
This data follows directly after the header of the section entry and starts with a 76-byte header.&lt;br /&gt;
&lt;br /&gt;
{|class=wikitable&lt;br /&gt;
! Offset !! Type !! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x00 || Int32 || {{unknown-left|&#039;&#039;&#039;Unknown&#039;&#039;&#039;. Seems to be always 0xFFFFFFFF and set to an address when loaded in memory.}}&lt;br /&gt;
|-&lt;br /&gt;
| 0x04 || Int32[3] || &#039;&#039;&#039;Collision XYZ offset&#039;&#039;&#039;.&lt;br /&gt;
|-&lt;br /&gt;
| 0x10 || Int32[3] || &#039;&#039;&#039;Visual model XYZ offset&#039;&#039;&#039;. The units are not the same as the collision offset.&lt;br /&gt;
|-&lt;br /&gt;
| 0x1C || [[#Track Section AABB|Track Section AABB]][2] || &#039;&#039;&#039;AABB areas&#039;&#039;&#039; of the entire section used for collision detection. The second AABB always seems to be a duplicate of the first.&lt;br /&gt;
|-&lt;br /&gt;
| 0x4C || colspan=2 {{unknown|End of header, start of [[#Track Section Polygon Data|Track Section Polygon Data]]}}&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
===== Track Section AABB =====&lt;br /&gt;
Track sections contain 2 identical AABB areas each. It is unknown why there&#039;s a duplicate, perhaps used during runtime after object space transform. All values need to be divided by 64 in order to obtain the absolute position data and match with the visual models.&lt;br /&gt;
&lt;br /&gt;
{|class=wikitable&lt;br /&gt;
! Offset !! Type !! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x00 || Int32[3] || &#039;&#039;&#039;AABB minimum XYZ position&#039;&#039;&#039;.&lt;br /&gt;
|-&lt;br /&gt;
| 0x0C || Int32[3] || &#039;&#039;&#039;AABB XYZ extent&#039;&#039;&#039;.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
===== Track Section Polygon Data =====&lt;br /&gt;
This section seems to store &#039;&#039;&#039;P&#039;&#039;&#039; polygon groups&#039; attributes.&lt;br /&gt;
&lt;br /&gt;
{|class=wikitable&lt;br /&gt;
! Offset !! Type !! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x00 || [[#Polygon Group Entry|Polygon Group Entry]][&#039;&#039;&#039;P&#039;&#039;&#039;] || &#039;&#039;&#039;Polygon group entries&#039;&#039;&#039;.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
====== Polygon Group Entry ======&lt;br /&gt;
Each polygon group entry is 12 bytes long.&lt;br /&gt;
&lt;br /&gt;
{|class=wikitable&lt;br /&gt;
! Offset !! Type !! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x00 || UInt16 || &#039;&#039;&#039;First triangle ID&#039;&#039;&#039;.&lt;br /&gt;
|-&lt;br /&gt;
| 0x02 || UInt16 || &#039;&#039;&#039;Number of triangles&#039;&#039;&#039;.&lt;br /&gt;
|-&lt;br /&gt;
| 0x04 || Byte || &#039;&#039;&#039;Main collision attribute&#039;&#039;&#039;. &#039;&#039;&#039;AAAA BBBB&#039;&#039;&#039;:&lt;br /&gt;
* &#039;&#039;&#039;A&#039;&#039;&#039;: &#039;&#039;&#039;Shadow level&#039;&#039;&#039;. The higher the value, the darker the character gets.&lt;br /&gt;
* &#039;&#039;&#039;B&#039;&#039;&#039;: &#039;&#039;&#039;Collision flag&#039;&#039;&#039;:&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! ID !! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x01 || Road and effects.&lt;br /&gt;
|-&lt;br /&gt;
| 0x05 || Wall.&lt;br /&gt;
|-&lt;br /&gt;
| 0x08 || Special effects?&lt;br /&gt;
|-&lt;br /&gt;
| 0x0C || Invisible wall.&lt;br /&gt;
|}&lt;br /&gt;
|-&lt;br /&gt;
| 0x05 || Byte || &#039;&#039;&#039;Secondary collision attribute&#039;&#039;&#039;:&lt;br /&gt;
* &#039;&#039;&#039;Main flag = 0x01&#039;&#039;&#039;:&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! ID !! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x00 || Special effect? Used for water.&lt;br /&gt;
|-&lt;br /&gt;
| 0x01 || Pass through/no effect.&lt;br /&gt;
|-&lt;br /&gt;
| 0x04 || Road.&lt;br /&gt;
|}&lt;br /&gt;
* &#039;&#039;&#039;Main flag = 0x08&#039;&#039;&#039;:&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! ID !! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x01 || Water.&lt;br /&gt;
|}&lt;br /&gt;
|-&lt;br /&gt;
| 0x06 || UInt16 || &#039;&#039;&#039;Tertiary collision attribute&#039;&#039;&#039;. Split in bits.&lt;br /&gt;
* &#039;&#039;&#039;Main flag = 0x01&#039;&#039;&#039;:&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! ID !! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x01 || {{unknown-left|&#039;&#039;&#039;Unknown&#039;&#039;&#039;. Used in non-collideable stuff.}}&lt;br /&gt;
|-&lt;br /&gt;
| 0x02 || Water, inflates tires in car.&lt;br /&gt;
|-&lt;br /&gt;
| 0x10 || {{unknown-left|&#039;&#039;&#039;Unknown&#039;&#039;&#039;. Used in non-collideable stuff.}}&lt;br /&gt;
|-&lt;br /&gt;
| 0x20 || {{unknown-left|&#039;&#039;&#039;Unknown&#039;&#039;&#039;. Used in non-collideable stuff.}}&lt;br /&gt;
|}&lt;br /&gt;
* &#039;&#039;&#039;Main flag = 0x0C&#039;&#039;&#039;:&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! ID !! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x04 || Ignore when using plane.&lt;br /&gt;
|}&lt;br /&gt;
|-&lt;br /&gt;
| 0x08 || Byte[4] || {{unknown-left|&#039;&#039;&#039;Unknown&#039;&#039;&#039;.}}&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The number of triangles &#039;&#039;&#039;T&#039;&#039;&#039; can be calculated by adding the first triangle ID to the number of triangles of the last polygon group entry.&lt;br /&gt;
&lt;br /&gt;
===== Track Section Triangle Data =====&lt;br /&gt;
This section stores &#039;&#039;&#039;T&#039;&#039;&#039; triangle entries.&lt;br /&gt;
&lt;br /&gt;
{|class=wikitable&lt;br /&gt;
! Offset !! Type !! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x00 || [[#Triangle Entry|Triangle Entry]][&#039;&#039;&#039;T&#039;&#039;&#039;] || &#039;&#039;&#039;Triangle entries&#039;&#039;&#039;.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
====== Triangle Entry ======&lt;br /&gt;
Each triangle entry is 20 bytes long.&lt;br /&gt;
&lt;br /&gt;
{|class=wikitable&lt;br /&gt;
! Offset !! Type !! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x00 || UInt16 || &#039;&#039;&#039;Attribute flags&#039;&#039;&#039;. &#039;&#039;&#039;AAAA AAAA AAAA AAAB&#039;&#039;&#039;:&lt;br /&gt;
* &#039;&#039;&#039;A&#039;&#039;&#039;: &#039;&#039;&#039;Texture ID&#039;&#039;&#039;.&lt;br /&gt;
* &#039;&#039;&#039;B&#039;&#039;&#039;: &#039;&#039;&#039;Is collidable&#039;&#039;&#039;.&lt;br /&gt;
|-&lt;br /&gt;
| 0x02 || UInt16[3] || &#039;&#039;&#039;Face XYZ normals&#039;&#039;&#039;. Values need to be divided by 4096.&lt;br /&gt;
|-&lt;br /&gt;
| 0x08 || Byte[4] || &#039;&#039;&#039;Vertex position indices&#039;&#039;&#039;. The index for each of the 3 vertices is 10 bits long. 2 last bits are unknown.&lt;br /&gt;
|-&lt;br /&gt;
| 0x0C || Byte[4] || &#039;&#039;&#039;UV indices&#039;&#039;&#039;. The index for each of the 3 vertices is 10 bits long. 2 last bits are unknown.&lt;br /&gt;
|-&lt;br /&gt;
| 0x10 || Byte[4] || &#039;&#039;&#039;Color indices&#039;&#039;&#039;. The index for each of the 3 vertices is 10 bits long. 2 last bits are unknown.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
===== Track Section Collision Data =====&lt;br /&gt;
4-byte data per triangle (?). &#039;&#039;TBD&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
===== Track Section Vertex Data =====&lt;br /&gt;
Vertex data is stored as 6-byte groups per entry &#039;&#039;&#039;V&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
{|class=wikitable&lt;br /&gt;
! Offset !! Type !! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x00 || Int16[3][&#039;&#039;&#039;V&#039;&#039;&#039;] || &#039;&#039;&#039;Vertex XYZ position&#039;&#039;&#039;.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
===== Track Section UV Data =====&lt;br /&gt;
UV data is stored as 4-byte groups per entry &#039;&#039;&#039;U&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
{|class=wikitable&lt;br /&gt;
! Offset !! Type !! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x00 || Int16[2][&#039;&#039;&#039;U&#039;&#039;&#039;] || &#039;&#039;&#039;Vertex UV position&#039;&#039;&#039;.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
===== Track Section Color Data =====&lt;br /&gt;
Color data is stored as 2-byte groups per entry &#039;&#039;&#039;C&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
{|class=wikitable&lt;br /&gt;
! Offset !! Type !! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x00 || UInt16[&#039;&#039;&#039;C&#039;&#039;&#039;] || &#039;&#039;&#039;RGBA5551 color&#039;&#039;&#039;.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Collision Effects ==&lt;br /&gt;
Each texture is linked to 2 specific collision effects that affect the vehicle&#039;s speed, particles and lighting. This section contains 2 blocks of &#039;&#039;&#039;X&#039;&#039;&#039; UInt16s.&lt;br /&gt;
&lt;br /&gt;
{|class=wikitable&lt;br /&gt;
! Offset !! Type !! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x00 || UInt16[&#039;&#039;&#039;X&#039;&#039;&#039;] || &#039;&#039;&#039;Effects&#039;&#039;&#039;, split in bits.&lt;br /&gt;
|-&lt;br /&gt;
| &#039;&#039;&#039;X&#039;&#039;&#039; * 2 || UInt16[&#039;&#039;&#039;X&#039;&#039;&#039;] || {{unknown-left|&#039;&#039;&#039;Unknown&#039;&#039;&#039;. This seems to be a copy of the previous block?}}&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Culling Groups ==&lt;br /&gt;
This section includes a 4-byte or 8-byte per track section values that determine which section models are loaded when entering a specific section. Each section is represented as 1 bit.&lt;br /&gt;
&lt;br /&gt;
{|class=wikitable&lt;br /&gt;
! Offset !! Type !! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x00 || UInt16[&#039;&#039;&#039;N&#039;&#039;&#039;]/UInt32[&#039;&#039;&#039;N&#039;&#039;&#039;] || &#039;&#039;&#039;Culled model sections&#039;&#039;&#039;, represented as &#039;&#039;&#039;N&#039;&#039;&#039; bits, 1 per section, in order from the least to the most significant bit. 0 if culled, 1 if loaded.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Texture Group ==&lt;br /&gt;
See &#039;&#039;&#039;[[DKRDS Texture Group]]&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
== Unknown Section 1 ==&lt;br /&gt;
&#039;&#039;TBD&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
== Wish Race Unknown Section ==&lt;br /&gt;
This section is only used for the Wish Race tracks. &#039;&#039;TBD&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
= Tools =&lt;br /&gt;
The following tools can handle DKRDS Track:&lt;br /&gt;
* (none)&lt;br /&gt;
&lt;br /&gt;
[[Category:Diddy Kong Racing DS File Formats]]&lt;/div&gt;</summary>
		<author><name>Atlas</name></author>
	</entry>
	<entry>
		<id>https://wiki.wexosmk.xyz/index.php?title=DKRDS_Track_(File_Format)&amp;diff=676</id>
		<title>DKRDS Track (File Format)</title>
		<link rel="alternate" type="text/html" href="https://wiki.wexosmk.xyz/index.php?title=DKRDS_Track_(File_Format)&amp;diff=676"/>
		<updated>2026-06-03T17:53:08Z</updated>

		<summary type="html">&lt;p&gt;Atlas: /* Polygon Group Entry */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{under-construction}}&lt;br /&gt;
&#039;&#039;&#039;DKRDS Track&#039;&#039;&#039; is the nameless file format used in &#039;&#039;[https://en.wikipedia.org/wiki/Diddy_Kong_Racing_DS Diddy Kong Racing DS]&#039;&#039; that stores the tracks&#039; section models, collision and textures. Its type identifier in [[assets.bin]] is &#039;&#039;&#039;0x9A&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
= File Format =&lt;br /&gt;
The file byte order is always little endian.&lt;br /&gt;
&lt;br /&gt;
== Header ==&lt;br /&gt;
The file starts with a header that is 56 bytes long.&lt;br /&gt;
&lt;br /&gt;
{|class=wikitable&lt;br /&gt;
! Offset !! Type !! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x00 || Int32 || &#039;&#039;&#039;Number of sections&#039;&#039;&#039; (&#039;&#039;&#039;N&#039;&#039;&#039;).&lt;br /&gt;
|-&lt;br /&gt;
| 0x04 || Int32 || &#039;&#039;&#039;[[#Track Section Group|Track Section Group]]&#039;&#039;&#039; offset.&lt;br /&gt;
|-&lt;br /&gt;
| 0x08 || Int32 || &#039;&#039;&#039;[[#Unknown Section 1|Unknown Section 1]]&#039;&#039;&#039; offset.&lt;br /&gt;
|-&lt;br /&gt;
| 0x0C || Byte[4] || {{unknown-left|&#039;&#039;&#039;Unknown&#039;&#039;&#039;. Always 0xCCCCCCCC.}}&lt;br /&gt;
|-&lt;br /&gt;
| 0x10 || Int32 || &#039;&#039;&#039;[[#Culling Groups|Culling Groups]]&#039;&#039;&#039; offset.&lt;br /&gt;
|-&lt;br /&gt;
| 0x14 || Int32 || &#039;&#039;&#039;[[#Culling Groups|Culling Groups]]&#039;&#039;&#039; data type:&lt;br /&gt;
* 1 = 4-byte per &#039;&#039;&#039;N&#039;&#039;&#039; group.&lt;br /&gt;
* 2 = 8-byte per &#039;&#039;&#039;N&#039;&#039;&#039; group.&lt;br /&gt;
|-&lt;br /&gt;
| 0x18 || Int32 || &#039;&#039;&#039;Number of textures&#039;&#039;&#039;.&lt;br /&gt;
|-&lt;br /&gt;
| 0x1C || Int32 || &#039;&#039;&#039;[[#Texture Group|Texture Group]]&#039;&#039;&#039; offset.&lt;br /&gt;
|-&lt;br /&gt;
| 0x20 || Int32 || &#039;&#039;&#039;[[#Unknown Section 2|Unknown Section 2]]&#039;&#039;&#039; offset.&lt;br /&gt;
|-&lt;br /&gt;
| 0x24 || Int32 || &#039;&#039;&#039;[[#Wish Race Unknown Section|Wish Race Unknown Section]]&#039;&#039;&#039; entry count.&lt;br /&gt;
|-&lt;br /&gt;
| 0x28 || Int32 || &#039;&#039;&#039;[[#Wish Race Unknown Section|Wish Race Unknown Section]]&#039;&#039;&#039; offset.&lt;br /&gt;
|-&lt;br /&gt;
| 0x2C || Byte[4] || {{unknown-left|&#039;&#039;&#039;Unknown&#039;&#039;&#039;. Seems to be some kind of flags.}}&lt;br /&gt;
|-&lt;br /&gt;
| 0x30 || Int32 || {{unknown-left|&#039;&#039;&#039;Unknown&#039;&#039;&#039;.}}&lt;br /&gt;
|-&lt;br /&gt;
| 0x34 || Int32 || &#039;&#039;&#039;File size&#039;&#039;&#039;.&lt;br /&gt;
|-&lt;br /&gt;
| 0x38 || colspan=2 {{unknown|End of header}}&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Track Section Group ==&lt;br /&gt;
This group starts with a list of &#039;&#039;&#039;N&#039;&#039;&#039; offsets.&lt;br /&gt;
&lt;br /&gt;
{|class=wikitable&lt;br /&gt;
|+ Track Section Header&lt;br /&gt;
! Offset !! Type !! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x00 || Int32[&#039;&#039;&#039;N&#039;&#039;&#039;] || &#039;&#039;&#039;[[#Track Section Entry|Track Section Entry]]&#039;&#039;&#039; offsets. Relative to the start of this group.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Track Section Entry ===&lt;br /&gt;
Every section entry defines model and collision data. The entry starts with a 32-byte header.&lt;br /&gt;
&lt;br /&gt;
{|class=wikitable&lt;br /&gt;
|+ Track Section Entry Header&lt;br /&gt;
! Offset !! Type !! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x00 || Byte || {{unknown-left|&#039;&#039;&#039;Unknown&#039;&#039;&#039;.}}&lt;br /&gt;
|-&lt;br /&gt;
| 0x01 || Byte || {{unknown-left|&#039;&#039;&#039;Unknown&#039;&#039;&#039;. Always 5?}}&lt;br /&gt;
|-&lt;br /&gt;
| 0x02 || UInt16 || {{unknown-left|&#039;&#039;&#039;Unknown&#039;&#039;&#039;.}}&lt;br /&gt;
|-&lt;br /&gt;
| 0x04 || UInt16 || &#039;&#039;&#039;Number of polygon groups&#039;&#039;&#039; (&#039;&#039;&#039;P&#039;&#039;&#039;).&lt;br /&gt;
|-&lt;br /&gt;
| 0x06 || UInt16 || &#039;&#039;&#039;Number of vertices&#039;&#039;&#039; in [[#Track Section Vertex Data|Track Section Vertex Data]] (&#039;&#039;&#039;V&#039;&#039;&#039;).&lt;br /&gt;
|-&lt;br /&gt;
| 0x08 || UInt16 || &#039;&#039;&#039;Number of UVs&#039;&#039;&#039; in [[#Track Section UV|Track Section UV Data]] (&#039;&#039;&#039;U&#039;&#039;&#039;).&lt;br /&gt;
|-&lt;br /&gt;
| 0x0A || UInt16 || &#039;&#039;&#039;Number of colors&#039;&#039;&#039; in [[#Track Section Color Data|Track Section Color Data]] (&#039;&#039;&#039;C&#039;&#039;&#039;).&lt;br /&gt;
|-&lt;br /&gt;
| 0x0C || Int32 || &#039;&#039;&#039;[[#Track Section Triangle Data|Track Section Triangle Data]]&#039;&#039;&#039; offset.&lt;br /&gt;
|-&lt;br /&gt;
| 0x10 || Int32 || &#039;&#039;&#039;[[#Track Section Collision Data|Track Section Collision Data]]&#039;&#039;&#039; offset.&lt;br /&gt;
|-&lt;br /&gt;
| 0x14 || Int32 || &#039;&#039;&#039;[[#Track Section Vertex Data|Track Section Vertex Data]]&#039;&#039;&#039; offset.&lt;br /&gt;
|-&lt;br /&gt;
| 0x18 || Int32 || &#039;&#039;&#039;[[#Track Section UV Data|Track Section UV Data]]&#039;&#039;&#039; offset.&lt;br /&gt;
|-&lt;br /&gt;
| 0x1C || Int32 || &#039;&#039;&#039;[[#Track Section Color Data|Track Section Color Data]]&#039;&#039;&#039; offset.&lt;br /&gt;
|-&lt;br /&gt;
| 0x20 || colspan=2 {{unknown|End of header, start of [[#Track Section Data|Track Section Data]]}}&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== Track Section Data ====&lt;br /&gt;
This data follows directly after the header of the section entry and starts with a 76-byte header.&lt;br /&gt;
&lt;br /&gt;
{|class=wikitable&lt;br /&gt;
! Offset !! Type !! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x00 || Int32 || {{unknown-left|&#039;&#039;&#039;Unknown&#039;&#039;&#039;. Seems to be always 0xFFFFFFFF and set to an address when loaded in memory.}}&lt;br /&gt;
|-&lt;br /&gt;
| 0x04 || Int32[3] || &#039;&#039;&#039;Collision XYZ offset&#039;&#039;&#039;.&lt;br /&gt;
|-&lt;br /&gt;
| 0x10 || Int32[3] || &#039;&#039;&#039;Visual model XYZ offset&#039;&#039;&#039;. The units are not the same as the collision offset.&lt;br /&gt;
|-&lt;br /&gt;
| 0x1C || [[#Track Section AABB|Track Section AABB]][2] || &#039;&#039;&#039;AABB areas&#039;&#039;&#039; of the entire section used for collision detection. The second AABB always seems to be a duplicate of the first.&lt;br /&gt;
|-&lt;br /&gt;
| 0x4C || colspan=2 {{unknown|End of header, start of [[#Track Section Polygon Data|Track Section Polygon Data]]}}&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
===== Track Section AABB =====&lt;br /&gt;
Track sections contain 2 identical AABB areas each. It is unknown why there&#039;s a duplicate, perhaps used during runtime after object space transform. All values need to be divided by 64 in order to obtain the absolute position data and match with the visual models.&lt;br /&gt;
&lt;br /&gt;
{|class=wikitable&lt;br /&gt;
! Offset !! Type !! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x00 || Int32[3] || &#039;&#039;&#039;AABB minimum XYZ position&#039;&#039;&#039;.&lt;br /&gt;
|-&lt;br /&gt;
| 0x0C || Int32[3] || &#039;&#039;&#039;AABB XYZ extent&#039;&#039;&#039;.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
===== Track Section Polygon Data =====&lt;br /&gt;
This section seems to store &#039;&#039;&#039;P&#039;&#039;&#039; polygon groups&#039; attributes.&lt;br /&gt;
&lt;br /&gt;
{|class=wikitable&lt;br /&gt;
! Offset !! Type !! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x00 || [[#Polygon Group Entry|Polygon Group Entry]][&#039;&#039;&#039;P&#039;&#039;&#039;] || &#039;&#039;&#039;Polygon group entries&#039;&#039;&#039;.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
====== Polygon Group Entry ======&lt;br /&gt;
Each polygon group entry is 12 bytes long.&lt;br /&gt;
&lt;br /&gt;
{|class=wikitable&lt;br /&gt;
! Offset !! Type !! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x00 || UInt16 || &#039;&#039;&#039;First triangle ID&#039;&#039;&#039;.&lt;br /&gt;
|-&lt;br /&gt;
| 0x02 || UInt16 || &#039;&#039;&#039;Number of triangles&#039;&#039;&#039;.&lt;br /&gt;
|-&lt;br /&gt;
| 0x04 || Byte || &#039;&#039;&#039;Main collision attribute&#039;&#039;&#039;. &#039;&#039;&#039;AAAA BBBB&#039;&#039;&#039;:&lt;br /&gt;
* &#039;&#039;&#039;A&#039;&#039;&#039;: &#039;&#039;&#039;Shadow level&#039;&#039;&#039;. The higher the value, the darker the character gets.&lt;br /&gt;
* &#039;&#039;&#039;B&#039;&#039;&#039;: &#039;&#039;&#039;Collision flag&#039;&#039;&#039;:&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! ID !! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x01 || Road and effects.&lt;br /&gt;
|-&lt;br /&gt;
| 0x05 || Wall.&lt;br /&gt;
|-&lt;br /&gt;
| 0x0C || Invisible wall.&lt;br /&gt;
|}&lt;br /&gt;
|-&lt;br /&gt;
| 0x05 || Byte || &#039;&#039;&#039;Secondary collision attribute&#039;&#039;&#039;:&lt;br /&gt;
* &#039;&#039;&#039;Main flag = 0x01&#039;&#039;&#039;:&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! ID !! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x00 || Special effect? Used for water.&lt;br /&gt;
|-&lt;br /&gt;
| 0x01 || Pass through/no effect.&lt;br /&gt;
|-&lt;br /&gt;
| 0x04 || Road.&lt;br /&gt;
|}&lt;br /&gt;
|-&lt;br /&gt;
| 0x06 || UInt16 || &#039;&#039;&#039;Tertiary collision attribute&#039;&#039;&#039;. Split in bits.&lt;br /&gt;
* &#039;&#039;&#039;Main flag = 0x01&#039;&#039;&#039;:&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! ID !! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x01 || {{unknown-left|&#039;&#039;&#039;Unknown&#039;&#039;&#039;. Used in non-collideable stuff.}}&lt;br /&gt;
|-&lt;br /&gt;
| 0x02 || Water, inflates tires in car.&lt;br /&gt;
|-&lt;br /&gt;
| 0x10 || {{unknown-left|&#039;&#039;&#039;Unknown&#039;&#039;&#039;. Used in non-collideable stuff.}}&lt;br /&gt;
|-&lt;br /&gt;
| 0x20 || {{unknown-left|&#039;&#039;&#039;Unknown&#039;&#039;&#039;. Used in non-collideable stuff.}}&lt;br /&gt;
|}&lt;br /&gt;
* &#039;&#039;&#039;Main flag = 0x0C&#039;&#039;&#039;:&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! ID !! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x04 || Ignore when using plane.&lt;br /&gt;
|}&lt;br /&gt;
|-&lt;br /&gt;
| 0x08 || Byte[4] || {{unknown-left|&#039;&#039;&#039;Unknown&#039;&#039;&#039;.}}&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The number of triangles &#039;&#039;&#039;T&#039;&#039;&#039; can be calculated by adding the first triangle ID to the number of triangles of the last polygon group entry.&lt;br /&gt;
&lt;br /&gt;
===== Track Section Triangle Data =====&lt;br /&gt;
This section stores &#039;&#039;&#039;T&#039;&#039;&#039; triangle entries.&lt;br /&gt;
&lt;br /&gt;
{|class=wikitable&lt;br /&gt;
! Offset !! Type !! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x00 || [[#Triangle Entry|Triangle Entry]][&#039;&#039;&#039;T&#039;&#039;&#039;] || &#039;&#039;&#039;Triangle entries&#039;&#039;&#039;.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
====== Triangle Entry ======&lt;br /&gt;
Each triangle entry is 20 bytes long.&lt;br /&gt;
&lt;br /&gt;
{|class=wikitable&lt;br /&gt;
! Offset !! Type !! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x00 || UInt16 || &#039;&#039;&#039;Attribute flags&#039;&#039;&#039;. &#039;&#039;&#039;AAAA AAAA AAAA AAAB&#039;&#039;&#039;:&lt;br /&gt;
* &#039;&#039;&#039;A&#039;&#039;&#039;: &#039;&#039;&#039;Texture ID&#039;&#039;&#039;.&lt;br /&gt;
* &#039;&#039;&#039;B&#039;&#039;&#039;: &#039;&#039;&#039;Is collidable&#039;&#039;&#039;.&lt;br /&gt;
|-&lt;br /&gt;
| 0x02 || UInt16[3] || &#039;&#039;&#039;Face XYZ normals&#039;&#039;&#039;. Values need to be divided by 4096.&lt;br /&gt;
|-&lt;br /&gt;
| 0x08 || Byte[4] || &#039;&#039;&#039;Vertex position indices&#039;&#039;&#039;. The index for each of the 3 vertices is 10 bits long. 2 last bits are unknown.&lt;br /&gt;
|-&lt;br /&gt;
| 0x0C || Byte[4] || &#039;&#039;&#039;UV indices&#039;&#039;&#039;. The index for each of the 3 vertices is 10 bits long. 2 last bits are unknown.&lt;br /&gt;
|-&lt;br /&gt;
| 0x10 || Byte[4] || &#039;&#039;&#039;Color indices&#039;&#039;&#039;. The index for each of the 3 vertices is 10 bits long. 2 last bits are unknown.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
===== Track Section Collision Data =====&lt;br /&gt;
4-byte data per triangle (?). &#039;&#039;TBD&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
===== Track Section Vertex Data =====&lt;br /&gt;
Vertex data is stored as 6-byte groups per entry &#039;&#039;&#039;V&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
{|class=wikitable&lt;br /&gt;
! Offset !! Type !! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x00 || Int16[3][&#039;&#039;&#039;V&#039;&#039;&#039;] || &#039;&#039;&#039;Vertex XYZ position&#039;&#039;&#039;.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
===== Track Section UV Data =====&lt;br /&gt;
UV data is stored as 4-byte groups per entry &#039;&#039;&#039;U&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
{|class=wikitable&lt;br /&gt;
! Offset !! Type !! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x00 || Int16[2][&#039;&#039;&#039;U&#039;&#039;&#039;] || &#039;&#039;&#039;Vertex UV position&#039;&#039;&#039;.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
===== Track Section Color Data =====&lt;br /&gt;
Color data is stored as 2-byte groups per entry &#039;&#039;&#039;C&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
{|class=wikitable&lt;br /&gt;
! Offset !! Type !! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x00 || UInt16[&#039;&#039;&#039;C&#039;&#039;&#039;] || &#039;&#039;&#039;RGBA5551 color&#039;&#039;&#039;.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Unknown Section 1 ==&lt;br /&gt;
&#039;&#039;TBD&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
== Culling Groups ==&lt;br /&gt;
This section includes a 4-byte or 8-byte per track section values that determine which section models are loaded when entering a specific section. Each section is represented as 1 bit.&lt;br /&gt;
&lt;br /&gt;
{|class=wikitable&lt;br /&gt;
! Offset !! Type !! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x00 || UInt16[&#039;&#039;&#039;N&#039;&#039;&#039;]/UInt32[&#039;&#039;&#039;N&#039;&#039;&#039;] || &#039;&#039;&#039;Culled model sections&#039;&#039;&#039;, represented as &#039;&#039;&#039;N&#039;&#039;&#039; bits, 1 per section, in order from the least to the most significant bit. 0 if culled, 1 if loaded.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Texture Group ==&lt;br /&gt;
See &#039;&#039;&#039;[[DKRDS Texture Group]]&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
== Unknown Section 2 ==&lt;br /&gt;
&#039;&#039;TBD&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
== Wish Race Unknown Section ==&lt;br /&gt;
This section is only used for the Wish Race tracks. &#039;&#039;TBD&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
= Tools =&lt;br /&gt;
The following tools can handle DKRDS Track:&lt;br /&gt;
* (none)&lt;br /&gt;
&lt;br /&gt;
[[Category:Diddy Kong Racing DS File Formats]]&lt;/div&gt;</summary>
		<author><name>Atlas</name></author>
	</entry>
	<entry>
		<id>https://wiki.wexosmk.xyz/index.php?title=DKRDS_Track_(File_Format)&amp;diff=675</id>
		<title>DKRDS Track (File Format)</title>
		<link rel="alternate" type="text/html" href="https://wiki.wexosmk.xyz/index.php?title=DKRDS_Track_(File_Format)&amp;diff=675"/>
		<updated>2026-06-03T15:58:58Z</updated>

		<summary type="html">&lt;p&gt;Atlas: /* Triangle Entry */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{under-construction}}&lt;br /&gt;
&#039;&#039;&#039;DKRDS Track&#039;&#039;&#039; is the nameless file format used in &#039;&#039;[https://en.wikipedia.org/wiki/Diddy_Kong_Racing_DS Diddy Kong Racing DS]&#039;&#039; that stores the tracks&#039; section models, collision and textures. Its type identifier in [[assets.bin]] is &#039;&#039;&#039;0x9A&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
= File Format =&lt;br /&gt;
The file byte order is always little endian.&lt;br /&gt;
&lt;br /&gt;
== Header ==&lt;br /&gt;
The file starts with a header that is 56 bytes long.&lt;br /&gt;
&lt;br /&gt;
{|class=wikitable&lt;br /&gt;
! Offset !! Type !! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x00 || Int32 || &#039;&#039;&#039;Number of sections&#039;&#039;&#039; (&#039;&#039;&#039;N&#039;&#039;&#039;).&lt;br /&gt;
|-&lt;br /&gt;
| 0x04 || Int32 || &#039;&#039;&#039;[[#Track Section Group|Track Section Group]]&#039;&#039;&#039; offset.&lt;br /&gt;
|-&lt;br /&gt;
| 0x08 || Int32 || &#039;&#039;&#039;[[#Unknown Section 1|Unknown Section 1]]&#039;&#039;&#039; offset.&lt;br /&gt;
|-&lt;br /&gt;
| 0x0C || Byte[4] || {{unknown-left|&#039;&#039;&#039;Unknown&#039;&#039;&#039;. Always 0xCCCCCCCC.}}&lt;br /&gt;
|-&lt;br /&gt;
| 0x10 || Int32 || &#039;&#039;&#039;[[#Culling Groups|Culling Groups]]&#039;&#039;&#039; offset.&lt;br /&gt;
|-&lt;br /&gt;
| 0x14 || Int32 || &#039;&#039;&#039;[[#Culling Groups|Culling Groups]]&#039;&#039;&#039; data type:&lt;br /&gt;
* 1 = 4-byte per &#039;&#039;&#039;N&#039;&#039;&#039; group.&lt;br /&gt;
* 2 = 8-byte per &#039;&#039;&#039;N&#039;&#039;&#039; group.&lt;br /&gt;
|-&lt;br /&gt;
| 0x18 || Int32 || &#039;&#039;&#039;Number of textures&#039;&#039;&#039;.&lt;br /&gt;
|-&lt;br /&gt;
| 0x1C || Int32 || &#039;&#039;&#039;[[#Texture Group|Texture Group]]&#039;&#039;&#039; offset.&lt;br /&gt;
|-&lt;br /&gt;
| 0x20 || Int32 || &#039;&#039;&#039;[[#Unknown Section 2|Unknown Section 2]]&#039;&#039;&#039; offset.&lt;br /&gt;
|-&lt;br /&gt;
| 0x24 || Int32 || &#039;&#039;&#039;[[#Wish Race Unknown Section|Wish Race Unknown Section]]&#039;&#039;&#039; entry count.&lt;br /&gt;
|-&lt;br /&gt;
| 0x28 || Int32 || &#039;&#039;&#039;[[#Wish Race Unknown Section|Wish Race Unknown Section]]&#039;&#039;&#039; offset.&lt;br /&gt;
|-&lt;br /&gt;
| 0x2C || Byte[4] || {{unknown-left|&#039;&#039;&#039;Unknown&#039;&#039;&#039;. Seems to be some kind of flags.}}&lt;br /&gt;
|-&lt;br /&gt;
| 0x30 || Int32 || {{unknown-left|&#039;&#039;&#039;Unknown&#039;&#039;&#039;.}}&lt;br /&gt;
|-&lt;br /&gt;
| 0x34 || Int32 || &#039;&#039;&#039;File size&#039;&#039;&#039;.&lt;br /&gt;
|-&lt;br /&gt;
| 0x38 || colspan=2 {{unknown|End of header}}&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Track Section Group ==&lt;br /&gt;
This group starts with a list of &#039;&#039;&#039;N&#039;&#039;&#039; offsets.&lt;br /&gt;
&lt;br /&gt;
{|class=wikitable&lt;br /&gt;
|+ Track Section Header&lt;br /&gt;
! Offset !! Type !! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x00 || Int32[&#039;&#039;&#039;N&#039;&#039;&#039;] || &#039;&#039;&#039;[[#Track Section Entry|Track Section Entry]]&#039;&#039;&#039; offsets. Relative to the start of this group.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Track Section Entry ===&lt;br /&gt;
Every section entry defines model and collision data. The entry starts with a 32-byte header.&lt;br /&gt;
&lt;br /&gt;
{|class=wikitable&lt;br /&gt;
|+ Track Section Entry Header&lt;br /&gt;
! Offset !! Type !! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x00 || Byte || {{unknown-left|&#039;&#039;&#039;Unknown&#039;&#039;&#039;.}}&lt;br /&gt;
|-&lt;br /&gt;
| 0x01 || Byte || {{unknown-left|&#039;&#039;&#039;Unknown&#039;&#039;&#039;. Always 5?}}&lt;br /&gt;
|-&lt;br /&gt;
| 0x02 || UInt16 || {{unknown-left|&#039;&#039;&#039;Unknown&#039;&#039;&#039;.}}&lt;br /&gt;
|-&lt;br /&gt;
| 0x04 || UInt16 || &#039;&#039;&#039;Number of polygon groups&#039;&#039;&#039; (&#039;&#039;&#039;P&#039;&#039;&#039;).&lt;br /&gt;
|-&lt;br /&gt;
| 0x06 || UInt16 || &#039;&#039;&#039;Number of vertices&#039;&#039;&#039; in [[#Track Section Vertex Data|Track Section Vertex Data]] (&#039;&#039;&#039;V&#039;&#039;&#039;).&lt;br /&gt;
|-&lt;br /&gt;
| 0x08 || UInt16 || &#039;&#039;&#039;Number of UVs&#039;&#039;&#039; in [[#Track Section UV|Track Section UV Data]] (&#039;&#039;&#039;U&#039;&#039;&#039;).&lt;br /&gt;
|-&lt;br /&gt;
| 0x0A || UInt16 || &#039;&#039;&#039;Number of colors&#039;&#039;&#039; in [[#Track Section Color Data|Track Section Color Data]] (&#039;&#039;&#039;C&#039;&#039;&#039;).&lt;br /&gt;
|-&lt;br /&gt;
| 0x0C || Int32 || &#039;&#039;&#039;[[#Track Section Triangle Data|Track Section Triangle Data]]&#039;&#039;&#039; offset.&lt;br /&gt;
|-&lt;br /&gt;
| 0x10 || Int32 || &#039;&#039;&#039;[[#Track Section Collision Data|Track Section Collision Data]]&#039;&#039;&#039; offset.&lt;br /&gt;
|-&lt;br /&gt;
| 0x14 || Int32 || &#039;&#039;&#039;[[#Track Section Vertex Data|Track Section Vertex Data]]&#039;&#039;&#039; offset.&lt;br /&gt;
|-&lt;br /&gt;
| 0x18 || Int32 || &#039;&#039;&#039;[[#Track Section UV Data|Track Section UV Data]]&#039;&#039;&#039; offset.&lt;br /&gt;
|-&lt;br /&gt;
| 0x1C || Int32 || &#039;&#039;&#039;[[#Track Section Color Data|Track Section Color Data]]&#039;&#039;&#039; offset.&lt;br /&gt;
|-&lt;br /&gt;
| 0x20 || colspan=2 {{unknown|End of header, start of [[#Track Section Data|Track Section Data]]}}&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== Track Section Data ====&lt;br /&gt;
This data follows directly after the header of the section entry and starts with a 76-byte header.&lt;br /&gt;
&lt;br /&gt;
{|class=wikitable&lt;br /&gt;
! Offset !! Type !! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x00 || Int32 || {{unknown-left|&#039;&#039;&#039;Unknown&#039;&#039;&#039;. Seems to be always 0xFFFFFFFF and set to an address when loaded in memory.}}&lt;br /&gt;
|-&lt;br /&gt;
| 0x04 || Int32[3] || &#039;&#039;&#039;Collision XYZ offset&#039;&#039;&#039;.&lt;br /&gt;
|-&lt;br /&gt;
| 0x10 || Int32[3] || &#039;&#039;&#039;Visual model XYZ offset&#039;&#039;&#039;. The units are not the same as the collision offset.&lt;br /&gt;
|-&lt;br /&gt;
| 0x1C || [[#Track Section AABB|Track Section AABB]][2] || &#039;&#039;&#039;AABB areas&#039;&#039;&#039; of the entire section used for collision detection. The second AABB always seems to be a duplicate of the first.&lt;br /&gt;
|-&lt;br /&gt;
| 0x4C || colspan=2 {{unknown|End of header, start of [[#Track Section Polygon Data|Track Section Polygon Data]]}}&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
===== Track Section AABB =====&lt;br /&gt;
Track sections contain 2 identical AABB areas each. It is unknown why there&#039;s a duplicate, perhaps used during runtime after object space transform. All values need to be divided by 64 in order to obtain the absolute position data and match with the visual models.&lt;br /&gt;
&lt;br /&gt;
{|class=wikitable&lt;br /&gt;
! Offset !! Type !! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x00 || Int32[3] || &#039;&#039;&#039;AABB minimum XYZ position&#039;&#039;&#039;.&lt;br /&gt;
|-&lt;br /&gt;
| 0x0C || Int32[3] || &#039;&#039;&#039;AABB XYZ extent&#039;&#039;&#039;.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
===== Track Section Polygon Data =====&lt;br /&gt;
This section seems to store &#039;&#039;&#039;P&#039;&#039;&#039; polygon groups&#039; attributes.&lt;br /&gt;
&lt;br /&gt;
{|class=wikitable&lt;br /&gt;
! Offset !! Type !! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x00 || [[#Polygon Group Entry|Polygon Group Entry]][&#039;&#039;&#039;P&#039;&#039;&#039;] || &#039;&#039;&#039;Polygon group entries&#039;&#039;&#039;.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
====== Polygon Group Entry ======&lt;br /&gt;
Each polygon group entry is 12 bytes long.&lt;br /&gt;
&lt;br /&gt;
{|class=wikitable&lt;br /&gt;
! Offset !! Type !! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x00 || UInt16 || &#039;&#039;&#039;First triangle ID&#039;&#039;&#039;.&lt;br /&gt;
|-&lt;br /&gt;
| 0x02 || UInt16 || &#039;&#039;&#039;Number of triangles&#039;&#039;&#039;.&lt;br /&gt;
|-&lt;br /&gt;
| 0x04 || Byte || {{unknown-left|&#039;&#039;&#039;Unknown&#039;&#039;&#039;.}}&lt;br /&gt;
|-&lt;br /&gt;
| 0x05 || Byte || {{unknown-left|&#039;&#039;&#039;Unknown&#039;&#039;&#039;. Seems to affect collision attributes, such as the type of collision and terrain effects.}}&lt;br /&gt;
|-&lt;br /&gt;
| 0x06 || UInt16 || {{unknown-left|&#039;&#039;&#039;Unknown&#039;&#039;&#039;.}}&lt;br /&gt;
|-&lt;br /&gt;
| 0x08 || Byte[4] || {{unknown-left|&#039;&#039;&#039;Unknown&#039;&#039;&#039;.}}&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The number of triangles &#039;&#039;&#039;T&#039;&#039;&#039; can be calculated by adding the first triangle ID to the number of triangles of the last polygon group entry.&lt;br /&gt;
&lt;br /&gt;
===== Track Section Triangle Data =====&lt;br /&gt;
This section stores &#039;&#039;&#039;T&#039;&#039;&#039; triangle entries.&lt;br /&gt;
&lt;br /&gt;
{|class=wikitable&lt;br /&gt;
! Offset !! Type !! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x00 || [[#Triangle Entry|Triangle Entry]][&#039;&#039;&#039;T&#039;&#039;&#039;] || &#039;&#039;&#039;Triangle entries&#039;&#039;&#039;.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
====== Triangle Entry ======&lt;br /&gt;
Each triangle entry is 20 bytes long.&lt;br /&gt;
&lt;br /&gt;
{|class=wikitable&lt;br /&gt;
! Offset !! Type !! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x00 || UInt16 || &#039;&#039;&#039;Attribute flags&#039;&#039;&#039;. &#039;&#039;&#039;AAAA AAAA AAAA AAAB&#039;&#039;&#039;:&lt;br /&gt;
* &#039;&#039;&#039;A&#039;&#039;&#039;: &#039;&#039;&#039;Texture ID&#039;&#039;&#039;.&lt;br /&gt;
* &#039;&#039;&#039;B&#039;&#039;&#039;: &#039;&#039;&#039;Is collidable&#039;&#039;&#039;.&lt;br /&gt;
|-&lt;br /&gt;
| 0x02 || UInt16[3] || &#039;&#039;&#039;Face XYZ normals&#039;&#039;&#039;. Values need to be divided by 4096.&lt;br /&gt;
|-&lt;br /&gt;
| 0x08 || Byte[4] || &#039;&#039;&#039;Vertex position indices&#039;&#039;&#039;. The index for each of the 3 vertices is 10 bits long. 2 last bits are unknown.&lt;br /&gt;
|-&lt;br /&gt;
| 0x0C || Byte[4] || &#039;&#039;&#039;UV indices&#039;&#039;&#039;. The index for each of the 3 vertices is 10 bits long. 2 last bits are unknown.&lt;br /&gt;
|-&lt;br /&gt;
| 0x10 || Byte[4] || &#039;&#039;&#039;Color indices&#039;&#039;&#039;. The index for each of the 3 vertices is 10 bits long. 2 last bits are unknown.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
===== Track Section Collision Data =====&lt;br /&gt;
4-byte data per triangle (?). &#039;&#039;TBD&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
===== Track Section Vertex Data =====&lt;br /&gt;
Vertex data is stored as 6-byte groups per entry &#039;&#039;&#039;V&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
{|class=wikitable&lt;br /&gt;
! Offset !! Type !! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x00 || Int16[3][&#039;&#039;&#039;V&#039;&#039;&#039;] || &#039;&#039;&#039;Vertex XYZ position&#039;&#039;&#039;.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
===== Track Section UV Data =====&lt;br /&gt;
UV data is stored as 4-byte groups per entry &#039;&#039;&#039;U&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
{|class=wikitable&lt;br /&gt;
! Offset !! Type !! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x00 || Int16[2][&#039;&#039;&#039;U&#039;&#039;&#039;] || &#039;&#039;&#039;Vertex UV position&#039;&#039;&#039;.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
===== Track Section Color Data =====&lt;br /&gt;
Color data is stored as 2-byte groups per entry &#039;&#039;&#039;C&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
{|class=wikitable&lt;br /&gt;
! Offset !! Type !! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x00 || UInt16[&#039;&#039;&#039;C&#039;&#039;&#039;] || &#039;&#039;&#039;RGBA5551 color&#039;&#039;&#039;.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Unknown Section 1 ==&lt;br /&gt;
&#039;&#039;TBD&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
== Culling Groups ==&lt;br /&gt;
This section includes a 4-byte or 8-byte per track section values that determine which section models are loaded when entering a specific section. Each section is represented as 1 bit.&lt;br /&gt;
&lt;br /&gt;
{|class=wikitable&lt;br /&gt;
! Offset !! Type !! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x00 || UInt16[&#039;&#039;&#039;N&#039;&#039;&#039;]/UInt32[&#039;&#039;&#039;N&#039;&#039;&#039;] || &#039;&#039;&#039;Culled model sections&#039;&#039;&#039;, represented as &#039;&#039;&#039;N&#039;&#039;&#039; bits, 1 per section, in order from the least to the most significant bit. 0 if culled, 1 if loaded.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Texture Group ==&lt;br /&gt;
See &#039;&#039;&#039;[[DKRDS Texture Group]]&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
== Unknown Section 2 ==&lt;br /&gt;
&#039;&#039;TBD&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
== Wish Race Unknown Section ==&lt;br /&gt;
This section is only used for the Wish Race tracks. &#039;&#039;TBD&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
= Tools =&lt;br /&gt;
The following tools can handle DKRDS Track:&lt;br /&gt;
* (none)&lt;br /&gt;
&lt;br /&gt;
[[Category:Diddy Kong Racing DS File Formats]]&lt;/div&gt;</summary>
		<author><name>Atlas</name></author>
	</entry>
	<entry>
		<id>https://wiki.wexosmk.xyz/index.php?title=DKRDS_Track_(File_Format)&amp;diff=674</id>
		<title>DKRDS Track (File Format)</title>
		<link rel="alternate" type="text/html" href="https://wiki.wexosmk.xyz/index.php?title=DKRDS_Track_(File_Format)&amp;diff=674"/>
		<updated>2026-06-03T12:20:18Z</updated>

		<summary type="html">&lt;p&gt;Atlas: /* Track Section Data */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{under-construction}}&lt;br /&gt;
&#039;&#039;&#039;DKRDS Track&#039;&#039;&#039; is the nameless file format used in &#039;&#039;[https://en.wikipedia.org/wiki/Diddy_Kong_Racing_DS Diddy Kong Racing DS]&#039;&#039; that stores the tracks&#039; section models, collision and textures. Its type identifier in [[assets.bin]] is &#039;&#039;&#039;0x9A&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
= File Format =&lt;br /&gt;
The file byte order is always little endian.&lt;br /&gt;
&lt;br /&gt;
== Header ==&lt;br /&gt;
The file starts with a header that is 56 bytes long.&lt;br /&gt;
&lt;br /&gt;
{|class=wikitable&lt;br /&gt;
! Offset !! Type !! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x00 || Int32 || &#039;&#039;&#039;Number of sections&#039;&#039;&#039; (&#039;&#039;&#039;N&#039;&#039;&#039;).&lt;br /&gt;
|-&lt;br /&gt;
| 0x04 || Int32 || &#039;&#039;&#039;[[#Track Section Group|Track Section Group]]&#039;&#039;&#039; offset.&lt;br /&gt;
|-&lt;br /&gt;
| 0x08 || Int32 || &#039;&#039;&#039;[[#Unknown Section 1|Unknown Section 1]]&#039;&#039;&#039; offset.&lt;br /&gt;
|-&lt;br /&gt;
| 0x0C || Byte[4] || {{unknown-left|&#039;&#039;&#039;Unknown&#039;&#039;&#039;. Always 0xCCCCCCCC.}}&lt;br /&gt;
|-&lt;br /&gt;
| 0x10 || Int32 || &#039;&#039;&#039;[[#Culling Groups|Culling Groups]]&#039;&#039;&#039; offset.&lt;br /&gt;
|-&lt;br /&gt;
| 0x14 || Int32 || &#039;&#039;&#039;[[#Culling Groups|Culling Groups]]&#039;&#039;&#039; data type:&lt;br /&gt;
* 1 = 4-byte per &#039;&#039;&#039;N&#039;&#039;&#039; group.&lt;br /&gt;
* 2 = 8-byte per &#039;&#039;&#039;N&#039;&#039;&#039; group.&lt;br /&gt;
|-&lt;br /&gt;
| 0x18 || Int32 || &#039;&#039;&#039;Number of textures&#039;&#039;&#039;.&lt;br /&gt;
|-&lt;br /&gt;
| 0x1C || Int32 || &#039;&#039;&#039;[[#Texture Group|Texture Group]]&#039;&#039;&#039; offset.&lt;br /&gt;
|-&lt;br /&gt;
| 0x20 || Int32 || &#039;&#039;&#039;[[#Unknown Section 2|Unknown Section 2]]&#039;&#039;&#039; offset.&lt;br /&gt;
|-&lt;br /&gt;
| 0x24 || Int32 || &#039;&#039;&#039;[[#Wish Race Unknown Section|Wish Race Unknown Section]]&#039;&#039;&#039; entry count.&lt;br /&gt;
|-&lt;br /&gt;
| 0x28 || Int32 || &#039;&#039;&#039;[[#Wish Race Unknown Section|Wish Race Unknown Section]]&#039;&#039;&#039; offset.&lt;br /&gt;
|-&lt;br /&gt;
| 0x2C || Byte[4] || {{unknown-left|&#039;&#039;&#039;Unknown&#039;&#039;&#039;. Seems to be some kind of flags.}}&lt;br /&gt;
|-&lt;br /&gt;
| 0x30 || Int32 || {{unknown-left|&#039;&#039;&#039;Unknown&#039;&#039;&#039;.}}&lt;br /&gt;
|-&lt;br /&gt;
| 0x34 || Int32 || &#039;&#039;&#039;File size&#039;&#039;&#039;.&lt;br /&gt;
|-&lt;br /&gt;
| 0x38 || colspan=2 {{unknown|End of header}}&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Track Section Group ==&lt;br /&gt;
This group starts with a list of &#039;&#039;&#039;N&#039;&#039;&#039; offsets.&lt;br /&gt;
&lt;br /&gt;
{|class=wikitable&lt;br /&gt;
|+ Track Section Header&lt;br /&gt;
! Offset !! Type !! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x00 || Int32[&#039;&#039;&#039;N&#039;&#039;&#039;] || &#039;&#039;&#039;[[#Track Section Entry|Track Section Entry]]&#039;&#039;&#039; offsets. Relative to the start of this group.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Track Section Entry ===&lt;br /&gt;
Every section entry defines model and collision data. The entry starts with a 32-byte header.&lt;br /&gt;
&lt;br /&gt;
{|class=wikitable&lt;br /&gt;
|+ Track Section Entry Header&lt;br /&gt;
! Offset !! Type !! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x00 || Byte || {{unknown-left|&#039;&#039;&#039;Unknown&#039;&#039;&#039;.}}&lt;br /&gt;
|-&lt;br /&gt;
| 0x01 || Byte || {{unknown-left|&#039;&#039;&#039;Unknown&#039;&#039;&#039;. Always 5?}}&lt;br /&gt;
|-&lt;br /&gt;
| 0x02 || UInt16 || {{unknown-left|&#039;&#039;&#039;Unknown&#039;&#039;&#039;.}}&lt;br /&gt;
|-&lt;br /&gt;
| 0x04 || UInt16 || &#039;&#039;&#039;Number of polygon groups&#039;&#039;&#039; (&#039;&#039;&#039;P&#039;&#039;&#039;).&lt;br /&gt;
|-&lt;br /&gt;
| 0x06 || UInt16 || &#039;&#039;&#039;Number of vertices&#039;&#039;&#039; in [[#Track Section Vertex Data|Track Section Vertex Data]] (&#039;&#039;&#039;V&#039;&#039;&#039;).&lt;br /&gt;
|-&lt;br /&gt;
| 0x08 || UInt16 || &#039;&#039;&#039;Number of UVs&#039;&#039;&#039; in [[#Track Section UV|Track Section UV Data]] (&#039;&#039;&#039;U&#039;&#039;&#039;).&lt;br /&gt;
|-&lt;br /&gt;
| 0x0A || UInt16 || &#039;&#039;&#039;Number of colors&#039;&#039;&#039; in [[#Track Section Color Data|Track Section Color Data]] (&#039;&#039;&#039;C&#039;&#039;&#039;).&lt;br /&gt;
|-&lt;br /&gt;
| 0x0C || Int32 || &#039;&#039;&#039;[[#Track Section Triangle Data|Track Section Triangle Data]]&#039;&#039;&#039; offset.&lt;br /&gt;
|-&lt;br /&gt;
| 0x10 || Int32 || &#039;&#039;&#039;[[#Track Section Collision Data|Track Section Collision Data]]&#039;&#039;&#039; offset.&lt;br /&gt;
|-&lt;br /&gt;
| 0x14 || Int32 || &#039;&#039;&#039;[[#Track Section Vertex Data|Track Section Vertex Data]]&#039;&#039;&#039; offset.&lt;br /&gt;
|-&lt;br /&gt;
| 0x18 || Int32 || &#039;&#039;&#039;[[#Track Section UV Data|Track Section UV Data]]&#039;&#039;&#039; offset.&lt;br /&gt;
|-&lt;br /&gt;
| 0x1C || Int32 || &#039;&#039;&#039;[[#Track Section Color Data|Track Section Color Data]]&#039;&#039;&#039; offset.&lt;br /&gt;
|-&lt;br /&gt;
| 0x20 || colspan=2 {{unknown|End of header, start of [[#Track Section Data|Track Section Data]]}}&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== Track Section Data ====&lt;br /&gt;
This data follows directly after the header of the section entry and starts with a 76-byte header.&lt;br /&gt;
&lt;br /&gt;
{|class=wikitable&lt;br /&gt;
! Offset !! Type !! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x00 || Int32 || {{unknown-left|&#039;&#039;&#039;Unknown&#039;&#039;&#039;. Seems to be always 0xFFFFFFFF and set to an address when loaded in memory.}}&lt;br /&gt;
|-&lt;br /&gt;
| 0x04 || Int32[3] || &#039;&#039;&#039;Collision XYZ offset&#039;&#039;&#039;.&lt;br /&gt;
|-&lt;br /&gt;
| 0x10 || Int32[3] || &#039;&#039;&#039;Visual model XYZ offset&#039;&#039;&#039;. The units are not the same as the collision offset.&lt;br /&gt;
|-&lt;br /&gt;
| 0x1C || [[#Track Section AABB|Track Section AABB]][2] || &#039;&#039;&#039;AABB areas&#039;&#039;&#039; of the entire section used for collision detection. The second AABB always seems to be a duplicate of the first.&lt;br /&gt;
|-&lt;br /&gt;
| 0x4C || colspan=2 {{unknown|End of header, start of [[#Track Section Polygon Data|Track Section Polygon Data]]}}&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
===== Track Section AABB =====&lt;br /&gt;
Track sections contain 2 identical AABB areas each. It is unknown why there&#039;s a duplicate, perhaps used during runtime after object space transform. All values need to be divided by 64 in order to obtain the absolute position data and match with the visual models.&lt;br /&gt;
&lt;br /&gt;
{|class=wikitable&lt;br /&gt;
! Offset !! Type !! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x00 || Int32[3] || &#039;&#039;&#039;AABB minimum XYZ position&#039;&#039;&#039;.&lt;br /&gt;
|-&lt;br /&gt;
| 0x0C || Int32[3] || &#039;&#039;&#039;AABB XYZ extent&#039;&#039;&#039;.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
===== Track Section Polygon Data =====&lt;br /&gt;
This section seems to store &#039;&#039;&#039;P&#039;&#039;&#039; polygon groups&#039; attributes.&lt;br /&gt;
&lt;br /&gt;
{|class=wikitable&lt;br /&gt;
! Offset !! Type !! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x00 || [[#Polygon Group Entry|Polygon Group Entry]][&#039;&#039;&#039;P&#039;&#039;&#039;] || &#039;&#039;&#039;Polygon group entries&#039;&#039;&#039;.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
====== Polygon Group Entry ======&lt;br /&gt;
Each polygon group entry is 12 bytes long.&lt;br /&gt;
&lt;br /&gt;
{|class=wikitable&lt;br /&gt;
! Offset !! Type !! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x00 || UInt16 || &#039;&#039;&#039;First triangle ID&#039;&#039;&#039;.&lt;br /&gt;
|-&lt;br /&gt;
| 0x02 || UInt16 || &#039;&#039;&#039;Number of triangles&#039;&#039;&#039;.&lt;br /&gt;
|-&lt;br /&gt;
| 0x04 || Byte || {{unknown-left|&#039;&#039;&#039;Unknown&#039;&#039;&#039;.}}&lt;br /&gt;
|-&lt;br /&gt;
| 0x05 || Byte || {{unknown-left|&#039;&#039;&#039;Unknown&#039;&#039;&#039;. Seems to affect collision attributes, such as the type of collision and terrain effects.}}&lt;br /&gt;
|-&lt;br /&gt;
| 0x06 || UInt16 || {{unknown-left|&#039;&#039;&#039;Unknown&#039;&#039;&#039;.}}&lt;br /&gt;
|-&lt;br /&gt;
| 0x08 || Byte[4] || {{unknown-left|&#039;&#039;&#039;Unknown&#039;&#039;&#039;.}}&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The number of triangles &#039;&#039;&#039;T&#039;&#039;&#039; can be calculated by adding the first triangle ID to the number of triangles of the last polygon group entry.&lt;br /&gt;
&lt;br /&gt;
===== Track Section Triangle Data =====&lt;br /&gt;
This section stores &#039;&#039;&#039;T&#039;&#039;&#039; triangle entries.&lt;br /&gt;
&lt;br /&gt;
{|class=wikitable&lt;br /&gt;
! Offset !! Type !! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x00 || [[#Triangle Entry|Triangle Entry]][&#039;&#039;&#039;T&#039;&#039;&#039;] || &#039;&#039;&#039;Triangle entries&#039;&#039;&#039;.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
====== Triangle Entry ======&lt;br /&gt;
Each triangle entry is 20 bytes long.&lt;br /&gt;
&lt;br /&gt;
{|class=wikitable&lt;br /&gt;
! Offset !! Type !! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x00 || UInt16 || &#039;&#039;&#039;Texture ID&#039;&#039;&#039;.&lt;br /&gt;
|-&lt;br /&gt;
| 0x02 || UInt16[3] || &#039;&#039;&#039;Face XYZ normals&#039;&#039;&#039;. Values need to be divided by 4096.&lt;br /&gt;
|-&lt;br /&gt;
| 0x08 || Byte[4] || &#039;&#039;&#039;Vertex position indices&#039;&#039;&#039;. The index for each of the 3 vertices is 10 bits long. 2 last bits are unknown.&lt;br /&gt;
|-&lt;br /&gt;
| 0x0C || Byte[4] || &#039;&#039;&#039;UV indices&#039;&#039;&#039;. The index for each of the 3 vertices is 10 bits long. 2 last bits are unknown.&lt;br /&gt;
|-&lt;br /&gt;
| 0x10 || Byte[4] || &#039;&#039;&#039;Color indices&#039;&#039;&#039;. The index for each of the 3 vertices is 10 bits long. 2 last bits are unknown.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
===== Track Section Collision Data =====&lt;br /&gt;
4-byte data per triangle (?). &#039;&#039;TBD&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
===== Track Section Vertex Data =====&lt;br /&gt;
Vertex data is stored as 6-byte groups per entry &#039;&#039;&#039;V&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
{|class=wikitable&lt;br /&gt;
! Offset !! Type !! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x00 || Int16[3][&#039;&#039;&#039;V&#039;&#039;&#039;] || &#039;&#039;&#039;Vertex XYZ position&#039;&#039;&#039;.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
===== Track Section UV Data =====&lt;br /&gt;
UV data is stored as 4-byte groups per entry &#039;&#039;&#039;U&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
{|class=wikitable&lt;br /&gt;
! Offset !! Type !! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x00 || Int16[2][&#039;&#039;&#039;U&#039;&#039;&#039;] || &#039;&#039;&#039;Vertex UV position&#039;&#039;&#039;.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
===== Track Section Color Data =====&lt;br /&gt;
Color data is stored as 2-byte groups per entry &#039;&#039;&#039;C&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
{|class=wikitable&lt;br /&gt;
! Offset !! Type !! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x00 || UInt16[&#039;&#039;&#039;C&#039;&#039;&#039;] || &#039;&#039;&#039;RGBA5551 color&#039;&#039;&#039;.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Unknown Section 1 ==&lt;br /&gt;
&#039;&#039;TBD&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
== Culling Groups ==&lt;br /&gt;
This section includes a 4-byte or 8-byte per track section values that determine which section models are loaded when entering a specific section. Each section is represented as 1 bit.&lt;br /&gt;
&lt;br /&gt;
{|class=wikitable&lt;br /&gt;
! Offset !! Type !! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x00 || UInt16[&#039;&#039;&#039;N&#039;&#039;&#039;]/UInt32[&#039;&#039;&#039;N&#039;&#039;&#039;] || &#039;&#039;&#039;Culled model sections&#039;&#039;&#039;, represented as &#039;&#039;&#039;N&#039;&#039;&#039; bits, 1 per section, in order from the least to the most significant bit. 0 if culled, 1 if loaded.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Texture Group ==&lt;br /&gt;
See &#039;&#039;&#039;[[DKRDS Texture Group]]&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
== Unknown Section 2 ==&lt;br /&gt;
&#039;&#039;TBD&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
== Wish Race Unknown Section ==&lt;br /&gt;
This section is only used for the Wish Race tracks. &#039;&#039;TBD&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
= Tools =&lt;br /&gt;
The following tools can handle DKRDS Track:&lt;br /&gt;
* (none)&lt;br /&gt;
&lt;br /&gt;
[[Category:Diddy Kong Racing DS File Formats]]&lt;/div&gt;</summary>
		<author><name>Atlas</name></author>
	</entry>
	<entry>
		<id>https://wiki.wexosmk.xyz/index.php?title=DKRDS_Texture_Tileset_(File_Format)&amp;diff=673</id>
		<title>DKRDS Texture Tileset (File Format)</title>
		<link rel="alternate" type="text/html" href="https://wiki.wexosmk.xyz/index.php?title=DKRDS_Texture_Tileset_(File_Format)&amp;diff=673"/>
		<updated>2026-05-26T22:53:12Z</updated>

		<summary type="html">&lt;p&gt;Atlas: /* Tools */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&#039;&#039;&#039;DKRDS Texture Tileset&#039;&#039;&#039; is a nameless file format used in &#039;&#039;[https://en.wikipedia.org/wiki/Diddy_Kong_Racing_DS Diddy Kong Racing DS]&#039;&#039;. It stores raw Nintendo DS 8x8 character tile graphics used to build screen backgrounds. It exists in 4bpp (32 bytes per tile) and 8bpp (64 bytes per tile) bit-depth variants, which correspond to different palette modes in the accompanying files. Other filetypes that are commonly associated with texture tilesets, and necessary to create screen backgrounds, are [[DKRDS Tile Layout]], [[DKRDS Tilemap]] and [[DKRDS Palette Bank]]. Its type identifier in [[assets.bin]] is &#039;&#039;&#039;0x00&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
= File Format =&lt;br /&gt;
The file byte order is always little endian.&lt;br /&gt;
&lt;br /&gt;
== Header ==&lt;br /&gt;
The file starts with a 4-byte header.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Offset !! Type !! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x00 || Int32 || &#039;&#039;&#039;Number of tiles&#039;&#039;&#039; (&#039;&#039;&#039;T&#039;&#039;&#039;).&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Tile Entries ==&lt;br /&gt;
After the header comes the tile entries. The total file size is always &amp;lt;code&amp;gt;4 + &#039;&#039;&#039;T&#039;&#039;&#039; x &#039;&#039;size&#039;&#039;&amp;lt;/code&amp;gt;, where &#039;&#039;size&#039;&#039; is 32 (4bpp) or 64 (8bpp) depending on the variant.&lt;br /&gt;
&lt;br /&gt;
=== Variant A ===&lt;br /&gt;
The first variant is used together with a 16-color palette from a [[DKRDS Palette Bank]] file. Each tile is an 8x8 pixel block where every pixel is a 4-bit index (0-15) into one of the 16 available palettes.&lt;br /&gt;
&lt;br /&gt;
==== Tile data layout ====&lt;br /&gt;
Each tile is made of 32 bytes. Pixels are packed two per byte, row-major within the tile:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Offset !! Description&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;&#039;&#039;&#039;R&#039;&#039;&#039; * 4 + &#039;&#039;&#039;C&#039;&#039;&#039; / 2&amp;lt;/code&amp;gt; || Two pixels from row &#039;&#039;&#039;R&#039;&#039;&#039;: low nibble = pixel at column &#039;&#039;&#039;C&#039;&#039;&#039; (even), high nibble = pixel at column &#039;&#039;&#039;C&#039;&#039;&#039;+1 (odd).&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Variant B ===&lt;br /&gt;
The second variant is used together with a 256-color palette from a [[DKRDS Palette Bank]]. Each tile is an 8x8 pixel block where every pixel is a full byte (0-255), a direct index into the single 256-color palette.&lt;br /&gt;
&lt;br /&gt;
==== Tile data layout ====&lt;br /&gt;
Each tile is made of 64 bytes. One byte per pixel, row-major.&lt;br /&gt;
&lt;br /&gt;
== Notes ==&lt;br /&gt;
* Pixel index 0 is always transparent. The corresponding palette entry may contain any value; it is never displayed.&lt;br /&gt;
* Sub-tile IDs referenced from the [[DKRDS Tile Layout]] file are direct indices into this file. For Variant B (48-byte two-section layout), the full value must be used without masking, as sub-tile IDs can exceed 1023.&lt;br /&gt;
* The [[DKRDS Tile Layout]] file specifies which palette bank to use for each sub-tile. In 4bpp mode this selects one of 16 palettes (each 16 colors x 2 bytes = 32 bytes). In 8bpp mode the whole 512-byte palette block is treated as a single 256-color palette and the palette ID field is ignored.&lt;br /&gt;
&lt;br /&gt;
= Tools =&lt;br /&gt;
The following tools can handle DKRDS Texture Tileset:&lt;br /&gt;
* (none)&lt;br /&gt;
&lt;br /&gt;
[[Category:Diddy Kong Racing DS File Formats]]&lt;/div&gt;</summary>
		<author><name>Atlas</name></author>
	</entry>
	<entry>
		<id>https://wiki.wexosmk.xyz/index.php?title=DKRDS_Palette_Bank&amp;diff=672</id>
		<title>DKRDS Palette Bank</title>
		<link rel="alternate" type="text/html" href="https://wiki.wexosmk.xyz/index.php?title=DKRDS_Palette_Bank&amp;diff=672"/>
		<updated>2026-05-26T22:52:38Z</updated>

		<summary type="html">&lt;p&gt;Atlas: Redirected page to DKRDS Palette Bank (File Format)&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;#REDIRECT [[DKRDS Palette Bank (File Format)]]&lt;/div&gt;</summary>
		<author><name>Atlas</name></author>
	</entry>
	<entry>
		<id>https://wiki.wexosmk.xyz/index.php?title=DKRDS_Palette_Bank_(File_Format)&amp;diff=671</id>
		<title>DKRDS Palette Bank (File Format)</title>
		<link rel="alternate" type="text/html" href="https://wiki.wexosmk.xyz/index.php?title=DKRDS_Palette_Bank_(File_Format)&amp;diff=671"/>
		<updated>2026-05-26T22:52:29Z</updated>

		<summary type="html">&lt;p&gt;Atlas: Created page with &amp;quot;&amp;#039;&amp;#039;&amp;#039;DKRDS Palette Bank&amp;#039;&amp;#039;&amp;#039; is a nameless file format used in &amp;#039;&amp;#039;[https://en.wikipedia.org/wiki/Diddy_Kong_Racing_DS Diddy Kong Racing DS]&amp;#039;&amp;#039;. It contains BGR555 color data used to render pixels from tile sprites. It exists in two variants depending on the bit-depth of the accompanying DKRDS Texture Tileset file: a 16-palette bank (for 4bpp tiles) or a single 256-color palette (for 8bpp tiles). Both variants are exactly 512 bytes. Other filetypes that are commonly associa...&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&#039;&#039;&#039;DKRDS Palette Bank&#039;&#039;&#039; is a nameless file format used in &#039;&#039;[https://en.wikipedia.org/wiki/Diddy_Kong_Racing_DS Diddy Kong Racing DS]&#039;&#039;. It contains BGR555 color data used to render pixels from tile sprites. It exists in two variants depending on the bit-depth of the accompanying [[DKRDS Texture Tileset]] file: a 16-palette bank (for 4bpp tiles) or a single 256-color palette (for 8bpp tiles). Both variants are exactly 512 bytes. Other filetypes that are commonly associated with palette banks, and necessary to create screen backgrounds, are [[DKRDS Tile Layout]] and [[DKRDS Tilemap]]. Its type identifier in [[assets.bin]] is &#039;&#039;&#039;0x00&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
= File Format =&lt;br /&gt;
The file byte order is always little endian.&lt;br /&gt;
&lt;br /&gt;
== Variant A ==&lt;br /&gt;
The first variant is used with 4bpp [[DKRDS Texture Tileset]] files. The 512 bytes are divided into 16 palettes of 16 colors each.&lt;br /&gt;
&lt;br /&gt;
=== Structure ===&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Offset !! Type !! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x00 || UInt16[16] || &#039;&#039;&#039;Palette 0&#039;&#039;&#039; (colors 0-15).&lt;br /&gt;
|-&lt;br /&gt;
| 0x20 || UInt16[16] || &#039;&#039;&#039;Palette 1&#039;&#039;&#039; (colors 0-15).&lt;br /&gt;
|-&lt;br /&gt;
| ... || ... || ...&lt;br /&gt;
|-&lt;br /&gt;
| 0x1E0 || UInt16[16] || &#039;&#039;&#039;Palette 15&#039;&#039;&#039; (colors 0-15).&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Variant B ==&lt;br /&gt;
The second variant is used with 8bpp [[DKRDS Texture Tileset]] files. The 512 bytes form a single palette of 256 colors; pixel bytes index directly into it.&lt;br /&gt;
&lt;br /&gt;
=== Structure ===&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Offset !! Type !! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x00 || UInt16[256] || &#039;&#039;&#039;BGR555 colors&#039;&#039;&#039; (colors 0-255).&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Notes ==&lt;br /&gt;
Color index 0 of &#039;&#039;&#039;any&#039;&#039;&#039; palette is transparent regardless of the stored BGR555 value.&lt;br /&gt;
&lt;br /&gt;
= Tools =&lt;br /&gt;
The following tools can handle DKRDS Palette Bank:&lt;br /&gt;
* (none)&lt;br /&gt;
&lt;br /&gt;
[[Category:Diddy Kong Racing DS File Formats]]&lt;/div&gt;</summary>
		<author><name>Atlas</name></author>
	</entry>
	<entry>
		<id>https://wiki.wexosmk.xyz/index.php?title=DKRDS_Texture_Tileset&amp;diff=670</id>
		<title>DKRDS Texture Tileset</title>
		<link rel="alternate" type="text/html" href="https://wiki.wexosmk.xyz/index.php?title=DKRDS_Texture_Tileset&amp;diff=670"/>
		<updated>2026-05-26T22:40:24Z</updated>

		<summary type="html">&lt;p&gt;Atlas: Redirected page to DKRDS Texture Tileset (File Format)&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;#REDIRECT [[DKRDS Texture Tileset (File Format)]]&lt;/div&gt;</summary>
		<author><name>Atlas</name></author>
	</entry>
	<entry>
		<id>https://wiki.wexosmk.xyz/index.php?title=DKRDS_Texture_Tileset_(File_Format)&amp;diff=669</id>
		<title>DKRDS Texture Tileset (File Format)</title>
		<link rel="alternate" type="text/html" href="https://wiki.wexosmk.xyz/index.php?title=DKRDS_Texture_Tileset_(File_Format)&amp;diff=669"/>
		<updated>2026-05-26T22:40:13Z</updated>

		<summary type="html">&lt;p&gt;Atlas: Created page with &amp;quot;&amp;#039;&amp;#039;&amp;#039;DKRDS Texture Tileset&amp;#039;&amp;#039;&amp;#039; is a nameless file format used in &amp;#039;&amp;#039;[https://en.wikipedia.org/wiki/Diddy_Kong_Racing_DS Diddy Kong Racing DS]&amp;#039;&amp;#039;. It stores raw Nintendo DS 8x8 character tile graphics used to build screen backgrounds. It exists in 4bpp (32 bytes per tile) and 8bpp (64 bytes per tile) bit-depth variants, which correspond to different palette modes in the accompanying files. Other filetypes that are commonly associated with texture tilesets, and necessary to cre...&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&#039;&#039;&#039;DKRDS Texture Tileset&#039;&#039;&#039; is a nameless file format used in &#039;&#039;[https://en.wikipedia.org/wiki/Diddy_Kong_Racing_DS Diddy Kong Racing DS]&#039;&#039;. It stores raw Nintendo DS 8x8 character tile graphics used to build screen backgrounds. It exists in 4bpp (32 bytes per tile) and 8bpp (64 bytes per tile) bit-depth variants, which correspond to different palette modes in the accompanying files. Other filetypes that are commonly associated with texture tilesets, and necessary to create screen backgrounds, are [[DKRDS Tile Layout]], [[DKRDS Tilemap]] and [[DKRDS Palette Bank]]. Its type identifier in [[assets.bin]] is &#039;&#039;&#039;0x00&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
= File Format =&lt;br /&gt;
The file byte order is always little endian.&lt;br /&gt;
&lt;br /&gt;
== Header ==&lt;br /&gt;
The file starts with a 4-byte header.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Offset !! Type !! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x00 || Int32 || &#039;&#039;&#039;Number of tiles&#039;&#039;&#039; (&#039;&#039;&#039;T&#039;&#039;&#039;).&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Tile Entries ==&lt;br /&gt;
After the header comes the tile entries. The total file size is always &amp;lt;code&amp;gt;4 + &#039;&#039;&#039;T&#039;&#039;&#039; x &#039;&#039;size&#039;&#039;&amp;lt;/code&amp;gt;, where &#039;&#039;size&#039;&#039; is 32 (4bpp) or 64 (8bpp) depending on the variant.&lt;br /&gt;
&lt;br /&gt;
=== Variant A ===&lt;br /&gt;
The first variant is used together with a 16-color palette from a [[DKRDS Palette Bank]] file. Each tile is an 8x8 pixel block where every pixel is a 4-bit index (0-15) into one of the 16 available palettes.&lt;br /&gt;
&lt;br /&gt;
==== Tile data layout ====&lt;br /&gt;
Each tile is made of 32 bytes. Pixels are packed two per byte, row-major within the tile:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Offset !! Description&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;&#039;&#039;&#039;R&#039;&#039;&#039; * 4 + &#039;&#039;&#039;C&#039;&#039;&#039; / 2&amp;lt;/code&amp;gt; || Two pixels from row &#039;&#039;&#039;R&#039;&#039;&#039;: low nibble = pixel at column &#039;&#039;&#039;C&#039;&#039;&#039; (even), high nibble = pixel at column &#039;&#039;&#039;C&#039;&#039;&#039;+1 (odd).&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Variant B ===&lt;br /&gt;
The second variant is used together with a 256-color palette from a [[DKRDS Palette Bank]]. Each tile is an 8x8 pixel block where every pixel is a full byte (0-255), a direct index into the single 256-color palette.&lt;br /&gt;
&lt;br /&gt;
==== Tile data layout ====&lt;br /&gt;
Each tile is made of 64 bytes. One byte per pixel, row-major.&lt;br /&gt;
&lt;br /&gt;
== Notes ==&lt;br /&gt;
* Pixel index 0 is always transparent. The corresponding palette entry may contain any value; it is never displayed.&lt;br /&gt;
* Sub-tile IDs referenced from the [[DKRDS Tile Layout]] file are direct indices into this file. For Variant B (48-byte two-section layout), the full value must be used without masking, as sub-tile IDs can exceed 1023.&lt;br /&gt;
* The [[DKRDS Tile Layout]] file specifies which palette bank to use for each sub-tile. In 4bpp mode this selects one of 16 palettes (each 16 colors x 2 bytes = 32 bytes). In 8bpp mode the whole 512-byte palette block is treated as a single 256-color palette and the palette ID field is ignored.&lt;br /&gt;
&lt;br /&gt;
= Tools =&lt;br /&gt;
The following tools can handle DKRDS Tile Layout:&lt;br /&gt;
* (none)&lt;br /&gt;
&lt;br /&gt;
[[Category:Diddy Kong Racing DS File Formats]]&lt;/div&gt;</summary>
		<author><name>Atlas</name></author>
	</entry>
	<entry>
		<id>https://wiki.wexosmk.xyz/index.php?title=DKRDS_Tilemap&amp;diff=668</id>
		<title>DKRDS Tilemap</title>
		<link rel="alternate" type="text/html" href="https://wiki.wexosmk.xyz/index.php?title=DKRDS_Tilemap&amp;diff=668"/>
		<updated>2026-05-26T22:18:51Z</updated>

		<summary type="html">&lt;p&gt;Atlas: Redirected page to DKRDS Tilemap (File Format)&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;#REDIRECT [[DKRDS Tilemap (File Format)]]&lt;/div&gt;</summary>
		<author><name>Atlas</name></author>
	</entry>
	<entry>
		<id>https://wiki.wexosmk.xyz/index.php?title=DKRDS_Tilemap_(File_Format)&amp;diff=667</id>
		<title>DKRDS Tilemap (File Format)</title>
		<link rel="alternate" type="text/html" href="https://wiki.wexosmk.xyz/index.php?title=DKRDS_Tilemap_(File_Format)&amp;diff=667"/>
		<updated>2026-05-26T22:18:39Z</updated>

		<summary type="html">&lt;p&gt;Atlas: Created page with &amp;quot;&amp;#039;&amp;#039;&amp;#039;DKRDS Tilemap&amp;#039;&amp;#039;&amp;#039; is a nameless file format used in &amp;#039;&amp;#039;[https://en.wikipedia.org/wiki/Diddy_Kong_Racing_DS Diddy Kong Racing DS]&amp;#039;&amp;#039; which defines a grid of 32x32 tile cells in order to assemble an image. Each cell in the grid is equivalent to one entry from the accompanying DKRDS Tile Layout file. Rendering all cells in order (from the top-left to the bottom-right tile) produces the complete image. Other filetypes that are commonly associated with tilemaps, and neces...&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&#039;&#039;&#039;DKRDS Tilemap&#039;&#039;&#039; is a nameless file format used in &#039;&#039;[https://en.wikipedia.org/wiki/Diddy_Kong_Racing_DS Diddy Kong Racing DS]&#039;&#039; which defines a grid of 32x32 tile cells in order to assemble an image. Each cell in the grid is equivalent to one entry from the accompanying [[DKRDS Tile Layout]] file. Rendering all cells in order (from the top-left to the bottom-right tile) produces the complete image. Other filetypes that are commonly associated with tilemaps, and necessary to create screen backgrounds, are [[DKRDS Texture Tileset]] and [[DKRDS Palette Bank]]. Its type identifier in [[assets.bin]] is &#039;&#039;&#039;0x00&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
= File Format =&lt;br /&gt;
The file byte order is always little endian.&lt;br /&gt;
&lt;br /&gt;
== Structure ==&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Offset !! Type !! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x00 || UInt16 || &#039;&#039;&#039;Map width&#039;&#039;&#039; in tiles (&#039;&#039;&#039;W&#039;&#039;&#039;).&lt;br /&gt;
|-&lt;br /&gt;
| 0x02 || UInt16 || &#039;&#039;&#039;Map height&#039;&#039;&#039; in tiles (&#039;&#039;&#039;H&#039;&#039;&#039;).&lt;br /&gt;
|-&lt;br /&gt;
| 0x04 || UInt16[&#039;&#039;&#039;W&#039;&#039;&#039;][&#039;&#039;&#039;H&#039;&#039;&#039;] || &#039;&#039;&#039;Grid of tile entries&#039;&#039;&#039;, row-major.&lt;br /&gt;
|}&lt;br /&gt;
 &lt;br /&gt;
=== Tile Entry ===&lt;br /&gt;
Each entry represents a 32x32 tile which contains a reference index and flip attributes. They use the following bit layout:&lt;br /&gt;
&lt;br /&gt;
 A  A  A  A  B  C  D  D  D  D  D  D  D  D  D  D&lt;br /&gt;
 0  1  2  3  4  5  6  7  8  9  10 11 12 13 14 15&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Bits !! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0-3 || {{Unknown-left|&#039;&#039;&#039;Unknown&#039;&#039;&#039;. Always 0?}}&lt;br /&gt;
|-&lt;br /&gt;
| 4 || &#039;&#039;&#039;Flip vertical&#039;&#039;&#039;. If 1, it mirrors the 32x32 tile on the Y axis.&lt;br /&gt;
|-&lt;br /&gt;
| 5 || &#039;&#039;&#039;Flip horizontal&#039;&#039;&#039;. If 1, it mirrors the 32x32 tile on the X axis.&lt;br /&gt;
|-&lt;br /&gt;
| 6-15 || &#039;&#039;&#039;Tile ID&#039;&#039;&#039;. This is the index into the [[DKRDS Tile Layout]] file (0-1023).&lt;br /&gt;
|}&lt;br /&gt;
 &lt;br /&gt;
== Notes ==&lt;br /&gt;
* Tile index 0 typically represents an empty or fully-transparent background tile. In minimaps, large regions surrounding the track consist entirely of index-0 entries.&lt;br /&gt;
* The flip fields apply to the rendered 32x32 output of the whole 32x32 tile, &#039;&#039;&#039;after&#039;&#039;&#039; all 8x8 sub-tiles within it have been composited. They are independent of the per-sub-tile flip flags stored in the [[DKRDS Tile Layout]] file.&lt;br /&gt;
 &lt;br /&gt;
= Tools =&lt;br /&gt;
The following tools can handle DKRDS Tilemap:&lt;br /&gt;
* (none)&lt;br /&gt;
&lt;br /&gt;
[[Category:Diddy Kong Racing DS File Formats]]&lt;/div&gt;</summary>
		<author><name>Atlas</name></author>
	</entry>
	<entry>
		<id>https://wiki.wexosmk.xyz/index.php?title=DKRDS_Tile_Layout&amp;diff=666</id>
		<title>DKRDS Tile Layout</title>
		<link rel="alternate" type="text/html" href="https://wiki.wexosmk.xyz/index.php?title=DKRDS_Tile_Layout&amp;diff=666"/>
		<updated>2026-05-26T22:01:48Z</updated>

		<summary type="html">&lt;p&gt;Atlas: Redirected page to DKRDS Tile Layout (File Format)&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;#REDIRECT [[DKRDS Tile Layout (File Format)]]&lt;/div&gt;</summary>
		<author><name>Atlas</name></author>
	</entry>
	<entry>
		<id>https://wiki.wexosmk.xyz/index.php?title=DKRDS_Tile_Layout&amp;diff=665</id>
		<title>DKRDS Tile Layout</title>
		<link rel="alternate" type="text/html" href="https://wiki.wexosmk.xyz/index.php?title=DKRDS_Tile_Layout&amp;diff=665"/>
		<updated>2026-05-26T22:01:38Z</updated>

		<summary type="html">&lt;p&gt;Atlas: Created page with &amp;quot;# REDIRECT DKRDS Tile Layout (File Format)&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;# REDIRECT [[DKRDS Tile Layout (File Format)]]&lt;/div&gt;</summary>
		<author><name>Atlas</name></author>
	</entry>
	<entry>
		<id>https://wiki.wexosmk.xyz/index.php?title=DKRDS_Tile_Layout_(File_Format)&amp;diff=664</id>
		<title>DKRDS Tile Layout (File Format)</title>
		<link rel="alternate" type="text/html" href="https://wiki.wexosmk.xyz/index.php?title=DKRDS_Tile_Layout_(File_Format)&amp;diff=664"/>
		<updated>2026-05-26T22:01:23Z</updated>

		<summary type="html">&lt;p&gt;Atlas: Created page with &amp;quot;&amp;#039;&amp;#039;&amp;#039;DKRDS Tile Layout&amp;#039;&amp;#039;&amp;#039; is a nameless file format used in &amp;#039;&amp;#039;[https://en.wikipedia.org/wiki/Diddy_Kong_Racing_DS Diddy Kong Racing DS]&amp;#039;&amp;#039; with the purpose of assembling a set of reusable 32x32-pixel tiles for screen backgrounds, such as minimaps. Each tile is composed of a 4x4 grid of 8x8 character tiles sourced from a DKRDS Texture Tileset file. At least two format variants exist, distinguished by their per-entry size. Other filetypes that are commonly associated with...&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&#039;&#039;&#039;DKRDS Tile Layout&#039;&#039;&#039; is a nameless file format used in &#039;&#039;[https://en.wikipedia.org/wiki/Diddy_Kong_Racing_DS Diddy Kong Racing DS]&#039;&#039; with the purpose of assembling a set of reusable 32x32-pixel tiles for screen backgrounds, such as minimaps. Each tile is composed of a 4x4 grid of 8x8 character tiles sourced from a [[DKRDS Texture Tileset]] file. At least two format variants exist, distinguished by their per-entry size. Other filetypes that are commonly associated with tile layouts, and necessary to create screen backgrounds, are [[DKRDS Tilemap]] and [[DKRDS Palette Bank]]. Its type identifier in [[assets.bin]] is &#039;&#039;&#039;0x00&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
= File Format =&lt;br /&gt;
The file byte order is always little endian.&lt;br /&gt;
&lt;br /&gt;
== Header ==&lt;br /&gt;
All variants begin with a 4-byte header.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Offset !! Type !! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x00 || Int32 || &#039;&#039;&#039;Number of tiles&#039;&#039;&#039; (&#039;&#039;&#039;T&#039;&#039;&#039;).&lt;br /&gt;
|-&lt;br /&gt;
| 0x04 || colspan=2 {{unknown|End of header}}&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Tile Entries ==&lt;br /&gt;
After the header comes the tile entries. The total file size is always &amp;lt;code&amp;gt;4 + &#039;&#039;&#039;T&#039;&#039;&#039; x &#039;&#039;size&#039;&#039;&amp;lt;/code&amp;gt;, where &#039;&#039;size&#039;&#039; is 32 or 48 depending on the variant.&lt;br /&gt;
&lt;br /&gt;
=== Variant A ===&lt;br /&gt;
The first variant is used when the sub-tiles carry their own palette in each tilemap value (4bpp mode with per-tile palette selection). It contains a single section of 32-byte entries. Each entry describes one 32x32 tile as 16 tilemap references arranged in a 4-column x 4-row grid (row-major, left-to-right then top-to-bottom).&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Offset !! Type !! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x00 || UInt16[16][&#039;&#039;&#039;T&#039;&#039;&#039;] || &#039;&#039;&#039;Sub-tile entries&#039;&#039;&#039;.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== Sub-tile Entry ====&lt;br /&gt;
Each entry is composed of a reference ID and tile attributes. Only up to 1024 different sub-tile references can be defined. They use the following bit layout:&lt;br /&gt;
&lt;br /&gt;
 A  A  A  A  B  C  D  D  D  D  D  D  D  D  D  D&lt;br /&gt;
 0  1  2  3  4  5  6  7  8  9  10 11 12 13 14 15&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Bits !! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0-3 || &#039;&#039;&#039;Palette ID&#039;&#039;&#039;. Selects one of the 16 palettes from the [[DKRDS Palette Bank]] file.&lt;br /&gt;
|-&lt;br /&gt;
| 4 || &#039;&#039;&#039;Flip vertical&#039;&#039;&#039;. If 1, it mirrors the 8x8 sub-tile on the Y axis.&lt;br /&gt;
|-&lt;br /&gt;
| 5 || &#039;&#039;&#039;Flip horizontal&#039;&#039;&#039;. If 1, it mirrors the 8x8 sub-tile on the X axis.&lt;br /&gt;
|-&lt;br /&gt;
| 6-15 || &#039;&#039;&#039;Sub-tile ID&#039;&#039;&#039;. This is the index into the [[DKRDS Texture Tileset]] file (0-1023).&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Variant B ===&lt;br /&gt;
The second variant is used when palette and flip information is stored separately from the sub-tile references (4bpp or 8bpp mode). The file is divided into two back-to-back sections (32-byte and 16-byte each) rather than interleaved per-entry data.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Offset !! Type !! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x00 || UInt16[16][&#039;&#039;&#039;T&#039;&#039;&#039;] || &#039;&#039;&#039;Sub-tile entries&#039;&#039;&#039;.&lt;br /&gt;
|-&lt;br /&gt;
| &#039;&#039;&#039;T&#039;&#039;&#039; * 32 || Byte[16][&#039;&#039;&#039;T&#039;&#039;&#039;] || &#039;&#039;&#039;Tile attributes&#039;&#039;&#039;.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== Sub-tile Entry ====&lt;br /&gt;
Each entry contains a direct sub-tile reference. The value here is &#039;&#039;&#039;only&#039;&#039;&#039; a tile index, so up to 65536 different sub-tiles can be referenced in contrast of Variant A&#039;s limit of 1024.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Bits !! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0-15 ||  &#039;&#039;&#039;Sub-tile ID&#039;&#039;&#039;. This is the index into the [[DKRDS Texture Tileset]] file (0-65535).&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== Tile Attribute ====&lt;br /&gt;
Each byte corresponds to a sub-tile and encodes palette and flip data using the following bit layout:&lt;br /&gt;
&lt;br /&gt;
 A A B B B B C D&lt;br /&gt;
 0 1 2 3 4 5 6 7&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Bits !! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0-1 || {{Unknown-left|&#039;&#039;&#039;Unknown&#039;&#039;&#039;. Changing these values seems to produce no visible difference in-game, but existing files still use different values for each sub-tile.}}&lt;br /&gt;
|-&lt;br /&gt;
| 2-5 || &#039;&#039;&#039;Palette ID&#039;&#039;&#039;.  Selects one of the 16 palettes from the [[DKRDS Palette Bank]] file.&lt;br /&gt;
|-&lt;br /&gt;
| 6 || &#039;&#039;&#039;Flip vertical&#039;&#039;&#039;. If 1, it mirrors the 8x8 sub-tile on the Y axis.&lt;br /&gt;
|-&lt;br /&gt;
| 7 || &#039;&#039;&#039;Flip horizontal&#039;&#039;&#039;. If 1, it mirrors the 8x8 sub-tile on the X axis.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
= Tools =&lt;br /&gt;
The following tools can handle DKRDS Tile Layout:&lt;br /&gt;
* (none)&lt;br /&gt;
&lt;br /&gt;
[[Category:Diddy Kong Racing DS File Formats]]&lt;/div&gt;</summary>
		<author><name>Atlas</name></author>
	</entry>
	<entry>
		<id>https://wiki.wexosmk.xyz/index.php?title=DKRDS_Track_(File_Format)&amp;diff=663</id>
		<title>DKRDS Track (File Format)</title>
		<link rel="alternate" type="text/html" href="https://wiki.wexosmk.xyz/index.php?title=DKRDS_Track_(File_Format)&amp;diff=663"/>
		<updated>2026-05-25T18:58:12Z</updated>

		<summary type="html">&lt;p&gt;Atlas: /* Track Section Entry */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{under-construction}}&lt;br /&gt;
&#039;&#039;&#039;DKRDS Track&#039;&#039;&#039; is the nameless file format used in &#039;&#039;[https://en.wikipedia.org/wiki/Diddy_Kong_Racing_DS Diddy Kong Racing DS]&#039;&#039; that stores the tracks&#039; section models, collision and textures. Its type identifier in [[assets.bin]] is &#039;&#039;&#039;0x9A&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
= File Format =&lt;br /&gt;
The file byte order is always little endian.&lt;br /&gt;
&lt;br /&gt;
== Header ==&lt;br /&gt;
The file starts with a header that is 56 bytes long.&lt;br /&gt;
&lt;br /&gt;
{|class=wikitable&lt;br /&gt;
! Offset !! Type !! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x00 || Int32 || &#039;&#039;&#039;Number of sections&#039;&#039;&#039; (&#039;&#039;&#039;N&#039;&#039;&#039;).&lt;br /&gt;
|-&lt;br /&gt;
| 0x04 || Int32 || &#039;&#039;&#039;[[#Track Section Group|Track Section Group]]&#039;&#039;&#039; offset.&lt;br /&gt;
|-&lt;br /&gt;
| 0x08 || Int32 || &#039;&#039;&#039;[[#Unknown Section 1|Unknown Section 1]]&#039;&#039;&#039; offset.&lt;br /&gt;
|-&lt;br /&gt;
| 0x0C || Byte[4] || {{unknown-left|&#039;&#039;&#039;Unknown&#039;&#039;&#039;. Always 0xCCCCCCCC.}}&lt;br /&gt;
|-&lt;br /&gt;
| 0x10 || Int32 || &#039;&#039;&#039;[[#Culling Groups|Culling Groups]]&#039;&#039;&#039; offset.&lt;br /&gt;
|-&lt;br /&gt;
| 0x14 || Int32 || &#039;&#039;&#039;[[#Culling Groups|Culling Groups]]&#039;&#039;&#039; data type:&lt;br /&gt;
* 1 = 4-byte per &#039;&#039;&#039;N&#039;&#039;&#039; group.&lt;br /&gt;
* 2 = 8-byte per &#039;&#039;&#039;N&#039;&#039;&#039; group.&lt;br /&gt;
|-&lt;br /&gt;
| 0x18 || Int32 || &#039;&#039;&#039;Number of textures&#039;&#039;&#039;.&lt;br /&gt;
|-&lt;br /&gt;
| 0x1C || Int32 || &#039;&#039;&#039;[[#Texture Group|Texture Group]]&#039;&#039;&#039; offset.&lt;br /&gt;
|-&lt;br /&gt;
| 0x20 || Int32 || &#039;&#039;&#039;[[#Unknown Section 2|Unknown Section 2]]&#039;&#039;&#039; offset.&lt;br /&gt;
|-&lt;br /&gt;
| 0x24 || Int32 || &#039;&#039;&#039;[[#Wish Race Unknown Section|Wish Race Unknown Section]]&#039;&#039;&#039; entry count.&lt;br /&gt;
|-&lt;br /&gt;
| 0x28 || Int32 || &#039;&#039;&#039;[[#Wish Race Unknown Section|Wish Race Unknown Section]]&#039;&#039;&#039; offset.&lt;br /&gt;
|-&lt;br /&gt;
| 0x2C || Byte[4] || {{unknown-left|&#039;&#039;&#039;Unknown&#039;&#039;&#039;. Seems to be some kind of flags.}}&lt;br /&gt;
|-&lt;br /&gt;
| 0x30 || Int32 || {{unknown-left|&#039;&#039;&#039;Unknown&#039;&#039;&#039;.}}&lt;br /&gt;
|-&lt;br /&gt;
| 0x34 || Int32 || &#039;&#039;&#039;File size&#039;&#039;&#039;.&lt;br /&gt;
|-&lt;br /&gt;
| 0x38 || colspan=2 {{unknown|End of header}}&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Track Section Group ==&lt;br /&gt;
This group starts with a list of &#039;&#039;&#039;N&#039;&#039;&#039; offsets.&lt;br /&gt;
&lt;br /&gt;
{|class=wikitable&lt;br /&gt;
|+ Track Section Header&lt;br /&gt;
! Offset !! Type !! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x00 || Int32[&#039;&#039;&#039;N&#039;&#039;&#039;] || &#039;&#039;&#039;[[#Track Section Entry|Track Section Entry]]&#039;&#039;&#039; offsets. Relative to the start of this group.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Track Section Entry ===&lt;br /&gt;
Every section entry defines model and collision data. The entry starts with a 32-byte header.&lt;br /&gt;
&lt;br /&gt;
{|class=wikitable&lt;br /&gt;
|+ Track Section Entry Header&lt;br /&gt;
! Offset !! Type !! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x00 || Byte || {{unknown-left|&#039;&#039;&#039;Unknown&#039;&#039;&#039;.}}&lt;br /&gt;
|-&lt;br /&gt;
| 0x01 || Byte || {{unknown-left|&#039;&#039;&#039;Unknown&#039;&#039;&#039;. Always 5?}}&lt;br /&gt;
|-&lt;br /&gt;
| 0x02 || UInt16 || {{unknown-left|&#039;&#039;&#039;Unknown&#039;&#039;&#039;.}}&lt;br /&gt;
|-&lt;br /&gt;
| 0x04 || UInt16 || &#039;&#039;&#039;Number of polygon groups&#039;&#039;&#039; (&#039;&#039;&#039;P&#039;&#039;&#039;).&lt;br /&gt;
|-&lt;br /&gt;
| 0x06 || UInt16 || &#039;&#039;&#039;Number of vertices&#039;&#039;&#039; in [[#Track Section Vertex Data|Track Section Vertex Data]] (&#039;&#039;&#039;V&#039;&#039;&#039;).&lt;br /&gt;
|-&lt;br /&gt;
| 0x08 || UInt16 || &#039;&#039;&#039;Number of UVs&#039;&#039;&#039; in [[#Track Section UV|Track Section UV Data]] (&#039;&#039;&#039;U&#039;&#039;&#039;).&lt;br /&gt;
|-&lt;br /&gt;
| 0x0A || UInt16 || &#039;&#039;&#039;Number of colors&#039;&#039;&#039; in [[#Track Section Color Data|Track Section Color Data]] (&#039;&#039;&#039;C&#039;&#039;&#039;).&lt;br /&gt;
|-&lt;br /&gt;
| 0x0C || Int32 || &#039;&#039;&#039;[[#Track Section Triangle Data|Track Section Triangle Data]]&#039;&#039;&#039; offset.&lt;br /&gt;
|-&lt;br /&gt;
| 0x10 || Int32 || &#039;&#039;&#039;[[#Track Section Collision Data|Track Section Collision Data]]&#039;&#039;&#039; offset.&lt;br /&gt;
|-&lt;br /&gt;
| 0x14 || Int32 || &#039;&#039;&#039;[[#Track Section Vertex Data|Track Section Vertex Data]]&#039;&#039;&#039; offset.&lt;br /&gt;
|-&lt;br /&gt;
| 0x18 || Int32 || &#039;&#039;&#039;[[#Track Section UV Data|Track Section UV Data]]&#039;&#039;&#039; offset.&lt;br /&gt;
|-&lt;br /&gt;
| 0x1C || Int32 || &#039;&#039;&#039;[[#Track Section Color Data|Track Section Color Data]]&#039;&#039;&#039; offset.&lt;br /&gt;
|-&lt;br /&gt;
| 0x20 || colspan=2 {{unknown|End of header, start of [[#Track Section Data|Track Section Data]]}}&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== Track Section Data ====&lt;br /&gt;
This data follows directly after the header of the section entry and starts with a 76-byte header.&lt;br /&gt;
&lt;br /&gt;
{|class=wikitable&lt;br /&gt;
! Offset !! Type !! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x00 || Int32 || {{unknown-left|&#039;&#039;&#039;Unknown&#039;&#039;&#039;. Seems to be always 0xFFFFFFFF and set to an address when loaded in memory.}}&lt;br /&gt;
|-&lt;br /&gt;
| 0x04 || Int32[3] || &#039;&#039;&#039;Collision XYZ offset&#039;&#039;&#039;.&lt;br /&gt;
|-&lt;br /&gt;
| 0x10 || Int32[3] || &#039;&#039;&#039;Visual model XYZ offset&#039;&#039;&#039;. The units are not the same as the collision offset.&lt;br /&gt;
|-&lt;br /&gt;
| 0x1C || UInt16[12][2] || {{unknown-left|&#039;&#039;&#039;Unknown&#039;&#039;&#039;. Both 24-byte arrays seem to always be the same? They affect collision data.}}&lt;br /&gt;
|-&lt;br /&gt;
| 0x4C || colspan=2 {{unknown|End of header, start of [[#Track Section Polygon Data|Track Section Polygon Data]]}}&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
===== Track Section Polygon Data =====&lt;br /&gt;
This section seems to store &#039;&#039;&#039;P&#039;&#039;&#039; polygon groups&#039; attributes.&lt;br /&gt;
&lt;br /&gt;
{|class=wikitable&lt;br /&gt;
! Offset !! Type !! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x00 || Polygon Group Entry[&#039;&#039;&#039;P&#039;&#039;&#039;] || &#039;&#039;&#039;Polygon group entries&#039;&#039;&#039;.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
====== Polygon Group Entry ======&lt;br /&gt;
Each polygon group entry is 12 bytes long.&lt;br /&gt;
&lt;br /&gt;
{|class=wikitable&lt;br /&gt;
! Offset !! Type !! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x00 || UInt16 || &#039;&#039;&#039;First triangle ID&#039;&#039;&#039;.&lt;br /&gt;
|-&lt;br /&gt;
| 0x02 || UInt16 || &#039;&#039;&#039;Number of triangles&#039;&#039;&#039;.&lt;br /&gt;
|-&lt;br /&gt;
| 0x04 || Byte || {{unknown-left|&#039;&#039;&#039;Unknown&#039;&#039;&#039;.}}&lt;br /&gt;
|-&lt;br /&gt;
| 0x05 || Byte || {{unknown-left|&#039;&#039;&#039;Unknown&#039;&#039;&#039;. Seems to affect collision attributes, such as the type of collision and terrain effects.}}&lt;br /&gt;
|-&lt;br /&gt;
| 0x06 || UInt16 || {{unknown-left|&#039;&#039;&#039;Unknown&#039;&#039;&#039;.}}&lt;br /&gt;
|-&lt;br /&gt;
| 0x08 || Byte[4] || {{unknown-left|&#039;&#039;&#039;Unknown&#039;&#039;&#039;.}}&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The number of triangles &#039;&#039;&#039;T&#039;&#039;&#039; can be calculated by adding the first triangle ID to the number of triangles of the last polygon group entry.&lt;br /&gt;
&lt;br /&gt;
===== Track Section Triangle Data =====&lt;br /&gt;
This section stores &#039;&#039;&#039;T&#039;&#039;&#039; triangle entries.&lt;br /&gt;
&lt;br /&gt;
{|class=wikitable&lt;br /&gt;
! Offset !! Type !! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x00 || Triangle Entry[&#039;&#039;&#039;T&#039;&#039;&#039;] || &#039;&#039;&#039;Triangle entries&#039;&#039;&#039;.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
====== Triangle Entry ======&lt;br /&gt;
Each triangle entry is 20 bytes long.&lt;br /&gt;
&lt;br /&gt;
{|class=wikitable&lt;br /&gt;
! Offset !! Type !! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x00 || UInt16 || &#039;&#039;&#039;Texture ID&#039;&#039;&#039;.&lt;br /&gt;
|-&lt;br /&gt;
| 0x02 || UInt16[3] || {{unknown-left|&#039;&#039;&#039;Unknown&#039;&#039;&#039;. Seems to affect the collision only. Perhaps triangle normals?}}&lt;br /&gt;
|-&lt;br /&gt;
| 0x08 || Byte[4] || &#039;&#039;&#039;Vertex position indices&#039;&#039;&#039;. The index for each of the 3 vertices is 10 bits long. 2 last bits are unknown.&lt;br /&gt;
|-&lt;br /&gt;
| 0x0C || Byte[4] || &#039;&#039;&#039;UV indices&#039;&#039;&#039;. The index for each of the 3 vertices is 10 bits long. 2 last bits are unknown.&lt;br /&gt;
|-&lt;br /&gt;
| 0x10 || Byte[4] || &#039;&#039;&#039;Color indices&#039;&#039;&#039;. The index for each of the 3 vertices is 10 bits long. 2 last bits are unknown.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
===== Track Section Collision Data =====&lt;br /&gt;
4-byte data per triangle (?). &#039;&#039;TBD&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
===== Track Section Vertex Data =====&lt;br /&gt;
Vertex data is stored as 6-byte groups per entry &#039;&#039;&#039;V&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
{|class=wikitable&lt;br /&gt;
! Offset !! Type !! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x00 || Int16[3][&#039;&#039;&#039;V&#039;&#039;&#039;] || &#039;&#039;&#039;Vertex XYZ position&#039;&#039;&#039;.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
===== Track Section UV Data =====&lt;br /&gt;
UV data is stored as 4-byte groups per entry &#039;&#039;&#039;U&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
{|class=wikitable&lt;br /&gt;
! Offset !! Type !! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x00 || Int16[2][&#039;&#039;&#039;U&#039;&#039;&#039;] || &#039;&#039;&#039;Vertex UV position&#039;&#039;&#039;.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
===== Track Section Color Data =====&lt;br /&gt;
Color data is stored as 2-byte groups per entry &#039;&#039;&#039;C&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
{|class=wikitable&lt;br /&gt;
! Offset !! Type !! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x00 || UInt16[&#039;&#039;&#039;C&#039;&#039;&#039;] || &#039;&#039;&#039;RGBA5551 color&#039;&#039;&#039;.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Unknown Section 1 ==&lt;br /&gt;
&#039;&#039;TBD&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
== Culling Groups ==&lt;br /&gt;
This section includes a 4-byte or 8-byte per track section values that determine which section models are loaded when entering a specific section. Each section is represented as 1 bit.&lt;br /&gt;
&lt;br /&gt;
{|class=wikitable&lt;br /&gt;
! Offset !! Type !! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x00 || UInt16[&#039;&#039;&#039;N&#039;&#039;&#039;]/UInt32[&#039;&#039;&#039;N&#039;&#039;&#039;] || &#039;&#039;&#039;Culled model sections&#039;&#039;&#039;, represented as &#039;&#039;&#039;N&#039;&#039;&#039; bits, 1 per section, in order from the least to the most significant bit. 0 if culled, 1 if loaded.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Texture Group ==&lt;br /&gt;
See &#039;&#039;&#039;[[DKRDS Texture Group]]&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
== Unknown Section 2 ==&lt;br /&gt;
&#039;&#039;TBD&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
== Wish Race Unknown Section ==&lt;br /&gt;
This section is only used for the Wish Race tracks. &#039;&#039;TBD&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
= Tools =&lt;br /&gt;
The following tools can handle DKRDS Track:&lt;br /&gt;
* (none)&lt;br /&gt;
&lt;br /&gt;
[[Category:Diddy Kong Racing DS File Formats]]&lt;/div&gt;</summary>
		<author><name>Atlas</name></author>
	</entry>
	<entry>
		<id>https://wiki.wexosmk.xyz/index.php?title=LEV_(File_Format)&amp;diff=662</id>
		<title>LEV (File Format)</title>
		<link rel="alternate" type="text/html" href="https://wiki.wexosmk.xyz/index.php?title=LEV_(File_Format)&amp;diff=662"/>
		<updated>2026-05-18T10:39:12Z</updated>

		<summary type="html">&lt;p&gt;Atlas: /* Asset Table */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&#039;&#039;&#039;LEV&#039;&#039;&#039; (&#039;&#039;&#039;LEV&#039;&#039;&#039;el) is a file format from &#039;&#039;[https://en.wikipedia.org/wiki/Diddy_Kong_Racing_DS Diddy Kong Racing DS]&#039;&#039; that contains indexes that link to [[assets.bin]].&lt;br /&gt;
&lt;br /&gt;
= File Format =&lt;br /&gt;
The file byte order is always little endian.&lt;br /&gt;
&lt;br /&gt;
== Asset Table ==&lt;br /&gt;
The file contains two tables. The first one links all the asset IDs from assets.bin used for the level/scene. The second table links to sound effect IDs from the SDAT&#039;s SEQ_SE sequences.&lt;br /&gt;
&lt;br /&gt;
{|class=wikitable&lt;br /&gt;
|+ Format of an ID Table&lt;br /&gt;
! Offset !! Type !! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x00 || UInt16 || Number of IDs used &#039;&#039;&#039;N&#039;&#039;&#039;.&lt;br /&gt;
|-&lt;br /&gt;
| 0x00 + 2 || UInt16[&#039;&#039;&#039;N&#039;&#039;&#039;] || IDs.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
= Tools =&lt;br /&gt;
The following tools can handle LEV files:&lt;br /&gt;
* (none)&lt;br /&gt;
&lt;br /&gt;
[[Category:Diddy Kong Racing DS File Formats]]&lt;/div&gt;</summary>
		<author><name>Atlas</name></author>
	</entry>
	<entry>
		<id>https://wiki.wexosmk.xyz/index.php?title=DKRDS_Sprite_Group_(File_Format)&amp;diff=661</id>
		<title>DKRDS Sprite Group (File Format)</title>
		<link rel="alternate" type="text/html" href="https://wiki.wexosmk.xyz/index.php?title=DKRDS_Sprite_Group_(File_Format)&amp;diff=661"/>
		<updated>2026-05-17T01:01:11Z</updated>

		<summary type="html">&lt;p&gt;Atlas: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&#039;&#039;&#039;DKRDS Sprite Group&#039;&#039;&#039; is the nameless file format used in &#039;&#039;[https://en.wikipedia.org/wiki/Diddy_Kong_Racing_DS Diddy Kong Racing DS]&#039;&#039; that stores a formation of tiles and positions to create sprites. Its type identifier in [[assets.bin]] is &#039;&#039;&#039;0x00&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
== Header ==&lt;br /&gt;
The file starts with a header that is 12 bytes long.&lt;br /&gt;
&lt;br /&gt;
{|class=wikitable&lt;br /&gt;
! Offset !! Type !! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x00  || UInt16 || {{unknown-left|&#039;&#039;&#039;Unknown&#039;&#039;&#039;. Always 0?}}&lt;br /&gt;
|-&lt;br /&gt;
| 0x02 || Byte || {{unknown-left|&#039;&#039;&#039;Unknown&#039;&#039;&#039;. Number of sets? Always 1?}}&lt;br /&gt;
|-&lt;br /&gt;
| 0x03 || Byte || &#039;&#039;&#039;Format&#039;&#039;&#039;:&lt;br /&gt;
* 0 = Palette16&lt;br /&gt;
* 1 = Palette256&lt;br /&gt;
|-&lt;br /&gt;
| 0x04 || Int32 || &#039;&#039;&#039;Maximum number of blocks&#039;&#039;&#039; in this group to be rendered on the screen.&lt;br /&gt;
|-&lt;br /&gt;
| 0x08 || Int32 || &#039;&#039;&#039;[[#Tile Generator|Tile Generator]] offset&#039;&#039;&#039;. Always 0xC?&lt;br /&gt;
|-&lt;br /&gt;
| 0x0C || colspan=2 {{unknown|End of header, start of Tile Generator}}&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Tile Generator ==&lt;br /&gt;
All offsets from here on are always relative to the start of this section.&lt;br /&gt;
&lt;br /&gt;
{|class=wikitable&lt;br /&gt;
! Offset !! Type !! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x00  || UInt16 || &#039;&#039;&#039;Number of [[#Tile Set|Tile Sets]]&#039;&#039;&#039; (&#039;&#039;&#039;S&#039;&#039;&#039;).&lt;br /&gt;
|-&lt;br /&gt;
| 0x02 || UInt16 || &#039;&#039;&#039;Total number of tile texture blocks&#039;&#039;&#039;.&lt;br /&gt;
|-&lt;br /&gt;
| 0x04 || [[#Tile Set|Tile Set]][&#039;&#039;&#039;S&#039;&#039;&#039;] || &#039;&#039;&#039;Tile set entries&#039;&#039;&#039;, 8 bytes long each.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Tile Set ===&lt;br /&gt;
Each tile set links tile information blocks with tile texture data.&lt;br /&gt;
&lt;br /&gt;
{|class=wikitable&lt;br /&gt;
! Offset !! Type !! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x00  || UInt16 || &#039;&#039;&#039;[[#Tile Texture Data|Tile Texture Data]] offset&#039;&#039;&#039;.&lt;br /&gt;
|-&lt;br /&gt;
| 0x02 || UInt16 || &#039;&#039;&#039;[[#Tile Information Block|Tile Information Block]] offset&#039;&#039;&#039;.&lt;br /&gt;
|-&lt;br /&gt;
| 0x04 || UInt16 || &#039;&#039;&#039;Number of tiles&#039;&#039;&#039; (&#039;&#039;&#039;T&#039;&#039;&#039;).&lt;br /&gt;
|-&lt;br /&gt;
| 0x06 || UInt16 || &#039;&#039;&#039;Total texture data length&#039;&#039;&#039; in bytes, of all tiles in this set.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Tiles ==&lt;br /&gt;
After all tile set entries are defined, each pair of arrays, that is &#039;&#039;&#039;T&#039;&#039;&#039; tile information blocks, and then its corresponding &#039;&#039;&#039;T&#039;&#039;&#039; tile texture data chunks; are stored sequentially.&lt;br /&gt;
&lt;br /&gt;
=== Tile Information Block ===&lt;br /&gt;
Each information block is 8 bytes long and stores position and tile format data.&lt;br /&gt;
&lt;br /&gt;
{|class=wikitable&lt;br /&gt;
! Offset !! Type !! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x00  || Int16[2] || &#039;&#039;&#039;Cumulative tile XY position&#039;&#039;&#039;. The coordinates are based on the top-left corner, being the origin the previous tile&#039;s top-left pixel.&lt;br /&gt;
|-&lt;br /&gt;
| 0x04 || Byte || &#039;&#039;&#039;Number of 8x8 texture blocks&#039;&#039;&#039; for this tile.&lt;br /&gt;
|-&lt;br /&gt;
| 0x05 || Byte || &#039;&#039;&#039;Texture dimensions&#039;&#039;&#039;. Only the 4 least significant bits are taken into account:&lt;br /&gt;
* 0 = 8x8&lt;br /&gt;
* 1 = 16x16&lt;br /&gt;
* 2 = 32x32&lt;br /&gt;
* 3 = 64x64&lt;br /&gt;
* 4 = 16x8&lt;br /&gt;
* 5 = 32x8&lt;br /&gt;
* 6 = 32x16&lt;br /&gt;
* 7 = 64x32&lt;br /&gt;
* 8 = 8x16&lt;br /&gt;
* 9 = 8x32&lt;br /&gt;
* 10 = 16x32&lt;br /&gt;
* 11 = 32x64&lt;br /&gt;
|-&lt;br /&gt;
| 0x06 || UInt16 || {{unknown-left|&#039;&#039;&#039;Unknown&#039;&#039;&#039;. Padding?}}&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Tile Texture Data ===&lt;br /&gt;
Texture data is stored as swizzled 8x8 blocks. Palette data is stored in separate files.&lt;br /&gt;
&lt;br /&gt;
= Tools =&lt;br /&gt;
The following tools can handle DKRDS Sprite Group:&lt;br /&gt;
* (none)&lt;br /&gt;
&lt;br /&gt;
[[Category:Diddy Kong Racing DS File Formats]]&lt;/div&gt;</summary>
		<author><name>Atlas</name></author>
	</entry>
	<entry>
		<id>https://wiki.wexosmk.xyz/index.php?title=DKRDS_Sprite_Group_(File_Format)&amp;diff=660</id>
		<title>DKRDS Sprite Group (File Format)</title>
		<link rel="alternate" type="text/html" href="https://wiki.wexosmk.xyz/index.php?title=DKRDS_Sprite_Group_(File_Format)&amp;diff=660"/>
		<updated>2026-05-16T23:34:28Z</updated>

		<summary type="html">&lt;p&gt;Atlas: /* Tile Information Block */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&#039;&#039;&#039;DKRDS Sprite Group&#039;&#039;&#039; is the nameless file format used in &#039;&#039;[https://en.wikipedia.org/wiki/Diddy_Kong_Racing_DS Diddy Kong Racing DS]&#039;&#039; that stores a formation of tiles and positions to create sprites. Its type identifier in [[assets.bin]] is &#039;&#039;&#039;0x00&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
== Header ==&lt;br /&gt;
The file starts with a header that is 12 bytes long.&lt;br /&gt;
&lt;br /&gt;
{|class=wikitable&lt;br /&gt;
! Offset !! Type !! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x00  || UInt16 || {{unknown-left|&#039;&#039;&#039;Unknown&#039;&#039;&#039;. Always 0?}}&lt;br /&gt;
|-&lt;br /&gt;
| 0x02 || UInt16 || {{unknown-left|&#039;&#039;&#039;Unknown&#039;&#039;&#039;. Number of sets? Always 1?}}&lt;br /&gt;
|-&lt;br /&gt;
| 0x04 || Int32 || &#039;&#039;&#039;Maximum number of blocks&#039;&#039;&#039; in this group to be rendered on the screen.&lt;br /&gt;
|-&lt;br /&gt;
| 0x08 || Int32 || &#039;&#039;&#039;[[#Tile Generator|Tile Generator]] offset&#039;&#039;&#039;. Always 0xC?&lt;br /&gt;
|-&lt;br /&gt;
| 0x0C || colspan=2 {{unknown|End of header, start of Tile Generator}}&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Tile Generator ==&lt;br /&gt;
All offsets from here on are always relative to the start of this section.&lt;br /&gt;
&lt;br /&gt;
{|class=wikitable&lt;br /&gt;
! Offset !! Type !! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x00  || UInt16 || &#039;&#039;&#039;Number of [[#Tile Set|Tile Sets]]&#039;&#039;&#039; (&#039;&#039;&#039;S&#039;&#039;&#039;).&lt;br /&gt;
|-&lt;br /&gt;
| 0x02 || UInt16 || &#039;&#039;&#039;Total number of tile texture blocks&#039;&#039;&#039;.&lt;br /&gt;
|-&lt;br /&gt;
| 0x04 || [[#Tile Set|Tile Set]][&#039;&#039;&#039;S&#039;&#039;&#039;] || &#039;&#039;&#039;Tile set entries&#039;&#039;&#039;, 8 bytes long each.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Tile Set ===&lt;br /&gt;
Each tile set links tile information blocks with tile texture data.&lt;br /&gt;
&lt;br /&gt;
{|class=wikitable&lt;br /&gt;
! Offset !! Type !! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x00  || UInt16 || &#039;&#039;&#039;[[#Tile Texture Data|Tile Texture Data]] offset&#039;&#039;&#039;.&lt;br /&gt;
|-&lt;br /&gt;
| 0x02 || UInt16 || &#039;&#039;&#039;[[#Tile Information Block|Tile Information Block]] offset&#039;&#039;&#039;.&lt;br /&gt;
|-&lt;br /&gt;
| 0x04 || UInt16 || &#039;&#039;&#039;Number of tiles&#039;&#039;&#039; (&#039;&#039;&#039;T&#039;&#039;&#039;).&lt;br /&gt;
|-&lt;br /&gt;
| 0x06 || UInt16 || &#039;&#039;&#039;Total texture data length&#039;&#039;&#039; in bytes, of all tiles in this set.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Tiles ==&lt;br /&gt;
After all tile set entries are defined, each pair of arrays, that is &#039;&#039;&#039;T&#039;&#039;&#039; tile information blocks, and then its corresponding &#039;&#039;&#039;T&#039;&#039;&#039; tile texture data chunks; are stored sequentially.&lt;br /&gt;
&lt;br /&gt;
=== Tile Information Block ===&lt;br /&gt;
Each information block is 8 bytes long and stores position and tile format data.&lt;br /&gt;
&lt;br /&gt;
{|class=wikitable&lt;br /&gt;
! Offset !! Type !! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x00  || Int16[2] || &#039;&#039;&#039;Cumulative tile XY position&#039;&#039;&#039;. The coordinates are based on the top-left corner, being the origin the previous tile&#039;s top-left pixel.&lt;br /&gt;
|-&lt;br /&gt;
| 0x04 || Byte || &#039;&#039;&#039;Number of 8x8 texture blocks&#039;&#039;&#039; for this tile.&lt;br /&gt;
|-&lt;br /&gt;
| 0x05 || Byte || &#039;&#039;&#039;Texture dimensions&#039;&#039;&#039;. Only the 4 least significant bits are taken into account:&lt;br /&gt;
* 0 = 8x8&lt;br /&gt;
* 1 = 16x16&lt;br /&gt;
* 2 = 32x32&lt;br /&gt;
* 3 = 64x64&lt;br /&gt;
* 4 = 16x8&lt;br /&gt;
* 5 = 32x8&lt;br /&gt;
* 6 = 32x16&lt;br /&gt;
* 7 = 64x32&lt;br /&gt;
* 8 = 8x16&lt;br /&gt;
* 9 = 8x32&lt;br /&gt;
* 10 = 16x32&lt;br /&gt;
* 11 = 32x64&lt;br /&gt;
|-&lt;br /&gt;
| 0x06 || UInt16 || {{unknown-left|&#039;&#039;&#039;Unknown&#039;&#039;&#039;. Padding?}}&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Tile Texture Data ===&lt;br /&gt;
Texture data is stored as swizzled 8x8 blocks in 16-color palette format (4 bits per pixel). Palette data is stored in separate files.&lt;br /&gt;
&lt;br /&gt;
= Tools =&lt;br /&gt;
The following tools can handle DKRDS Sprite Group:&lt;br /&gt;
* (none)&lt;br /&gt;
&lt;br /&gt;
[[Category:Diddy Kong Racing DS File Formats]]&lt;/div&gt;</summary>
		<author><name>Atlas</name></author>
	</entry>
	<entry>
		<id>https://wiki.wexosmk.xyz/index.php?title=DKRDS_Sprite_Group_(File_Format)&amp;diff=659</id>
		<title>DKRDS Sprite Group (File Format)</title>
		<link rel="alternate" type="text/html" href="https://wiki.wexosmk.xyz/index.php?title=DKRDS_Sprite_Group_(File_Format)&amp;diff=659"/>
		<updated>2026-05-16T23:09:05Z</updated>

		<summary type="html">&lt;p&gt;Atlas: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&#039;&#039;&#039;DKRDS Sprite Group&#039;&#039;&#039; is the nameless file format used in &#039;&#039;[https://en.wikipedia.org/wiki/Diddy_Kong_Racing_DS Diddy Kong Racing DS]&#039;&#039; that stores a formation of tiles and positions to create sprites. Its type identifier in [[assets.bin]] is &#039;&#039;&#039;0x00&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
== Header ==&lt;br /&gt;
The file starts with a header that is 12 bytes long.&lt;br /&gt;
&lt;br /&gt;
{|class=wikitable&lt;br /&gt;
! Offset !! Type !! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x00  || UInt16 || {{unknown-left|&#039;&#039;&#039;Unknown&#039;&#039;&#039;. Always 0?}}&lt;br /&gt;
|-&lt;br /&gt;
| 0x02 || UInt16 || {{unknown-left|&#039;&#039;&#039;Unknown&#039;&#039;&#039;. Number of sets? Always 1?}}&lt;br /&gt;
|-&lt;br /&gt;
| 0x04 || Int32 || &#039;&#039;&#039;Maximum number of blocks&#039;&#039;&#039; in this group to be rendered on the screen.&lt;br /&gt;
|-&lt;br /&gt;
| 0x08 || Int32 || &#039;&#039;&#039;[[#Tile Generator|Tile Generator]] offset&#039;&#039;&#039;. Always 0xC?&lt;br /&gt;
|-&lt;br /&gt;
| 0x0C || colspan=2 {{unknown|End of header, start of Tile Generator}}&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Tile Generator ==&lt;br /&gt;
All offsets from here on are always relative to the start of this section.&lt;br /&gt;
&lt;br /&gt;
{|class=wikitable&lt;br /&gt;
! Offset !! Type !! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x00  || UInt16 || &#039;&#039;&#039;Number of [[#Tile Set|Tile Sets]]&#039;&#039;&#039; (&#039;&#039;&#039;S&#039;&#039;&#039;).&lt;br /&gt;
|-&lt;br /&gt;
| 0x02 || UInt16 || &#039;&#039;&#039;Total number of tile texture blocks&#039;&#039;&#039;.&lt;br /&gt;
|-&lt;br /&gt;
| 0x04 || [[#Tile Set|Tile Set]][&#039;&#039;&#039;S&#039;&#039;&#039;] || &#039;&#039;&#039;Tile set entries&#039;&#039;&#039;, 8 bytes long each.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Tile Set ===&lt;br /&gt;
Each tile set links tile information blocks with tile texture data.&lt;br /&gt;
&lt;br /&gt;
{|class=wikitable&lt;br /&gt;
! Offset !! Type !! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x00  || UInt16 || &#039;&#039;&#039;[[#Tile Texture Data|Tile Texture Data]] offset&#039;&#039;&#039;.&lt;br /&gt;
|-&lt;br /&gt;
| 0x02 || UInt16 || &#039;&#039;&#039;[[#Tile Information Block|Tile Information Block]] offset&#039;&#039;&#039;.&lt;br /&gt;
|-&lt;br /&gt;
| 0x04 || UInt16 || &#039;&#039;&#039;Number of tiles&#039;&#039;&#039; (&#039;&#039;&#039;T&#039;&#039;&#039;).&lt;br /&gt;
|-&lt;br /&gt;
| 0x06 || UInt16 || &#039;&#039;&#039;Total texture data length&#039;&#039;&#039; in bytes, of all tiles in this set.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Tiles ==&lt;br /&gt;
After all tile set entries are defined, each pair of arrays, that is &#039;&#039;&#039;T&#039;&#039;&#039; tile information blocks, and then its corresponding &#039;&#039;&#039;T&#039;&#039;&#039; tile texture data chunks; are stored sequentially.&lt;br /&gt;
&lt;br /&gt;
=== Tile Information Block ===&lt;br /&gt;
Each information block is 8 bytes long and stores position and tile format data.&lt;br /&gt;
&lt;br /&gt;
{|class=wikitable&lt;br /&gt;
! Offset !! Type !! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x00  || Int16 || &#039;&#039;&#039;Tile X position&#039;&#039;&#039;.&lt;br /&gt;
|-&lt;br /&gt;
| 0x02 || Int16 || &#039;&#039;&#039;Tile Y position&#039;&#039;&#039;.&lt;br /&gt;
|-&lt;br /&gt;
| 0x04 || Byte || &#039;&#039;&#039;Number of 8x8 texture blocks&#039;&#039;&#039; for this tile.&lt;br /&gt;
|-&lt;br /&gt;
| 0x05 || Byte || &#039;&#039;&#039;Texture dimensions&#039;&#039;&#039;. Only the 4 least significant bits are taken into account:&lt;br /&gt;
* 0 = 8x8&lt;br /&gt;
* 1 = 16x16&lt;br /&gt;
* 2 = 32x32&lt;br /&gt;
* 3 = 64x64&lt;br /&gt;
* 4 = 16x8&lt;br /&gt;
* 5 = 32x8&lt;br /&gt;
* 6 = 32x16&lt;br /&gt;
* 7 = 64x32&lt;br /&gt;
* 8 = 8x16&lt;br /&gt;
* 9 = 8x32&lt;br /&gt;
* 10 = 16x32&lt;br /&gt;
* 11 = 32x64&lt;br /&gt;
|-&lt;br /&gt;
| 0x06 || UInt16 || {{unknown-left|&#039;&#039;&#039;Unknown&#039;&#039;&#039;. Padding?}}&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Tile Texture Data ===&lt;br /&gt;
Texture data is stored as swizzled 8x8 blocks in 16-color palette format (4 bits per pixel). Palette data is stored in separate files.&lt;br /&gt;
&lt;br /&gt;
= Tools =&lt;br /&gt;
The following tools can handle DKRDS Sprite Group:&lt;br /&gt;
* (none)&lt;br /&gt;
&lt;br /&gt;
[[Category:Diddy Kong Racing DS File Formats]]&lt;/div&gt;</summary>
		<author><name>Atlas</name></author>
	</entry>
</feed>