<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://hedgedocs.com/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Hyper</id>
	<title>HedgeDocs - User contributions [en]</title>
	<link rel="self" type="application/atom+xml" href="https://hedgedocs.com/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Hyper"/>
	<link rel="alternate" type="text/html" href="https://hedgedocs.com/index.php/Special:Contributions/Hyper"/>
	<updated>2026-04-13T16:35:13Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.43.0</generator>
	<entry>
		<id>https://hedgedocs.com/index.php?title=Documentation&amp;diff=1411</id>
		<title>Documentation</title>
		<link rel="alternate" type="text/html" href="https://hedgedocs.com/index.php?title=Documentation&amp;diff=1411"/>
		<updated>2026-04-12T02:34:25Z</updated>

		<summary type="html">&lt;p&gt;Hyper: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This section lists documentation pages for resources you&#039;ll find in Sonic games. You&#039;ll find information about certain file formats and other general game resources.&lt;br /&gt;
&lt;br /&gt;
== Rendering ==&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+&lt;br /&gt;
!Name&lt;br /&gt;
!Info&lt;br /&gt;
|-&lt;br /&gt;
| [[Normal mapping]]&lt;br /&gt;
| How normal mapping works&lt;br /&gt;
|-&lt;br /&gt;
| [[Vertex Colors]]&lt;br /&gt;
| How vertex colors work&lt;br /&gt;
|-&lt;br /&gt;
| [[Mesh Layers]]&lt;br /&gt;
| Model mesh layers&lt;br /&gt;
|-&lt;br /&gt;
| [[Opacity]]&lt;br /&gt;
| The concept of opacity explained&lt;br /&gt;
|- &lt;br /&gt;
| [[Texture Blending]]&lt;br /&gt;
| The different ways to blend textures&lt;br /&gt;
|-&lt;br /&gt;
!&lt;br /&gt;
!&lt;br /&gt;
|-&lt;br /&gt;
|[[Hedgehog Engine Rendering|Hedgehog Engine]]&lt;br /&gt;
|Engine first used in Sonic Unleashed&lt;br /&gt;
|-&lt;br /&gt;
|[[Hedgehog Engine 2 Rendering|Hedgehog Engine 2]]&lt;br /&gt;
|Engine first used in Sonic Forces&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Models ==&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+&lt;br /&gt;
!Name&lt;br /&gt;
!Info&lt;br /&gt;
!Extension&lt;br /&gt;
!Tools&lt;br /&gt;
|-&lt;br /&gt;
|[[SCA Parameters]]&lt;br /&gt;
|Model and material parameters stored in SCA file headers&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Shaders ==&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+&lt;br /&gt;
!Name&lt;br /&gt;
!Info&lt;br /&gt;
!Extension&lt;br /&gt;
!Tools&lt;br /&gt;
|-&lt;br /&gt;
|[[Shader Features]]&lt;br /&gt;
|Hedgehog engine 1 shader features&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Set-Data ==&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+&lt;br /&gt;
!Name&lt;br /&gt;
!Description&lt;br /&gt;
!Extension&lt;br /&gt;
!Tools&lt;br /&gt;
|-&lt;br /&gt;
|[[HSON Format|HSON]] (Hedgehog Set Object Notation)&lt;br /&gt;
|Universal object placement representation format.&lt;br /&gt;
|&amp;lt;code&amp;gt;.hson&amp;lt;/code&amp;gt;&lt;br /&gt;
|&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== User Interface ==&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+&lt;br /&gt;
!Name&lt;br /&gt;
!Description&lt;br /&gt;
!Extension&lt;br /&gt;
!Tools&lt;br /&gt;
|-&lt;br /&gt;
|[[NCP File Format|NCP]] (Ninja CellSpriteDraw Project)&lt;br /&gt;
|Describes a user interface in most Hedgehog Engine games.&lt;br /&gt;
|&amp;lt;span style=&amp;quot;text-align: center&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;&amp;lt;code&amp;gt;.xncp&amp;lt;/code&amp;gt;&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;&amp;lt;code&amp;gt;.yncp&amp;lt;/code&amp;gt;&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;&amp;lt;code&amp;gt;.gncp&amp;lt;/code&amp;gt;&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;&amp;lt;code&amp;gt;.sncp&amp;lt;/code&amp;gt;&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;/span&amp;gt;&lt;br /&gt;
|&lt;br /&gt;
* [[Kunai]]&lt;br /&gt;
* [[Shuriken]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Archives ==&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!Name&lt;br /&gt;
!Description&lt;br /&gt;
!Extension&lt;br /&gt;
!Tools&lt;br /&gt;
|-&lt;br /&gt;
|[[Binary Resource]]&lt;br /&gt;
|Generic container format used for storing chunks of binary data.&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|[[NN Chunk Format|NN Chunk]]&lt;br /&gt;
|Generic container format used for storing SEGA NN binary data.&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|[[U8 Archive]]&lt;br /&gt;
|Hierarchical archive format.&lt;br /&gt;
|&amp;lt;code&amp;gt;.arc&amp;lt;/code&amp;gt;&lt;br /&gt;
|&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Animation ==&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+&lt;br /&gt;
!Name&lt;br /&gt;
!Description&lt;br /&gt;
!Extension&lt;br /&gt;
!Tools&lt;br /&gt;
|-&lt;br /&gt;
|[[PXD|PXD Animation]]&lt;br /&gt;
|Skeleton and skeletal animation format in Hedgehog Engine 2 Games&lt;br /&gt;
|&amp;lt;span style=&amp;quot;text-align: center&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;&amp;lt;code&amp;gt;.anm.pxd&amp;lt;/code&amp;gt;&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;&amp;lt;code&amp;gt;.skl.pxd&amp;lt;/code&amp;gt;&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;/span&amp;gt;&lt;br /&gt;
|[[Frontiers Animation Tools]]&lt;br /&gt;
|-&lt;br /&gt;
|[[PBA|PBA Skeleton]]&lt;br /&gt;
|Physics Based Animation Skeleton for Hedgehog Engine 2 Games&lt;br /&gt;
|&amp;lt;code&amp;gt;.pba&amp;lt;/code&amp;gt;&lt;br /&gt;
|&lt;br /&gt;
|}&lt;/div&gt;</summary>
		<author><name>Hyper</name></author>
	</entry>
	<entry>
		<id>https://hedgedocs.com/index.php?title=Text_Font_Picture&amp;diff=1380</id>
		<title>Text Font Picture</title>
		<link rel="alternate" type="text/html" href="https://hedgedocs.com/index.php?title=Text_Font_Picture&amp;diff=1380"/>
		<updated>2025-12-04T20:50:05Z</updated>

		<summary type="html">&lt;p&gt;Hyper: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&#039;&#039;&#039;&#039;&#039;Text Font Picture&#039;&#039;&#039;&#039;&#039; is a file format used in [[Sonic the Hedgehog (2006)]] for defining images for picture variables in the [[Text Book]] format.&lt;br /&gt;
&lt;br /&gt;
This file format consists of an array of bounding boxes (known as &amp;quot;crops&amp;quot; officially) with names that can be used in the picture variable for the &#039;&#039;&#039;Text Book&#039;&#039;&#039; format.&lt;br /&gt;
&lt;br /&gt;
This file is located at &amp;lt;code&amp;gt;./{[[Sonic the Hedgehog (2006) File System#Platform Root|platform_root]]}/archives/text.arc/{platform_root}/text/picture.pft&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
== Specification ==&lt;br /&gt;
&#039;&#039;&#039;Text Font Picture&#039;&#039;&#039; uses a [[Binary Resource]] container.&lt;br /&gt;
&lt;br /&gt;
=== Header ===&lt;br /&gt;
The header consists of the following data structure:&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+Length: 0x10&lt;br /&gt;
!Offset&lt;br /&gt;
!Type&lt;br /&gt;
!Name&lt;br /&gt;
!Description&lt;br /&gt;
|-&lt;br /&gt;
|0x00&lt;br /&gt;
|Char[4]&lt;br /&gt;
|Signature&lt;br /&gt;
|Always &amp;quot;FNTP&amp;quot;.&lt;br /&gt;
|-&lt;br /&gt;
|0x04&lt;br /&gt;
|UInt32&lt;br /&gt;
|TexturePathOffset&lt;br /&gt;
|The offset of the path to the texture the crops pertain to.&lt;br /&gt;
|-&lt;br /&gt;
|0x08&lt;br /&gt;
|UInt32&lt;br /&gt;
|CropCount&lt;br /&gt;
|The number of crops in the texture.&lt;br /&gt;
|-&lt;br /&gt;
|0x0C&lt;br /&gt;
|UInt32&lt;br /&gt;
|CropTableOffset&lt;br /&gt;
|The offset of the crop table.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Crop ===&lt;br /&gt;
Each crop in the table consists of the following data structure:&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+Length: 0x0C&lt;br /&gt;
!Offset&lt;br /&gt;
!Type&lt;br /&gt;
!Name&lt;br /&gt;
!Description&lt;br /&gt;
|-&lt;br /&gt;
|0x00&lt;br /&gt;
|UInt32&lt;br /&gt;
|NameOffset&lt;br /&gt;
|The offset of the name of this crop.&lt;br /&gt;
|-&lt;br /&gt;
|0x04&lt;br /&gt;
|UInt16&lt;br /&gt;
|X&lt;br /&gt;
|The X position of this crop.&lt;br /&gt;
|-&lt;br /&gt;
|0x06&lt;br /&gt;
|UInt16&lt;br /&gt;
|Y&lt;br /&gt;
|The Y position of this crop.&lt;br /&gt;
|-&lt;br /&gt;
|0x08&lt;br /&gt;
|UInt16&lt;br /&gt;
|Width&lt;br /&gt;
|The width of this crop.&lt;br /&gt;
|-&lt;br /&gt;
|0x0A&lt;br /&gt;
|UInt16&lt;br /&gt;
|Height&lt;br /&gt;
|The height of this crop.&lt;br /&gt;
|}&lt;br /&gt;
[[Category:File Formats]]&lt;/div&gt;</summary>
		<author><name>Hyper</name></author>
	</entry>
	<entry>
		<id>https://hedgedocs.com/index.php?title=Text_Font_Map&amp;diff=1379</id>
		<title>Text Font Map</title>
		<link rel="alternate" type="text/html" href="https://hedgedocs.com/index.php?title=Text_Font_Map&amp;diff=1379"/>
		<updated>2025-12-04T20:49:55Z</updated>

		<summary type="html">&lt;p&gt;Hyper: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&#039;&#039;&#039;&#039;&#039;Text Font Map&#039;&#039;&#039;&#039;&#039; is a file format used in [[Sonic the Hedgehog (2006)]] for storing font character information.&lt;br /&gt;
&lt;br /&gt;
These files are located in &amp;lt;code&amp;gt;text.arc&amp;lt;/code&amp;gt; under the &amp;lt;code&amp;gt;./text/&amp;lt;/code&amp;gt; directory from [[Sonic the Hedgehog (2006) File System#Platform Root|platform root]] as &amp;lt;code&amp;gt;*.ftm&amp;lt;/code&amp;gt; files.&lt;br /&gt;
&lt;br /&gt;
== Specification ==&lt;br /&gt;
&#039;&#039;&#039;Text Font Map&#039;&#039;&#039; uses a [[Binary Resource]] container.&lt;br /&gt;
&lt;br /&gt;
=== Header ===&lt;br /&gt;
The header consists of the following data structure:&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+Length: 0x14&lt;br /&gt;
!Offset&lt;br /&gt;
!Type&lt;br /&gt;
!Name&lt;br /&gt;
!Description&lt;br /&gt;
|-&lt;br /&gt;
|0x00&lt;br /&gt;
|Char[4]&lt;br /&gt;
|Signature&lt;br /&gt;
|Always &amp;quot;FNTM&amp;quot;.&lt;br /&gt;
|-&lt;br /&gt;
|0x04&lt;br /&gt;
|UInt32&lt;br /&gt;
|CodePageCount&lt;br /&gt;
|The number of code pages mapped in this font.&lt;br /&gt;
This is a zero-based count, so 0 = 1.&lt;br /&gt;
|-&lt;br /&gt;
|0x08&lt;br /&gt;
|UInt32&lt;br /&gt;
|CodePageTableOffset&lt;br /&gt;
|The offset of the table of code page offsets.&lt;br /&gt;
|-&lt;br /&gt;
|0x0C&lt;br /&gt;
|Byte&lt;br /&gt;
|Columns&lt;br /&gt;
|The number of columns in the font atlas.&lt;br /&gt;
This field is not used by the game. See [[Text Font Map#Static Font Data|Static Font Data]].&lt;br /&gt;
|-&lt;br /&gt;
|0x0D&lt;br /&gt;
|Byte&lt;br /&gt;
|Rows&lt;br /&gt;
|The number of rows in the font atlas.&lt;br /&gt;
This field is not used by the game. See [[Text Font Map#Static Font Data|Static Font Data]].&lt;br /&gt;
|-&lt;br /&gt;
|0x0E&lt;br /&gt;
|UInt16&lt;br /&gt;
|N/A&lt;br /&gt;
|Unknown. Always 1.&lt;br /&gt;
|-&lt;br /&gt;
|0x10&lt;br /&gt;
|UInt32&lt;br /&gt;
|FontNameOffset&lt;br /&gt;
|The offset of the name of this font.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Code Page Table ===&lt;br /&gt;
The code page table is an indirection table with a fixed size of 256 elements.&lt;br /&gt;
&lt;br /&gt;
Each element is a 32-bit offset that points to a fixed 256 element page of characters in Unicode. These characters consist of cell information and flags that map to the font atlas texture.&lt;br /&gt;
&lt;br /&gt;
=== Character ===&lt;br /&gt;
Each character is stored as the following data structure:&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+Length: 0x04&lt;br /&gt;
!Offset&lt;br /&gt;
!Type&lt;br /&gt;
!Name&lt;br /&gt;
!Description&lt;br /&gt;
|-&lt;br /&gt;
|0x00&lt;br /&gt;
|Byte&lt;br /&gt;
|Column&lt;br /&gt;
|The column of this character cell in the font atlas texture.&lt;br /&gt;
|-&lt;br /&gt;
|0x01&lt;br /&gt;
|Byte&lt;br /&gt;
|Row&lt;br /&gt;
|The row of this character cell in the font atlas texture.&lt;br /&gt;
|-&lt;br /&gt;
|0x02&lt;br /&gt;
|UInt16&lt;br /&gt;
|Flags&lt;br /&gt;
|The flags for this character.&lt;br /&gt;
If &amp;lt;code&amp;gt;0xFFFF&amp;lt;/code&amp;gt;, this character will be unset.&lt;br /&gt;
|}&lt;br /&gt;
To get the Unicode character this element pertains to, use the following expression:&amp;lt;syntaxhighlight lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Character = (CodePageIndex &amp;lt;&amp;lt; 8) | CharacterIndex&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Static Font Data ===&lt;br /&gt;
The game stores the last remaining font information in a static array in the executable.&lt;br /&gt;
&lt;br /&gt;
The array can be found at the following addresses:&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+&lt;br /&gt;
!Platform&lt;br /&gt;
!File&lt;br /&gt;
!Virtual Address&lt;br /&gt;
!Physical Address&lt;br /&gt;
|-&lt;br /&gt;
|Xbox 360&lt;br /&gt;
|&amp;lt;code&amp;gt;default.xex&amp;lt;/code&amp;gt;&lt;br /&gt;
|&amp;lt;code&amp;gt;0x82B7F860&amp;lt;/code&amp;gt;&lt;br /&gt;
|&amp;lt;code&amp;gt;0xB82860&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|PlayStation 3&lt;br /&gt;
|&amp;lt;code&amp;gt;EBOOT.BIN&amp;lt;/code&amp;gt;&lt;br /&gt;
|&amp;lt;code&amp;gt;0x100DDA20&amp;lt;/code&amp;gt;&lt;br /&gt;
|&amp;lt;code&amp;gt;0x178DA20&amp;lt;/code&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
The array consists of three elements of the following data structure:&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+Length: 0x1C&lt;br /&gt;
!Offset&lt;br /&gt;
!Type&lt;br /&gt;
!Name&lt;br /&gt;
!Description&lt;br /&gt;
|-&lt;br /&gt;
|0x00&lt;br /&gt;
|uint32_t&lt;br /&gt;
|ID&lt;br /&gt;
|The ID of this font.&lt;br /&gt;
|-&lt;br /&gt;
|0x04&lt;br /&gt;
|const char*&lt;br /&gt;
|pTexturePath&lt;br /&gt;
|A pointer to the path to the font atlas texture.&lt;br /&gt;
|-&lt;br /&gt;
|0x08&lt;br /&gt;
|uint16_t&lt;br /&gt;
|TextureWidth&lt;br /&gt;
|The width of the font atlas texture.&lt;br /&gt;
|-&lt;br /&gt;
|0x0A&lt;br /&gt;
|uint16_t&lt;br /&gt;
|TextureHeight&lt;br /&gt;
|The height of the font atlas texture.&lt;br /&gt;
|-&lt;br /&gt;
|0x0C&lt;br /&gt;
|const char*&lt;br /&gt;
|pTextFontMapPath&lt;br /&gt;
|A pointer to the path to the &#039;&#039;&#039;Text&#039;&#039;&#039; &#039;&#039;&#039;Font Map&#039;&#039;&#039; for this font.&lt;br /&gt;
|-&lt;br /&gt;
|0x10&lt;br /&gt;
|const char*&lt;br /&gt;
|pTextFontProportionPath&lt;br /&gt;
|A pointer to the path to the &#039;&#039;&#039;Text Font Proportion&#039;&#039;&#039; for this font.&lt;br /&gt;
|-&lt;br /&gt;
|0x14&lt;br /&gt;
|const char*&lt;br /&gt;
|pTextFontPicturePath&lt;br /&gt;
|A pointer to the path to the [[Text Font Picture]] for this font.&lt;br /&gt;
If non-applicable, this should be null.&lt;br /&gt;
|-&lt;br /&gt;
|0x18&lt;br /&gt;
|uint16_t&lt;br /&gt;
|CellWidth&lt;br /&gt;
|The width of each character cell in the font atlas texture.&lt;br /&gt;
|-&lt;br /&gt;
|0x1A&lt;br /&gt;
|uint16_t&lt;br /&gt;
|CellHeight&lt;br /&gt;
|The height of each character cell in the font atlas texture.&lt;br /&gt;
|}&lt;br /&gt;
[[Category:File Formats]]&lt;/div&gt;</summary>
		<author><name>Hyper</name></author>
	</entry>
	<entry>
		<id>https://hedgedocs.com/index.php?title=Text_Book&amp;diff=1378</id>
		<title>Text Book</title>
		<link rel="alternate" type="text/html" href="https://hedgedocs.com/index.php?title=Text_Book&amp;diff=1378"/>
		<updated>2025-12-04T20:46:56Z</updated>

		<summary type="html">&lt;p&gt;Hyper: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&#039;&#039;&#039;&#039;&#039;Text Book&#039;&#039;&#039;&#039;&#039; is a file format used in [[Sonic the Hedgehog (2006)]] for storing text with friendly names and variables.&lt;br /&gt;
&lt;br /&gt;
These files are located in &amp;lt;code&amp;gt;cache.arc&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;text.arc&amp;lt;/code&amp;gt; under the &amp;lt;code&amp;gt;./text/&amp;lt;/code&amp;gt; directory from [[Sonic the Hedgehog (2006) File System#Platform Root|platform root]] as &amp;lt;code&amp;gt;*.mst&amp;lt;/code&amp;gt; files.&lt;br /&gt;
&lt;br /&gt;
== Specification ==&lt;br /&gt;
&#039;&#039;&#039;Text Book&#039;&#039;&#039; uses a [[Binary Resource]] container. The text to be displayed is encoded as UTF-16, whereas the names and variables are encoded as Shift-JIS.&lt;br /&gt;
&lt;br /&gt;
=== Header ===&lt;br /&gt;
The header consists of the following data structure:&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+Length: 0x0C&lt;br /&gt;
!Offset&lt;br /&gt;
!Type&lt;br /&gt;
!Name&lt;br /&gt;
!Description&lt;br /&gt;
|-&lt;br /&gt;
|0x00&lt;br /&gt;
|Char[4]&lt;br /&gt;
|Signature&lt;br /&gt;
|Always &amp;quot;WTXT&amp;quot; (referring to UTF-16).&lt;br /&gt;
|-&lt;br /&gt;
|0x04&lt;br /&gt;
|UInt32&lt;br /&gt;
|NameOffset&lt;br /&gt;
|The offset of the name of this &#039;&#039;&#039;Text Book&#039;&#039;&#039;.&lt;br /&gt;
|-&lt;br /&gt;
|0x08&lt;br /&gt;
|UInt32&lt;br /&gt;
|CardCount&lt;br /&gt;
|The total number of &#039;&#039;&#039;Text Cards&#039;&#039;&#039; in this &#039;&#039;&#039;Text Book&#039;&#039;&#039;.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Text Card ===&lt;br /&gt;
Text Cards consist of the following data structure:&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+Length: 0x0C&lt;br /&gt;
!Offset&lt;br /&gt;
!Type&lt;br /&gt;
!Name&lt;br /&gt;
!Description&lt;br /&gt;
|-&lt;br /&gt;
|0x00&lt;br /&gt;
|UInt32&lt;br /&gt;
|NameOffset&lt;br /&gt;
|The offset of the name of this &#039;&#039;&#039;Text Card&#039;&#039;&#039;.&lt;br /&gt;
|-&lt;br /&gt;
|0x04&lt;br /&gt;
|UInt32&lt;br /&gt;
|TextOffset&lt;br /&gt;
|The offset of the UTF-16 text for this &#039;&#039;&#039;Text Card&#039;&#039;&#039;.&lt;br /&gt;
|-&lt;br /&gt;
|0x08&lt;br /&gt;
|UInt32&lt;br /&gt;
|VariablesOffset&lt;br /&gt;
|The offset of the variables for this &#039;&#039;&#039;Text Card&#039;&#039;&#039;.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Variables ==&lt;br /&gt;
Variables are stored as comma-separated values, there should be one for each &#039;$&#039; character in the actual text to be displayed.&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+&lt;br /&gt;
!Variable&lt;br /&gt;
!Parameters&lt;br /&gt;
!Description&lt;br /&gt;
|-&lt;br /&gt;
|blue&lt;br /&gt;
|None&lt;br /&gt;
|Once encountered, starts colouring characters blue. &amp;lt;span title=&amp;quot;#00C6C6&amp;quot; style=&amp;quot;display: inline-block; width: 12px; height: 12px; background: #00C6C6; margin: 0 4px; vertical-align: middle;&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|color&lt;br /&gt;
|None&lt;br /&gt;
|Once encountered, starts colouring characters white. &amp;lt;span title=&amp;quot;#FFFFFF&amp;quot; style=&amp;quot;display: inline-block; width: 12px; height: 12px; background: #FFFFFF; margin: 0 4px; vertical-align: middle;&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|color!&lt;br /&gt;
|None&lt;br /&gt;
|Once encountered, starts colouring characters yellow. &amp;lt;span title=&amp;quot;#FFC658&amp;quot; style=&amp;quot;display: inline-block; width: 12px; height: 12px; background: #FFC658; margin: 0 4px; vertical-align: middle;&amp;quot;&amp;gt;&amp;lt;/span&amp;gt; Presumably this is meant as the &amp;quot;warning&amp;quot; colour, hence the exclamation mark.&lt;br /&gt;
|-&lt;br /&gt;
|gray&lt;br /&gt;
|None&lt;br /&gt;
|Once encountered, starts colouring characters grey. &amp;lt;span title=&amp;quot;#737373&amp;quot; style=&amp;quot;display: inline-block; width: 12px; height: 12px; background: #737373; margin: 0 4px; vertical-align: middle;&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|green&lt;br /&gt;
|None&lt;br /&gt;
|Once encountered, starts colouring characters green. &amp;lt;span title=&amp;quot;#58FF8E&amp;quot; style=&amp;quot;display: inline-block; width: 12px; height: 12px; background: #58FF8E; margin: 0 4px; vertical-align: middle;&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|picture&lt;br /&gt;
|String&lt;br /&gt;
|Once encountered, draws the specified picture defined in the game&#039;s [[Text Font Picture]] file.&lt;br /&gt;
|-&lt;br /&gt;
|red&lt;br /&gt;
|None&lt;br /&gt;
|Once encountered, starts colouring characters red. &amp;lt;span title=&amp;quot;#FD5858&amp;quot; style=&amp;quot;display: inline-block; width: 12px; height: 12px; background: #FD5858; margin: 0 4px; vertical-align: middle;&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|rgba&lt;br /&gt;
|Byte, Byte, Byte&lt;br /&gt;
|Once encountered, starts colouring characters the specified colour. Despite the name, this does not support setting the alpha colour of the text.&lt;br /&gt;
|-&lt;br /&gt;
|sound&lt;br /&gt;
|String&lt;br /&gt;
|Once encountered, plays the specified sound effect if the &#039;&#039;&#039;Sound Bank&#039;&#039;&#039; containing it is loaded.&lt;br /&gt;
|-&lt;br /&gt;
|text&lt;br /&gt;
|Unknown&lt;br /&gt;
|Unknown.&lt;br /&gt;
|-&lt;br /&gt;
|value&lt;br /&gt;
|Unknown&lt;br /&gt;
|Unknown.&lt;br /&gt;
|-&lt;br /&gt;
|yellow&lt;br /&gt;
|None&lt;br /&gt;
|Once encountered, starts colouring characters yellow. &amp;lt;span title=&amp;quot;#FCC658&amp;quot; style=&amp;quot;display: inline-block; width: 12px; height: 12px; background: #FCC658; margin: 0 4px; vertical-align: middle;&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{{Notice|type=example|content=&lt;br /&gt;
With the following text:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
$The quick $brown$ fox jumps over the $lazy$ dog.\nPress the $ button to continue.&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
And the following variables:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
sound(all01_a00_sn),rgba(127,51,0),color,red,color,picture(button_a)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
The game should first play the sound &amp;lt;code&amp;gt;all01_a00_sn&amp;lt;/code&amp;gt;, then draw something akin to the following text:&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-code&amp;quot; style=&amp;quot;display: flex; align-items: center; margin: 20px 0 0 0; background-color: var(--hedgedocs-frame-bg-color); border-color: var(--hedgedocs-base-border-color);&amp;quot;&amp;gt;&lt;br /&gt;
The quick &amp;lt;span style=&amp;quot;color:#7F3300;&amp;quot;&amp;gt;brown&amp;lt;/span&amp;gt; fox jumps over the &amp;lt;span style=&amp;quot;color:#FD5858;&amp;quot;&amp;gt;lazy&amp;lt;/span&amp;gt; dog.&lt;br /&gt;
Press the &amp;lt;span style=&amp;quot;color:#58FF8E;&amp;quot;&amp;gt;&#039;&#039;&#039;Ⓐ&#039;&#039;&#039;&amp;lt;/span&amp;gt; button to continue.&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
[[Category:File Formats]]&lt;/div&gt;</summary>
		<author><name>Hyper</name></author>
	</entry>
	<entry>
		<id>https://hedgedocs.com/index.php?title=Text_Font_Map&amp;diff=1377</id>
		<title>Text Font Map</title>
		<link rel="alternate" type="text/html" href="https://hedgedocs.com/index.php?title=Text_Font_Map&amp;diff=1377"/>
		<updated>2025-12-04T20:46:26Z</updated>

		<summary type="html">&lt;p&gt;Hyper: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&#039;&#039;&#039;&#039;&#039;Text Font Map&#039;&#039;&#039;&#039;&#039; is a file format used in [[Sonic the Hedgehog (2006)]] for storing font character information.&lt;br /&gt;
&lt;br /&gt;
These files are located in &amp;lt;code&amp;gt;text.arc&amp;lt;/code&amp;gt; under the &amp;lt;code&amp;gt;./text/&amp;lt;/code&amp;gt; directory from [[Sonic the Hedgehog (2006) File System#Platform Root|platform root]] as &amp;lt;code&amp;gt;*.ftm&amp;lt;/code&amp;gt; files.&lt;br /&gt;
&lt;br /&gt;
== Specification ==&lt;br /&gt;
&#039;&#039;&#039;Text Font Map&#039;&#039;&#039; uses a [[Binary Resource]] container.&lt;br /&gt;
&lt;br /&gt;
=== Header ===&lt;br /&gt;
The header consists of the following data structure:&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+Length: 0x14&lt;br /&gt;
!Offset&lt;br /&gt;
!Type&lt;br /&gt;
!Name&lt;br /&gt;
!Description&lt;br /&gt;
|-&lt;br /&gt;
|0x00&lt;br /&gt;
|Char[4]&lt;br /&gt;
|Signature&lt;br /&gt;
|Always &amp;quot;FNTM&amp;quot;.&lt;br /&gt;
|-&lt;br /&gt;
|0x04&lt;br /&gt;
|UInt32&lt;br /&gt;
|CodePageCount&lt;br /&gt;
|The number of code pages mapped in this font.&lt;br /&gt;
This is a zero-based count, so 0 = 1.&lt;br /&gt;
|-&lt;br /&gt;
|0x08&lt;br /&gt;
|UInt32&lt;br /&gt;
|CodePageTableOffset&lt;br /&gt;
|The offset of the table of code page offsets.&lt;br /&gt;
|-&lt;br /&gt;
|0x0C&lt;br /&gt;
|Byte&lt;br /&gt;
|Columns&lt;br /&gt;
|The number of columns in the font atlas.&lt;br /&gt;
This field is not used by the game. See [[Text Font Map#Static Font Data|Static Font Data]].&lt;br /&gt;
|-&lt;br /&gt;
|0x0D&lt;br /&gt;
|Byte&lt;br /&gt;
|Rows&lt;br /&gt;
|The number of rows in the font atlas.&lt;br /&gt;
This field is not used by the game. See [[Text Font Map#Static Font Data|Static Font Data]].&lt;br /&gt;
|-&lt;br /&gt;
|0x0E&lt;br /&gt;
|UInt16&lt;br /&gt;
|N/A&lt;br /&gt;
|Unknown. Always 1.&lt;br /&gt;
|-&lt;br /&gt;
|0x10&lt;br /&gt;
|UInt32&lt;br /&gt;
|FontNameOffset&lt;br /&gt;
|The offset of the name of this font.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Code Page Table ===&lt;br /&gt;
The code page table is an indirection table with a fixed size of 256 elements.&lt;br /&gt;
&lt;br /&gt;
Each element is a 32-bit offset that points to a fixed 256 element page of characters in Unicode. These characters consist of cell information and flags that map to the font atlas texture.&lt;br /&gt;
&lt;br /&gt;
=== Character ===&lt;br /&gt;
Each character is stored as the following data structure:&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+Length: 0x04&lt;br /&gt;
!Offset&lt;br /&gt;
!Type&lt;br /&gt;
!Name&lt;br /&gt;
!Description&lt;br /&gt;
|-&lt;br /&gt;
|0x00&lt;br /&gt;
|Byte&lt;br /&gt;
|Column&lt;br /&gt;
|The column of this character cell in the font atlas texture.&lt;br /&gt;
|-&lt;br /&gt;
|0x01&lt;br /&gt;
|Byte&lt;br /&gt;
|Row&lt;br /&gt;
|The row of this character cell in the font atlas texture.&lt;br /&gt;
|-&lt;br /&gt;
|0x02&lt;br /&gt;
|UInt16&lt;br /&gt;
|Flags&lt;br /&gt;
|The flags for this character.&lt;br /&gt;
If &amp;lt;code&amp;gt;0xFFFF&amp;lt;/code&amp;gt;, this character will be unset.&lt;br /&gt;
|}&lt;br /&gt;
To get the Unicode character this element pertains to, use the following expression:&amp;lt;syntaxhighlight lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Character = (CodePageIndex &amp;lt;&amp;lt; 8) | CharacterIndex&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Static Font Data ===&lt;br /&gt;
The game stores the last remaining font information in a static array in the executable.&lt;br /&gt;
&lt;br /&gt;
The array can be found at the following addresses:&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+&lt;br /&gt;
!Platform&lt;br /&gt;
!File&lt;br /&gt;
!Virtual Address&lt;br /&gt;
!Physical Address&lt;br /&gt;
|-&lt;br /&gt;
|Xbox 360&lt;br /&gt;
|&amp;lt;code&amp;gt;default.xex&amp;lt;/code&amp;gt;&lt;br /&gt;
|&amp;lt;code&amp;gt;0x82B7F860&amp;lt;/code&amp;gt;&lt;br /&gt;
|&amp;lt;code&amp;gt;0xB82860&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|PlayStation 3&lt;br /&gt;
|&amp;lt;code&amp;gt;EBOOT.BIN&amp;lt;/code&amp;gt;&lt;br /&gt;
|&amp;lt;code&amp;gt;0x100DDA20&amp;lt;/code&amp;gt;&lt;br /&gt;
|&amp;lt;code&amp;gt;0x178DA20&amp;lt;/code&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
The array consists of three elements of the following data structure:&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+Length: 0x1C&lt;br /&gt;
!Offset&lt;br /&gt;
!Type&lt;br /&gt;
!Name&lt;br /&gt;
!Description&lt;br /&gt;
|-&lt;br /&gt;
|0x00&lt;br /&gt;
|uint32_t&lt;br /&gt;
|ID&lt;br /&gt;
|The ID of this font.&lt;br /&gt;
|-&lt;br /&gt;
|0x04&lt;br /&gt;
|const char*&lt;br /&gt;
|pTexturePath&lt;br /&gt;
|A pointer to the path to the font atlas texture.&lt;br /&gt;
|-&lt;br /&gt;
|0x08&lt;br /&gt;
|uint16_t&lt;br /&gt;
|TextureWidth&lt;br /&gt;
|The width of the font atlas texture.&lt;br /&gt;
|-&lt;br /&gt;
|0x0A&lt;br /&gt;
|uint16_t&lt;br /&gt;
|TextureHeight&lt;br /&gt;
|The height of the font atlas texture.&lt;br /&gt;
|-&lt;br /&gt;
|0x0C&lt;br /&gt;
|const char*&lt;br /&gt;
|pTextFontMapPath&lt;br /&gt;
|A pointer to the path to the &#039;&#039;&#039;Text&#039;&#039;&#039; &#039;&#039;&#039;Font Map&#039;&#039;&#039; for this font.&lt;br /&gt;
|-&lt;br /&gt;
|0x10&lt;br /&gt;
|const char*&lt;br /&gt;
|pTextFontProportionPath&lt;br /&gt;
|A pointer to the path to the &#039;&#039;&#039;Text Font Proportion&#039;&#039;&#039; for this font.&lt;br /&gt;
|-&lt;br /&gt;
|0x14&lt;br /&gt;
|const char*&lt;br /&gt;
|pTextFontPicturePath&lt;br /&gt;
|A pointer to the path to the [[Text Font Picture]] for this font.&lt;br /&gt;
If non-applicable, this should be null.&lt;br /&gt;
|-&lt;br /&gt;
|0x18&lt;br /&gt;
|uint16_t&lt;br /&gt;
|CellWidth&lt;br /&gt;
|The width of each character cell in the font atlas texture.&lt;br /&gt;
|-&lt;br /&gt;
|0x1A&lt;br /&gt;
|uint16_t&lt;br /&gt;
|CellHeight&lt;br /&gt;
|The height of each character cell in the font atlas texture.&lt;br /&gt;
|}&lt;/div&gt;</summary>
		<author><name>Hyper</name></author>
	</entry>
	<entry>
		<id>https://hedgedocs.com/index.php?title=Sonic_the_Hedgehog_(2006)&amp;diff=1376</id>
		<title>Sonic the Hedgehog (2006)</title>
		<link rel="alternate" type="text/html" href="https://hedgedocs.com/index.php?title=Sonic_the_Hedgehog_(2006)&amp;diff=1376"/>
		<updated>2025-12-04T20:45:59Z</updated>

		<summary type="html">&lt;p&gt;Hyper: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Guides ==&lt;br /&gt;
&lt;br /&gt;
=== Level Editing ===&lt;br /&gt;
* [[How To Use Sonic GLvl with Sonic &#039;06|Sonic GLvl]]&lt;br /&gt;
&lt;br /&gt;
== Documentation ==&lt;br /&gt;
&lt;br /&gt;
* [[Sonic the Hedgehog (2006) File System|File System]]&lt;br /&gt;
* [[Player State IDs]]&lt;br /&gt;
* [[Player State Maps]]&lt;br /&gt;
* [[Section IDs]]&lt;br /&gt;
* [[Sonic the Hedgehog (2006) Shaders|Shaders]]&lt;br /&gt;
* [[Texture Tags]]&lt;br /&gt;
&lt;br /&gt;
=== Scripting ===&lt;br /&gt;
&lt;br /&gt;
* [[Mission Parameters]]&lt;br /&gt;
* [[Player Parameters]]&lt;br /&gt;
* [[Scene Parameters]]&lt;br /&gt;
&lt;br /&gt;
== Formats ==&lt;br /&gt;
=== Archive ===&lt;br /&gt;
* [[U8 Archive]]&lt;br /&gt;
&lt;br /&gt;
=== Event ===&lt;br /&gt;
&lt;br /&gt;
* [[Event Playbook]]&lt;br /&gt;
&lt;br /&gt;
=== Ninja ===&lt;br /&gt;
* [[NN Chunk Format]]&lt;br /&gt;
&lt;br /&gt;
=== Text ===&lt;br /&gt;
&lt;br /&gt;
* [[Text Book]]&lt;br /&gt;
* [[Text Font Map]]&lt;br /&gt;
* [[Text Font Picture]]&lt;/div&gt;</summary>
		<author><name>Hyper</name></author>
	</entry>
	<entry>
		<id>https://hedgedocs.com/index.php?title=Text_Book&amp;diff=1375</id>
		<title>Text Book</title>
		<link rel="alternate" type="text/html" href="https://hedgedocs.com/index.php?title=Text_Book&amp;diff=1375"/>
		<updated>2025-12-04T20:45:29Z</updated>

		<summary type="html">&lt;p&gt;Hyper: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&#039;&#039;&#039;&#039;&#039;Text Book&#039;&#039;&#039;&#039;&#039; is a file format used in [[Sonic the Hedgehog (2006)]] for storing text with friendly names and variables.&lt;br /&gt;
&lt;br /&gt;
These files are located in &amp;lt;code&amp;gt;cache.arc&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;text.arc&amp;lt;/code&amp;gt; under the &amp;lt;code&amp;gt;./text/&amp;lt;/code&amp;gt; directory from [[Sonic the Hedgehog (2006) File System#Platform Root|platform root]] as &amp;lt;code&amp;gt;*.mst&amp;lt;/code&amp;gt; files.&lt;br /&gt;
&lt;br /&gt;
== Specification ==&lt;br /&gt;
&#039;&#039;&#039;Text Book&#039;&#039;&#039; uses a [[Binary Resource]] container. The text to be displayed is encoded as UTF-16, whereas the names and variables are encoded as Shift-JIS.&lt;br /&gt;
&lt;br /&gt;
=== Header ===&lt;br /&gt;
The header consists of the following data structure:&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+Length: 0x0C&lt;br /&gt;
!Offset&lt;br /&gt;
!Type&lt;br /&gt;
!Name&lt;br /&gt;
!Description&lt;br /&gt;
|-&lt;br /&gt;
|0x00&lt;br /&gt;
|Char[4]&lt;br /&gt;
|Signature&lt;br /&gt;
|Always &amp;quot;WTXT&amp;quot; (referring to UTF-16).&lt;br /&gt;
|-&lt;br /&gt;
|0x04&lt;br /&gt;
|UInt32&lt;br /&gt;
|NameOffset&lt;br /&gt;
|The offset of the name of this &#039;&#039;&#039;Text Book&#039;&#039;&#039;.&lt;br /&gt;
|-&lt;br /&gt;
|0x08&lt;br /&gt;
|UInt32&lt;br /&gt;
|CardCount&lt;br /&gt;
|The total number of &#039;&#039;&#039;Text Cards&#039;&#039;&#039; in this &#039;&#039;&#039;Text Book&#039;&#039;&#039;.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Text Card ===&lt;br /&gt;
Text Cards consist of the following data structure:&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+Length: 0x0C&lt;br /&gt;
!Offset&lt;br /&gt;
!Type&lt;br /&gt;
!Name&lt;br /&gt;
!Description&lt;br /&gt;
|-&lt;br /&gt;
|0x00&lt;br /&gt;
|UInt32&lt;br /&gt;
|NameOffset&lt;br /&gt;
|The offset of the name of this &#039;&#039;&#039;Text Card&#039;&#039;&#039;.&lt;br /&gt;
|-&lt;br /&gt;
|0x04&lt;br /&gt;
|UInt32&lt;br /&gt;
|TextOffset&lt;br /&gt;
|The offset of the UTF-16 text for this &#039;&#039;&#039;Text Card&#039;&#039;&#039;.&lt;br /&gt;
|-&lt;br /&gt;
|0x08&lt;br /&gt;
|UInt32&lt;br /&gt;
|VariablesOffset&lt;br /&gt;
|The offset of the variables for this &#039;&#039;&#039;Text Card&#039;&#039;&#039;.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Variables ==&lt;br /&gt;
Variables are stored as comma-separated values, there should be one for each &#039;$&#039; character in the actual text to be displayed.&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+&lt;br /&gt;
!Variable&lt;br /&gt;
!Parameters&lt;br /&gt;
!Description&lt;br /&gt;
|-&lt;br /&gt;
|blue&lt;br /&gt;
|None&lt;br /&gt;
|Once encountered, starts colouring characters blue. &amp;lt;span title=&amp;quot;#00C6C6&amp;quot; style=&amp;quot;display: inline-block; width: 12px; height: 12px; background: #00C6C6; margin: 0 4px; vertical-align: middle;&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|color&lt;br /&gt;
|None&lt;br /&gt;
|Once encountered, starts colouring characters white. &amp;lt;span title=&amp;quot;#FFFFFF&amp;quot; style=&amp;quot;display: inline-block; width: 12px; height: 12px; background: #FFFFFF; margin: 0 4px; vertical-align: middle;&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|color!&lt;br /&gt;
|None&lt;br /&gt;
|Once encountered, starts colouring characters yellow. &amp;lt;span title=&amp;quot;#FFC658&amp;quot; style=&amp;quot;display: inline-block; width: 12px; height: 12px; background: #FFC658; margin: 0 4px; vertical-align: middle;&amp;quot;&amp;gt;&amp;lt;/span&amp;gt; Presumably this is meant as the &amp;quot;warning&amp;quot; colour, hence the exclamation mark.&lt;br /&gt;
|-&lt;br /&gt;
|gray&lt;br /&gt;
|None&lt;br /&gt;
|Once encountered, starts colouring characters grey. &amp;lt;span title=&amp;quot;#737373&amp;quot; style=&amp;quot;display: inline-block; width: 12px; height: 12px; background: #737373; margin: 0 4px; vertical-align: middle;&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|green&lt;br /&gt;
|None&lt;br /&gt;
|Once encountered, starts colouring characters green. &amp;lt;span title=&amp;quot;#58FF8E&amp;quot; style=&amp;quot;display: inline-block; width: 12px; height: 12px; background: #58FF8E; margin: 0 4px; vertical-align: middle;&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|picture&lt;br /&gt;
|String&lt;br /&gt;
|Once encountered, draws the specified picture defined in the game&#039;s &#039;&#039;&#039;[[Text Font Picture]]&#039;&#039;&#039; file.&lt;br /&gt;
|-&lt;br /&gt;
|red&lt;br /&gt;
|None&lt;br /&gt;
|Once encountered, starts colouring characters red. &amp;lt;span title=&amp;quot;#FD5858&amp;quot; style=&amp;quot;display: inline-block; width: 12px; height: 12px; background: #FD5858; margin: 0 4px; vertical-align: middle;&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|rgba&lt;br /&gt;
|Byte, Byte, Byte&lt;br /&gt;
|Once encountered, starts colouring characters the specified colour. Despite the name, this does not support setting the alpha colour of the text.&lt;br /&gt;
|-&lt;br /&gt;
|sound&lt;br /&gt;
|String&lt;br /&gt;
|Once encountered, plays the specified sound effect if the &#039;&#039;&#039;Sound Bank&#039;&#039;&#039; containing it is loaded.&lt;br /&gt;
|-&lt;br /&gt;
|text&lt;br /&gt;
|Unknown&lt;br /&gt;
|Unknown.&lt;br /&gt;
|-&lt;br /&gt;
|value&lt;br /&gt;
|Unknown&lt;br /&gt;
|Unknown.&lt;br /&gt;
|-&lt;br /&gt;
|yellow&lt;br /&gt;
|None&lt;br /&gt;
|Once encountered, starts colouring characters yellow. &amp;lt;span title=&amp;quot;#FCC658&amp;quot; style=&amp;quot;display: inline-block; width: 12px; height: 12px; background: #FCC658; margin: 0 4px; vertical-align: middle;&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{{Notice|type=example|content=&lt;br /&gt;
With the following text:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
$The quick $brown$ fox jumps over the $lazy$ dog.\nPress the $ button to continue.&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
And the following variables:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
sound(all01_a00_sn),rgba(127,51,0),color,red,color,picture(button_a)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
The game should first play the sound &amp;lt;code&amp;gt;all01_a00_sn&amp;lt;/code&amp;gt;, then draw something akin to the following text:&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-code&amp;quot; style=&amp;quot;display: flex; align-items: center; margin: 20px 0 0 0; background-color: var(--hedgedocs-frame-bg-color); border-color: var(--hedgedocs-base-border-color);&amp;quot;&amp;gt;&lt;br /&gt;
The quick &amp;lt;span style=&amp;quot;color:#7F3300;&amp;quot;&amp;gt;brown&amp;lt;/span&amp;gt; fox jumps over the &amp;lt;span style=&amp;quot;color:#FD5858;&amp;quot;&amp;gt;lazy&amp;lt;/span&amp;gt; dog.&lt;br /&gt;
Press the &amp;lt;span style=&amp;quot;color:#58FF8E;&amp;quot;&amp;gt;&#039;&#039;&#039;Ⓐ&#039;&#039;&#039;&amp;lt;/span&amp;gt; button to continue.&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
[[Category:File Formats]]&lt;/div&gt;</summary>
		<author><name>Hyper</name></author>
	</entry>
	<entry>
		<id>https://hedgedocs.com/index.php?title=Text_Font_Picture&amp;diff=1374</id>
		<title>Text Font Picture</title>
		<link rel="alternate" type="text/html" href="https://hedgedocs.com/index.php?title=Text_Font_Picture&amp;diff=1374"/>
		<updated>2025-12-04T20:44:50Z</updated>

		<summary type="html">&lt;p&gt;Hyper: Created page with &amp;quot;&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;Text Font Picture&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039; is a file format used in Sonic the Hedgehog (2006) for defining images for picture variables in the Text Book format.  This file format consists of an array of bounding boxes (known as &amp;quot;crops&amp;quot; officially) with names that can be used in the picture variable for the &amp;#039;&amp;#039;&amp;#039;Text Book&amp;#039;&amp;#039;&amp;#039; format.  This file is located at &amp;lt;code&amp;gt;./{platform_root}/archives/text.arc/{platform_root}/text/pictur...&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&#039;&#039;&#039;&#039;&#039;Text Font Picture&#039;&#039;&#039;&#039;&#039; is a file format used in [[Sonic the Hedgehog (2006)]] for defining images for picture variables in the [[Text Book]] format.&lt;br /&gt;
&lt;br /&gt;
This file format consists of an array of bounding boxes (known as &amp;quot;crops&amp;quot; officially) with names that can be used in the picture variable for the &#039;&#039;&#039;Text Book&#039;&#039;&#039; format.&lt;br /&gt;
&lt;br /&gt;
This file is located at &amp;lt;code&amp;gt;./{[[Sonic the Hedgehog (2006) File System#Platform Root|platform_root]]}/archives/text.arc/{platform_root}/text/picture.pft&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
== Specification ==&lt;br /&gt;
&#039;&#039;&#039;Text Font Picture&#039;&#039;&#039; uses a [[Binary Resource]] container.&lt;br /&gt;
&lt;br /&gt;
=== Header ===&lt;br /&gt;
The header consists of the following data structure:&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+Length: 0x10&lt;br /&gt;
!Offset&lt;br /&gt;
!Type&lt;br /&gt;
!Name&lt;br /&gt;
!Description&lt;br /&gt;
|-&lt;br /&gt;
|0x00&lt;br /&gt;
|Char[4]&lt;br /&gt;
|Signature&lt;br /&gt;
|Always &amp;quot;FNTP&amp;quot;.&lt;br /&gt;
|-&lt;br /&gt;
|0x04&lt;br /&gt;
|UInt32&lt;br /&gt;
|TexturePathOffset&lt;br /&gt;
|The offset of the path to the texture the crops pertain to.&lt;br /&gt;
|-&lt;br /&gt;
|0x08&lt;br /&gt;
|UInt32&lt;br /&gt;
|CropCount&lt;br /&gt;
|The number of crops in the texture.&lt;br /&gt;
|-&lt;br /&gt;
|0x0C&lt;br /&gt;
|UInt32&lt;br /&gt;
|CropTableOffset&lt;br /&gt;
|The offset of the crop table.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Crop ===&lt;br /&gt;
Each crop in the table consists of the following data structure:&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+Length: 0x0C&lt;br /&gt;
!Offset&lt;br /&gt;
!Type&lt;br /&gt;
!Name&lt;br /&gt;
!Description&lt;br /&gt;
|-&lt;br /&gt;
|0x00&lt;br /&gt;
|UInt32&lt;br /&gt;
|NameOffset&lt;br /&gt;
|The offset of the name of this crop.&lt;br /&gt;
|-&lt;br /&gt;
|0x04&lt;br /&gt;
|UInt16&lt;br /&gt;
|X&lt;br /&gt;
|The X position of this crop.&lt;br /&gt;
|-&lt;br /&gt;
|0x06&lt;br /&gt;
|UInt16&lt;br /&gt;
|Y&lt;br /&gt;
|The Y position of this crop.&lt;br /&gt;
|-&lt;br /&gt;
|0x08&lt;br /&gt;
|UInt16&lt;br /&gt;
|Width&lt;br /&gt;
|The width of this crop.&lt;br /&gt;
|-&lt;br /&gt;
|0x0A&lt;br /&gt;
|UInt16&lt;br /&gt;
|Height&lt;br /&gt;
|The height of this crop.&lt;br /&gt;
|}&lt;/div&gt;</summary>
		<author><name>Hyper</name></author>
	</entry>
	<entry>
		<id>https://hedgedocs.com/index.php?title=Text_Font_Map&amp;diff=1373</id>
		<title>Text Font Map</title>
		<link rel="alternate" type="text/html" href="https://hedgedocs.com/index.php?title=Text_Font_Map&amp;diff=1373"/>
		<updated>2025-12-04T20:30:51Z</updated>

		<summary type="html">&lt;p&gt;Hyper: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&#039;&#039;&#039;&#039;&#039;Text Font Map&#039;&#039;&#039;&#039;&#039; is a file format used in [[Sonic the Hedgehog (2006)]] for storing font character information.&lt;br /&gt;
&lt;br /&gt;
These files are located in &amp;lt;code&amp;gt;text.arc&amp;lt;/code&amp;gt; under the &amp;lt;code&amp;gt;./text/&amp;lt;/code&amp;gt; directory from [[Sonic the Hedgehog (2006) File System#Platform Root|platform root]] as &amp;lt;code&amp;gt;*.ftm&amp;lt;/code&amp;gt; files.&lt;br /&gt;
&lt;br /&gt;
== Specification ==&lt;br /&gt;
&#039;&#039;&#039;Text Font Map&#039;&#039;&#039; uses a [[Binary Resource]] container.&lt;br /&gt;
&lt;br /&gt;
=== Header ===&lt;br /&gt;
The header consists of the following data structure:&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+Length: 0x14&lt;br /&gt;
!Offset&lt;br /&gt;
!Type&lt;br /&gt;
!Name&lt;br /&gt;
!Description&lt;br /&gt;
|-&lt;br /&gt;
|0x00&lt;br /&gt;
|Char[4]&lt;br /&gt;
|Signature&lt;br /&gt;
|Always &amp;quot;FNTM&amp;quot;.&lt;br /&gt;
|-&lt;br /&gt;
|0x04&lt;br /&gt;
|UInt32&lt;br /&gt;
|CodePageCount&lt;br /&gt;
|The number of code pages mapped in this font.&lt;br /&gt;
This is a zero-based count, so 0 = 1.&lt;br /&gt;
|-&lt;br /&gt;
|0x08&lt;br /&gt;
|UInt32&lt;br /&gt;
|CodePageTableOffset&lt;br /&gt;
|The offset of the table of code page offsets.&lt;br /&gt;
|-&lt;br /&gt;
|0x0C&lt;br /&gt;
|Byte&lt;br /&gt;
|Columns&lt;br /&gt;
|The number of columns in the font atlas.&lt;br /&gt;
This field is not used by the game. See [[Text Font Map#Static Font Data|Static Font Data]].&lt;br /&gt;
|-&lt;br /&gt;
|0x0D&lt;br /&gt;
|Byte&lt;br /&gt;
|Rows&lt;br /&gt;
|The number of rows in the font atlas.&lt;br /&gt;
This field is not used by the game. See [[Text Font Map#Static Font Data|Static Font Data]].&lt;br /&gt;
|-&lt;br /&gt;
|0x0E&lt;br /&gt;
|UInt16&lt;br /&gt;
|N/A&lt;br /&gt;
|Unknown. Always 1.&lt;br /&gt;
|-&lt;br /&gt;
|0x10&lt;br /&gt;
|UInt32&lt;br /&gt;
|FontNameOffset&lt;br /&gt;
|The offset of the name of this font.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Code Page Table ===&lt;br /&gt;
The code page table is an indirection table with a fixed size of 256 elements.&lt;br /&gt;
&lt;br /&gt;
Each element is a 32-bit offset that points to a fixed 256 element page of characters in Unicode. These characters consist of cell information and flags that map to the font atlas texture.&lt;br /&gt;
&lt;br /&gt;
=== Character ===&lt;br /&gt;
Each character is stored as the following data structure:&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+Length: 0x04&lt;br /&gt;
!Offset&lt;br /&gt;
!Type&lt;br /&gt;
!Name&lt;br /&gt;
!Description&lt;br /&gt;
|-&lt;br /&gt;
|0x00&lt;br /&gt;
|Byte&lt;br /&gt;
|Column&lt;br /&gt;
|The column of this character cell in the font atlas texture.&lt;br /&gt;
|-&lt;br /&gt;
|0x01&lt;br /&gt;
|Byte&lt;br /&gt;
|Row&lt;br /&gt;
|The row of this character cell in the font atlas texture.&lt;br /&gt;
|-&lt;br /&gt;
|0x02&lt;br /&gt;
|UInt16&lt;br /&gt;
|Flags&lt;br /&gt;
|The flags for this character.&lt;br /&gt;
If &amp;lt;code&amp;gt;0xFFFF&amp;lt;/code&amp;gt;, this character will be unset.&lt;br /&gt;
|}&lt;br /&gt;
To get the Unicode character this element pertains to, use the following expression:&amp;lt;syntaxhighlight lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Character = (CodePageIndex &amp;lt;&amp;lt; 8) | CharacterIndex&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Static Font Data ===&lt;br /&gt;
The game stores the last remaining font information in a static array in the executable.&lt;br /&gt;
&lt;br /&gt;
The array can be found at the following addresses:&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+&lt;br /&gt;
!Platform&lt;br /&gt;
!File&lt;br /&gt;
!Virtual Address&lt;br /&gt;
!Physical Address&lt;br /&gt;
|-&lt;br /&gt;
|Xbox 360&lt;br /&gt;
|&amp;lt;code&amp;gt;default.xex&amp;lt;/code&amp;gt;&lt;br /&gt;
|&amp;lt;code&amp;gt;0x82B7F860&amp;lt;/code&amp;gt;&lt;br /&gt;
|&amp;lt;code&amp;gt;0xB82860&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|PlayStation 3&lt;br /&gt;
|&amp;lt;code&amp;gt;EBOOT.BIN&amp;lt;/code&amp;gt;&lt;br /&gt;
|&amp;lt;code&amp;gt;0x100DDA20&amp;lt;/code&amp;gt;&lt;br /&gt;
|&amp;lt;code&amp;gt;0x178DA20&amp;lt;/code&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
The array consists of three elements of the following data structure:&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+Length: 0x1C&lt;br /&gt;
!Offset&lt;br /&gt;
!Type&lt;br /&gt;
!Name&lt;br /&gt;
!Description&lt;br /&gt;
|-&lt;br /&gt;
|0x00&lt;br /&gt;
|uint32_t&lt;br /&gt;
|ID&lt;br /&gt;
|The ID of this font.&lt;br /&gt;
|-&lt;br /&gt;
|0x04&lt;br /&gt;
|const char*&lt;br /&gt;
|pTexturePath&lt;br /&gt;
|A pointer to the path to the font atlas texture.&lt;br /&gt;
|-&lt;br /&gt;
|0x08&lt;br /&gt;
|uint16_t&lt;br /&gt;
|TextureWidth&lt;br /&gt;
|The width of the font atlas texture.&lt;br /&gt;
|-&lt;br /&gt;
|0x0A&lt;br /&gt;
|uint16_t&lt;br /&gt;
|TextureHeight&lt;br /&gt;
|The height of the font atlas texture.&lt;br /&gt;
|-&lt;br /&gt;
|0x0C&lt;br /&gt;
|const char*&lt;br /&gt;
|pTextFontMapPath&lt;br /&gt;
|A pointer to the path to the &#039;&#039;&#039;Text&#039;&#039;&#039; &#039;&#039;&#039;Font Map&#039;&#039;&#039; for this font.&lt;br /&gt;
|-&lt;br /&gt;
|0x10&lt;br /&gt;
|const char*&lt;br /&gt;
|pTextFontProportionPath&lt;br /&gt;
|A pointer to the path to the &#039;&#039;&#039;Text Font Proportion&#039;&#039;&#039; for this font.&lt;br /&gt;
|-&lt;br /&gt;
|0x14&lt;br /&gt;
|const char*&lt;br /&gt;
|pTextFontPicturePath&lt;br /&gt;
|A pointer to the path to the &#039;&#039;&#039;Text Font Picture&#039;&#039;&#039; for this font.&lt;br /&gt;
If non-applicable, this should be null.&lt;br /&gt;
|-&lt;br /&gt;
|0x18&lt;br /&gt;
|uint16_t&lt;br /&gt;
|CellWidth&lt;br /&gt;
|The width of each character cell in the font atlas texture.&lt;br /&gt;
|-&lt;br /&gt;
|0x1A&lt;br /&gt;
|uint16_t&lt;br /&gt;
|CellHeight&lt;br /&gt;
|The height of each character cell in the font atlas texture.&lt;br /&gt;
|}&lt;/div&gt;</summary>
		<author><name>Hyper</name></author>
	</entry>
	<entry>
		<id>https://hedgedocs.com/index.php?title=Sonic_the_Hedgehog_(2006)&amp;diff=1372</id>
		<title>Sonic the Hedgehog (2006)</title>
		<link rel="alternate" type="text/html" href="https://hedgedocs.com/index.php?title=Sonic_the_Hedgehog_(2006)&amp;diff=1372"/>
		<updated>2025-12-04T20:23:32Z</updated>

		<summary type="html">&lt;p&gt;Hyper: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Guides ==&lt;br /&gt;
&lt;br /&gt;
=== Level Editing ===&lt;br /&gt;
* [[How To Use Sonic GLvl with Sonic &#039;06|Sonic GLvl]]&lt;br /&gt;
&lt;br /&gt;
== Documentation ==&lt;br /&gt;
&lt;br /&gt;
* [[Sonic the Hedgehog (2006) File System|File System]]&lt;br /&gt;
* [[Player State IDs]]&lt;br /&gt;
* [[Player State Maps]]&lt;br /&gt;
* [[Section IDs]]&lt;br /&gt;
* [[Sonic the Hedgehog (2006) Shaders|Shaders]]&lt;br /&gt;
* [[Texture Tags]]&lt;br /&gt;
&lt;br /&gt;
=== Scripting ===&lt;br /&gt;
&lt;br /&gt;
* [[Mission Parameters]]&lt;br /&gt;
* [[Player Parameters]]&lt;br /&gt;
* [[Scene Parameters]]&lt;br /&gt;
&lt;br /&gt;
== Formats ==&lt;br /&gt;
=== Archive ===&lt;br /&gt;
* [[U8 Archive]]&lt;br /&gt;
&lt;br /&gt;
=== Event ===&lt;br /&gt;
&lt;br /&gt;
* [[Event Playbook]]&lt;br /&gt;
&lt;br /&gt;
=== Ninja ===&lt;br /&gt;
* [[NN Chunk Format]]&lt;br /&gt;
&lt;br /&gt;
=== Text ===&lt;br /&gt;
&lt;br /&gt;
* [[Text Book]]&lt;br /&gt;
* [[Text Font Map]]&lt;/div&gt;</summary>
		<author><name>Hyper</name></author>
	</entry>
	<entry>
		<id>https://hedgedocs.com/index.php?title=Sonic_the_Hedgehog_(2006)&amp;diff=1371</id>
		<title>Sonic the Hedgehog (2006)</title>
		<link rel="alternate" type="text/html" href="https://hedgedocs.com/index.php?title=Sonic_the_Hedgehog_(2006)&amp;diff=1371"/>
		<updated>2025-12-04T20:21:11Z</updated>

		<summary type="html">&lt;p&gt;Hyper: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Guides ==&lt;br /&gt;
&lt;br /&gt;
=== Level Editing ===&lt;br /&gt;
* [[How To Use Sonic GLvl with Sonic &#039;06|Sonic GLvl]]&lt;br /&gt;
&lt;br /&gt;
== Documentation ==&lt;br /&gt;
&lt;br /&gt;
* [[Sonic the Hedgehog (2006) File System|File System]]&lt;br /&gt;
* [[Player State IDs]]&lt;br /&gt;
* [[Player State Maps]]&lt;br /&gt;
* [[Section IDs]]&lt;br /&gt;
* [[Sonic the Hedgehog (2006) Shaders|Shaders]]&lt;br /&gt;
* [[Texture Tags]]&lt;br /&gt;
&lt;br /&gt;
=== Scripting ===&lt;br /&gt;
&lt;br /&gt;
* [[Mission Parameters]]&lt;br /&gt;
* [[Player Parameters]]&lt;br /&gt;
&lt;br /&gt;
* [[Scene Parameters]]&lt;br /&gt;
&lt;br /&gt;
== Formats ==&lt;br /&gt;
=== Archive ===&lt;br /&gt;
* [[U8 Archive]]&lt;br /&gt;
&lt;br /&gt;
=== Event ===&lt;br /&gt;
&lt;br /&gt;
* [[Event Playbook]]&lt;br /&gt;
&lt;br /&gt;
=== Ninja ===&lt;br /&gt;
* [[NN Chunk Format]]&lt;br /&gt;
&lt;br /&gt;
=== Text ===&lt;br /&gt;
&lt;br /&gt;
* [[Text Book]]&lt;br /&gt;
* [[Text Font Map]]&lt;/div&gt;</summary>
		<author><name>Hyper</name></author>
	</entry>
	<entry>
		<id>https://hedgedocs.com/index.php?title=Text_Font_Map&amp;diff=1370</id>
		<title>Text Font Map</title>
		<link rel="alternate" type="text/html" href="https://hedgedocs.com/index.php?title=Text_Font_Map&amp;diff=1370"/>
		<updated>2025-12-04T20:20:49Z</updated>

		<summary type="html">&lt;p&gt;Hyper: Created page with &amp;quot;&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;Text Font Map&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039; is a file format used in Sonic the Hedgehog (2006) for storing font character information.  These files are located in &amp;lt;code&amp;gt;text.arc&amp;lt;/code&amp;gt; under the &amp;lt;code&amp;gt;./text/&amp;lt;/code&amp;gt; directory from platform root as &amp;lt;code&amp;gt;*.ftm&amp;lt;/code&amp;gt; files.  == Specification == Text Font Map uses a Binary Resource container.  === Header === The header consists of the following data structure: {| class=&amp;quot;wikitable...&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&#039;&#039;&#039;&#039;&#039;Text Font Map&#039;&#039;&#039;&#039;&#039; is a file format used in [[Sonic the Hedgehog (2006)]] for storing font character information.&lt;br /&gt;
&lt;br /&gt;
These files are located in &amp;lt;code&amp;gt;text.arc&amp;lt;/code&amp;gt; under the &amp;lt;code&amp;gt;./text/&amp;lt;/code&amp;gt; directory from [[Sonic the Hedgehog (2006) File System#Platform Root|platform root]] as &amp;lt;code&amp;gt;*.ftm&amp;lt;/code&amp;gt; files.&lt;br /&gt;
&lt;br /&gt;
== Specification ==&lt;br /&gt;
Text Font Map uses a [[Binary Resource]] container.&lt;br /&gt;
&lt;br /&gt;
=== Header ===&lt;br /&gt;
The header consists of the following data structure:&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+Length: 0x14&lt;br /&gt;
!Offset&lt;br /&gt;
!Type&lt;br /&gt;
!Name&lt;br /&gt;
!Description&lt;br /&gt;
|-&lt;br /&gt;
|0x00&lt;br /&gt;
|Char[4]&lt;br /&gt;
|Signature&lt;br /&gt;
|Always &amp;quot;FNTM&amp;quot;.&lt;br /&gt;
|-&lt;br /&gt;
|0x04&lt;br /&gt;
|UInt32&lt;br /&gt;
|CodePageCount&lt;br /&gt;
|The number of code pages mapped in this font.&lt;br /&gt;
This is a zero-based count, so 0 = 1.&lt;br /&gt;
|-&lt;br /&gt;
|0x08&lt;br /&gt;
|UInt32&lt;br /&gt;
|CodePageTableOffset&lt;br /&gt;
|The offset of the table of code page offsets.&lt;br /&gt;
|-&lt;br /&gt;
|0x0C&lt;br /&gt;
|Byte&lt;br /&gt;
|Columns&lt;br /&gt;
|The number of columns in the font atlas.&lt;br /&gt;
This field is not used by the game. See [[Text Font Map#Static Font Data|Static Font Data]].&lt;br /&gt;
|-&lt;br /&gt;
|0x0D&lt;br /&gt;
|Byte&lt;br /&gt;
|Rows&lt;br /&gt;
|The number of rows in the font atlas.&lt;br /&gt;
This field is not used by the game. See [[Text Font Map#Static Font Data|Static Font Data]].&lt;br /&gt;
|-&lt;br /&gt;
|0x0E&lt;br /&gt;
|UInt16&lt;br /&gt;
|N/A&lt;br /&gt;
|Unknown. Always 1.&lt;br /&gt;
|-&lt;br /&gt;
|0x10&lt;br /&gt;
|UInt32&lt;br /&gt;
|FontNameOffset&lt;br /&gt;
|The offset of the name of this font.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Code Page Table ===&lt;br /&gt;
The code page table is an indirection table with a fixed size of 256 elements.&lt;br /&gt;
&lt;br /&gt;
Each element is a 32-bit offset that points to a fixed 256 element page of characters in Unicode. These characters consist of cell information and flags that map to the font atlas texture.&lt;br /&gt;
&lt;br /&gt;
=== Character ===&lt;br /&gt;
Each character is stored as the following data structure:&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+Length: 0x04&lt;br /&gt;
!Offset&lt;br /&gt;
!Type&lt;br /&gt;
!Name&lt;br /&gt;
!Description&lt;br /&gt;
|-&lt;br /&gt;
|0x00&lt;br /&gt;
|Byte&lt;br /&gt;
|Column&lt;br /&gt;
|The column of this character cell in the font atlas texture.&lt;br /&gt;
|-&lt;br /&gt;
|0x01&lt;br /&gt;
|Byte&lt;br /&gt;
|Row&lt;br /&gt;
|The row of this character cell in the font atlas texture.&lt;br /&gt;
|-&lt;br /&gt;
|0x02&lt;br /&gt;
|UInt16&lt;br /&gt;
|Flags&lt;br /&gt;
|The flags for this character.&lt;br /&gt;
If &amp;lt;code&amp;gt;0xFFFF&amp;lt;/code&amp;gt;, this character will be unset.&lt;br /&gt;
|}&lt;br /&gt;
To get the Unicode character this element pertains to, use the following expression:&amp;lt;syntaxhighlight lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Character = (CodePageIndex &amp;lt;&amp;lt; 8) | CharacterIndex&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Static Font Data ===&lt;br /&gt;
The game stores the last remaining font information in a static array in the executable.&lt;br /&gt;
&lt;br /&gt;
The array can be found at the following addresses:&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+&lt;br /&gt;
!Platform&lt;br /&gt;
!File&lt;br /&gt;
!Virtual Address&lt;br /&gt;
!Physical Address&lt;br /&gt;
|-&lt;br /&gt;
|Xbox 360&lt;br /&gt;
|&amp;lt;code&amp;gt;default.xex&amp;lt;/code&amp;gt;&lt;br /&gt;
|&amp;lt;code&amp;gt;0x82B7F860&amp;lt;/code&amp;gt;&lt;br /&gt;
|&amp;lt;code&amp;gt;0xB82860&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|PlayStation 3&lt;br /&gt;
|&amp;lt;code&amp;gt;EBOOT.BIN&amp;lt;/code&amp;gt;&lt;br /&gt;
|&amp;lt;code&amp;gt;0x100DDA20&amp;lt;/code&amp;gt;&lt;br /&gt;
|&amp;lt;code&amp;gt;0x178DA20&amp;lt;/code&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
The array consists of three elements of the following data structure:&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+Length: 0x1C&lt;br /&gt;
!Offset&lt;br /&gt;
!Type&lt;br /&gt;
!Name&lt;br /&gt;
!Description&lt;br /&gt;
|-&lt;br /&gt;
|0x00&lt;br /&gt;
|uint32_t&lt;br /&gt;
|ID&lt;br /&gt;
|The ID of this font.&lt;br /&gt;
|-&lt;br /&gt;
|0x04&lt;br /&gt;
|const char*&lt;br /&gt;
|pTexturePath&lt;br /&gt;
|A pointer to the path to the font atlas texture.&lt;br /&gt;
|-&lt;br /&gt;
|0x08&lt;br /&gt;
|uint16_t&lt;br /&gt;
|TextureWidth&lt;br /&gt;
|The width of the font atlas texture.&lt;br /&gt;
|-&lt;br /&gt;
|0x0A&lt;br /&gt;
|uint16_t&lt;br /&gt;
|TextureHeight&lt;br /&gt;
|The height of the font atlas texture.&lt;br /&gt;
|-&lt;br /&gt;
|0x0C&lt;br /&gt;
|const char*&lt;br /&gt;
|pTextFontMapPath&lt;br /&gt;
|A pointer to the path to the &#039;&#039;&#039;Text&#039;&#039;&#039; &#039;&#039;&#039;Font Map&#039;&#039;&#039; for this font.&lt;br /&gt;
|-&lt;br /&gt;
|0x10&lt;br /&gt;
|const char*&lt;br /&gt;
|pTextFontProportionPath&lt;br /&gt;
|A pointer to the path to the &#039;&#039;&#039;Text Font Proportion&#039;&#039;&#039; for this font.&lt;br /&gt;
|-&lt;br /&gt;
|0x14&lt;br /&gt;
|const char*&lt;br /&gt;
|pTextFontPicturePath&lt;br /&gt;
|A pointer to the path to the &#039;&#039;&#039;Text Font Picture&#039;&#039;&#039; for this font.&lt;br /&gt;
If non-applicable, this should be null.&lt;br /&gt;
|-&lt;br /&gt;
|0x18&lt;br /&gt;
|uint16_t&lt;br /&gt;
|CellWidth&lt;br /&gt;
|The width of each character cell in the font atlas texture.&lt;br /&gt;
|-&lt;br /&gt;
|0x1A&lt;br /&gt;
|uint16_t&lt;br /&gt;
|CellHeight&lt;br /&gt;
|The height of each character cell in the font atlas texture.&lt;br /&gt;
|}&lt;/div&gt;</summary>
		<author><name>Hyper</name></author>
	</entry>
	<entry>
		<id>https://hedgedocs.com/index.php?title=Sonic_the_Hedgehog_(2006)_File_System&amp;diff=1369</id>
		<title>Sonic the Hedgehog (2006) File System</title>
		<link rel="alternate" type="text/html" href="https://hedgedocs.com/index.php?title=Sonic_the_Hedgehog_(2006)_File_System&amp;diff=1369"/>
		<updated>2025-12-04T19:13:27Z</updated>

		<summary type="html">&lt;p&gt;Hyper: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;The file system for [[Sonic the Hedgehog (2006)]] follows an organisational pattern where the directories starting from root are platform identifiers for the file formats contained within them. This structure is respected from the root of the game disc all the way through the internal packed file system.&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+&lt;br /&gt;
!Identifier&lt;br /&gt;
!Endianness&lt;br /&gt;
!Purpose&lt;br /&gt;
|-&lt;br /&gt;
|common&lt;br /&gt;
|N/A&lt;br /&gt;
|Used for files where endianness is non-applicable (e.g. files that are read manually in a specific byte order irrespective of the current platform).&lt;br /&gt;
|-&lt;br /&gt;
|xenon&lt;br /&gt;
|Big&lt;br /&gt;
|Used for files that are read directly into memory and mapped to structures where big-endian byte order is expected for the Xbox 360 platform.&lt;br /&gt;
|-&lt;br /&gt;
|ps3&lt;br /&gt;
|Big&lt;br /&gt;
|Same as above, but for the PlayStation 3 platform.&lt;br /&gt;
|-&lt;br /&gt;
|win32&lt;br /&gt;
|Little&lt;br /&gt;
|Used for files that are read directly into memory and mapped to structures where little-endian byte order is expected for the Windows (x86) platform.&lt;br /&gt;
These files would be read manually for endian swapping on big-endian platforms.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Platform Root ==&lt;br /&gt;
When wiki articles mention &amp;quot;platform root&amp;quot;, they are specifically referring to either &amp;lt;code&amp;gt;xenon&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;ps3&amp;lt;/code&amp;gt;, as they tend to share files in this location between both console platforms. This may not always apply, however, as the PlayStation 3 port uses a different model format for terrain and had its stage data archives moved from &amp;lt;code&amp;gt;win32&amp;lt;/code&amp;gt; to &amp;lt;code&amp;gt;ps3&amp;lt;/code&amp;gt;.&lt;/div&gt;</summary>
		<author><name>Hyper</name></author>
	</entry>
	<entry>
		<id>https://hedgedocs.com/index.php?title=Text_Book&amp;diff=1368</id>
		<title>Text Book</title>
		<link rel="alternate" type="text/html" href="https://hedgedocs.com/index.php?title=Text_Book&amp;diff=1368"/>
		<updated>2025-12-04T19:12:57Z</updated>

		<summary type="html">&lt;p&gt;Hyper: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&#039;&#039;&#039;&#039;&#039;Text Book&#039;&#039;&#039;&#039;&#039; is a file format used in [[Sonic the Hedgehog (2006)]] for storing text with friendly names and variables.&lt;br /&gt;
&lt;br /&gt;
These files are located in &amp;lt;code&amp;gt;cache.arc&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;text.arc&amp;lt;/code&amp;gt; under the &amp;lt;code&amp;gt;./text/&amp;lt;/code&amp;gt; directory from [[Sonic the Hedgehog (2006) File System#Platform Root|platform root]] as &amp;lt;code&amp;gt;*.mst&amp;lt;/code&amp;gt; files.&lt;br /&gt;
&lt;br /&gt;
== Specification ==&lt;br /&gt;
&#039;&#039;&#039;Text Book&#039;&#039;&#039; uses a [[Binary Resource]] container. The text to be displayed is encoded as UTF-16, whereas the names and variables are encoded as Shift-JIS.&lt;br /&gt;
&lt;br /&gt;
=== Header ===&lt;br /&gt;
The header consists of the following data structure:&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+Length: 0x0C&lt;br /&gt;
!Offset&lt;br /&gt;
!Type&lt;br /&gt;
!Name&lt;br /&gt;
!Description&lt;br /&gt;
|-&lt;br /&gt;
|0x00&lt;br /&gt;
|Char[4]&lt;br /&gt;
|Signature&lt;br /&gt;
|Always &amp;quot;WTXT&amp;quot; (referring to UTF-16).&lt;br /&gt;
|-&lt;br /&gt;
|0x04&lt;br /&gt;
|UInt32&lt;br /&gt;
|NameOffset&lt;br /&gt;
|The offset of the name of this &#039;&#039;&#039;Text Book&#039;&#039;&#039;.&lt;br /&gt;
|-&lt;br /&gt;
|0x08&lt;br /&gt;
|UInt32&lt;br /&gt;
|CardCount&lt;br /&gt;
|The total number of &#039;&#039;&#039;Text Cards&#039;&#039;&#039; in this &#039;&#039;&#039;Text Book&#039;&#039;&#039;.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Text Card ===&lt;br /&gt;
Text Cards consist of the following data structure:&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+Length: 0x0C&lt;br /&gt;
!Offset&lt;br /&gt;
!Type&lt;br /&gt;
!Name&lt;br /&gt;
!Description&lt;br /&gt;
|-&lt;br /&gt;
|0x00&lt;br /&gt;
|UInt32&lt;br /&gt;
|NameOffset&lt;br /&gt;
|The offset of the name of this &#039;&#039;&#039;Text Card&#039;&#039;&#039;.&lt;br /&gt;
|-&lt;br /&gt;
|0x04&lt;br /&gt;
|UInt32&lt;br /&gt;
|TextOffset&lt;br /&gt;
|The offset of the UTF-16 text for this &#039;&#039;&#039;Text Card&#039;&#039;&#039;.&lt;br /&gt;
|-&lt;br /&gt;
|0x08&lt;br /&gt;
|UInt32&lt;br /&gt;
|VariablesOffset&lt;br /&gt;
|The offset of the variables for this &#039;&#039;&#039;Text Card&#039;&#039;&#039;.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Variables ==&lt;br /&gt;
Variables are stored as comma-separated values, there should be one for each &#039;$&#039; character in the actual text to be displayed.&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+&lt;br /&gt;
!Variable&lt;br /&gt;
!Parameters&lt;br /&gt;
!Description&lt;br /&gt;
|-&lt;br /&gt;
|blue&lt;br /&gt;
|None&lt;br /&gt;
|Once encountered, starts colouring characters blue. &amp;lt;span title=&amp;quot;#00C6C6&amp;quot; style=&amp;quot;display: inline-block; width: 12px; height: 12px; background: #00C6C6; margin: 0 4px; vertical-align: middle;&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|color&lt;br /&gt;
|None&lt;br /&gt;
|Once encountered, starts colouring characters white. &amp;lt;span title=&amp;quot;#FFFFFF&amp;quot; style=&amp;quot;display: inline-block; width: 12px; height: 12px; background: #FFFFFF; margin: 0 4px; vertical-align: middle;&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|color!&lt;br /&gt;
|None&lt;br /&gt;
|Once encountered, starts colouring characters yellow. &amp;lt;span title=&amp;quot;#FFC658&amp;quot; style=&amp;quot;display: inline-block; width: 12px; height: 12px; background: #FFC658; margin: 0 4px; vertical-align: middle;&amp;quot;&amp;gt;&amp;lt;/span&amp;gt; Presumably this is meant as the &amp;quot;warning&amp;quot; colour, hence the exclamation mark.&lt;br /&gt;
|-&lt;br /&gt;
|gray&lt;br /&gt;
|None&lt;br /&gt;
|Once encountered, starts colouring characters grey. &amp;lt;span title=&amp;quot;#737373&amp;quot; style=&amp;quot;display: inline-block; width: 12px; height: 12px; background: #737373; margin: 0 4px; vertical-align: middle;&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|green&lt;br /&gt;
|None&lt;br /&gt;
|Once encountered, starts colouring characters green. &amp;lt;span title=&amp;quot;#58FF8E&amp;quot; style=&amp;quot;display: inline-block; width: 12px; height: 12px; background: #58FF8E; margin: 0 4px; vertical-align: middle;&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|picture&lt;br /&gt;
|String&lt;br /&gt;
|Once encountered, draws the specified picture defined in the game&#039;s &#039;&#039;&#039;Text Font Picture&#039;&#039;&#039; file.&lt;br /&gt;
|-&lt;br /&gt;
|red&lt;br /&gt;
|None&lt;br /&gt;
|Once encountered, starts colouring characters red. &amp;lt;span title=&amp;quot;#FD5858&amp;quot; style=&amp;quot;display: inline-block; width: 12px; height: 12px; background: #FD5858; margin: 0 4px; vertical-align: middle;&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|rgba&lt;br /&gt;
|Byte, Byte, Byte&lt;br /&gt;
|Once encountered, starts colouring characters the specified colour. Despite the name, this does not support setting the alpha colour of the text.&lt;br /&gt;
|-&lt;br /&gt;
|sound&lt;br /&gt;
|String&lt;br /&gt;
|Once encountered, plays the specified sound effect if the &#039;&#039;&#039;Sound Bank&#039;&#039;&#039; containing it is loaded.&lt;br /&gt;
|-&lt;br /&gt;
|text&lt;br /&gt;
|Unknown&lt;br /&gt;
|Unknown.&lt;br /&gt;
|-&lt;br /&gt;
|value&lt;br /&gt;
|Unknown&lt;br /&gt;
|Unknown.&lt;br /&gt;
|-&lt;br /&gt;
|yellow&lt;br /&gt;
|None&lt;br /&gt;
|Once encountered, starts colouring characters yellow. &amp;lt;span title=&amp;quot;#FCC658&amp;quot; style=&amp;quot;display: inline-block; width: 12px; height: 12px; background: #FCC658; margin: 0 4px; vertical-align: middle;&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{{Notice|type=example|content=&lt;br /&gt;
With the following text:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
$The quick $brown$ fox jumps over the $lazy$ dog.\nPress the $ button to continue.&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
And the following variables:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
sound(all01_a00_sn),rgba(127,51,0),color,red,color,picture(button_a)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
The game should first play the sound &amp;lt;code&amp;gt;all01_a00_sn&amp;lt;/code&amp;gt;, then draw something akin to the following text:&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-code&amp;quot; style=&amp;quot;display: flex; align-items: center; margin: 20px 0 0 0; background-color: var(--hedgedocs-frame-bg-color); border-color: var(--hedgedocs-base-border-color);&amp;quot;&amp;gt;&lt;br /&gt;
The quick &amp;lt;span style=&amp;quot;color:#7F3300;&amp;quot;&amp;gt;brown&amp;lt;/span&amp;gt; fox jumps over the &amp;lt;span style=&amp;quot;color:#FD5858;&amp;quot;&amp;gt;lazy&amp;lt;/span&amp;gt; dog.&lt;br /&gt;
Press the &amp;lt;span style=&amp;quot;color:#58FF8E;&amp;quot;&amp;gt;&#039;&#039;&#039;Ⓐ&#039;&#039;&#039;&amp;lt;/span&amp;gt; button to continue.&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
[[Category:File Formats]]&lt;/div&gt;</summary>
		<author><name>Hyper</name></author>
	</entry>
	<entry>
		<id>https://hedgedocs.com/index.php?title=Sonic_the_Hedgehog_(2006)_File_System&amp;diff=1367</id>
		<title>Sonic the Hedgehog (2006) File System</title>
		<link rel="alternate" type="text/html" href="https://hedgedocs.com/index.php?title=Sonic_the_Hedgehog_(2006)_File_System&amp;diff=1367"/>
		<updated>2025-12-04T19:12:22Z</updated>

		<summary type="html">&lt;p&gt;Hyper: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;The file system for [[Sonic the Hedgehog (2006)]] follows an organisational pattern where the directories starting from root are platform identifiers for the file formats contained within them. This structure is respected from the root of the game disc all the way through the internal packed file system.&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+&lt;br /&gt;
!Identifier&lt;br /&gt;
!Endianness&lt;br /&gt;
!Purpose&lt;br /&gt;
|-&lt;br /&gt;
|common&lt;br /&gt;
|N/A&lt;br /&gt;
|Used for files where endianness is non-applicable (e.g. files that are read manually in a specific byte order irrespective of the current platform).&lt;br /&gt;
|-&lt;br /&gt;
|xenon&lt;br /&gt;
|Big&lt;br /&gt;
|Used for files that are read directly into memory and mapped to structures where big-endian byte order is expected for the Xbox 360 platform.&lt;br /&gt;
|-&lt;br /&gt;
|ps3&lt;br /&gt;
|Big&lt;br /&gt;
|Same as above, but for the PlayStation 3 platform.&lt;br /&gt;
|-&lt;br /&gt;
|win32&lt;br /&gt;
|Little&lt;br /&gt;
|Used for files that are read directly into memory and mapped to structures where little-endian byte order is expected for the Windows (x86) platform.&lt;br /&gt;
These files would be read manually for endian swapping on big-endian platforms.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Platform Root ==&lt;br /&gt;
When wiki articles mention &amp;quot;platform root&amp;quot;, they are specifically referring to either &amp;lt;code&amp;gt;xenon&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;ps3&amp;lt;/code&amp;gt;, as they tend to share files in this location between both console platforms. This may not always apply, however, as the PlayStation 3 port uses a different model format for terrain and had its stage data archives moved to &amp;lt;code&amp;gt;ps3&amp;lt;/code&amp;gt;.&lt;/div&gt;</summary>
		<author><name>Hyper</name></author>
	</entry>
	<entry>
		<id>https://hedgedocs.com/index.php?title=Event_Playbook&amp;diff=1366</id>
		<title>Event Playbook</title>
		<link rel="alternate" type="text/html" href="https://hedgedocs.com/index.php?title=Event_Playbook&amp;diff=1366"/>
		<updated>2025-12-04T19:10:50Z</updated>

		<summary type="html">&lt;p&gt;Hyper: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&#039;&#039;&#039;&#039;&#039;Event Playbook&#039;&#039;&#039;&#039;&#039; is a file format used in [[Sonic the Hedgehog (2006)]] to define cutscene properties.&lt;br /&gt;
&lt;br /&gt;
This file is located at &amp;lt;code&amp;gt;./{[[Sonic the Hedgehog (2006) File System#Platform Root|platform_root]]}/archives/cache.arc/{platform_root}/eventplaybook.epb&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
== Specification ==&lt;br /&gt;
&#039;&#039;&#039;Event Playbook&#039;&#039;&#039; uses a [[Binary Resource]] container.&lt;br /&gt;
&lt;br /&gt;
=== Header ===&lt;br /&gt;
The header consists of the following data structure:&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+Length: 0x10&lt;br /&gt;
!Offset&lt;br /&gt;
!Type&lt;br /&gt;
!Name&lt;br /&gt;
!Description&lt;br /&gt;
|-&lt;br /&gt;
|0x00&lt;br /&gt;
|Char[4]&lt;br /&gt;
|Signature&lt;br /&gt;
|Always &amp;quot;.EPB&amp;quot;.&lt;br /&gt;
|-&lt;br /&gt;
|0x04&lt;br /&gt;
|UInt32&lt;br /&gt;
|Version&lt;br /&gt;
|Always 0x20060700 (big-endian). Format: 2006 July, Revision 0.&lt;br /&gt;
|-&lt;br /&gt;
|0x08&lt;br /&gt;
|UInt32&lt;br /&gt;
|EventCount&lt;br /&gt;
|The total number of events.&lt;br /&gt;
|-&lt;br /&gt;
|0x0C&lt;br /&gt;
|UInt32&lt;br /&gt;
|EventTableOffset&lt;br /&gt;
|The offset of the event table.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Event Playbook Data ===&lt;br /&gt;
Each event within the table consists of the following data structure:&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+Length: 0x38&lt;br /&gt;
!Offset&lt;br /&gt;
!Type&lt;br /&gt;
!Name&lt;br /&gt;
!Description&lt;br /&gt;
|-&lt;br /&gt;
|0x00&lt;br /&gt;
|UInt32&lt;br /&gt;
|NameOffset&lt;br /&gt;
|The offset to the name of this event.&lt;br /&gt;
|-&lt;br /&gt;
|0x04&lt;br /&gt;
|UInt32&lt;br /&gt;
|DirectoryOffset&lt;br /&gt;
|The offset to the path to the directory containing this event&#039;s resources.&lt;br /&gt;
|-&lt;br /&gt;
|0x08&lt;br /&gt;
|UInt32&lt;br /&gt;
|Duration&lt;br /&gt;
|The duration of this event in frames.&lt;br /&gt;
|-&lt;br /&gt;
|0x0C&lt;br /&gt;
|Vector3&lt;br /&gt;
|Position&lt;br /&gt;
|The start position of this event&#039;s camera.&lt;br /&gt;
|-&lt;br /&gt;
|0x18&lt;br /&gt;
|Vector3&lt;br /&gt;
|Rotation&lt;br /&gt;
|The start rotation of this event&#039;s camera.&lt;br /&gt;
|-&lt;br /&gt;
|0x24&lt;br /&gt;
|UInt32&lt;br /&gt;
|TerrainOffset&lt;br /&gt;
|The offset to the location of this event&#039;s terrain.&lt;br /&gt;
|-&lt;br /&gt;
|0x28&lt;br /&gt;
|UInt32&lt;br /&gt;
|SceneParamsOffset&lt;br /&gt;
|The offset to the location of this event&#039;s scene parameter script.&lt;br /&gt;
|-&lt;br /&gt;
|0x2C&lt;br /&gt;
|UInt32&lt;br /&gt;
|SoundBankOffset&lt;br /&gt;
|The offset to the location of this event&#039;s Sound Bank.&lt;br /&gt;
|-&lt;br /&gt;
|0x30&lt;br /&gt;
|UInt32&lt;br /&gt;
|ParticleContainerOffset&lt;br /&gt;
|The offset to the location of this event&#039;s Particle Container.&lt;br /&gt;
|-&lt;br /&gt;
|0x34&lt;br /&gt;
|UInt32&lt;br /&gt;
|TextBookOffset&lt;br /&gt;
|The offset to the location of this event&#039;s [[Text Book]] for subtitles.&lt;br /&gt;
|}&lt;br /&gt;
[[Category:File Formats]]&lt;/div&gt;</summary>
		<author><name>Hyper</name></author>
	</entry>
	<entry>
		<id>https://hedgedocs.com/index.php?title=Sonic_the_Hedgehog_(2006)&amp;diff=1365</id>
		<title>Sonic the Hedgehog (2006)</title>
		<link rel="alternate" type="text/html" href="https://hedgedocs.com/index.php?title=Sonic_the_Hedgehog_(2006)&amp;diff=1365"/>
		<updated>2025-12-04T19:09:23Z</updated>

		<summary type="html">&lt;p&gt;Hyper: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Guides ==&lt;br /&gt;
&lt;br /&gt;
=== Level Editing ===&lt;br /&gt;
* [[How To Use Sonic GLvl with Sonic &#039;06|Sonic GLvl]]&lt;br /&gt;
&lt;br /&gt;
== Documentation ==&lt;br /&gt;
&lt;br /&gt;
* [[Sonic the Hedgehog (2006) File System|File System]]&lt;br /&gt;
* [[Player State IDs]]&lt;br /&gt;
* [[Player State Maps]]&lt;br /&gt;
* [[Section IDs]]&lt;br /&gt;
* [[Sonic the Hedgehog (2006) Shaders|Shaders]]&lt;br /&gt;
* [[Texture Tags]]&lt;br /&gt;
&lt;br /&gt;
=== Scripting ===&lt;br /&gt;
&lt;br /&gt;
* [[Mission Parameters]]&lt;br /&gt;
* [[Player Parameters]]&lt;br /&gt;
&lt;br /&gt;
* [[Scene Parameters]]&lt;br /&gt;
&lt;br /&gt;
== Formats ==&lt;br /&gt;
=== Archive ===&lt;br /&gt;
* [[U8 Archive]]&lt;br /&gt;
&lt;br /&gt;
=== Event ===&lt;br /&gt;
&lt;br /&gt;
* [[Event Playbook]]&lt;br /&gt;
&lt;br /&gt;
=== Ninja ===&lt;br /&gt;
* [[NN Chunk Format]]&lt;br /&gt;
&lt;br /&gt;
=== Text ===&lt;br /&gt;
&lt;br /&gt;
* [[Text Book]]&lt;/div&gt;</summary>
		<author><name>Hyper</name></author>
	</entry>
	<entry>
		<id>https://hedgedocs.com/index.php?title=Sonic_the_Hedgehog_(2006)_File_System&amp;diff=1364</id>
		<title>Sonic the Hedgehog (2006) File System</title>
		<link rel="alternate" type="text/html" href="https://hedgedocs.com/index.php?title=Sonic_the_Hedgehog_(2006)_File_System&amp;diff=1364"/>
		<updated>2025-12-04T19:08:12Z</updated>

		<summary type="html">&lt;p&gt;Hyper: Created page with &amp;quot;The file system for Sonic the Hedgehog (2006) follows an organisational pattern where the directories starting from root are platform identifiers for the file formats contained within them. This structure is respected from the root of the game disc all the way through the internal packed file system. {| class=&amp;quot;wikitable&amp;quot; |+ !Identifier !Endianness !Purpose |- |common |N/A |Used for files where endianness is non-applicable (e.g. files that are read manually in a speci...&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;The file system for [[Sonic the Hedgehog (2006)]] follows an organisational pattern where the directories starting from root are platform identifiers for the file formats contained within them. This structure is respected from the root of the game disc all the way through the internal packed file system.&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+&lt;br /&gt;
!Identifier&lt;br /&gt;
!Endianness&lt;br /&gt;
!Purpose&lt;br /&gt;
|-&lt;br /&gt;
|common&lt;br /&gt;
|N/A&lt;br /&gt;
|Used for files where endianness is non-applicable (e.g. files that are read manually in a specific byte order irrespective of the current platform).&lt;br /&gt;
|-&lt;br /&gt;
|xenon&lt;br /&gt;
|Big&lt;br /&gt;
|Used for files that are read directly into memory and mapped to structures where big-endian byte order is expected for the Xbox 360 platform.&lt;br /&gt;
|-&lt;br /&gt;
|ps3&lt;br /&gt;
|Big&lt;br /&gt;
|Same as above, but for the PlayStation 3 platform.&lt;br /&gt;
|-&lt;br /&gt;
|win32&lt;br /&gt;
|Little&lt;br /&gt;
|Used for files that are read directly into memory and mapped to structures where little-endian byte order is expected for the Windows (x86) platform.&lt;br /&gt;
These files would be read manually for endian swapping on big-endian platforms.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Platform Root ==&lt;br /&gt;
When wiki articles mention &amp;quot;platform root&amp;quot;, they are specifically referring to either &amp;lt;code&amp;gt;xenon&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;ps3&amp;lt;/code&amp;gt;, as an official Windows port was never released and this directory tends to share files between both console platforms. This may not always apply, however, as the PlayStation 3 port uses a different model format for terrain and had its stage data archives moved to &amp;lt;code&amp;gt;ps3&amp;lt;/code&amp;gt;.&lt;/div&gt;</summary>
		<author><name>Hyper</name></author>
	</entry>
	<entry>
		<id>https://hedgedocs.com/index.php?title=Text_Book&amp;diff=1358</id>
		<title>Text Book</title>
		<link rel="alternate" type="text/html" href="https://hedgedocs.com/index.php?title=Text_Book&amp;diff=1358"/>
		<updated>2025-12-03T10:22:37Z</updated>

		<summary type="html">&lt;p&gt;Hyper: Use example notice for variables example&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&#039;&#039;&#039;&#039;&#039;Text Book&#039;&#039;&#039;&#039;&#039; is a file format used in [[Sonic the Hedgehog (2006)]] for storing text with friendly names and variables.&lt;br /&gt;
&lt;br /&gt;
These files are located in &amp;lt;code&amp;gt;cache.arc&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;text.arc&amp;lt;/code&amp;gt; under the &amp;lt;code&amp;gt;./text/&amp;lt;/code&amp;gt; directory from platform root as &amp;lt;code&amp;gt;*.mst&amp;lt;/code&amp;gt; files.&lt;br /&gt;
&lt;br /&gt;
== Specification ==&lt;br /&gt;
&#039;&#039;&#039;Text Book&#039;&#039;&#039; uses a [[Binary Resource]] container. The text to be displayed is encoded as UTF-16, whereas the names and variables are encoded as Shift-JIS.&lt;br /&gt;
&lt;br /&gt;
=== Header ===&lt;br /&gt;
The header consists of the following data structure:&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+Length: 0x0C&lt;br /&gt;
!Offset&lt;br /&gt;
!Type&lt;br /&gt;
!Name&lt;br /&gt;
!Description&lt;br /&gt;
|-&lt;br /&gt;
|0x00&lt;br /&gt;
|Char[4]&lt;br /&gt;
|Signature&lt;br /&gt;
|Always &amp;quot;WTXT&amp;quot; (referring to UTF-16).&lt;br /&gt;
|-&lt;br /&gt;
|0x04&lt;br /&gt;
|UInt32&lt;br /&gt;
|NameOffset&lt;br /&gt;
|The offset of the name of this &#039;&#039;&#039;Text Book&#039;&#039;&#039;.&lt;br /&gt;
|-&lt;br /&gt;
|0x08&lt;br /&gt;
|UInt32&lt;br /&gt;
|CardCount&lt;br /&gt;
|The total number of &#039;&#039;&#039;Text Cards&#039;&#039;&#039; in this &#039;&#039;&#039;Text Book&#039;&#039;&#039;.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Text Card ===&lt;br /&gt;
Text Cards consist of the following data structure:&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+Length: 0x0C&lt;br /&gt;
!Offset&lt;br /&gt;
!Type&lt;br /&gt;
!Name&lt;br /&gt;
!Description&lt;br /&gt;
|-&lt;br /&gt;
|0x00&lt;br /&gt;
|UInt32&lt;br /&gt;
|NameOffset&lt;br /&gt;
|The offset of the name of this &#039;&#039;&#039;Text Card&#039;&#039;&#039;.&lt;br /&gt;
|-&lt;br /&gt;
|0x04&lt;br /&gt;
|UInt32&lt;br /&gt;
|TextOffset&lt;br /&gt;
|The offset of the UTF-16 text for this &#039;&#039;&#039;Text Card&#039;&#039;&#039;.&lt;br /&gt;
|-&lt;br /&gt;
|0x08&lt;br /&gt;
|UInt32&lt;br /&gt;
|VariablesOffset&lt;br /&gt;
|The offset of the variables for this &#039;&#039;&#039;Text Card&#039;&#039;&#039;.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Variables ==&lt;br /&gt;
Variables are stored as comma-separated values, there should be one for each &#039;$&#039; character in the actual text to be displayed.&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+&lt;br /&gt;
!Variable&lt;br /&gt;
!Parameters&lt;br /&gt;
!Description&lt;br /&gt;
|-&lt;br /&gt;
|blue&lt;br /&gt;
|None&lt;br /&gt;
|Once encountered, starts colouring characters blue. &amp;lt;span title=&amp;quot;#00C6C6&amp;quot; style=&amp;quot;display: inline-block; width: 12px; height: 12px; background: #00C6C6; margin: 0 4px; vertical-align: middle;&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|color&lt;br /&gt;
|None&lt;br /&gt;
|Once encountered, starts colouring characters white. &amp;lt;span title=&amp;quot;#FFFFFF&amp;quot; style=&amp;quot;display: inline-block; width: 12px; height: 12px; background: #FFFFFF; margin: 0 4px; vertical-align: middle;&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|color!&lt;br /&gt;
|None&lt;br /&gt;
|Once encountered, starts colouring characters yellow. &amp;lt;span title=&amp;quot;#FFC658&amp;quot; style=&amp;quot;display: inline-block; width: 12px; height: 12px; background: #FFC658; margin: 0 4px; vertical-align: middle;&amp;quot;&amp;gt;&amp;lt;/span&amp;gt; Presumably this is meant as the &amp;quot;warning&amp;quot; colour, hence the exclamation mark.&lt;br /&gt;
|-&lt;br /&gt;
|gray&lt;br /&gt;
|None&lt;br /&gt;
|Once encountered, starts colouring characters grey. &amp;lt;span title=&amp;quot;#737373&amp;quot; style=&amp;quot;display: inline-block; width: 12px; height: 12px; background: #737373; margin: 0 4px; vertical-align: middle;&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|green&lt;br /&gt;
|None&lt;br /&gt;
|Once encountered, starts colouring characters green. &amp;lt;span title=&amp;quot;#58FF8E&amp;quot; style=&amp;quot;display: inline-block; width: 12px; height: 12px; background: #58FF8E; margin: 0 4px; vertical-align: middle;&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|picture&lt;br /&gt;
|String&lt;br /&gt;
|Once encountered, draws the specified picture defined in the game&#039;s &#039;&#039;&#039;Text Font Picture&#039;&#039;&#039; file.&lt;br /&gt;
|-&lt;br /&gt;
|red&lt;br /&gt;
|None&lt;br /&gt;
|Once encountered, starts colouring characters red. &amp;lt;span title=&amp;quot;#FD5858&amp;quot; style=&amp;quot;display: inline-block; width: 12px; height: 12px; background: #FD5858; margin: 0 4px; vertical-align: middle;&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|rgba&lt;br /&gt;
|Byte, Byte, Byte&lt;br /&gt;
|Once encountered, starts colouring characters the specified colour. Despite the name, this does not support setting the alpha colour of the text.&lt;br /&gt;
|-&lt;br /&gt;
|sound&lt;br /&gt;
|String&lt;br /&gt;
|Once encountered, plays the specified sound effect if the &#039;&#039;&#039;Sound Bank&#039;&#039;&#039; containing it is loaded.&lt;br /&gt;
|-&lt;br /&gt;
|text&lt;br /&gt;
|Unknown&lt;br /&gt;
|Unknown.&lt;br /&gt;
|-&lt;br /&gt;
|value&lt;br /&gt;
|Unknown&lt;br /&gt;
|Unknown.&lt;br /&gt;
|-&lt;br /&gt;
|yellow&lt;br /&gt;
|None&lt;br /&gt;
|Once encountered, starts colouring characters yellow. &amp;lt;span title=&amp;quot;#FCC658&amp;quot; style=&amp;quot;display: inline-block; width: 12px; height: 12px; background: #FCC658; margin: 0 4px; vertical-align: middle;&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{{Notice|type=example|content=&lt;br /&gt;
With the following text:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
$The quick $brown$ fox jumps over the $lazy$ dog.\nPress the $ button to continue.&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
And the following variables:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
sound(all01_a00_sn),rgba(127,51,0),color,red,color,picture(button_a)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
The game should first play the sound &amp;lt;code&amp;gt;all01_a00_sn&amp;lt;/code&amp;gt;, then draw something akin to the following text:&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-code&amp;quot; style=&amp;quot;display: flex; align-items: center; margin: 20px 0 0 0; background-color: var(--hedgedocs-frame-bg-color); border-color: var(--hedgedocs-base-border-color);&amp;quot;&amp;gt;&lt;br /&gt;
The quick &amp;lt;span style=&amp;quot;color:#7F3300;&amp;quot;&amp;gt;brown&amp;lt;/span&amp;gt; fox jumps over the &amp;lt;span style=&amp;quot;color:#FD5858;&amp;quot;&amp;gt;lazy&amp;lt;/span&amp;gt; dog.&lt;br /&gt;
Press the &amp;lt;span style=&amp;quot;color:#58FF8E;&amp;quot;&amp;gt;&#039;&#039;&#039;Ⓐ&#039;&#039;&#039;&amp;lt;/span&amp;gt; button to continue.&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
[[Category:File Formats]]&lt;/div&gt;</summary>
		<author><name>Hyper</name></author>
	</entry>
	<entry>
		<id>https://hedgedocs.com/index.php?title=Text_Book&amp;diff=1357</id>
		<title>Text Book</title>
		<link rel="alternate" type="text/html" href="https://hedgedocs.com/index.php?title=Text_Book&amp;diff=1357"/>
		<updated>2025-12-03T09:50:00Z</updated>

		<summary type="html">&lt;p&gt;Hyper: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&#039;&#039;&#039;&#039;&#039;Text Book&#039;&#039;&#039;&#039;&#039; is a file format used in [[Sonic the Hedgehog (2006)]] for storing text with friendly names and variables.&lt;br /&gt;
&lt;br /&gt;
These files are located in &amp;lt;code&amp;gt;cache.arc&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;text.arc&amp;lt;/code&amp;gt; under the &amp;lt;code&amp;gt;./text/&amp;lt;/code&amp;gt; directory from platform root as &amp;lt;code&amp;gt;*.mst&amp;lt;/code&amp;gt; files.&lt;br /&gt;
&lt;br /&gt;
== Specification ==&lt;br /&gt;
&#039;&#039;&#039;Text Book&#039;&#039;&#039; uses a [[Binary Resource]] container. The text to be displayed is encoded as UTF-16, whereas the names and variables are encoded as Shift-JIS.&lt;br /&gt;
&lt;br /&gt;
=== Header ===&lt;br /&gt;
The header consists of the following data structure:&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+Length: 0x0C&lt;br /&gt;
!Offset&lt;br /&gt;
!Type&lt;br /&gt;
!Name&lt;br /&gt;
!Description&lt;br /&gt;
|-&lt;br /&gt;
|0x00&lt;br /&gt;
|Char[4]&lt;br /&gt;
|Signature&lt;br /&gt;
|Always &amp;quot;WTXT&amp;quot; (referring to UTF-16).&lt;br /&gt;
|-&lt;br /&gt;
|0x04&lt;br /&gt;
|UInt32&lt;br /&gt;
|NameOffset&lt;br /&gt;
|The offset of the name of this &#039;&#039;&#039;Text Book&#039;&#039;&#039;.&lt;br /&gt;
|-&lt;br /&gt;
|0x08&lt;br /&gt;
|UInt32&lt;br /&gt;
|CardCount&lt;br /&gt;
|The total number of &#039;&#039;&#039;Text Cards&#039;&#039;&#039; in this &#039;&#039;&#039;Text Book&#039;&#039;&#039;.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Text Card ===&lt;br /&gt;
Text Cards consist of the following data structure:&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+Length: 0x0C&lt;br /&gt;
!Offset&lt;br /&gt;
!Type&lt;br /&gt;
!Name&lt;br /&gt;
!Description&lt;br /&gt;
|-&lt;br /&gt;
|0x00&lt;br /&gt;
|UInt32&lt;br /&gt;
|NameOffset&lt;br /&gt;
|The offset of the name of this &#039;&#039;&#039;Text Card&#039;&#039;&#039;.&lt;br /&gt;
|-&lt;br /&gt;
|0x04&lt;br /&gt;
|UInt32&lt;br /&gt;
|TextOffset&lt;br /&gt;
|The offset of the UTF-16 text for this &#039;&#039;&#039;Text Card&#039;&#039;&#039;.&lt;br /&gt;
|-&lt;br /&gt;
|0x08&lt;br /&gt;
|UInt32&lt;br /&gt;
|VariablesOffset&lt;br /&gt;
|The offset of the variables for this &#039;&#039;&#039;Text Card&#039;&#039;&#039;.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Variables ==&lt;br /&gt;
Variables are stored as comma-separated values, there should be one for each &#039;$&#039; character in the actual text to be displayed.&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+&lt;br /&gt;
!Variable&lt;br /&gt;
!Parameters&lt;br /&gt;
!Description&lt;br /&gt;
|-&lt;br /&gt;
|blue&lt;br /&gt;
|None&lt;br /&gt;
|Once encountered, starts colouring characters blue. &amp;lt;span title=&amp;quot;#00C6C6&amp;quot; style=&amp;quot;display: inline-block; width: 12px; height: 12px; background: #00C6C6; margin: 0 4px; vertical-align: middle;&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|color&lt;br /&gt;
|None&lt;br /&gt;
|Once encountered, starts colouring characters white. &amp;lt;span title=&amp;quot;#FFFFFF&amp;quot; style=&amp;quot;display: inline-block; width: 12px; height: 12px; background: #FFFFFF; margin: 0 4px; vertical-align: middle;&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|color!&lt;br /&gt;
|None&lt;br /&gt;
|Once encountered, starts colouring characters yellow. &amp;lt;span title=&amp;quot;#FFC658&amp;quot; style=&amp;quot;display: inline-block; width: 12px; height: 12px; background: #FFC658; margin: 0 4px; vertical-align: middle;&amp;quot;&amp;gt;&amp;lt;/span&amp;gt; Presumably this is meant as the &amp;quot;warning&amp;quot; colour, hence the exclamation mark.&lt;br /&gt;
|-&lt;br /&gt;
|gray&lt;br /&gt;
|None&lt;br /&gt;
|Once encountered, starts colouring characters grey. &amp;lt;span title=&amp;quot;#737373&amp;quot; style=&amp;quot;display: inline-block; width: 12px; height: 12px; background: #737373; margin: 0 4px; vertical-align: middle;&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|green&lt;br /&gt;
|None&lt;br /&gt;
|Once encountered, starts colouring characters green. &amp;lt;span title=&amp;quot;#58FF8E&amp;quot; style=&amp;quot;display: inline-block; width: 12px; height: 12px; background: #58FF8E; margin: 0 4px; vertical-align: middle;&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|picture&lt;br /&gt;
|String&lt;br /&gt;
|Once encountered, draws the specified picture defined in the game&#039;s &#039;&#039;&#039;Text Font Picture&#039;&#039;&#039; file.&lt;br /&gt;
|-&lt;br /&gt;
|red&lt;br /&gt;
|None&lt;br /&gt;
|Once encountered, starts colouring characters red. &amp;lt;span title=&amp;quot;#FD5858&amp;quot; style=&amp;quot;display: inline-block; width: 12px; height: 12px; background: #FD5858; margin: 0 4px; vertical-align: middle;&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|rgba&lt;br /&gt;
|Byte, Byte, Byte&lt;br /&gt;
|Once encountered, starts colouring characters the specified colour. Despite the name, this does not support setting the alpha colour of the text.&lt;br /&gt;
|-&lt;br /&gt;
|sound&lt;br /&gt;
|String&lt;br /&gt;
|Once encountered, plays the specified sound effect if the &#039;&#039;&#039;Sound Bank&#039;&#039;&#039; containing it is loaded.&lt;br /&gt;
|-&lt;br /&gt;
|text&lt;br /&gt;
|Unknown&lt;br /&gt;
|Unknown.&lt;br /&gt;
|-&lt;br /&gt;
|value&lt;br /&gt;
|Unknown&lt;br /&gt;
|Unknown.&lt;br /&gt;
|-&lt;br /&gt;
|yellow&lt;br /&gt;
|None&lt;br /&gt;
|Once encountered, starts colouring characters yellow. &amp;lt;span title=&amp;quot;#FCC658&amp;quot; style=&amp;quot;display: inline-block; width: 12px; height: 12px; background: #FCC658; margin: 0 4px; vertical-align: middle;&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
For example, with the following text:&amp;lt;syntaxhighlight lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
$The quick $brown$ fox jumps over the $lazy$ dog.\nPress the $ button to continue.&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;And the following variables:&amp;lt;syntaxhighlight lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
sound(all01_a00_sn),rgba(127,51,0),color,red,color,picture(button_a)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;The game should first play the sound &amp;lt;code&amp;gt;all01_a00_sn&amp;lt;/code&amp;gt;, then draw something akin to the following text:&lt;br /&gt;
The quick &amp;lt;span style=&amp;quot;color:#7F3300;&amp;quot;&amp;gt;brown&amp;lt;/span&amp;gt; fox jumps over the &amp;lt;span style=&amp;quot;color:#FD5858;&amp;quot;&amp;gt;lazy&amp;lt;/span&amp;gt; dog. Press the &amp;lt;span style=&amp;quot;color:#58FF8E;&amp;quot;&amp;gt;&#039;&#039;&#039;Ⓐ&#039;&#039;&#039;&amp;lt;/span&amp;gt; button to continue.&lt;br /&gt;
[[Category:File Formats]]&lt;/div&gt;</summary>
		<author><name>Hyper</name></author>
	</entry>
	<entry>
		<id>https://hedgedocs.com/index.php?title=Text_Book&amp;diff=1356</id>
		<title>Text Book</title>
		<link rel="alternate" type="text/html" href="https://hedgedocs.com/index.php?title=Text_Book&amp;diff=1356"/>
		<updated>2025-12-03T09:47:57Z</updated>

		<summary type="html">&lt;p&gt;Hyper: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&#039;&#039;&#039;&#039;&#039;Text Book&#039;&#039;&#039;&#039;&#039; is a file format used in [[Sonic the Hedgehog (2006)]] for storing text with friendly names and variables.&lt;br /&gt;
&lt;br /&gt;
These files are located in &amp;lt;code&amp;gt;cache.arc&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;text.arc&amp;lt;/code&amp;gt; under the &amp;lt;code&amp;gt;./text/&amp;lt;/code&amp;gt; directory from platform root as &amp;lt;code&amp;gt;*.mst&amp;lt;/code&amp;gt; files.&lt;br /&gt;
&lt;br /&gt;
== Specification ==&lt;br /&gt;
&#039;&#039;&#039;Text Book&#039;&#039;&#039; uses a [[Binary Resource]] container. The text to be displayed is encoded as UTF-16, whereas the names and variables are encoded as Shift-JIS.&lt;br /&gt;
&lt;br /&gt;
=== Header ===&lt;br /&gt;
The header consists of the following data structure:&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+Length: 0x0C&lt;br /&gt;
!Offset&lt;br /&gt;
!Type&lt;br /&gt;
!Name&lt;br /&gt;
!Description&lt;br /&gt;
|-&lt;br /&gt;
|0x00&lt;br /&gt;
|Char[4]&lt;br /&gt;
|Signature&lt;br /&gt;
|Always &amp;quot;WTXT&amp;quot; (referring to UTF-16).&lt;br /&gt;
|-&lt;br /&gt;
|0x04&lt;br /&gt;
|UInt32&lt;br /&gt;
|NameOffset&lt;br /&gt;
|The offset of the name of this &#039;&#039;&#039;Text Book&#039;&#039;&#039;.&lt;br /&gt;
|-&lt;br /&gt;
|0x08&lt;br /&gt;
|UInt32&lt;br /&gt;
|CardCount&lt;br /&gt;
|The total number of &#039;&#039;&#039;Text Cards&#039;&#039;&#039; in this &#039;&#039;&#039;Text Book&#039;&#039;&#039;.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Text Card ===&lt;br /&gt;
Text Cards consist of the following data structure:&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+Length: 0x0C&lt;br /&gt;
!Offset&lt;br /&gt;
!Type&lt;br /&gt;
!Name&lt;br /&gt;
!Description&lt;br /&gt;
|-&lt;br /&gt;
|0x00&lt;br /&gt;
|UInt32&lt;br /&gt;
|NameOffset&lt;br /&gt;
|The offset of the name of this &#039;&#039;&#039;Text Card&#039;&#039;&#039;.&lt;br /&gt;
|-&lt;br /&gt;
|0x04&lt;br /&gt;
|UInt32&lt;br /&gt;
|TextOffset&lt;br /&gt;
|The offset of the UTF-16 text for this &#039;&#039;&#039;Text Card&#039;&#039;&#039;.&lt;br /&gt;
|-&lt;br /&gt;
|0x08&lt;br /&gt;
|UInt32&lt;br /&gt;
|VariablesOffset&lt;br /&gt;
|The offset of the variables for this &#039;&#039;&#039;Text Card&#039;&#039;&#039;.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Variables ==&lt;br /&gt;
Variables are stored as comma-separated values, there should be one for each &#039;$&#039; character in the actual text to be displayed.&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+&lt;br /&gt;
!Variable&lt;br /&gt;
!Description&lt;br /&gt;
!Parameters&lt;br /&gt;
|-&lt;br /&gt;
|blue&lt;br /&gt;
|Once encountered, starts colouring characters blue. &amp;lt;span title=&amp;quot;#00C6C6&amp;quot; style=&amp;quot;display: inline-block; width: 12px; height: 12px; background: #00C6C6; margin: 0 4px; vertical-align: middle;&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
|None&lt;br /&gt;
|-&lt;br /&gt;
|color&lt;br /&gt;
|Once encountered, starts colouring characters white. &amp;lt;span title=&amp;quot;#FFFFFF&amp;quot; style=&amp;quot;display: inline-block; width: 12px; height: 12px; background: #FFFFFF; margin: 0 4px; vertical-align: middle;&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
|None&lt;br /&gt;
|-&lt;br /&gt;
|color!&lt;br /&gt;
|Once encountered, starts colouring characters yellow. &amp;lt;span title=&amp;quot;#FFC658&amp;quot; style=&amp;quot;display: inline-block; width: 12px; height: 12px; background: #FFC658; margin: 0 4px; vertical-align: middle;&amp;quot;&amp;gt;&amp;lt;/span&amp;gt; Presumably this is meant as the &amp;quot;warning&amp;quot; colour, hence the exclamation mark.&lt;br /&gt;
|None&lt;br /&gt;
|-&lt;br /&gt;
|gray&lt;br /&gt;
|Once encountered, starts colouring characters grey. &amp;lt;span title=&amp;quot;#737373&amp;quot; style=&amp;quot;display: inline-block; width: 12px; height: 12px; background: #737373; margin: 0 4px; vertical-align: middle;&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
|None&lt;br /&gt;
|-&lt;br /&gt;
|green&lt;br /&gt;
|Once encountered, starts colouring characters green. &amp;lt;span title=&amp;quot;#58FF8E&amp;quot; style=&amp;quot;display: inline-block; width: 12px; height: 12px; background: #58FF8E; margin: 0 4px; vertical-align: middle;&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
|None&lt;br /&gt;
|-&lt;br /&gt;
|picture&lt;br /&gt;
|Once encountered, draws the specified picture defined in the game&#039;s &#039;&#039;&#039;Text Font Picture&#039;&#039;&#039; file.&lt;br /&gt;
|String&lt;br /&gt;
|-&lt;br /&gt;
|red&lt;br /&gt;
|Once encountered, starts colouring characters red. &amp;lt;span title=&amp;quot;#FD5858&amp;quot; style=&amp;quot;display: inline-block; width: 12px; height: 12px; background: #FD5858; margin: 0 4px; vertical-align: middle;&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
|None&lt;br /&gt;
|-&lt;br /&gt;
|rgba&lt;br /&gt;
|Once encountered, starts colouring characters the specified colour. Despite the name, this does not support setting the alpha colour of the text.&lt;br /&gt;
|Byte, Byte, Byte&lt;br /&gt;
|-&lt;br /&gt;
|sound&lt;br /&gt;
|Once encountered, plays the specified sound effect if the &#039;&#039;&#039;Sound Bank&#039;&#039;&#039; containing it is loaded.&lt;br /&gt;
|String&lt;br /&gt;
|-&lt;br /&gt;
|text&lt;br /&gt;
|Unknown.&lt;br /&gt;
|Unknown&lt;br /&gt;
|-&lt;br /&gt;
|value&lt;br /&gt;
|Unknown.&lt;br /&gt;
|Unknown&lt;br /&gt;
|-&lt;br /&gt;
|yellow&lt;br /&gt;
|Once encountered, starts colouring characters yellow. &amp;lt;span title=&amp;quot;#FCC658&amp;quot; style=&amp;quot;display: inline-block; width: 12px; height: 12px; background: #FCC658; margin: 0 4px; vertical-align: middle;&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
|None&lt;br /&gt;
|}&lt;br /&gt;
For example, with the following text:&amp;lt;syntaxhighlight lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
$The quick $brown$ fox jumps over the $lazy$ dog.\nPress the $ button to continue.&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;And the following variables:&amp;lt;syntaxhighlight lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
sound(all01_a00_sn),rgba(127,51,0),color,red,color,picture(button_a)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;The game should first play the sound &amp;lt;code&amp;gt;all01_a00_sn&amp;lt;/code&amp;gt;, then draw something akin to the following text:&lt;br /&gt;
The quick &amp;lt;span style=&amp;quot;color:#7F3300;&amp;quot;&amp;gt;brown&amp;lt;/span&amp;gt; fox jumps over the &amp;lt;span style=&amp;quot;color:#FD5858;&amp;quot;&amp;gt;lazy&amp;lt;/span&amp;gt; dog. Press the &amp;lt;span style=&amp;quot;color:#58FF8E;&amp;quot;&amp;gt;&#039;&#039;&#039;Ⓐ&#039;&#039;&#039;&amp;lt;/span&amp;gt; button to continue.&lt;br /&gt;
[[Category:File Formats]]&lt;/div&gt;</summary>
		<author><name>Hyper</name></author>
	</entry>
	<entry>
		<id>https://hedgedocs.com/index.php?title=Text_Book&amp;diff=1355</id>
		<title>Text Book</title>
		<link rel="alternate" type="text/html" href="https://hedgedocs.com/index.php?title=Text_Book&amp;diff=1355"/>
		<updated>2025-12-03T09:45:56Z</updated>

		<summary type="html">&lt;p&gt;Hyper: Added colour guides to variables&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&#039;&#039;&#039;&#039;&#039;Text Book&#039;&#039;&#039;&#039;&#039; is a file format used in [[Sonic the Hedgehog (2006)]] for storing text with friendly names and variables.&lt;br /&gt;
&lt;br /&gt;
These files are located in &amp;lt;code&amp;gt;cache.arc&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;text.arc&amp;lt;/code&amp;gt; under the &amp;lt;code&amp;gt;./text/&amp;lt;/code&amp;gt; directory from platform root as &amp;lt;code&amp;gt;*.mst&amp;lt;/code&amp;gt; files.&lt;br /&gt;
&lt;br /&gt;
== Specification ==&lt;br /&gt;
&#039;&#039;&#039;Text Book&#039;&#039;&#039; uses a [[Binary Resource]] container. The text to be displayed is encoded as UTF-16, whereas the names and variables are encoded as Shift-JIS.&lt;br /&gt;
&lt;br /&gt;
=== Header ===&lt;br /&gt;
The header consists of the following data structure:&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+Length: 0x0C&lt;br /&gt;
!Offset&lt;br /&gt;
!Type&lt;br /&gt;
!Name&lt;br /&gt;
!Description&lt;br /&gt;
|-&lt;br /&gt;
|0x00&lt;br /&gt;
|Char[4]&lt;br /&gt;
|Signature&lt;br /&gt;
|Always &amp;quot;WTXT&amp;quot; (referring to UTF-16).&lt;br /&gt;
|-&lt;br /&gt;
|0x04&lt;br /&gt;
|UInt32&lt;br /&gt;
|NameOffset&lt;br /&gt;
|The offset of the name of this &#039;&#039;&#039;Text Book&#039;&#039;&#039;.&lt;br /&gt;
|-&lt;br /&gt;
|0x08&lt;br /&gt;
|UInt32&lt;br /&gt;
|CardCount&lt;br /&gt;
|The total number of &#039;&#039;&#039;Text Cards&#039;&#039;&#039; in this &#039;&#039;&#039;Text Book&#039;&#039;&#039;.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Text Card ===&lt;br /&gt;
Text Cards consist of the following data structure:&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+Length: 0x0C&lt;br /&gt;
!Offset&lt;br /&gt;
!Type&lt;br /&gt;
!Name&lt;br /&gt;
!Description&lt;br /&gt;
|-&lt;br /&gt;
|0x00&lt;br /&gt;
|UInt32&lt;br /&gt;
|NameOffset&lt;br /&gt;
|The offset of the name of this &#039;&#039;&#039;Text Card&#039;&#039;&#039;.&lt;br /&gt;
|-&lt;br /&gt;
|0x04&lt;br /&gt;
|UInt32&lt;br /&gt;
|TextOffset&lt;br /&gt;
|The offset of the UTF-16 text for this &#039;&#039;&#039;Text Card&#039;&#039;&#039;.&lt;br /&gt;
|-&lt;br /&gt;
|0x08&lt;br /&gt;
|UInt32&lt;br /&gt;
|VariablesOffset&lt;br /&gt;
|The offset of the variables for this &#039;&#039;&#039;Text Card&#039;&#039;&#039;.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Variables ==&lt;br /&gt;
Variables are stored as comma-separated values, there should be one for each &#039;$&#039; character in the actual text to be displayed.&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+&lt;br /&gt;
!Variable&lt;br /&gt;
!Description&lt;br /&gt;
!Parameters&lt;br /&gt;
|-&lt;br /&gt;
|blue&lt;br /&gt;
|Once encountered, starts colouring characters blue. &amp;lt;span title=&amp;quot;#00C6C6&amp;quot; style=&amp;quot;display: inline-block; width: 12px; height: 12px; background: #00C6C6; margin: 0 4px; vertical-align: middle;&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
|None&lt;br /&gt;
|-&lt;br /&gt;
|color&lt;br /&gt;
|Once encountered, starts colouring characters white.&lt;br /&gt;
|None&lt;br /&gt;
|-&lt;br /&gt;
|color!&lt;br /&gt;
|Once encountered, starts colouring characters yellow. &amp;lt;span title=&amp;quot;#FFC658&amp;quot; style=&amp;quot;display: inline-block; width: 12px; height: 12px; background: #FFC658; margin: 0 4px; vertical-align: middle;&amp;quot;&amp;gt;&amp;lt;/span&amp;gt; Presumably this is meant as the &amp;quot;warning&amp;quot; colour, hence the exclamation mark.&lt;br /&gt;
|None&lt;br /&gt;
|-&lt;br /&gt;
|gray&lt;br /&gt;
|Once encountered, starts colouring characters grey. &amp;lt;span title=&amp;quot;#737373&amp;quot; style=&amp;quot;display: inline-block; width: 12px; height: 12px; background: #737373; margin: 0 4px; vertical-align: middle;&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
|None&lt;br /&gt;
|-&lt;br /&gt;
|green&lt;br /&gt;
|Once encountered, starts colouring characters green. &amp;lt;span title=&amp;quot;#58FF8E&amp;quot; style=&amp;quot;display: inline-block; width: 12px; height: 12px; background: #58FF8E; margin: 0 4px; vertical-align: middle;&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
|None&lt;br /&gt;
|-&lt;br /&gt;
|picture&lt;br /&gt;
|Once encountered, draws the specified picture defined in the game&#039;s &#039;&#039;&#039;Text Font Picture&#039;&#039;&#039; file.&lt;br /&gt;
|String&lt;br /&gt;
|-&lt;br /&gt;
|red&lt;br /&gt;
|Once encountered, starts colouring characters red. &amp;lt;span title=&amp;quot;#FD5858&amp;quot; style=&amp;quot;display: inline-block; width: 12px; height: 12px; background: #FD5858; margin: 0 4px; vertical-align: middle;&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
|None&lt;br /&gt;
|-&lt;br /&gt;
|rgba&lt;br /&gt;
|Once encountered, starts colouring characters the specified colour. Despite the name, this does not support setting the alpha colour of the text.&lt;br /&gt;
|Byte, Byte, Byte&lt;br /&gt;
|-&lt;br /&gt;
|sound&lt;br /&gt;
|Once encountered, plays the specified sound effect if the &#039;&#039;&#039;Sound Bank&#039;&#039;&#039; containing it is loaded.&lt;br /&gt;
|String&lt;br /&gt;
|-&lt;br /&gt;
|text&lt;br /&gt;
|Unknown.&lt;br /&gt;
|Unknown&lt;br /&gt;
|-&lt;br /&gt;
|value&lt;br /&gt;
|Unknown.&lt;br /&gt;
|Unknown&lt;br /&gt;
|-&lt;br /&gt;
|yellow&lt;br /&gt;
|Once encountered, starts colouring characters yellow. &amp;lt;span title=&amp;quot;#FCC658&amp;quot; style=&amp;quot;display: inline-block; width: 12px; height: 12px; background: #FCC658; margin: 0 4px; vertical-align: middle;&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
|None&lt;br /&gt;
|}&lt;br /&gt;
For example, with the following text:&amp;lt;syntaxhighlight lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
$The quick $brown$ fox jumps over the $lazy$ dog.\nPress the $ button to continue.&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;And the following variables:&amp;lt;syntaxhighlight lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
sound(all01_a00_sn),rgba(127,51,0),color,red,color,picture(button_a)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;The game should first play the sound &amp;lt;code&amp;gt;all01_a00_sn&amp;lt;/code&amp;gt;, then draw something akin to the following text:&lt;br /&gt;
The quick &amp;lt;span style=&amp;quot;color:#7F3300;&amp;quot;&amp;gt;brown&amp;lt;/span&amp;gt; fox jumps over the &amp;lt;span style=&amp;quot;color:#FD5858;&amp;quot;&amp;gt;lazy&amp;lt;/span&amp;gt; dog. Press the &amp;lt;span style=&amp;quot;color:#58FF8E;&amp;quot;&amp;gt;&#039;&#039;&#039;Ⓐ&#039;&#039;&#039;&amp;lt;/span&amp;gt; button to continue.&lt;br /&gt;
[[Category:File Formats]]&lt;/div&gt;</summary>
		<author><name>Hyper</name></author>
	</entry>
	<entry>
		<id>https://hedgedocs.com/index.php?title=Text_Book&amp;diff=1354</id>
		<title>Text Book</title>
		<link rel="alternate" type="text/html" href="https://hedgedocs.com/index.php?title=Text_Book&amp;diff=1354"/>
		<updated>2025-12-03T09:05:00Z</updated>

		<summary type="html">&lt;p&gt;Hyper: Documented unused text variables&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&#039;&#039;&#039;&#039;&#039;Text Book&#039;&#039;&#039;&#039;&#039; is a file format used in [[Sonic the Hedgehog (2006)]] for storing text with friendly names and variables.&lt;br /&gt;
&lt;br /&gt;
These files are located in &amp;lt;code&amp;gt;cache.arc&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;text.arc&amp;lt;/code&amp;gt; under the &amp;lt;code&amp;gt;./text/&amp;lt;/code&amp;gt; directory from platform root as &amp;lt;code&amp;gt;*.mst&amp;lt;/code&amp;gt; files.&lt;br /&gt;
&lt;br /&gt;
== Specification ==&lt;br /&gt;
&#039;&#039;&#039;Text Book&#039;&#039;&#039; uses a [[Binary Resource]] container. The text to be displayed is encoded as UTF-16, whereas the names and variables are encoded as Shift-JIS.&lt;br /&gt;
&lt;br /&gt;
=== Header ===&lt;br /&gt;
The header consists of the following data structure:&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+Length: 0x0C&lt;br /&gt;
!Offset&lt;br /&gt;
!Type&lt;br /&gt;
!Name&lt;br /&gt;
!Description&lt;br /&gt;
|-&lt;br /&gt;
|0x00&lt;br /&gt;
|Char[4]&lt;br /&gt;
|Signature&lt;br /&gt;
|Always &amp;quot;WTXT&amp;quot; (referring to UTF-16).&lt;br /&gt;
|-&lt;br /&gt;
|0x04&lt;br /&gt;
|UInt32&lt;br /&gt;
|NameOffset&lt;br /&gt;
|The offset of the name of this &#039;&#039;&#039;Text Book&#039;&#039;&#039;.&lt;br /&gt;
|-&lt;br /&gt;
|0x08&lt;br /&gt;
|UInt32&lt;br /&gt;
|CardCount&lt;br /&gt;
|The total number of &#039;&#039;&#039;Text Cards&#039;&#039;&#039; in this &#039;&#039;&#039;Text Book&#039;&#039;&#039;.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Text Card ===&lt;br /&gt;
Text Cards consist of the following data structure:&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+Length: 0x0C&lt;br /&gt;
!Offset&lt;br /&gt;
!Type&lt;br /&gt;
!Name&lt;br /&gt;
!Description&lt;br /&gt;
|-&lt;br /&gt;
|0x00&lt;br /&gt;
|UInt32&lt;br /&gt;
|NameOffset&lt;br /&gt;
|The offset of the name of this &#039;&#039;&#039;Text Card&#039;&#039;&#039;.&lt;br /&gt;
|-&lt;br /&gt;
|0x04&lt;br /&gt;
|UInt32&lt;br /&gt;
|TextOffset&lt;br /&gt;
|The offset of the UTF-16 text for this &#039;&#039;&#039;Text Card&#039;&#039;&#039;.&lt;br /&gt;
|-&lt;br /&gt;
|0x08&lt;br /&gt;
|UInt32&lt;br /&gt;
|VariablesOffset&lt;br /&gt;
|The offset of the variables for this &#039;&#039;&#039;Text Card&#039;&#039;&#039;.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Variables ==&lt;br /&gt;
Variables are stored as comma-separated values, there should be one for each &#039;$&#039; character in the actual text to be displayed.&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+&lt;br /&gt;
!Variable&lt;br /&gt;
!Description&lt;br /&gt;
!Parameters&lt;br /&gt;
|-&lt;br /&gt;
|blue&lt;br /&gt;
|Once encountered, starts colouring characters light blue.&lt;br /&gt;
|None&lt;br /&gt;
|-&lt;br /&gt;
|color&lt;br /&gt;
|Once encountered, starts colouring characters white.&lt;br /&gt;
|None&lt;br /&gt;
|-&lt;br /&gt;
|color!&lt;br /&gt;
|Once encountered, starts colouring characters dark yellow. Presumably this is meant as the &amp;quot;warning&amp;quot; colour, hence the exclamation mark.&lt;br /&gt;
|None&lt;br /&gt;
|-&lt;br /&gt;
|gray&lt;br /&gt;
|Once encountered, starts colouring characters grey.&lt;br /&gt;
|None&lt;br /&gt;
|-&lt;br /&gt;
|green&lt;br /&gt;
|Once encountered, starts colouring characters green.&lt;br /&gt;
|None&lt;br /&gt;
|-&lt;br /&gt;
|picture&lt;br /&gt;
|Once encountered, draws the specified picture defined in the game&#039;s &#039;&#039;&#039;Text Font Picture&#039;&#039;&#039; file.&lt;br /&gt;
|String&lt;br /&gt;
|-&lt;br /&gt;
|red&lt;br /&gt;
|Once encountered, starts colouring characters red.&lt;br /&gt;
|None&lt;br /&gt;
|-&lt;br /&gt;
|rgba&lt;br /&gt;
|Once encountered, starts colouring characters the specified colour. Despite the name, this does not support setting the alpha colour of the text.&lt;br /&gt;
|Byte, Byte, Byte&lt;br /&gt;
|-&lt;br /&gt;
|sound&lt;br /&gt;
|Once encountered, plays the specified sound effect if the &#039;&#039;&#039;Sound Bank&#039;&#039;&#039; containing it is loaded.&lt;br /&gt;
|String&lt;br /&gt;
|-&lt;br /&gt;
|text&lt;br /&gt;
|Unknown.&lt;br /&gt;
|Unknown&lt;br /&gt;
|-&lt;br /&gt;
|value&lt;br /&gt;
|Unknown.&lt;br /&gt;
|Unknown&lt;br /&gt;
|-&lt;br /&gt;
|yellow&lt;br /&gt;
|Once encountered, starts colouring characters dark yellow.&lt;br /&gt;
|None&lt;br /&gt;
|}&lt;br /&gt;
For example, with the following text:&amp;lt;syntaxhighlight lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
$The quick $brown$ fox jumps over the $lazy$ dog.\nPress the $ button to continue.&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;And the following variables:&amp;lt;syntaxhighlight lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
sound(all01_a00_sn),rgba(127,51,0),color,red,color,picture(button_a)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;The game should first play the sound &amp;lt;code&amp;gt;all01_a00_sn&amp;lt;/code&amp;gt;, then draw something akin to the following text:&lt;br /&gt;
The quick &amp;lt;span style=&amp;quot;color:#7F3300;&amp;quot;&amp;gt;brown&amp;lt;/span&amp;gt; fox jumps over the &amp;lt;span style=&amp;quot;color:#FF0000;&amp;quot;&amp;gt;lazy&amp;lt;/span&amp;gt; dog. Press the &amp;lt;span style=&amp;quot;color:#32AA00;&amp;quot;&amp;gt;&#039;&#039;&#039;Ⓐ&#039;&#039;&#039;&amp;lt;/span&amp;gt; button to continue.&lt;br /&gt;
[[Category:File Formats]]&lt;/div&gt;</summary>
		<author><name>Hyper</name></author>
	</entry>
	<entry>
		<id>https://hedgedocs.com/index.php?title=U8_Archive&amp;diff=1263</id>
		<title>U8 Archive</title>
		<link rel="alternate" type="text/html" href="https://hedgedocs.com/index.php?title=U8_Archive&amp;diff=1263"/>
		<updated>2025-12-02T20:37:48Z</updated>

		<summary type="html">&lt;p&gt;Hyper: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&#039;&#039;&#039;&#039;&#039;U8 Archive&#039;&#039;&#039;&#039;&#039; is a hierarchical archive format developed by Nintendo during the GameCube era and was predominantly used on the Wii.&lt;br /&gt;
&lt;br /&gt;
== Titles using U8 Archive ==&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+&lt;br /&gt;
!Game&lt;br /&gt;
!Platforms&lt;br /&gt;
!Usage&lt;br /&gt;
|-&lt;br /&gt;
|Sonic Heroes&lt;br /&gt;
|PlayStation 2&lt;br /&gt;
| rowspan=&amp;quot;2&amp;quot; |Used as the packed file system.&lt;br /&gt;
|-&lt;br /&gt;
|[[Sonic the Hedgehog (2006)]]&lt;br /&gt;
|Xbox 360, PlayStation 3&lt;br /&gt;
|-&lt;br /&gt;
|Sonic and the Secret Rings&lt;br /&gt;
| rowspan=&amp;quot;3&amp;quot; |Wii&lt;br /&gt;
| rowspan=&amp;quot;2&amp;quot; |Used for operating system only.&lt;br /&gt;
|-&lt;br /&gt;
|Sonic and the Black Knight&lt;br /&gt;
|-&lt;br /&gt;
|[[Sonic Colors]]&lt;br /&gt;
|Used as the packed file system.&lt;br /&gt;
|-&lt;br /&gt;
|Sonic Colors: Ultimate&lt;br /&gt;
|Windows, Xbox One, PlayStation 4, Switch&lt;br /&gt;
|Used as the packed file system for data not covered by Godot.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Specification ==&lt;br /&gt;
=== Header ===&lt;br /&gt;
The header consists of the following data structure:&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+Length: 0x20&lt;br /&gt;
!Offset&lt;br /&gt;
!Type&lt;br /&gt;
!Name&lt;br /&gt;
!Description&lt;br /&gt;
|-&lt;br /&gt;
|0x00&lt;br /&gt;
|UInt32&lt;br /&gt;
|Signature&lt;br /&gt;
|Always 0x55AA382D (big-endian) or 0x2D38AA55 (little-endian).&lt;br /&gt;
|-&lt;br /&gt;
|0x04&lt;br /&gt;
|UInt32&lt;br /&gt;
|FSTableOffset&lt;br /&gt;
|The offset of the file system table.&lt;br /&gt;
|-&lt;br /&gt;
|0x08&lt;br /&gt;
|UInt32&lt;br /&gt;
|FSTableLength&lt;br /&gt;
|The length of the file system table (including the string pool).&lt;br /&gt;
|-&lt;br /&gt;
|0x0C&lt;br /&gt;
|UInt32&lt;br /&gt;
|DataOffset&lt;br /&gt;
|The offset of the file data.&lt;br /&gt;
|-&lt;br /&gt;
|0x10&lt;br /&gt;
|UInt32[4]&lt;br /&gt;
|Reserved&lt;br /&gt;
|These fields appear to be populated in archives for &#039;&#039;&#039;Sonic the Hedgehog (2006)&#039;&#039;&#039;, but this is bogus data from uninitialised memory and should be ignored.&lt;br /&gt;
For the sake of tooling heuristics, writing &amp;lt;code&amp;gt;0xE4F91300&amp;lt;/code&amp;gt; (big-endian) to index 0 and &amp;lt;code&amp;gt;0x78013800&amp;lt;/code&amp;gt; (big-endian) to index 3 would be ideal for detecting whether an archive is from that game specifically.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== File System ===&lt;br /&gt;
The file system consists of an array of the following data structure:&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+Length: 0x0C (or 0x10 for Sonic the Hedgehog (2006))&lt;br /&gt;
!Offset&lt;br /&gt;
!Type&lt;br /&gt;
!Name&lt;br /&gt;
!Description&lt;br /&gt;
|-&lt;br /&gt;
|0x00&lt;br /&gt;
|Boolean (UInt8)&lt;br /&gt;
|IsDirectory&lt;br /&gt;
|Determines whether this node is a directory.&lt;br /&gt;
|-&lt;br /&gt;
|0x01&lt;br /&gt;
|UInt24&lt;br /&gt;
|NameOffset&lt;br /&gt;
|The offset of this node&#039;s name in the string pool.&lt;br /&gt;
If root, always zero.&lt;br /&gt;
|-&lt;br /&gt;
|0x04&lt;br /&gt;
|Union (UInt32, UInt32)&lt;br /&gt;
|DataOffset, ParentIndex&lt;br /&gt;
|&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+&lt;br /&gt;
|File&lt;br /&gt;
|The offset of this file&#039;s data.&lt;br /&gt;
|-&lt;br /&gt;
|Directory&lt;br /&gt;
|The index of the parent node for this directory.&lt;br /&gt;
If root, always zero.&lt;br /&gt;
|}&lt;br /&gt;
|-&lt;br /&gt;
|0x08&lt;br /&gt;
|Union (UInt32, UInt32)&lt;br /&gt;
|Length, NodeCount&lt;br /&gt;
|&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+&lt;br /&gt;
|File&lt;br /&gt;
|The length of this file&#039;s data.&lt;br /&gt;
|-&lt;br /&gt;
|Directory&lt;br /&gt;
|The total number of nodes in this directory.&lt;br /&gt;
If root, the total number of nodes in this archive.&lt;br /&gt;
|}&lt;br /&gt;
|-&lt;br /&gt;
|0x0C&lt;br /&gt;
|UInt32&lt;br /&gt;
|UncompressedLength&lt;br /&gt;
|This field is unique to archives for &#039;&#039;&#039;Sonic the Hedgehog (2006)&#039;&#039;&#039;.&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+&lt;br /&gt;
|File&lt;br /&gt;
|The uncompressed length of this file&#039;s data.&lt;br /&gt;
This field can be set to zero to disable compression for this file, allowing its data to be stored uncompressed.&lt;br /&gt;
|-&lt;br /&gt;
|Directory&lt;br /&gt;
|Undefined.&lt;br /&gt;
Much like the reserved bytes in the header, this field will appear to be populated, but again, this is bogus data from uninitialised memory.&lt;br /&gt;
|}&lt;br /&gt;
|}&lt;br /&gt;
The total number of nodes to read is determined by the root node&#039;s &amp;lt;code&amp;gt;NodeCount&amp;lt;/code&amp;gt; field. As this is a hierarchical file system, nodes should be read recursively to build the file system correctly.&lt;br /&gt;
&lt;br /&gt;
The first node &#039;&#039;&#039;must&#039;&#039;&#039; be a root node defined as a directory, with the &amp;lt;code&amp;gt;NodeCount&amp;lt;/code&amp;gt; field set to the total number of nodes in the archive. This is necessary for determining the length of the file system table.&lt;br /&gt;
&lt;br /&gt;
=== String Pool ===&lt;br /&gt;
The string pool offset can be calculated after reading the root node and using the following expression:&amp;lt;syntaxhighlight lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
FSTableOffset + (Root.NodeCount * FSNodeSize) // FSNodeSize = 0x0C (or 0x10 for Sonic the Hedgehog (2006))&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;Each string in the pool is ASCII-encoded and null-terminated, the offsets to which are relative to the start of the pool.&lt;br /&gt;
&lt;br /&gt;
The string pool &#039;&#039;&#039;must&#039;&#039;&#039; have a single null terminator at the beginning for the root node, as it does not have a name.&lt;br /&gt;
&lt;br /&gt;
=== File Data ===&lt;br /&gt;
Files are aligned by 32 bytes per file after the string pool.&lt;br /&gt;
&lt;br /&gt;
In &#039;&#039;&#039;Sonic the Hedgehog (2006)&#039;&#039;&#039;, files may be compressed using [[wikipedia:Zlib|zlib]]. This compression is optional, and files can be stored uncompressed so long as &amp;lt;code&amp;gt;UncompressedLength&amp;lt;/code&amp;gt; is set to zero.&lt;br /&gt;
[[Category:File Formats]]&lt;/div&gt;</summary>
		<author><name>Hyper</name></author>
	</entry>
	<entry>
		<id>https://hedgedocs.com/index.php?title=U8_Archive&amp;diff=1262</id>
		<title>U8 Archive</title>
		<link rel="alternate" type="text/html" href="https://hedgedocs.com/index.php?title=U8_Archive&amp;diff=1262"/>
		<updated>2025-12-02T20:36:15Z</updated>

		<summary type="html">&lt;p&gt;Hyper: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&#039;&#039;&#039;&#039;&#039;U8 Archive&#039;&#039;&#039;&#039;&#039; is a hierarchical archive format developed by Nintendo during the GameCube era and was predominantly used on the Wii.&lt;br /&gt;
&lt;br /&gt;
== Titles using U8 Archive ==&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+&lt;br /&gt;
!Game&lt;br /&gt;
!Platforms&lt;br /&gt;
!Usage&lt;br /&gt;
|-&lt;br /&gt;
|Sonic Heroes&lt;br /&gt;
|PlayStation 2&lt;br /&gt;
|Used as the packed file system.&lt;br /&gt;
|-&lt;br /&gt;
|[[Sonic the Hedgehog (2006)]]&lt;br /&gt;
|Xbox 360, PlayStation 3&lt;br /&gt;
|Used as the packed file system.&lt;br /&gt;
|-&lt;br /&gt;
|Sonic and the Secret Rings&lt;br /&gt;
|Wii&lt;br /&gt;
|Used for operating system only.&lt;br /&gt;
|-&lt;br /&gt;
|Sonic and the Black Knight&lt;br /&gt;
|Wii&lt;br /&gt;
|Used for operating system only.&lt;br /&gt;
|-&lt;br /&gt;
|[[Sonic Colors]]&lt;br /&gt;
|Wii&lt;br /&gt;
|Used as the packed file system.&lt;br /&gt;
|-&lt;br /&gt;
|Sonic Colors: Ultimate&lt;br /&gt;
|Windows, Xbox One, PlayStation 4, Switch&lt;br /&gt;
|Used as the packed file system for data not covered by Godot.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Specification ==&lt;br /&gt;
=== Header ===&lt;br /&gt;
The header consists of the following data structure:&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+Length: 0x20&lt;br /&gt;
!Offset&lt;br /&gt;
!Type&lt;br /&gt;
!Name&lt;br /&gt;
!Description&lt;br /&gt;
|-&lt;br /&gt;
|0x00&lt;br /&gt;
|UInt32&lt;br /&gt;
|Signature&lt;br /&gt;
|Always 0x55AA382D (big-endian) or 0x2D38AA55 (little-endian).&lt;br /&gt;
|-&lt;br /&gt;
|0x04&lt;br /&gt;
|UInt32&lt;br /&gt;
|FSTableOffset&lt;br /&gt;
|The offset of the file system table.&lt;br /&gt;
|-&lt;br /&gt;
|0x08&lt;br /&gt;
|UInt32&lt;br /&gt;
|FSTableLength&lt;br /&gt;
|The length of the file system table (including the string pool).&lt;br /&gt;
|-&lt;br /&gt;
|0x0C&lt;br /&gt;
|UInt32&lt;br /&gt;
|DataOffset&lt;br /&gt;
|The offset of the file data.&lt;br /&gt;
|-&lt;br /&gt;
|0x10&lt;br /&gt;
|UInt32[4]&lt;br /&gt;
|Reserved&lt;br /&gt;
|These fields appear to be populated in archives for &#039;&#039;&#039;Sonic the Hedgehog (2006)&#039;&#039;&#039;, but this is bogus data from uninitialised memory and should be ignored.&lt;br /&gt;
For the sake of tooling heuristics, writing &amp;lt;code&amp;gt;0xE4F91300&amp;lt;/code&amp;gt; (big-endian) to index 0 and &amp;lt;code&amp;gt;0x78013800&amp;lt;/code&amp;gt; (big-endian) to index 3 would be ideal for detecting whether an archive is from that game specifically.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== File System ===&lt;br /&gt;
The file system consists of an array of the following data structure:&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+Length: 0x0C (or 0x10 for Sonic the Hedgehog (2006))&lt;br /&gt;
!Offset&lt;br /&gt;
!Type&lt;br /&gt;
!Name&lt;br /&gt;
!Description&lt;br /&gt;
|-&lt;br /&gt;
|0x00&lt;br /&gt;
|Boolean (UInt8)&lt;br /&gt;
|IsDirectory&lt;br /&gt;
|Determines whether this node is a directory.&lt;br /&gt;
|-&lt;br /&gt;
|0x01&lt;br /&gt;
|UInt24&lt;br /&gt;
|NameOffset&lt;br /&gt;
|The offset of this node&#039;s name in the string pool.&lt;br /&gt;
If root, always zero.&lt;br /&gt;
|-&lt;br /&gt;
|0x04&lt;br /&gt;
|Union (UInt32, UInt32)&lt;br /&gt;
|DataOffset, ParentIndex&lt;br /&gt;
|&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+&lt;br /&gt;
|File&lt;br /&gt;
|The offset of this file&#039;s data.&lt;br /&gt;
|-&lt;br /&gt;
|Directory&lt;br /&gt;
|The index of the parent node for this directory.&lt;br /&gt;
If root, always zero.&lt;br /&gt;
|}&lt;br /&gt;
|-&lt;br /&gt;
|0x08&lt;br /&gt;
|Union (UInt32, UInt32)&lt;br /&gt;
|Length, NodeCount&lt;br /&gt;
|&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+&lt;br /&gt;
|File&lt;br /&gt;
|The length of this file&#039;s data.&lt;br /&gt;
|-&lt;br /&gt;
|Directory&lt;br /&gt;
|The total number of nodes in this directory.&lt;br /&gt;
If root, the total number of nodes in this archive.&lt;br /&gt;
|}&lt;br /&gt;
|-&lt;br /&gt;
|0x0C&lt;br /&gt;
|UInt32&lt;br /&gt;
|UncompressedLength&lt;br /&gt;
|This field is unique to archives for &#039;&#039;&#039;Sonic the Hedgehog (2006)&#039;&#039;&#039;.&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+&lt;br /&gt;
|File&lt;br /&gt;
|The uncompressed length of this file&#039;s data.&lt;br /&gt;
This field can be set to zero to disable compression for this file, allowing its data to be stored uncompressed.&lt;br /&gt;
|-&lt;br /&gt;
|Directory&lt;br /&gt;
|Undefined.&lt;br /&gt;
Much like the reserved bytes in the header, this field will appear to be populated, but again, this is bogus data from uninitialised memory.&lt;br /&gt;
|}&lt;br /&gt;
|}&lt;br /&gt;
The total number of nodes to read is determined by the root node&#039;s &amp;lt;code&amp;gt;NodeCount&amp;lt;/code&amp;gt; field. As this is a hierarchical file system, nodes should be read recursively to build the file system correctly.&lt;br /&gt;
&lt;br /&gt;
The first node &#039;&#039;&#039;must&#039;&#039;&#039; be a root node defined as a directory, with the &amp;lt;code&amp;gt;NodeCount&amp;lt;/code&amp;gt; field set to the total number of nodes in the archive. This is necessary for determining the length of the file system table.&lt;br /&gt;
&lt;br /&gt;
=== String Pool ===&lt;br /&gt;
The string pool offset can be calculated after reading the root node and using the following expression:&amp;lt;syntaxhighlight lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
FSTableOffset + (Root.NodeCount * FSNodeSize) // FSNodeSize = 0x0C (or 0x10 for Sonic the Hedgehog (2006))&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;Each string in the pool is ASCII-encoded and null-terminated, the offsets to which are relative to the start of the pool.&lt;br /&gt;
&lt;br /&gt;
The string pool &#039;&#039;&#039;must&#039;&#039;&#039; have a single null terminator at the beginning for the root node, as it does not have a name.&lt;br /&gt;
&lt;br /&gt;
=== File Data ===&lt;br /&gt;
Files are aligned by 32 bytes per file after the string pool.&lt;br /&gt;
&lt;br /&gt;
In &#039;&#039;&#039;Sonic the Hedgehog (2006)&#039;&#039;&#039;, files may be compressed using [[wikipedia:Zlib|zlib]]. This compression is optional, and files can be stored uncompressed so long as &amp;lt;code&amp;gt;UncompressedLength&amp;lt;/code&amp;gt; is set to zero.&lt;br /&gt;
[[Category:File Formats]]&lt;/div&gt;</summary>
		<author><name>Hyper</name></author>
	</entry>
	<entry>
		<id>https://hedgedocs.com/index.php?title=Sonic_the_Hedgehog_(2006)&amp;diff=1261</id>
		<title>Sonic the Hedgehog (2006)</title>
		<link rel="alternate" type="text/html" href="https://hedgedocs.com/index.php?title=Sonic_the_Hedgehog_(2006)&amp;diff=1261"/>
		<updated>2025-12-02T20:27:18Z</updated>

		<summary type="html">&lt;p&gt;Hyper: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Guides ==&lt;br /&gt;
&lt;br /&gt;
=== Level Editing ===&lt;br /&gt;
* [[How To Use Sonic GLvl with Sonic &#039;06|Sonic GLvl]]&lt;br /&gt;
&lt;br /&gt;
== Documentation ==&lt;br /&gt;
&lt;br /&gt;
* [[Section IDs]]&lt;br /&gt;
* [[Player State IDs]]&lt;br /&gt;
* [[Texture Tags]]&lt;br /&gt;
* [[Sonic the Hedgehog (2006)/Shaders|Shaders]]&lt;br /&gt;
&lt;br /&gt;
== Formats ==&lt;br /&gt;
=== Archive ===&lt;br /&gt;
* [[U8 Archive]]&lt;br /&gt;
&lt;br /&gt;
=== Event ===&lt;br /&gt;
&lt;br /&gt;
* [[Event Playbook]]&lt;br /&gt;
&lt;br /&gt;
=== Ninja ===&lt;br /&gt;
* [[NN Chunk Format]]&lt;br /&gt;
&lt;br /&gt;
=== Text ===&lt;br /&gt;
&lt;br /&gt;
* [[Text Book]]&lt;/div&gt;</summary>
		<author><name>Hyper</name></author>
	</entry>
	<entry>
		<id>https://hedgedocs.com/index.php?title=Event_Playbook&amp;diff=1260</id>
		<title>Event Playbook</title>
		<link rel="alternate" type="text/html" href="https://hedgedocs.com/index.php?title=Event_Playbook&amp;diff=1260"/>
		<updated>2025-12-02T20:26:50Z</updated>

		<summary type="html">&lt;p&gt;Hyper: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&#039;&#039;&#039;&#039;&#039;Event Playbook&#039;&#039;&#039;&#039;&#039; is a file format used in [[Sonic the Hedgehog (2006)]] to define cutscene properties.&lt;br /&gt;
&lt;br /&gt;
This file is located at &amp;lt;code&amp;gt;./xenon/archives/cache.arc/xenon/eventplaybook.epb&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
== Specification ==&lt;br /&gt;
&#039;&#039;&#039;Event Playbook&#039;&#039;&#039; uses a [[Binary Resource]] container.&lt;br /&gt;
&lt;br /&gt;
=== Header ===&lt;br /&gt;
The header consists of the following data structure:&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+Length: 0x10&lt;br /&gt;
!Offset&lt;br /&gt;
!Type&lt;br /&gt;
!Name&lt;br /&gt;
!Description&lt;br /&gt;
|-&lt;br /&gt;
|0x00&lt;br /&gt;
|Char[4]&lt;br /&gt;
|Signature&lt;br /&gt;
|Always &amp;quot;.EPB&amp;quot;.&lt;br /&gt;
|-&lt;br /&gt;
|0x04&lt;br /&gt;
|UInt32&lt;br /&gt;
|Version&lt;br /&gt;
|Always 0x20060700 (big-endian). Format: 2006 July, Revision 0.&lt;br /&gt;
|-&lt;br /&gt;
|0x08&lt;br /&gt;
|UInt32&lt;br /&gt;
|EventCount&lt;br /&gt;
|The total number of events.&lt;br /&gt;
|-&lt;br /&gt;
|0x0C&lt;br /&gt;
|UInt32&lt;br /&gt;
|EventTableOffset&lt;br /&gt;
|The offset of the event table.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Event Playbook Data ===&lt;br /&gt;
Each event within the table consists of the following data structure:&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+Length: 0x38&lt;br /&gt;
!Offset&lt;br /&gt;
!Type&lt;br /&gt;
!Name&lt;br /&gt;
!Description&lt;br /&gt;
|-&lt;br /&gt;
|0x00&lt;br /&gt;
|UInt32&lt;br /&gt;
|NameOffset&lt;br /&gt;
|The offset to the name of this event.&lt;br /&gt;
|-&lt;br /&gt;
|0x04&lt;br /&gt;
|UInt32&lt;br /&gt;
|DirectoryOffset&lt;br /&gt;
|The offset to the path to the directory containing this event&#039;s resources.&lt;br /&gt;
|-&lt;br /&gt;
|0x08&lt;br /&gt;
|UInt32&lt;br /&gt;
|Duration&lt;br /&gt;
|The duration of this event in frames.&lt;br /&gt;
|-&lt;br /&gt;
|0x0C&lt;br /&gt;
|Vector3&lt;br /&gt;
|Position&lt;br /&gt;
|The start position of this event&#039;s camera.&lt;br /&gt;
|-&lt;br /&gt;
|0x18&lt;br /&gt;
|Vector3&lt;br /&gt;
|Rotation&lt;br /&gt;
|The start rotation of this event&#039;s camera.&lt;br /&gt;
|-&lt;br /&gt;
|0x24&lt;br /&gt;
|UInt32&lt;br /&gt;
|TerrainOffset&lt;br /&gt;
|The offset to the location of this event&#039;s terrain.&lt;br /&gt;
|-&lt;br /&gt;
|0x28&lt;br /&gt;
|UInt32&lt;br /&gt;
|SceneParamsOffset&lt;br /&gt;
|The offset to the location of this event&#039;s scene parameter script.&lt;br /&gt;
|-&lt;br /&gt;
|0x2C&lt;br /&gt;
|UInt32&lt;br /&gt;
|SoundBankOffset&lt;br /&gt;
|The offset to the location of this event&#039;s Sound Bank.&lt;br /&gt;
|-&lt;br /&gt;
|0x30&lt;br /&gt;
|UInt32&lt;br /&gt;
|ParticleContainerOffset&lt;br /&gt;
|The offset to the location of this event&#039;s Particle Container.&lt;br /&gt;
|-&lt;br /&gt;
|0x34&lt;br /&gt;
|UInt32&lt;br /&gt;
|TextBookOffset&lt;br /&gt;
|The offset to the location of this event&#039;s [[Text Book]] for subtitles.&lt;br /&gt;
|}&lt;br /&gt;
[[Category:File Formats]]&lt;/div&gt;</summary>
		<author><name>Hyper</name></author>
	</entry>
	<entry>
		<id>https://hedgedocs.com/index.php?title=Text_Book&amp;diff=1259</id>
		<title>Text Book</title>
		<link rel="alternate" type="text/html" href="https://hedgedocs.com/index.php?title=Text_Book&amp;diff=1259"/>
		<updated>2025-12-02T20:25:06Z</updated>

		<summary type="html">&lt;p&gt;Hyper: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&#039;&#039;&#039;&#039;&#039;Text Book&#039;&#039;&#039;&#039;&#039; is a file format used in [[Sonic the Hedgehog (2006)]] for storing text with friendly names and variables.&lt;br /&gt;
&lt;br /&gt;
These files are located in &amp;lt;code&amp;gt;cache.arc&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;text.arc&amp;lt;/code&amp;gt; under the &amp;lt;code&amp;gt;./text/&amp;lt;/code&amp;gt; directory from platform root as &amp;lt;code&amp;gt;*.mst&amp;lt;/code&amp;gt; files.&lt;br /&gt;
&lt;br /&gt;
== Specification ==&lt;br /&gt;
&#039;&#039;&#039;Text Book&#039;&#039;&#039; uses a [[Binary Resource]] container. The text to be displayed is encoded as UTF-16, whereas the names and variables are encoded as Shift-JIS.&lt;br /&gt;
&lt;br /&gt;
=== Header ===&lt;br /&gt;
The header consists of the following data structure:&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+Length: 0x0C&lt;br /&gt;
!Offset&lt;br /&gt;
!Type&lt;br /&gt;
!Name&lt;br /&gt;
!Description&lt;br /&gt;
|-&lt;br /&gt;
|0x00&lt;br /&gt;
|Char[4]&lt;br /&gt;
|Signature&lt;br /&gt;
|Always &amp;quot;WTXT&amp;quot; (referring to UTF-16).&lt;br /&gt;
|-&lt;br /&gt;
|0x04&lt;br /&gt;
|UInt32&lt;br /&gt;
|NameOffset&lt;br /&gt;
|The offset of the name of this &#039;&#039;&#039;Text Book&#039;&#039;&#039;.&lt;br /&gt;
|-&lt;br /&gt;
|0x08&lt;br /&gt;
|UInt32&lt;br /&gt;
|CardCount&lt;br /&gt;
|The total number of &#039;&#039;&#039;Text Cards&#039;&#039;&#039; in this &#039;&#039;&#039;Text Book&#039;&#039;&#039;.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Text Card ===&lt;br /&gt;
Text Cards consist of the following data structure:&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+Length: 0x0C&lt;br /&gt;
!Offset&lt;br /&gt;
!Type&lt;br /&gt;
!Name&lt;br /&gt;
!Description&lt;br /&gt;
|-&lt;br /&gt;
|0x00&lt;br /&gt;
|UInt32&lt;br /&gt;
|NameOffset&lt;br /&gt;
|The offset of the name of this &#039;&#039;&#039;Text Card&#039;&#039;&#039;.&lt;br /&gt;
|-&lt;br /&gt;
|0x04&lt;br /&gt;
|UInt32&lt;br /&gt;
|TextOffset&lt;br /&gt;
|The offset of the UTF-16 text for this &#039;&#039;&#039;Text Card&#039;&#039;&#039;.&lt;br /&gt;
|-&lt;br /&gt;
|0x08&lt;br /&gt;
|UInt32&lt;br /&gt;
|VariablesOffset&lt;br /&gt;
|The offset of the variables for this &#039;&#039;&#039;Text Card&#039;&#039;&#039;.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Variables ==&lt;br /&gt;
Variables are stored as comma-separated values, there should be one for each &#039;$&#039; character in the actual text to be displayed.&lt;br /&gt;
{{Notice|content=TODO: there are some unused variable types, test and document them.}}&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+&lt;br /&gt;
!Variable&lt;br /&gt;
!Description&lt;br /&gt;
!Usage&lt;br /&gt;
|-&lt;br /&gt;
|color&lt;br /&gt;
|Once encountered, stops colouring characters the colour that was previously set.&lt;br /&gt;
|&amp;lt;code&amp;gt;color&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|picture&lt;br /&gt;
|Once encountered, draws a picture defined in the game&#039;s &#039;&#039;&#039;Text Font Picture&#039;&#039;&#039; file.&lt;br /&gt;
|&amp;lt;code&amp;gt;picture(button_a)&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|rgba&lt;br /&gt;
|Once encountered, starts colouring characters the specified colour.&lt;br /&gt;
|&amp;lt;code&amp;gt;rgba(255,0,0)&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|sound&lt;br /&gt;
|Once encountered, the game will play the specified sound effect if the &#039;&#039;&#039;Sound Bank&#039;&#039;&#039; containing it is loaded.&lt;br /&gt;
|&amp;lt;code&amp;gt;sound(all01_a00_sn)&amp;lt;/code&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
For example, with the following text:&amp;lt;syntaxhighlight lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
$The quick $brown$ fox jumps over the $lazy$ dog.\nPress the $ button to continue.&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;And the following variables:&amp;lt;syntaxhighlight lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
sound(all01_a00_sn),rgba(127,51,0),color,rgba(255,0,0),color,picture(button_a)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;The game should first play the sound &amp;lt;code&amp;gt;all01_a00_sn&amp;lt;/code&amp;gt;, then draw something akin to the following text:&lt;br /&gt;
The quick &amp;lt;span style=&amp;quot;color:#7F3300;&amp;quot;&amp;gt;brown&amp;lt;/span&amp;gt; fox jumps over the &amp;lt;span style=&amp;quot;color:#FF0000;&amp;quot;&amp;gt;lazy&amp;lt;/span&amp;gt; dog. Press the &amp;lt;span style=&amp;quot;color:#32AA00;&amp;quot;&amp;gt;&#039;&#039;&#039;Ⓐ&#039;&#039;&#039;&amp;lt;/span&amp;gt; button to continue.&lt;br /&gt;
[[Category:File Formats]]&lt;/div&gt;</summary>
		<author><name>Hyper</name></author>
	</entry>
	<entry>
		<id>https://hedgedocs.com/index.php?title=Text_Book&amp;diff=1258</id>
		<title>Text Book</title>
		<link rel="alternate" type="text/html" href="https://hedgedocs.com/index.php?title=Text_Book&amp;diff=1258"/>
		<updated>2025-12-02T20:24:43Z</updated>

		<summary type="html">&lt;p&gt;Hyper: Created page with &amp;quot;&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;Text Book&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039; is a file format used in Sonic the Hedgehog (2006) for storing text with friendly names and variables.  These files are located in &amp;lt;code&amp;gt;cache.arc&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;text.arc&amp;lt;/code&amp;gt; under the &amp;lt;code&amp;gt;./text/&amp;lt;/code&amp;gt; directory from platform root as &amp;lt;code&amp;gt;*.mst&amp;lt;/code&amp;gt; files.  == Specification == &amp;#039;&amp;#039;&amp;#039;Text Book&amp;#039;&amp;#039;&amp;#039; uses a Binary Resource container. The text to be displayed is encoded as UTF-16, whereas the names and variables are encoded as Shift-JIS.  =...&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&#039;&#039;&#039;&#039;&#039;Text Book&#039;&#039;&#039;&#039;&#039; is a file format used in [[Sonic the Hedgehog (2006)]] for storing text with friendly names and variables.&lt;br /&gt;
&lt;br /&gt;
These files are located in &amp;lt;code&amp;gt;cache.arc&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;text.arc&amp;lt;/code&amp;gt; under the &amp;lt;code&amp;gt;./text/&amp;lt;/code&amp;gt; directory from platform root as &amp;lt;code&amp;gt;*.mst&amp;lt;/code&amp;gt; files.&lt;br /&gt;
&lt;br /&gt;
== Specification ==&lt;br /&gt;
&#039;&#039;&#039;Text Book&#039;&#039;&#039; uses a [[Binary Resource]] container. The text to be displayed is encoded as UTF-16, whereas the names and variables are encoded as Shift-JIS.&lt;br /&gt;
&lt;br /&gt;
=== Header ===&lt;br /&gt;
The header consists of the following data structure:&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+Length: 0x0C&lt;br /&gt;
!Offset&lt;br /&gt;
!Type&lt;br /&gt;
!Name&lt;br /&gt;
!Description&lt;br /&gt;
|-&lt;br /&gt;
|0x00&lt;br /&gt;
|Char[4]&lt;br /&gt;
|Signature&lt;br /&gt;
|Always &amp;quot;WTXT&amp;quot; (referring to UTF-16).&lt;br /&gt;
|-&lt;br /&gt;
|0x04&lt;br /&gt;
|UInt32&lt;br /&gt;
|NameOffset&lt;br /&gt;
|The offset of the name of this &#039;&#039;&#039;Text Book&#039;&#039;&#039;.&lt;br /&gt;
|-&lt;br /&gt;
|0x08&lt;br /&gt;
|UInt32&lt;br /&gt;
|CardCount&lt;br /&gt;
|The total number of &#039;&#039;&#039;Text Cards&#039;&#039;&#039; in this &#039;&#039;&#039;Text Book&#039;&#039;&#039;.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Text Card ===&lt;br /&gt;
Text Cards consist of the following data structure:&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+Length: 0x0C&lt;br /&gt;
!Offset&lt;br /&gt;
!Type&lt;br /&gt;
!Name&lt;br /&gt;
!Description&lt;br /&gt;
|-&lt;br /&gt;
|0x00&lt;br /&gt;
|UInt32&lt;br /&gt;
|NameOffset&lt;br /&gt;
|The offset of the name of this &#039;&#039;&#039;Text Card&#039;&#039;&#039;.&lt;br /&gt;
|-&lt;br /&gt;
|0x04&lt;br /&gt;
|UInt32&lt;br /&gt;
|TextOffset&lt;br /&gt;
|The offset of the UTF-16 text for this &#039;&#039;&#039;Text Card&#039;&#039;&#039;.&lt;br /&gt;
|-&lt;br /&gt;
|0x08&lt;br /&gt;
|UInt32&lt;br /&gt;
|VariablesOffset&lt;br /&gt;
|The offset of the variables for this &#039;&#039;&#039;Text Card&#039;&#039;&#039;.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Variables ==&lt;br /&gt;
Variables are stored as comma-separated values, there should be one for each &#039;$&#039; character in the actual text to be displayed.&lt;br /&gt;
{{Notice|content=TODO: there are some unused variable types, test and document them.}}&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+&lt;br /&gt;
!Variable&lt;br /&gt;
!Description&lt;br /&gt;
!Usage&lt;br /&gt;
|-&lt;br /&gt;
|color&lt;br /&gt;
|Once encountered, stops colouring characters the colour that was previously set.&lt;br /&gt;
|&amp;lt;code&amp;gt;color&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|picture&lt;br /&gt;
|Once encountered, draws a picture defined in the game&#039;s &#039;&#039;&#039;Text Font Picture&#039;&#039;&#039; file.&lt;br /&gt;
|&amp;lt;code&amp;gt;picture(button_a)&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|rgba&lt;br /&gt;
|Once encountered, starts colouring characters the specified colour.&lt;br /&gt;
|&amp;lt;code&amp;gt;rgba(255,0,0)&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|sound&lt;br /&gt;
|Once encountered, the game will play the specified sound effect if the &#039;&#039;&#039;Sound Bank&#039;&#039;&#039; containing it is loaded.&lt;br /&gt;
|&amp;lt;code&amp;gt;sound(all01_a00_sn)&amp;lt;/code&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
For example, with the following text:&amp;lt;syntaxhighlight lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
$The quick $brown$ fox jumps over the $lazy$ dog.\nPress the $ button to continue.&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;And the following variables:&amp;lt;syntaxhighlight lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
sound(all01_a00_sn),rgba(127,51,0),color,rgba(255,0,0),color,picture(button_a)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;The game should first play the sound &amp;lt;code&amp;gt;all01_a00_sn&amp;lt;/code&amp;gt;, then draw something akin to the following text:&lt;br /&gt;
The quick &amp;lt;span style=&amp;quot;color:#7F3300;&amp;quot;&amp;gt;brown&amp;lt;/span&amp;gt; fox jumps over the &amp;lt;span style=&amp;quot;color:#FF0000;&amp;quot;&amp;gt;lazy&amp;lt;/span&amp;gt; dog. Press the &amp;lt;span style=&amp;quot;color:#32AA00;&amp;quot;&amp;gt;&#039;&#039;&#039;Ⓐ&#039;&#039;&#039;&amp;lt;/span&amp;gt; button to continue.&lt;/div&gt;</summary>
		<author><name>Hyper</name></author>
	</entry>
	<entry>
		<id>https://hedgedocs.com/index.php?title=Event_Playbook&amp;diff=1256</id>
		<title>Event Playbook</title>
		<link rel="alternate" type="text/html" href="https://hedgedocs.com/index.php?title=Event_Playbook&amp;diff=1256"/>
		<updated>2025-12-02T19:32:48Z</updated>

		<summary type="html">&lt;p&gt;Hyper: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&#039;&#039;&#039;&#039;&#039;Event Playbook&#039;&#039;&#039;&#039;&#039; is a file format used in [[Sonic the Hedgehog (2006)]] to define cutscene properties.&lt;br /&gt;
&lt;br /&gt;
This file is located at &amp;lt;code&amp;gt;./xenon/archives/cache.arc/xenon/eventplaybook.epb&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
== Specification ==&lt;br /&gt;
&#039;&#039;&#039;Event Playbook&#039;&#039;&#039; uses a [[Binary Resource]] container.&lt;br /&gt;
&lt;br /&gt;
=== Header ===&lt;br /&gt;
The header consists of the following data structure:&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+Length: 0x10&lt;br /&gt;
!Offset&lt;br /&gt;
!Type&lt;br /&gt;
!Name&lt;br /&gt;
!Description&lt;br /&gt;
|-&lt;br /&gt;
|0x00&lt;br /&gt;
|Char[4]&lt;br /&gt;
|Signature&lt;br /&gt;
|Always &amp;quot;.EPB&amp;quot;.&lt;br /&gt;
|-&lt;br /&gt;
|0x04&lt;br /&gt;
|UInt32&lt;br /&gt;
|Version&lt;br /&gt;
|Always 0x20060700 (big-endian). Format: 2006 July, Revision 0.&lt;br /&gt;
|-&lt;br /&gt;
|0x08&lt;br /&gt;
|UInt32&lt;br /&gt;
|EventCount&lt;br /&gt;
|The total number of events.&lt;br /&gt;
|-&lt;br /&gt;
|0x0C&lt;br /&gt;
|UInt32&lt;br /&gt;
|EventTableOffset&lt;br /&gt;
|The offset of the event table.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Event Playbook Data ===&lt;br /&gt;
Each event within the table consists of the following data structure:&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+Length: 0x38&lt;br /&gt;
!Offset&lt;br /&gt;
!Type&lt;br /&gt;
!Name&lt;br /&gt;
!Description&lt;br /&gt;
|-&lt;br /&gt;
|0x00&lt;br /&gt;
|UInt32&lt;br /&gt;
|NameOffset&lt;br /&gt;
|The offset to the name of this event.&lt;br /&gt;
|-&lt;br /&gt;
|0x04&lt;br /&gt;
|UInt32&lt;br /&gt;
|DirectoryOffset&lt;br /&gt;
|The offset to the path to the directory containing this event&#039;s resources.&lt;br /&gt;
|-&lt;br /&gt;
|0x08&lt;br /&gt;
|UInt32&lt;br /&gt;
|Duration&lt;br /&gt;
|The duration of this event in frames.&lt;br /&gt;
|-&lt;br /&gt;
|0x0C&lt;br /&gt;
|Vector3&lt;br /&gt;
|Position&lt;br /&gt;
|The start position of this event&#039;s camera.&lt;br /&gt;
|-&lt;br /&gt;
|0x18&lt;br /&gt;
|Vector3&lt;br /&gt;
|Rotation&lt;br /&gt;
|The start rotation of this event&#039;s camera.&lt;br /&gt;
|-&lt;br /&gt;
|0x24&lt;br /&gt;
|UInt32&lt;br /&gt;
|TerrainOffset&lt;br /&gt;
|The offset to the location of this event&#039;s terrain.&lt;br /&gt;
|-&lt;br /&gt;
|0x28&lt;br /&gt;
|UInt32&lt;br /&gt;
|SceneParamsOffset&lt;br /&gt;
|The offset to the location of this event&#039;s scene parameter.&lt;br /&gt;
|-&lt;br /&gt;
|0x2C&lt;br /&gt;
|UInt32&lt;br /&gt;
|SoundBankOffset&lt;br /&gt;
|The offset to the location of this event&#039;s sound bank.&lt;br /&gt;
|-&lt;br /&gt;
|0x30&lt;br /&gt;
|UInt32&lt;br /&gt;
|ParticleContainerOffset&lt;br /&gt;
|The offset to the location of this event&#039;s particle container.&lt;br /&gt;
|-&lt;br /&gt;
|0x34&lt;br /&gt;
|UInt32&lt;br /&gt;
|TextBookOffset&lt;br /&gt;
|The offset to the location of this event&#039;s text book for subtitles.&lt;br /&gt;
|}&lt;br /&gt;
[[Category:File Formats]]&lt;/div&gt;</summary>
		<author><name>Hyper</name></author>
	</entry>
	<entry>
		<id>https://hedgedocs.com/index.php?title=Event_Playbook&amp;diff=1255</id>
		<title>Event Playbook</title>
		<link rel="alternate" type="text/html" href="https://hedgedocs.com/index.php?title=Event_Playbook&amp;diff=1255"/>
		<updated>2025-12-02T19:24:56Z</updated>

		<summary type="html">&lt;p&gt;Hyper: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&#039;&#039;&#039;&#039;&#039;Event Playbook&#039;&#039;&#039;&#039;&#039; is a file format used in [[Sonic the Hedgehog (2006)]] to define cutscene properties.&lt;br /&gt;
&lt;br /&gt;
This file is located at &amp;lt;code&amp;gt;./xenon/archives/cache.arc/xenon/eventplaybook.epb&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
== Specification ==&lt;br /&gt;
&#039;&#039;&#039;Event Playbook&#039;&#039;&#039; uses a [[Binary Resource]] container.&lt;br /&gt;
&lt;br /&gt;
=== Header ===&lt;br /&gt;
The header consists of the following data structure:&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+Length: 0x10&lt;br /&gt;
!Offset&lt;br /&gt;
!Type&lt;br /&gt;
!Name&lt;br /&gt;
!Description&lt;br /&gt;
|-&lt;br /&gt;
|0x00&lt;br /&gt;
|Char[4]&lt;br /&gt;
|Signature&lt;br /&gt;
|Always &amp;quot;.EPB&amp;quot;.&lt;br /&gt;
|-&lt;br /&gt;
|0x04&lt;br /&gt;
|UInt32&lt;br /&gt;
|Version&lt;br /&gt;
|Always 0x20060700 (big-endian). Format: 2006 July, Revision 0.&lt;br /&gt;
|-&lt;br /&gt;
|0x08&lt;br /&gt;
|UInt32&lt;br /&gt;
|EventCount&lt;br /&gt;
|The total number of events.&lt;br /&gt;
|-&lt;br /&gt;
|0x0C&lt;br /&gt;
|UInt32&lt;br /&gt;
|EventTableOffset&lt;br /&gt;
|The offset of the event table.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Event Data ===&lt;br /&gt;
Each event within the table consists of the following data structure:&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+Length: 0x38&lt;br /&gt;
!Offset&lt;br /&gt;
!Type&lt;br /&gt;
!Name&lt;br /&gt;
!Description&lt;br /&gt;
|-&lt;br /&gt;
|0x00&lt;br /&gt;
|UInt32&lt;br /&gt;
|NameOffset&lt;br /&gt;
|The offset to the name of this event.&lt;br /&gt;
|-&lt;br /&gt;
|0x04&lt;br /&gt;
|UInt32&lt;br /&gt;
|DirectoryOffset&lt;br /&gt;
|The offset to the path to the directory containing this event&#039;s resources.&lt;br /&gt;
|-&lt;br /&gt;
|0x08&lt;br /&gt;
|UInt32&lt;br /&gt;
|Duration&lt;br /&gt;
|The duration of this event in frames.&lt;br /&gt;
|-&lt;br /&gt;
|0x0C&lt;br /&gt;
|Vector3&lt;br /&gt;
|Position&lt;br /&gt;
|The start position of this event&#039;s camera.&lt;br /&gt;
|-&lt;br /&gt;
|0x18&lt;br /&gt;
|Vector3&lt;br /&gt;
|Rotation&lt;br /&gt;
|The start rotation of this event&#039;s camera.&lt;br /&gt;
|-&lt;br /&gt;
|0x24&lt;br /&gt;
|UInt32&lt;br /&gt;
|TerrainOffset&lt;br /&gt;
|The offset to the location of this event&#039;s terrain.&lt;br /&gt;
|-&lt;br /&gt;
|0x28&lt;br /&gt;
|UInt32&lt;br /&gt;
|SceneParamsOffset&lt;br /&gt;
|The offset to the location of this event&#039;s scene parameter.&lt;br /&gt;
|-&lt;br /&gt;
|0x2C&lt;br /&gt;
|UInt32&lt;br /&gt;
|SoundBankOffset&lt;br /&gt;
|The offset to the location of this event&#039;s sound bank.&lt;br /&gt;
|-&lt;br /&gt;
|0x30&lt;br /&gt;
|UInt32&lt;br /&gt;
|ParticleContainerOffset&lt;br /&gt;
|The offset to the location of this event&#039;s particle container.&lt;br /&gt;
|-&lt;br /&gt;
|0x34&lt;br /&gt;
|UInt32&lt;br /&gt;
|TextBookOffset&lt;br /&gt;
|The offset to the location of this event&#039;s text book for subtitles.&lt;br /&gt;
|}&lt;br /&gt;
[[Category:File Formats]]&lt;/div&gt;</summary>
		<author><name>Hyper</name></author>
	</entry>
	<entry>
		<id>https://hedgedocs.com/index.php?title=Event_Playbook&amp;diff=1254</id>
		<title>Event Playbook</title>
		<link rel="alternate" type="text/html" href="https://hedgedocs.com/index.php?title=Event_Playbook&amp;diff=1254"/>
		<updated>2025-12-02T19:23:56Z</updated>

		<summary type="html">&lt;p&gt;Hyper: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&#039;&#039;&#039;&#039;&#039;Event Playbook&#039;&#039;&#039;&#039;&#039; is a file format used in [[Sonic the Hedgehog (2006)]] to define cutscene properties.&lt;br /&gt;
&lt;br /&gt;
This file is located at &amp;lt;code&amp;gt;./xenon/archives/cache.arc/xenon/eventplaybook.epb&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
== Specification ==&lt;br /&gt;
&#039;&#039;&#039;Event Playbook&#039;&#039;&#039; uses a [[Binary Resource]] container.&lt;br /&gt;
&lt;br /&gt;
=== Header ===&lt;br /&gt;
The header consists of the following data structure:&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+Length: 0x10&lt;br /&gt;
!Offset&lt;br /&gt;
!Type&lt;br /&gt;
!Name&lt;br /&gt;
!Description&lt;br /&gt;
|-&lt;br /&gt;
|0x00&lt;br /&gt;
|Char[4]&lt;br /&gt;
|Signature&lt;br /&gt;
|Always &amp;quot;.EPB&amp;quot;.&lt;br /&gt;
|-&lt;br /&gt;
|0x04&lt;br /&gt;
|UInt32&lt;br /&gt;
|Version&lt;br /&gt;
|Always 0x20060700 (big-endian). Format: 2006 July, Revision 0.&lt;br /&gt;
|-&lt;br /&gt;
|0x08&lt;br /&gt;
|UInt32&lt;br /&gt;
|EventCount&lt;br /&gt;
|The total number of events.&lt;br /&gt;
|-&lt;br /&gt;
|0x0C&lt;br /&gt;
|UInt32&lt;br /&gt;
|EventTableOffset&lt;br /&gt;
|The offset of the event table.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Event Data ===&lt;br /&gt;
Each event within the table consists of the following data structure:&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+Length: 0x38&lt;br /&gt;
!Offset&lt;br /&gt;
!Type&lt;br /&gt;
!Name&lt;br /&gt;
!Description&lt;br /&gt;
|-&lt;br /&gt;
|0x00&lt;br /&gt;
|UInt32&lt;br /&gt;
|NameOffset&lt;br /&gt;
|The offset to the name of this event.&lt;br /&gt;
|-&lt;br /&gt;
|0x04&lt;br /&gt;
|UInt32&lt;br /&gt;
|DirectoryOffset&lt;br /&gt;
|The offset to the path to the directory containing this event&#039;s resources.&lt;br /&gt;
|-&lt;br /&gt;
|0x08&lt;br /&gt;
|UInt32&lt;br /&gt;
|Duration&lt;br /&gt;
|The duration of this event in frames.&lt;br /&gt;
|-&lt;br /&gt;
|0x0C&lt;br /&gt;
|Vector3&lt;br /&gt;
|Position&lt;br /&gt;
|The start position of this event&#039;s camera.&lt;br /&gt;
|-&lt;br /&gt;
|0x18&lt;br /&gt;
|Vector3&lt;br /&gt;
|Rotation&lt;br /&gt;
|The start rotation of this event&#039;s camera.&lt;br /&gt;
|-&lt;br /&gt;
|0x24&lt;br /&gt;
|UInt32&lt;br /&gt;
|TerrainOffset&lt;br /&gt;
|The offset to the location of this event&#039;s terrain.&lt;br /&gt;
|-&lt;br /&gt;
|0x28&lt;br /&gt;
|UInt32&lt;br /&gt;
|SceneParamsOffset&lt;br /&gt;
|The offset to the location of this event&#039;s scene parameter.&lt;br /&gt;
|-&lt;br /&gt;
|0x2C&lt;br /&gt;
|UInt32&lt;br /&gt;
|SoundBankOffset&lt;br /&gt;
|The offset to the location of this event&#039;s sound bank.&lt;br /&gt;
|-&lt;br /&gt;
|0x30&lt;br /&gt;
|UInt32&lt;br /&gt;
|ParticleContainerOffset&lt;br /&gt;
|The offset to the location of this event&#039;s particle container.&lt;br /&gt;
|-&lt;br /&gt;
|0x34&lt;br /&gt;
|UInt32&lt;br /&gt;
|TextBookOffset&lt;br /&gt;
|The offset to the location of this event&#039;s text book for subtitles.&lt;br /&gt;
|}&lt;/div&gt;</summary>
		<author><name>Hyper</name></author>
	</entry>
	<entry>
		<id>https://hedgedocs.com/index.php?title=Binary_Resource&amp;diff=1250</id>
		<title>Binary Resource</title>
		<link rel="alternate" type="text/html" href="https://hedgedocs.com/index.php?title=Binary_Resource&amp;diff=1250"/>
		<updated>2025-12-02T17:51:50Z</updated>

		<summary type="html">&lt;p&gt;Hyper: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&#039;&#039;&#039;&#039;&#039;Binary Resource&#039;&#039;&#039;&#039;&#039; (or &#039;&#039;&#039;BINA&#039;&#039;&#039;) is a container format for binary data developed by Sonic Team.&lt;br /&gt;
&lt;br /&gt;
== Engines using Binary Resource ==&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+&lt;br /&gt;
!Engine&lt;br /&gt;
!Version&lt;br /&gt;
!Games&lt;br /&gt;
|-&lt;br /&gt;
|SoX&lt;br /&gt;
|1&lt;br /&gt;
|[[Sonic the Hedgehog (2006)]]&lt;br /&gt;
|-&lt;br /&gt;
| rowspan=&amp;quot;2&amp;quot; |Hedgehog Engine&lt;br /&gt;
|1&lt;br /&gt;
|[[Sonic Colors]]&lt;br /&gt;
|-&lt;br /&gt;
|2&lt;br /&gt;
|[[Sonic Lost World]]&lt;br /&gt;
|-&lt;br /&gt;
|Hedgehog Engine 2&lt;br /&gt;
|2&lt;br /&gt;
|&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Specifications ==&lt;br /&gt;
&#039;&#039;&#039;Binary Resource&#039;&#039;&#039; has two known major versions.&lt;br /&gt;
&lt;br /&gt;
== Version 1 ==&lt;br /&gt;
&lt;br /&gt;
=== Header ===&lt;br /&gt;
The header consists of the following data structure:&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+Length: 0x20&lt;br /&gt;
!Offset&lt;br /&gt;
!Type&lt;br /&gt;
!Name&lt;br /&gt;
!Description&lt;br /&gt;
|-&lt;br /&gt;
|0x00&lt;br /&gt;
|UInt32&lt;br /&gt;
|ResourceSize&lt;br /&gt;
|The size of the resource.&lt;br /&gt;
|-&lt;br /&gt;
|0x04&lt;br /&gt;
|UInt32&lt;br /&gt;
|RelocTableOffset&lt;br /&gt;
|The offset of the relocation table relative to the end of the header.&lt;br /&gt;
|-&lt;br /&gt;
|0x08&lt;br /&gt;
|UInt32&lt;br /&gt;
|RelocTableLength&lt;br /&gt;
|The length of the relocation table.&lt;br /&gt;
|-&lt;br /&gt;
|0x0C&lt;br /&gt;
|UInt32&lt;br /&gt;
|N/A&lt;br /&gt;
|Unknown. Usually zero.&lt;br /&gt;
|-&lt;br /&gt;
|0x10&lt;br /&gt;
|UInt32&lt;br /&gt;
|ChunkCount&lt;br /&gt;
|The total number of chunks in the data section. Only used in &#039;&#039;&#039;Sonic Colors&#039;&#039;&#039;.&lt;br /&gt;
|-&lt;br /&gt;
|0x14&lt;br /&gt;
|Char[4]&lt;br /&gt;
|Version&lt;br /&gt;
|The first two characters are skipped, leaving Revision and Endianness.&lt;br /&gt;
The endianness character is either &#039;&amp;lt;nowiki/&amp;gt;&#039;&#039;&#039;L&#039;&#039;&#039;&amp;lt;nowiki/&amp;gt;&#039; or &#039;&#039;&#039;&#039;B&#039;&#039;&#039;&amp;lt;nowiki/&amp;gt;&#039;, for little-endian and big-endian respectively.&lt;br /&gt;
|-&lt;br /&gt;
|0x18&lt;br /&gt;
|Char[4]&lt;br /&gt;
|Signature&lt;br /&gt;
|Always &amp;quot;BINA&amp;quot;.&lt;br /&gt;
|-&lt;br /&gt;
|0x1C&lt;br /&gt;
|UInt32&lt;br /&gt;
|N/A&lt;br /&gt;
|Unknown. Usually zero.&lt;br /&gt;
|}&lt;br /&gt;
Due to the nature of the header, you &#039;&#039;&#039;must&#039;&#039;&#039; read ahead &#039;&#039;&#039;0x14&#039;&#039;&#039; bytes to read the &amp;lt;code&amp;gt;Version&amp;lt;/code&amp;gt; field to get the endianness of the file before proceeding with the rest of the fields at the start of the file.&lt;br /&gt;
&lt;br /&gt;
=== Data Section ===&lt;br /&gt;
The data after the header is specific to each file format contained within a &#039;&#039;&#039;Binary Resource&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
All offset fields inside the data section are relative to the end of the header, so you must add the size of the header to the offset to get the absolute offset to where it&#039;s pointing to in the file on disk.&amp;lt;syntaxhighlight lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
MyOffset = ReadUInt32() + HeaderSize // HeaderSize = 0x20&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Relocation Table ===&lt;br /&gt;
After the data section is a relocation table, which is used by the &#039;&#039;&#039;Binary Resource&#039;&#039;&#039; loader to locate offsets in the data section to make them absolute pointers. This allows the data section to be mapped directly to a structure without having to read it manually.&lt;br /&gt;
&lt;br /&gt;
The relocation table must be aligned to 4 bytes before and after writing it.&lt;br /&gt;
&lt;br /&gt;
Each entry in the relocation table is encoded as such:&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+&lt;br /&gt;
!Type Bits&lt;br /&gt;
!Length&lt;br /&gt;
!Minimum&lt;br /&gt;
!Maximum&lt;br /&gt;
!Description&lt;br /&gt;
|-&lt;br /&gt;
|0b01000000&lt;br /&gt;
|6 bits&lt;br /&gt;
|0x00&lt;br /&gt;
|0x3F&lt;br /&gt;
|The offset is stored in the remaining six bits after the type bits.&lt;br /&gt;
|-&lt;br /&gt;
|0b10000000&lt;br /&gt;
|14 bits&lt;br /&gt;
|0x3F&lt;br /&gt;
|0x3FFF&lt;br /&gt;
|The offset is stored in the remaining six bits after the type bits, including an extra byte.&lt;br /&gt;
|-&lt;br /&gt;
|0b11000000&lt;br /&gt;
|30 bits&lt;br /&gt;
|0x3FFF&lt;br /&gt;
|0x3FFFFFFF&lt;br /&gt;
|The offset is stored in the remaining six bits after the type bits, including an extra three bytes.&lt;br /&gt;
|}&lt;br /&gt;
To encode an entry in the relocation table, first subtract the current offset with the previous offset that was encoded, then bit shift the result to the right by two bits. When encoding the first entry in the relocation table, the previous offset will be the size of the header (&#039;&#039;&#039;0x20&#039;&#039;&#039;).&amp;lt;syntaxhighlight lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
EncodedOffset = (CurrentOffset - PreviousOffset) &amp;gt;&amp;gt; 2&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;After this, the value of the encoded offset can be used to determine which type bits are needed to fit it in the relocation table.&lt;br /&gt;
&lt;br /&gt;
=== Footer ===&lt;br /&gt;
If the &amp;lt;code&amp;gt;ChunkCount&amp;lt;/code&amp;gt; field in the header is non-zero, a footer must be written to the end of the file. The purpose of this footer isn&#039;t fully understood, but it only appears to be used in &#039;&#039;&#039;Sonic Colors&#039;&#039;&#039;.&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+Length: 0x0C&lt;br /&gt;
!Offset&lt;br /&gt;
!Type&lt;br /&gt;
!Name&lt;br /&gt;
!Description&lt;br /&gt;
|-&lt;br /&gt;
|0x00&lt;br /&gt;
|UInt32&lt;br /&gt;
|N/A&lt;br /&gt;
|Unknown. Always 16.&lt;br /&gt;
|-&lt;br /&gt;
|0x04&lt;br /&gt;
|UInt32&lt;br /&gt;
|N/A&lt;br /&gt;
|Unknown. Always zero.&lt;br /&gt;
|-&lt;br /&gt;
|0x08&lt;br /&gt;
|Char[4]&lt;br /&gt;
|N/A&lt;br /&gt;
|Always &amp;quot;bvh\0&amp;quot;.&lt;br /&gt;
|}&lt;br /&gt;
[[Category:File Formats]]&lt;/div&gt;</summary>
		<author><name>Hyper</name></author>
	</entry>
	<entry>
		<id>https://hedgedocs.com/index.php?title=Binary_Resource&amp;diff=1248</id>
		<title>Binary Resource</title>
		<link rel="alternate" type="text/html" href="https://hedgedocs.com/index.php?title=Binary_Resource&amp;diff=1248"/>
		<updated>2025-12-02T17:30:47Z</updated>

		<summary type="html">&lt;p&gt;Hyper: Add Sonic Lost World to engine table for V2&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&#039;&#039;&#039;&#039;&#039;Binary Resource&#039;&#039;&#039;&#039;&#039; (or &#039;&#039;&#039;BINA&#039;&#039;&#039;) is a container format for binary data developed by Sonic Team.&lt;br /&gt;
&lt;br /&gt;
== Engines using Binary Resource ==&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+&lt;br /&gt;
!Engine&lt;br /&gt;
!Version&lt;br /&gt;
!Games&lt;br /&gt;
|-&lt;br /&gt;
|SoX&lt;br /&gt;
|1&lt;br /&gt;
|[[Sonic the Hedgehog (2006)]]&lt;br /&gt;
|-&lt;br /&gt;
|Hedgehog Engine&lt;br /&gt;
|1&lt;br /&gt;
|[[Sonic Colors]]&lt;br /&gt;
|-&lt;br /&gt;
|Hedgehog Engine&lt;br /&gt;
|2&lt;br /&gt;
|[[Sonic Lost World]]&lt;br /&gt;
|-&lt;br /&gt;
|Hedgehog Engine 2&lt;br /&gt;
|2&lt;br /&gt;
|&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Specifications ==&lt;br /&gt;
&#039;&#039;&#039;Binary Resource&#039;&#039;&#039; has two known major versions.&lt;br /&gt;
&lt;br /&gt;
== Version 1 ==&lt;br /&gt;
&lt;br /&gt;
=== Header ===&lt;br /&gt;
The header consists of the following data structure:&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+Length: 0x20&lt;br /&gt;
!Offset&lt;br /&gt;
!Type&lt;br /&gt;
!Name&lt;br /&gt;
!Description&lt;br /&gt;
|-&lt;br /&gt;
|0x00&lt;br /&gt;
|UInt32&lt;br /&gt;
|ResourceSize&lt;br /&gt;
|The size of the resource.&lt;br /&gt;
|-&lt;br /&gt;
|0x04&lt;br /&gt;
|UInt32&lt;br /&gt;
|RelocTableOffset&lt;br /&gt;
|The offset of the relocation table relative to the end of the header.&lt;br /&gt;
|-&lt;br /&gt;
|0x08&lt;br /&gt;
|UInt32&lt;br /&gt;
|RelocTableLength&lt;br /&gt;
|The length of the relocation table.&lt;br /&gt;
|-&lt;br /&gt;
|0x0C&lt;br /&gt;
|UInt32&lt;br /&gt;
|N/A&lt;br /&gt;
|Unknown. Usually zero.&lt;br /&gt;
|-&lt;br /&gt;
|0x10&lt;br /&gt;
|UInt32&lt;br /&gt;
|ChunkCount&lt;br /&gt;
|The total number of chunks in the data section. Only used in &#039;&#039;&#039;Sonic Colors&#039;&#039;&#039;.&lt;br /&gt;
|-&lt;br /&gt;
|0x14&lt;br /&gt;
|Char[4]&lt;br /&gt;
|Version&lt;br /&gt;
|The first two characters are skipped, leaving Revision and Endianness.&lt;br /&gt;
The endianness character is either &#039;&amp;lt;nowiki/&amp;gt;&#039;&#039;&#039;L&#039;&#039;&#039;&amp;lt;nowiki/&amp;gt;&#039; or &#039;&#039;&#039;&#039;B&#039;&#039;&#039;&amp;lt;nowiki/&amp;gt;&#039;, for little-endian and big-endian respectively.&lt;br /&gt;
|-&lt;br /&gt;
|0x18&lt;br /&gt;
|Char[4]&lt;br /&gt;
|Signature&lt;br /&gt;
|Always &amp;quot;BINA&amp;quot;.&lt;br /&gt;
|-&lt;br /&gt;
|0x1C&lt;br /&gt;
|UInt32&lt;br /&gt;
|N/A&lt;br /&gt;
|Unknown. Usually zero.&lt;br /&gt;
|}&lt;br /&gt;
Due to the nature of the header, you &#039;&#039;&#039;must&#039;&#039;&#039; read ahead &#039;&#039;&#039;0x14&#039;&#039;&#039; bytes to read the &amp;lt;code&amp;gt;Version&amp;lt;/code&amp;gt; field to get the endianness of the file before proceeding with the rest of the fields at the start of the file.&lt;br /&gt;
&lt;br /&gt;
=== Data Section ===&lt;br /&gt;
The data after the header is specific to each file format contained within a &#039;&#039;&#039;Binary Resource&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
All offset fields inside the data section are relative to the end of the header, so you must add the size of the header to the offset to get the absolute offset to where it&#039;s pointing to in the file on disk.&amp;lt;syntaxhighlight lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
MyOffset = ReadUInt32() + HeaderSize // HeaderSize = 0x20&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Relocation Table ===&lt;br /&gt;
After the data section is a relocation table, which is used by the &#039;&#039;&#039;Binary Resource&#039;&#039;&#039; loader to locate offsets in the data section to make them absolute pointers. This allows the data section to be mapped directly to a structure without having to read it manually.&lt;br /&gt;
&lt;br /&gt;
The relocation table must be aligned to 4 bytes before and after writing it.&lt;br /&gt;
&lt;br /&gt;
Each entry in the relocation table is encoded as such:&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+&lt;br /&gt;
!Type Bits&lt;br /&gt;
!Length&lt;br /&gt;
!Minimum&lt;br /&gt;
!Maximum&lt;br /&gt;
!Description&lt;br /&gt;
|-&lt;br /&gt;
|0b01000000&lt;br /&gt;
|6 bits&lt;br /&gt;
|0x00&lt;br /&gt;
|0x3F&lt;br /&gt;
|The offset is stored in the remaining six bits after the type bits.&lt;br /&gt;
|-&lt;br /&gt;
|0b10000000&lt;br /&gt;
|14 bits&lt;br /&gt;
|0x3F&lt;br /&gt;
|0x3FFF&lt;br /&gt;
|The offset is stored in the remaining six bits after the type bits, including an extra byte.&lt;br /&gt;
|-&lt;br /&gt;
|0b11000000&lt;br /&gt;
|30 bits&lt;br /&gt;
|0x3FFF&lt;br /&gt;
|0x3FFFFFFF&lt;br /&gt;
|The offset is stored in the remaining six bits after the type bits, including an extra three bytes.&lt;br /&gt;
|}&lt;br /&gt;
To encode an entry in the relocation table, first subtract the current offset with the last offset that was encoded, then bit shift the result to the right by two bits. When encoding the first entry in the relocation table, the last offset will be the size of the header (&#039;&#039;&#039;0x20&#039;&#039;&#039;).&amp;lt;syntaxhighlight lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
EncodedOffset = (CurrentOffset - LastOffset) &amp;gt;&amp;gt; 2&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;After this, the value of the encoded offset can be used to determine which type bits are needed to fit it in the relocation table.&lt;br /&gt;
&lt;br /&gt;
=== Footer ===&lt;br /&gt;
If the &amp;lt;code&amp;gt;ChunkCount&amp;lt;/code&amp;gt; field in the header is non-zero, a footer must be written to the end of the file. The purpose of this footer isn&#039;t fully understood, but it only appears to be used in &#039;&#039;&#039;Sonic Colors&#039;&#039;&#039;.&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+Length: 0x0C&lt;br /&gt;
!Offset&lt;br /&gt;
!Type&lt;br /&gt;
!Name&lt;br /&gt;
!Description&lt;br /&gt;
|-&lt;br /&gt;
|0x00&lt;br /&gt;
|UInt32&lt;br /&gt;
|N/A&lt;br /&gt;
|Unknown. Always 16.&lt;br /&gt;
|-&lt;br /&gt;
|0x04&lt;br /&gt;
|UInt32&lt;br /&gt;
|N/A&lt;br /&gt;
|Unknown. Always zero.&lt;br /&gt;
|-&lt;br /&gt;
|0x08&lt;br /&gt;
|Char[4]&lt;br /&gt;
|N/A&lt;br /&gt;
|Always &amp;quot;bvh\0&amp;quot;.&lt;br /&gt;
|}&lt;br /&gt;
[[Category:File Formats]]&lt;/div&gt;</summary>
		<author><name>Hyper</name></author>
	</entry>
	<entry>
		<id>https://hedgedocs.com/index.php?title=Binary_Resource&amp;diff=1247</id>
		<title>Binary Resource</title>
		<link rel="alternate" type="text/html" href="https://hedgedocs.com/index.php?title=Binary_Resource&amp;diff=1247"/>
		<updated>2025-12-02T17:23:14Z</updated>

		<summary type="html">&lt;p&gt;Hyper: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&#039;&#039;&#039;&#039;&#039;Binary Resource&#039;&#039;&#039;&#039;&#039; (or &#039;&#039;&#039;BINA&#039;&#039;&#039;) is a container format for binary data developed by Sonic Team.&lt;br /&gt;
&lt;br /&gt;
== Engines using Binary Resource ==&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+&lt;br /&gt;
!Engine&lt;br /&gt;
!Version&lt;br /&gt;
!Games&lt;br /&gt;
|-&lt;br /&gt;
|SoX&lt;br /&gt;
|1&lt;br /&gt;
|[[Sonic the Hedgehog (2006)]]&lt;br /&gt;
|-&lt;br /&gt;
|Hedgehog Engine&lt;br /&gt;
|1&lt;br /&gt;
|[[Sonic Colors]]&lt;br /&gt;
|-&lt;br /&gt;
|Hedgehog Engine 2&lt;br /&gt;
|2&lt;br /&gt;
|&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Specifications ==&lt;br /&gt;
&#039;&#039;&#039;Binary Resource&#039;&#039;&#039; has two known major versions.&lt;br /&gt;
&lt;br /&gt;
== Version 1 ==&lt;br /&gt;
&lt;br /&gt;
=== Header ===&lt;br /&gt;
The header consists of the following data structure:&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+Length: 0x20&lt;br /&gt;
!Offset&lt;br /&gt;
!Type&lt;br /&gt;
!Name&lt;br /&gt;
!Description&lt;br /&gt;
|-&lt;br /&gt;
|0x00&lt;br /&gt;
|UInt32&lt;br /&gt;
|ResourceSize&lt;br /&gt;
|The size of the resource.&lt;br /&gt;
|-&lt;br /&gt;
|0x04&lt;br /&gt;
|UInt32&lt;br /&gt;
|RelocTableOffset&lt;br /&gt;
|The offset of the relocation table relative to the end of the header.&lt;br /&gt;
|-&lt;br /&gt;
|0x08&lt;br /&gt;
|UInt32&lt;br /&gt;
|RelocTableLength&lt;br /&gt;
|The length of the relocation table.&lt;br /&gt;
|-&lt;br /&gt;
|0x0C&lt;br /&gt;
|UInt32&lt;br /&gt;
|N/A&lt;br /&gt;
|Unknown. Usually zero.&lt;br /&gt;
|-&lt;br /&gt;
|0x10&lt;br /&gt;
|UInt32&lt;br /&gt;
|ChunkCount&lt;br /&gt;
|The total number of chunks in the data section. Only used in &#039;&#039;&#039;Sonic Colors&#039;&#039;&#039;.&lt;br /&gt;
|-&lt;br /&gt;
|0x14&lt;br /&gt;
|Char[4]&lt;br /&gt;
|Version&lt;br /&gt;
|The first two characters are skipped, leaving Revision and Endianness.&lt;br /&gt;
The endianness character is either &#039;&amp;lt;nowiki/&amp;gt;&#039;&#039;&#039;L&#039;&#039;&#039;&amp;lt;nowiki/&amp;gt;&#039; or &#039;&#039;&#039;&#039;B&#039;&#039;&#039;&amp;lt;nowiki/&amp;gt;&#039;, for little-endian and big-endian respectively.&lt;br /&gt;
|-&lt;br /&gt;
|0x18&lt;br /&gt;
|Char[4]&lt;br /&gt;
|Signature&lt;br /&gt;
|Always &amp;quot;BINA&amp;quot;.&lt;br /&gt;
|-&lt;br /&gt;
|0x1C&lt;br /&gt;
|UInt32&lt;br /&gt;
|N/A&lt;br /&gt;
|Unknown. Usually zero.&lt;br /&gt;
|}&lt;br /&gt;
Due to the nature of the header, you &#039;&#039;&#039;must&#039;&#039;&#039; read ahead &#039;&#039;&#039;0x14&#039;&#039;&#039; bytes to read the &amp;lt;code&amp;gt;Version&amp;lt;/code&amp;gt; field to get the endianness of the file before proceeding with the rest of the fields at the start of the file.&lt;br /&gt;
&lt;br /&gt;
=== Data Section ===&lt;br /&gt;
The data after the header is specific to each file format contained within a &#039;&#039;&#039;Binary Resource&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
All offset fields inside the data section are relative to the end of the header, so you must add the size of the header to the offset to get the absolute offset to where it&#039;s pointing to in the file on disk.&amp;lt;syntaxhighlight lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
MyOffset = ReadUInt32() + HeaderSize // HeaderSize = 0x20&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Relocation Table ===&lt;br /&gt;
After the data section is a relocation table, which is used by the &#039;&#039;&#039;Binary Resource&#039;&#039;&#039; loader to locate offsets in the data section to make them absolute pointers. This allows the data section to be mapped directly to a structure without having to read it manually.&lt;br /&gt;
&lt;br /&gt;
The relocation table must be aligned to 4 bytes before and after writing it.&lt;br /&gt;
&lt;br /&gt;
Each entry in the relocation table is encoded as such:&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+&lt;br /&gt;
!Type Bits&lt;br /&gt;
!Length&lt;br /&gt;
!Minimum&lt;br /&gt;
!Maximum&lt;br /&gt;
!Description&lt;br /&gt;
|-&lt;br /&gt;
|0b01000000&lt;br /&gt;
|6 bits&lt;br /&gt;
|0x00&lt;br /&gt;
|0x3F&lt;br /&gt;
|The offset is stored in the remaining six bits after the type bits.&lt;br /&gt;
|-&lt;br /&gt;
|0b10000000&lt;br /&gt;
|14 bits&lt;br /&gt;
|0x3F&lt;br /&gt;
|0x3FFF&lt;br /&gt;
|The offset is stored in the remaining six bits after the type bits, including an extra byte.&lt;br /&gt;
|-&lt;br /&gt;
|0b11000000&lt;br /&gt;
|30 bits&lt;br /&gt;
|0x3FFF&lt;br /&gt;
|0x3FFFFFFF&lt;br /&gt;
|The offset is stored in the remaining six bits after the type bits, including an extra three bytes.&lt;br /&gt;
|}&lt;br /&gt;
To encode an entry in the relocation table, first subtract the current offset with the last offset that was encoded, then bit shift the result to the right by two bits. When encoding the first entry in the relocation table, the last offset will be the size of the header (&#039;&#039;&#039;0x20&#039;&#039;&#039;).&amp;lt;syntaxhighlight lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
EncodedOffset = (CurrentOffset - LastOffset) &amp;gt;&amp;gt; 2&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;After this, the value of the encoded offset can be used to determine which type bits are needed to fit it in the relocation table.&lt;br /&gt;
&lt;br /&gt;
=== Footer ===&lt;br /&gt;
If the &amp;lt;code&amp;gt;ChunkCount&amp;lt;/code&amp;gt; field in the header is non-zero, a footer must be written to the end of the file. The purpose of this footer isn&#039;t fully understood, but it only appears to be used in &#039;&#039;&#039;Sonic Colors&#039;&#039;&#039;.&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+Length: 0x0C&lt;br /&gt;
!Offset&lt;br /&gt;
!Type&lt;br /&gt;
!Name&lt;br /&gt;
!Description&lt;br /&gt;
|-&lt;br /&gt;
|0x00&lt;br /&gt;
|UInt32&lt;br /&gt;
|N/A&lt;br /&gt;
|Unknown. Always 16.&lt;br /&gt;
|-&lt;br /&gt;
|0x04&lt;br /&gt;
|UInt32&lt;br /&gt;
|N/A&lt;br /&gt;
|Unknown. Always zero.&lt;br /&gt;
|-&lt;br /&gt;
|0x08&lt;br /&gt;
|Char[4]&lt;br /&gt;
|N/A&lt;br /&gt;
|Always &amp;quot;bvh\0&amp;quot;.&lt;br /&gt;
|}&lt;br /&gt;
[[Category:File Formats]]&lt;/div&gt;</summary>
		<author><name>Hyper</name></author>
	</entry>
	<entry>
		<id>https://hedgedocs.com/index.php?title=Binary_Resource&amp;diff=1246</id>
		<title>Binary Resource</title>
		<link rel="alternate" type="text/html" href="https://hedgedocs.com/index.php?title=Binary_Resource&amp;diff=1246"/>
		<updated>2025-12-02T17:19:39Z</updated>

		<summary type="html">&lt;p&gt;Hyper: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&#039;&#039;&#039;&#039;&#039;Binary Resource&#039;&#039;&#039;&#039;&#039; (or &#039;&#039;&#039;BINA&#039;&#039;&#039;) is a container format for binary data developed by Sonic Team.&lt;br /&gt;
&lt;br /&gt;
== Engines using Binary Resource ==&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+&lt;br /&gt;
!Engine&lt;br /&gt;
!Version&lt;br /&gt;
!Games&lt;br /&gt;
|-&lt;br /&gt;
|SoX&lt;br /&gt;
|1&lt;br /&gt;
|[[Sonic the Hedgehog (2006)]]&lt;br /&gt;
|-&lt;br /&gt;
|Hedgehog Engine&lt;br /&gt;
|1&lt;br /&gt;
|[[Sonic Colors]]&lt;br /&gt;
|-&lt;br /&gt;
|Hedgehog Engine 2&lt;br /&gt;
|2&lt;br /&gt;
|&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Specifications ==&lt;br /&gt;
&#039;&#039;&#039;Binary Resource&#039;&#039;&#039; has two known major versions.&lt;br /&gt;
&lt;br /&gt;
== Version 1 ==&lt;br /&gt;
&lt;br /&gt;
=== Header ===&lt;br /&gt;
The header consists of the following data structure:&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+Length: 0x20&lt;br /&gt;
!Offset&lt;br /&gt;
!Type&lt;br /&gt;
!Name&lt;br /&gt;
!Description&lt;br /&gt;
|-&lt;br /&gt;
|0x00&lt;br /&gt;
|UInt32&lt;br /&gt;
|ResourceSize&lt;br /&gt;
|The size of the resource.&lt;br /&gt;
|-&lt;br /&gt;
|0x04&lt;br /&gt;
|UInt32&lt;br /&gt;
|RelocTableOffset&lt;br /&gt;
|The offset of the relocation table relative to the end of the header.&lt;br /&gt;
|-&lt;br /&gt;
|0x08&lt;br /&gt;
|UInt32&lt;br /&gt;
|RelocTableLength&lt;br /&gt;
|The length of the relocation table.&lt;br /&gt;
|-&lt;br /&gt;
|0x0C&lt;br /&gt;
|UInt32&lt;br /&gt;
|N/A&lt;br /&gt;
|Unknown. Usually zero.&lt;br /&gt;
|-&lt;br /&gt;
|0x10&lt;br /&gt;
|UInt32&lt;br /&gt;
|ChunkCount&lt;br /&gt;
|The total number of chunks in the data section. Only used in &#039;&#039;&#039;Sonic Colors&#039;&#039;&#039;.&lt;br /&gt;
|-&lt;br /&gt;
|0x14&lt;br /&gt;
|Char[4]&lt;br /&gt;
|Version&lt;br /&gt;
|The first two characters are skipped, leaving Revision and Endianness.&lt;br /&gt;
The endianness character is either &#039;&amp;lt;nowiki/&amp;gt;&#039;&#039;&#039;L&#039;&#039;&#039;&amp;lt;nowiki/&amp;gt;&#039; or &#039;&#039;&#039;&#039;B&#039;&#039;&#039;&amp;lt;nowiki/&amp;gt;&#039;, for little-endian and big-endian respectively.&lt;br /&gt;
|-&lt;br /&gt;
|0x18&lt;br /&gt;
|Char[4]&lt;br /&gt;
|Signature&lt;br /&gt;
|Always &amp;quot;BINA&amp;quot;.&lt;br /&gt;
|-&lt;br /&gt;
|0x1C&lt;br /&gt;
|UInt32&lt;br /&gt;
|N/A&lt;br /&gt;
|Unknown. Usually zero.&lt;br /&gt;
|}&lt;br /&gt;
Due to the nature of the header, you &#039;&#039;&#039;must&#039;&#039;&#039; read ahead &#039;&#039;&#039;0x14&#039;&#039;&#039; bytes to read the &amp;lt;code&amp;gt;Version&amp;lt;/code&amp;gt; field to get the endianness of the file before proceeding with the rest of the fields at the start of the file.&lt;br /&gt;
&lt;br /&gt;
=== Data Section ===&lt;br /&gt;
The data after the header is specific to each file format contained within a &#039;&#039;&#039;Binary Resource&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
All offset fields inside the data section are relative to the end of the header, so you must add the size of the header to the offset to get the absolute offset to where it&#039;s pointing to in the file on disk.&amp;lt;syntaxhighlight lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
MyOffset = ReadUInt32() + HeaderSize // HeaderSize = 0x20&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Relocation Table ===&lt;br /&gt;
After the data section is a relocation table, which is used by the &#039;&#039;&#039;Binary Resource&#039;&#039;&#039; loader to locate offsets in the data section to make them absolute pointers. This allows the data section to be mapped directly to a structure without having to read it manually.&lt;br /&gt;
&lt;br /&gt;
The relocation table must be aligned to 4 bytes before and after writing it.&lt;br /&gt;
&lt;br /&gt;
Each entry in the relocation table is encoded as such:&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+&lt;br /&gt;
!Type Bits&lt;br /&gt;
!Length&lt;br /&gt;
!Minimum&lt;br /&gt;
!Maximum&lt;br /&gt;
!Description&lt;br /&gt;
|-&lt;br /&gt;
|0b01000000&lt;br /&gt;
|6 bits&lt;br /&gt;
|0x00&lt;br /&gt;
|0x3F&lt;br /&gt;
|The offset is stored in the remaining six bits after the type bits.&lt;br /&gt;
|-&lt;br /&gt;
|0b10000000&lt;br /&gt;
|14 bits&lt;br /&gt;
|0x3F&lt;br /&gt;
|0x3FFF&lt;br /&gt;
|The offset is stored in the remaining six bits after the type bits, including an extra byte.&lt;br /&gt;
|-&lt;br /&gt;
|0b11000000&lt;br /&gt;
|30 bits&lt;br /&gt;
|0x3FFF&lt;br /&gt;
|0x3FFFFFFF&lt;br /&gt;
|The offset is stored in the remaining six bits after the type bits, including an extra three bytes.&lt;br /&gt;
|}&lt;br /&gt;
To encode an entry in the relocation table, first subtract the current offset with the last offset that was encoded, then bit shift the result to the right by two bits.&amp;lt;syntaxhighlight lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
EncodedOffset = (CurrentOffset - LastOffset) &amp;gt;&amp;gt; 2&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;After this, the value of the encoded offset can be used to determine which type bits are needed to fit it in the relocation table.&lt;br /&gt;
&lt;br /&gt;
=== Footer ===&lt;br /&gt;
If the &amp;lt;code&amp;gt;ChunkCount&amp;lt;/code&amp;gt; field in the header is non-zero, a footer must be written to the end of the file. The purpose of this footer isn&#039;t fully understood, but it only appears to be used in &#039;&#039;&#039;Sonic Colors&#039;&#039;&#039;.&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+Length: 0x0C&lt;br /&gt;
!Offset&lt;br /&gt;
!Type&lt;br /&gt;
!Name&lt;br /&gt;
!Description&lt;br /&gt;
|-&lt;br /&gt;
|0x00&lt;br /&gt;
|UInt32&lt;br /&gt;
|N/A&lt;br /&gt;
|Unknown. Always 16.&lt;br /&gt;
|-&lt;br /&gt;
|0x04&lt;br /&gt;
|UInt32&lt;br /&gt;
|N/A&lt;br /&gt;
|Unknown. Always zero.&lt;br /&gt;
|-&lt;br /&gt;
|0x08&lt;br /&gt;
|Char[4]&lt;br /&gt;
|N/A&lt;br /&gt;
|Always &amp;quot;bvh\0&amp;quot;.&lt;br /&gt;
|}&lt;br /&gt;
[[Category:File Formats]]&lt;/div&gt;</summary>
		<author><name>Hyper</name></author>
	</entry>
	<entry>
		<id>https://hedgedocs.com/index.php?title=Documentation&amp;diff=1245</id>
		<title>Documentation</title>
		<link rel="alternate" type="text/html" href="https://hedgedocs.com/index.php?title=Documentation&amp;diff=1245"/>
		<updated>2025-12-02T17:07:23Z</updated>

		<summary type="html">&lt;p&gt;Hyper: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This section lists documentation pages for resources you&#039;ll find in Sonic games. You&#039;ll find information about certain file formats and other general game resources.&lt;br /&gt;
&lt;br /&gt;
== Rendering ==&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+&lt;br /&gt;
!Name&lt;br /&gt;
!Info&lt;br /&gt;
|-&lt;br /&gt;
| [[Normal mapping]]&lt;br /&gt;
| How normal mapping works&lt;br /&gt;
|-&lt;br /&gt;
| [[Vertex Colors]]&lt;br /&gt;
| How vertex colors work&lt;br /&gt;
|-&lt;br /&gt;
| [[Mesh Layers]]&lt;br /&gt;
| Model mesh layers&lt;br /&gt;
|-&lt;br /&gt;
| [[Opacity]]&lt;br /&gt;
| The concept of opacity explained&lt;br /&gt;
|- &lt;br /&gt;
| [[Texture Blending]]&lt;br /&gt;
| The different ways to blend textures&lt;br /&gt;
|-&lt;br /&gt;
!&lt;br /&gt;
!&lt;br /&gt;
|-&lt;br /&gt;
|[[Hedgehog Engine Rendering|Hedgehog Engine]]&lt;br /&gt;
|Render engine first used in Sonic Unleashed&lt;br /&gt;
|-&lt;br /&gt;
|[[Hedgehog Engine 2 Rendering|Hedgehog Engine 2]]&lt;br /&gt;
|Render Engine first used in Sonic Forces&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Models ==&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+&lt;br /&gt;
!Name&lt;br /&gt;
!Info&lt;br /&gt;
!Extension&lt;br /&gt;
!Tools&lt;br /&gt;
|-&lt;br /&gt;
|[[SCA Parameters]]&lt;br /&gt;
|Model and material parameters stored in SCA file headers&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Shaders ==&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+&lt;br /&gt;
!Name&lt;br /&gt;
!Info&lt;br /&gt;
!Extension&lt;br /&gt;
!Tools&lt;br /&gt;
|-&lt;br /&gt;
|[[Shader Features]]&lt;br /&gt;
|Hedgehog engine 1 shader features&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Set-Data ==&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+&lt;br /&gt;
!Name&lt;br /&gt;
!Description&lt;br /&gt;
!Extension&lt;br /&gt;
!Tools&lt;br /&gt;
|-&lt;br /&gt;
|[[HSON Format|HSON]] (Hedgehog Set Object Notation)&lt;br /&gt;
|Universal object placement representation format.&lt;br /&gt;
|&amp;lt;code&amp;gt;.hson&amp;lt;/code&amp;gt;&lt;br /&gt;
|&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== User Interface ==&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+&lt;br /&gt;
!Name&lt;br /&gt;
!Description&lt;br /&gt;
!Extension&lt;br /&gt;
!Tools&lt;br /&gt;
|-&lt;br /&gt;
|[[NCP File Format|NCP]] (Ninja CellSpriteDraw Project)&lt;br /&gt;
|Describes a user interface in most Hedgehog Engine games.&lt;br /&gt;
|&amp;lt;span style=&amp;quot;text-align: center&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;&amp;lt;code&amp;gt;.xncp&amp;lt;/code&amp;gt;&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;&amp;lt;code&amp;gt;.yncp&amp;lt;/code&amp;gt;&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;&amp;lt;code&amp;gt;.gncp&amp;lt;/code&amp;gt;&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;&amp;lt;code&amp;gt;.sncp&amp;lt;/code&amp;gt;&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;/span&amp;gt;&lt;br /&gt;
|&lt;br /&gt;
* [[Kunai]]&lt;br /&gt;
* [[Shuriken]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Archives ==&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!Name&lt;br /&gt;
!Description&lt;br /&gt;
!Extension&lt;br /&gt;
!Tools&lt;br /&gt;
|-&lt;br /&gt;
|[[Binary Resource]]&lt;br /&gt;
|Generic container format used for storing chunks of binary data.&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|[[NN Chunk Format|NN Chunk]]&lt;br /&gt;
|Generic container format used for storing SEGA NN binary data.&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|[[U8 Archive]]&lt;br /&gt;
|Hierarchical archive format.&lt;br /&gt;
|&amp;lt;code&amp;gt;.arc&amp;lt;/code&amp;gt;&lt;br /&gt;
|&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Animation ==&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+&lt;br /&gt;
!Name&lt;br /&gt;
!Description&lt;br /&gt;
!Extension&lt;br /&gt;
!Tools&lt;br /&gt;
|-&lt;br /&gt;
|[[PXD|PXD Animation]]&lt;br /&gt;
|Skeleton and skeletal animation format in Hedgehog Engine 2 Games&lt;br /&gt;
|&amp;lt;span style=&amp;quot;text-align: center&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;&amp;lt;code&amp;gt;.anm.pxd&amp;lt;/code&amp;gt;&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;&amp;lt;code&amp;gt;.skl.pxd&amp;lt;/code&amp;gt;&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;/span&amp;gt;&lt;br /&gt;
|[[Frontiers Animation Tools]]&lt;br /&gt;
|-&lt;br /&gt;
|[[PBA|PBA Skeleton]]&lt;br /&gt;
|Physics Based Animation Skeleton for Hedgehog Engine 2 Games&lt;br /&gt;
|&amp;lt;code&amp;gt;.pba&amp;lt;/code&amp;gt;&lt;br /&gt;
|&lt;br /&gt;
|}&lt;/div&gt;</summary>
		<author><name>Hyper</name></author>
	</entry>
	<entry>
		<id>https://hedgedocs.com/index.php?title=Binary_Resource&amp;diff=1244</id>
		<title>Binary Resource</title>
		<link rel="alternate" type="text/html" href="https://hedgedocs.com/index.php?title=Binary_Resource&amp;diff=1244"/>
		<updated>2025-12-02T17:04:03Z</updated>

		<summary type="html">&lt;p&gt;Hyper: Documented BINAv1&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&#039;&#039;&#039;&#039;&#039;Binary Resource&#039;&#039;&#039;&#039;&#039; (or &#039;&#039;&#039;BINA&#039;&#039;&#039;) is a container format for binary data developed by Sonic Team.&lt;br /&gt;
&lt;br /&gt;
== Engines using Binary Resource ==&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+&lt;br /&gt;
!Engine&lt;br /&gt;
!Version&lt;br /&gt;
!Games&lt;br /&gt;
|-&lt;br /&gt;
|SoX&lt;br /&gt;
|1&lt;br /&gt;
|[[Sonic the Hedgehog (2006)]]&lt;br /&gt;
|-&lt;br /&gt;
|Hedgehog Engine&lt;br /&gt;
|1&lt;br /&gt;
|[[Sonic Colors]]&lt;br /&gt;
|-&lt;br /&gt;
|Hedgehog Engine 2&lt;br /&gt;
|2&lt;br /&gt;
|&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Specifications ==&lt;br /&gt;
&#039;&#039;&#039;Binary Resource&#039;&#039;&#039; has two known major versions.&lt;br /&gt;
&lt;br /&gt;
== Version 1 ==&lt;br /&gt;
&lt;br /&gt;
=== Header ===&lt;br /&gt;
The header consists of the following data structure:&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+Length: 0x20&lt;br /&gt;
!Offset&lt;br /&gt;
!Type&lt;br /&gt;
!Name&lt;br /&gt;
!Description&lt;br /&gt;
|-&lt;br /&gt;
|0x00&lt;br /&gt;
|UInt32&lt;br /&gt;
|ResourceSize&lt;br /&gt;
|The size of the resource.&lt;br /&gt;
|-&lt;br /&gt;
|0x04&lt;br /&gt;
|UInt32&lt;br /&gt;
|RelocTableOffset&lt;br /&gt;
|The offset of the relocation table relative to the end of the header.&lt;br /&gt;
|-&lt;br /&gt;
|0x08&lt;br /&gt;
|UInt32&lt;br /&gt;
|RelocTableLength&lt;br /&gt;
|The length of the relocation table.&lt;br /&gt;
|-&lt;br /&gt;
|0x0C&lt;br /&gt;
|UInt32&lt;br /&gt;
|N/A&lt;br /&gt;
|Unknown. Usually zero.&lt;br /&gt;
|-&lt;br /&gt;
|0x10&lt;br /&gt;
|UInt32&lt;br /&gt;
|ChunkCount&lt;br /&gt;
|The total number of chunks in the data section. Only used in &#039;&#039;&#039;Sonic Colors&#039;&#039;&#039;.&lt;br /&gt;
|-&lt;br /&gt;
|0x14&lt;br /&gt;
|Char[4]&lt;br /&gt;
|Version&lt;br /&gt;
|The first two characters are skipped, leaving Revision and Endianness.&lt;br /&gt;
The endianness character is either &#039;&amp;lt;nowiki/&amp;gt;&#039;&#039;&#039;L&#039;&#039;&#039;&amp;lt;nowiki/&amp;gt;&#039; or &#039;&#039;&#039;&#039;B&#039;&#039;&#039;&amp;lt;nowiki/&amp;gt;&#039;, for little-endian and big-endian respectively.&lt;br /&gt;
|-&lt;br /&gt;
|0x18&lt;br /&gt;
|Char[4]&lt;br /&gt;
|Signature&lt;br /&gt;
|Always &amp;quot;BINA&amp;quot;.&lt;br /&gt;
|-&lt;br /&gt;
|0x1C&lt;br /&gt;
|UInt32&lt;br /&gt;
|N/A&lt;br /&gt;
|Unknown. Usually zero.&lt;br /&gt;
|}&lt;br /&gt;
Due to the nature of the header, you &#039;&#039;&#039;must&#039;&#039;&#039; read ahead &#039;&#039;&#039;0x14&#039;&#039;&#039; bytes to read the &amp;lt;code&amp;gt;Version&amp;lt;/code&amp;gt; field to get the endianness of the file before proceeding with the rest of the fields at the start of the file.&lt;br /&gt;
&lt;br /&gt;
=== Data Section ===&lt;br /&gt;
The data after the header is specific to each file format contained within a &#039;&#039;&#039;Binary Resource&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
All offset fields inside the data section are relative to the end of the header, so you must add the size of the header to the offset to get the absolute offset to where it&#039;s pointing to in the file on disk.&amp;lt;syntaxhighlight lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
MyOffset = ReadUInt32() + HeaderSize // HeaderSize = 0x20&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Relocation Table ===&lt;br /&gt;
After the data section is a relocation table, which is used by the &#039;&#039;&#039;Binary Resource&#039;&#039;&#039; loader to locate offsets in the data section to make them absolute pointers. This allows the data section to be mapped directly to a structure without having to read it manually.&lt;br /&gt;
&lt;br /&gt;
The relocation table must be aligned to 4 bytes before and after writing it.&lt;br /&gt;
&lt;br /&gt;
Each entry in the relocation table is encoded as such:&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+&lt;br /&gt;
!Type Bits&lt;br /&gt;
!Length&lt;br /&gt;
!Minimum&lt;br /&gt;
!Maximum&lt;br /&gt;
!Description&lt;br /&gt;
|-&lt;br /&gt;
|0b01000000&lt;br /&gt;
|6 bits&lt;br /&gt;
|0x00&lt;br /&gt;
|0x3F&lt;br /&gt;
|The offset is stored in the remaining six bits after the type bits.&lt;br /&gt;
|-&lt;br /&gt;
|0b10000000&lt;br /&gt;
|14 bits&lt;br /&gt;
|0x3F&lt;br /&gt;
|0x3FFF&lt;br /&gt;
|The offset is stored in the remaining six bits after the type bits, including an extra byte.&lt;br /&gt;
|-&lt;br /&gt;
|0b11000000&lt;br /&gt;
|30 bits&lt;br /&gt;
|0x3FFF&lt;br /&gt;
|0x3FFFFFFF&lt;br /&gt;
|The offset is stored in the remaining six bits after the type bits, including an extra three bytes.&lt;br /&gt;
|}&lt;br /&gt;
To encode an entry in the relocation table, first subtract the current offset with the last offset that was encoded, then bit shift the result to the right by two bits.&amp;lt;syntaxhighlight lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
EncodedOffset = (CurrentOffset - LastOffset) &amp;gt;&amp;gt; 2&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;After this, the value of the encoded offset can be used to determine which type bits are needed to fit it in the relocation table.&lt;br /&gt;
&lt;br /&gt;
=== Footer ===&lt;br /&gt;
If the &amp;lt;code&amp;gt;ChunkCount&amp;lt;/code&amp;gt; field in the header is non-zero, a footer must be written to the end of the file. The purpose of this footer isn&#039;t fully understood, but it only appears to be used in &#039;&#039;&#039;Sonic Colors&#039;&#039;&#039;.&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+Length: 0x0C&lt;br /&gt;
!Offset&lt;br /&gt;
!Type&lt;br /&gt;
!Name&lt;br /&gt;
!Description&lt;br /&gt;
|-&lt;br /&gt;
|0x00&lt;br /&gt;
|UInt32&lt;br /&gt;
|N/A&lt;br /&gt;
|Unknown. Always 16.&lt;br /&gt;
|-&lt;br /&gt;
|0x04&lt;br /&gt;
|UInt32&lt;br /&gt;
|N/A&lt;br /&gt;
|Unknown. Always zero.&lt;br /&gt;
|-&lt;br /&gt;
|0x08&lt;br /&gt;
|Char[4]&lt;br /&gt;
|N/A&lt;br /&gt;
|Always &amp;quot;bvh&amp;quot;.&lt;br /&gt;
|}&lt;br /&gt;
[[Category:File Formats]]&lt;/div&gt;</summary>
		<author><name>Hyper</name></author>
	</entry>
	<entry>
		<id>https://hedgedocs.com/index.php?title=U8_Archive&amp;diff=1243</id>
		<title>U8 Archive</title>
		<link rel="alternate" type="text/html" href="https://hedgedocs.com/index.php?title=U8_Archive&amp;diff=1243"/>
		<updated>2025-12-02T13:39:58Z</updated>

		<summary type="html">&lt;p&gt;Hyper: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&#039;&#039;&#039;&#039;&#039;U8 Archive&#039;&#039;&#039;&#039;&#039; is a hierarchical archive format developed by Nintendo during the GameCube era and was predominantly used on the Wii.&lt;br /&gt;
&lt;br /&gt;
== Titles using U8 Archive ==&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Sonic Heroes&#039;&#039;&#039; (PlayStation 2) - released 2004&lt;br /&gt;
* &#039;&#039;&#039;[[Sonic the Hedgehog (2006)|Sonic the Hedgehog]]&#039;&#039;&#039; (Xbox 360, PlayStation 3) - released 2006&lt;br /&gt;
* &#039;&#039;&#039;Sonic and the Secret Rings&#039;&#039;&#039;&amp;lt;sup&amp;gt;†&amp;lt;/sup&amp;gt; (Wii) - released 2007&lt;br /&gt;
* &#039;&#039;&#039;Sonic and the Black Knight&#039;&#039;&#039;&amp;lt;sup&amp;gt;†&amp;lt;/sup&amp;gt; (Wii) - released 2009&lt;br /&gt;
* &#039;&#039;&#039;[[Sonic Colors]]&#039;&#039;&#039; (Wii) - released 2010&lt;br /&gt;
* &#039;&#039;&#039;Sonic Colors: Ultimate&#039;&#039;&#039; (Windows, Xbox One, PlayStation 4, Switch) - released 2021&lt;br /&gt;
&lt;br /&gt;
&amp;lt;sup&amp;gt;†&amp;lt;/sup&amp;gt; — used for operating system only.&lt;br /&gt;
&lt;br /&gt;
== Specification ==&lt;br /&gt;
=== Header ===&lt;br /&gt;
The header consists of the following data structure:&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+Length: 0x20&lt;br /&gt;
!Offset&lt;br /&gt;
!Type&lt;br /&gt;
!Name&lt;br /&gt;
!Description&lt;br /&gt;
|-&lt;br /&gt;
|0x00&lt;br /&gt;
|UInt32&lt;br /&gt;
|Signature&lt;br /&gt;
|Always 0x55AA382D (big-endian) or 0x2D38AA55 (little-endian).&lt;br /&gt;
|-&lt;br /&gt;
|0x04&lt;br /&gt;
|UInt32&lt;br /&gt;
|FSTableOffset&lt;br /&gt;
|The offset of the file system table.&lt;br /&gt;
|-&lt;br /&gt;
|0x08&lt;br /&gt;
|UInt32&lt;br /&gt;
|FSTableLength&lt;br /&gt;
|The length of the file system table (including the string pool).&lt;br /&gt;
|-&lt;br /&gt;
|0x0C&lt;br /&gt;
|UInt32&lt;br /&gt;
|DataOffset&lt;br /&gt;
|The offset of the file data.&lt;br /&gt;
|-&lt;br /&gt;
|0x10&lt;br /&gt;
|UInt32[4]&lt;br /&gt;
|Reserved&lt;br /&gt;
|These fields appear to be populated in archives for &#039;&#039;&#039;Sonic the Hedgehog (2006)&#039;&#039;&#039;, but this is bogus data from uninitialised memory and should be ignored.&lt;br /&gt;
For the sake of tooling heuristics, writing &amp;lt;code&amp;gt;0xE4F91300&amp;lt;/code&amp;gt; (big-endian) to index 0 and &amp;lt;code&amp;gt;0x78013800&amp;lt;/code&amp;gt; (big-endian) to index 3 would be ideal for detecting whether an archive is from that game specifically.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== File System ===&lt;br /&gt;
The file system consists of an array of the following data structure:&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+Length: 0x0C (or 0x10 for Sonic the Hedgehog (2006))&lt;br /&gt;
!Offset&lt;br /&gt;
!Type&lt;br /&gt;
!Name&lt;br /&gt;
!Description&lt;br /&gt;
|-&lt;br /&gt;
|0x00&lt;br /&gt;
|Boolean (UInt8)&lt;br /&gt;
|IsDirectory&lt;br /&gt;
|Determines whether this node is a directory.&lt;br /&gt;
|-&lt;br /&gt;
|0x01&lt;br /&gt;
|UInt24&lt;br /&gt;
|NameOffset&lt;br /&gt;
|The offset of this node&#039;s name in the string pool.&lt;br /&gt;
If root, always zero.&lt;br /&gt;
|-&lt;br /&gt;
|0x04&lt;br /&gt;
|Union (UInt32, UInt32)&lt;br /&gt;
|DataOffset, ParentIndex&lt;br /&gt;
|&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+&lt;br /&gt;
|File&lt;br /&gt;
|The offset of this file&#039;s data.&lt;br /&gt;
|-&lt;br /&gt;
|Directory&lt;br /&gt;
|The index of the parent node for this directory.&lt;br /&gt;
If root, always zero.&lt;br /&gt;
|}&lt;br /&gt;
|-&lt;br /&gt;
|0x08&lt;br /&gt;
|Union (UInt32, UInt32)&lt;br /&gt;
|Length, NodeCount&lt;br /&gt;
|&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+&lt;br /&gt;
|File&lt;br /&gt;
|The length of this file&#039;s data.&lt;br /&gt;
|-&lt;br /&gt;
|Directory&lt;br /&gt;
|The total number of nodes in this directory.&lt;br /&gt;
If root, the total number of nodes in this archive.&lt;br /&gt;
|}&lt;br /&gt;
|-&lt;br /&gt;
|0x0C&lt;br /&gt;
|UInt32&lt;br /&gt;
|UncompressedLength&lt;br /&gt;
|This field is unique to archives for &#039;&#039;&#039;Sonic the Hedgehog (2006)&#039;&#039;&#039;.&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+&lt;br /&gt;
|File&lt;br /&gt;
|The uncompressed length of this file&#039;s data.&lt;br /&gt;
This field can be set to zero to disable compression for this file, allowing its data to be stored uncompressed.&lt;br /&gt;
|-&lt;br /&gt;
|Directory&lt;br /&gt;
|Undefined.&lt;br /&gt;
Much like the reserved bytes in the header, this field will appear to be populated, but again, this is bogus data from uninitialised memory.&lt;br /&gt;
|}&lt;br /&gt;
|}&lt;br /&gt;
The total number of nodes to read is determined by the root node&#039;s &amp;lt;code&amp;gt;NodeCount&amp;lt;/code&amp;gt; field. As this is a hierarchical file system, nodes should be read recursively to build the file system correctly.&lt;br /&gt;
&lt;br /&gt;
The first node &#039;&#039;&#039;must&#039;&#039;&#039; be a root node defined as a directory, with the &amp;lt;code&amp;gt;NodeCount&amp;lt;/code&amp;gt; field set to the total number of nodes in the archive. This is necessary for determining the length of the file system table.&lt;br /&gt;
&lt;br /&gt;
=== String Pool ===&lt;br /&gt;
The string pool offset can be calculated after reading the root node and using the following expression:&amp;lt;syntaxhighlight lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
FSTableOffset + (Root.NodeCount * FSNodeSize) // FSNodeSize = 0x0C (or 0x10 for Sonic the Hedgehog (2006))&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;Each string in the pool is ASCII-encoded and null-terminated, the offsets to which are relative to the start of the pool.&lt;br /&gt;
&lt;br /&gt;
The string pool &#039;&#039;&#039;must&#039;&#039;&#039; have a single null terminator at the beginning for the root node, as it does not have a name.&lt;br /&gt;
&lt;br /&gt;
=== File Data ===&lt;br /&gt;
Files are aligned by 32 bytes per file after the string pool.&lt;br /&gt;
&lt;br /&gt;
In &#039;&#039;&#039;Sonic the Hedgehog (2006)&#039;&#039;&#039;, files may be compressed using [[wikipedia:Zlib|zlib]]. This compression is optional, and files can be stored uncompressed so long as &amp;lt;code&amp;gt;UncompressedLength&amp;lt;/code&amp;gt; is set to zero.&lt;br /&gt;
[[Category:File Formats]]&lt;/div&gt;</summary>
		<author><name>Hyper</name></author>
	</entry>
	<entry>
		<id>https://hedgedocs.com/index.php?title=U8_Archive&amp;diff=1242</id>
		<title>U8 Archive</title>
		<link rel="alternate" type="text/html" href="https://hedgedocs.com/index.php?title=U8_Archive&amp;diff=1242"/>
		<updated>2025-12-02T13:12:38Z</updated>

		<summary type="html">&lt;p&gt;Hyper: Fix string pool expression&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&#039;&#039;&#039;&#039;&#039;U8 Archive&#039;&#039;&#039;&#039;&#039; is a hierarchical archive format developed by Nintendo during the GameCube era and was predominantly used on the Wii.&lt;br /&gt;
&lt;br /&gt;
== Titles using U8 Archive ==&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Sonic Heroes&#039;&#039;&#039; (PlayStation 2) - released 2004&lt;br /&gt;
* &#039;&#039;&#039;Sonic the Hedgehog&#039;&#039;&#039; (Xbox 360, PlayStation 3) - released 2006&lt;br /&gt;
* &#039;&#039;&#039;Sonic and the Secret Rings&#039;&#039;&#039;&amp;lt;sup&amp;gt;†&amp;lt;/sup&amp;gt; (Wii) - released 2007&lt;br /&gt;
* &#039;&#039;&#039;Sonic and the Black Knight&#039;&#039;&#039;&amp;lt;sup&amp;gt;†&amp;lt;/sup&amp;gt; (Wii) - released 2009&lt;br /&gt;
* &#039;&#039;&#039;Sonic Colours&#039;&#039;&#039; (Wii) - released 2010&lt;br /&gt;
* &#039;&#039;&#039;Sonic Colours: Ultimate&#039;&#039;&#039; (Windows, Xbox One, PlayStation 4, Switch) - released 2021&lt;br /&gt;
&lt;br /&gt;
&amp;lt;sup&amp;gt;†&amp;lt;/sup&amp;gt; — used for operating system only.&lt;br /&gt;
&lt;br /&gt;
== Specification ==&lt;br /&gt;
=== Header ===&lt;br /&gt;
The header consists of the following data structure:&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+Length: 0x20&lt;br /&gt;
!Offset&lt;br /&gt;
!Type&lt;br /&gt;
!Name&lt;br /&gt;
!Description&lt;br /&gt;
|-&lt;br /&gt;
|0x00&lt;br /&gt;
|UInt32&lt;br /&gt;
|Signature&lt;br /&gt;
|Always 0x55AA382D (big-endian) or 0x2D38AA55 (little-endian).&lt;br /&gt;
|-&lt;br /&gt;
|0x04&lt;br /&gt;
|UInt32&lt;br /&gt;
|FSTableOffset&lt;br /&gt;
|The offset of the file system table.&lt;br /&gt;
|-&lt;br /&gt;
|0x08&lt;br /&gt;
|UInt32&lt;br /&gt;
|FSTableLength&lt;br /&gt;
|The length of the file system table (including the string pool).&lt;br /&gt;
|-&lt;br /&gt;
|0x0C&lt;br /&gt;
|UInt32&lt;br /&gt;
|DataOffset&lt;br /&gt;
|The offset of the file data.&lt;br /&gt;
|-&lt;br /&gt;
|0x10&lt;br /&gt;
|UInt32[4]&lt;br /&gt;
|Reserved&lt;br /&gt;
|These fields appear to be populated in archives for &#039;&#039;&#039;Sonic the Hedgehog (2006)&#039;&#039;&#039;, but this is bogus data from uninitialised memory and should be ignored.&lt;br /&gt;
For the sake of tooling heuristics, writing &amp;lt;code&amp;gt;0xE4F91300&amp;lt;/code&amp;gt; (big-endian) to index 0 and &amp;lt;code&amp;gt;0x78013800&amp;lt;/code&amp;gt; (big-endian) to index 3 would be ideal for detecting whether an archive is from that game specifically.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== File System ===&lt;br /&gt;
The file system consists of an array of the following data structure:&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+Length: 0x0C (or 0x10 for Sonic the Hedgehog (2006))&lt;br /&gt;
!Offset&lt;br /&gt;
!Type&lt;br /&gt;
!Name&lt;br /&gt;
!Description&lt;br /&gt;
|-&lt;br /&gt;
|0x00&lt;br /&gt;
|Boolean (UInt8)&lt;br /&gt;
|IsDirectory&lt;br /&gt;
|Determines whether this node is a directory.&lt;br /&gt;
|-&lt;br /&gt;
|0x01&lt;br /&gt;
|UInt24&lt;br /&gt;
|NameOffset&lt;br /&gt;
|The offset of this node&#039;s name in the string pool.&lt;br /&gt;
If root, always zero.&lt;br /&gt;
|-&lt;br /&gt;
|0x04&lt;br /&gt;
|Union (UInt32, UInt32)&lt;br /&gt;
|DataOffset, ParentIndex&lt;br /&gt;
|&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+&lt;br /&gt;
|File&lt;br /&gt;
|The offset of this file&#039;s data.&lt;br /&gt;
|-&lt;br /&gt;
|Directory&lt;br /&gt;
|The index of the parent node for this directory.&lt;br /&gt;
If root, always zero.&lt;br /&gt;
|}&lt;br /&gt;
|-&lt;br /&gt;
|0x08&lt;br /&gt;
|Union (UInt32, UInt32)&lt;br /&gt;
|Length, NodeCount&lt;br /&gt;
|&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+&lt;br /&gt;
|File&lt;br /&gt;
|The length of this file&#039;s data.&lt;br /&gt;
|-&lt;br /&gt;
|Directory&lt;br /&gt;
|The total number of nodes in this directory.&lt;br /&gt;
If root, the total number of nodes in this archive.&lt;br /&gt;
|}&lt;br /&gt;
|-&lt;br /&gt;
|0x0C&lt;br /&gt;
|UInt32&lt;br /&gt;
|UncompressedLength&lt;br /&gt;
|This field is unique to archives for &#039;&#039;&#039;Sonic the Hedgehog (2006)&#039;&#039;&#039;.&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+&lt;br /&gt;
|File&lt;br /&gt;
|The uncompressed length of this file&#039;s data.&lt;br /&gt;
This field can be set to zero to disable compression for this file, allowing its data to be stored uncompressed.&lt;br /&gt;
|-&lt;br /&gt;
|Directory&lt;br /&gt;
|Undefined.&lt;br /&gt;
Much like the reserved bytes in the header, this field will appear to be populated, but again, this is bogus data from uninitialised memory.&lt;br /&gt;
|}&lt;br /&gt;
|}&lt;br /&gt;
The total number of nodes to read is determined by the root node&#039;s &amp;lt;code&amp;gt;NodeCount&amp;lt;/code&amp;gt; field. As this is a hierarchical file system, nodes should be read recursively to build the file system correctly.&lt;br /&gt;
&lt;br /&gt;
The first node &#039;&#039;&#039;must&#039;&#039;&#039; be a root node defined as a directory, with the &amp;lt;code&amp;gt;NodeCount&amp;lt;/code&amp;gt; field set to the total number of nodes in the archive. This is necessary for determining the length of the file system table.&lt;br /&gt;
&lt;br /&gt;
=== String Pool ===&lt;br /&gt;
The string pool offset can be calculated after reading the root node and using the following expression:&amp;lt;syntaxhighlight lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
FSTableOffset + (Root.NodeCount * FSNodeSize) // FSNodeSize = 0x0C (or 0x10 for Sonic the Hedgehog (2006))&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;Each string in the pool is ASCII-encoded and null-terminated, the offsets to which are relative to the start of the pool.&lt;br /&gt;
&lt;br /&gt;
The string pool &#039;&#039;&#039;must&#039;&#039;&#039; have a single null terminator at the beginning for the root node, as it does not have a name.&lt;br /&gt;
&lt;br /&gt;
=== File Data ===&lt;br /&gt;
Files are aligned by 32 bytes per file after the string pool.&lt;br /&gt;
&lt;br /&gt;
In &#039;&#039;&#039;Sonic the Hedgehog (2006)&#039;&#039;&#039;, files may be compressed using [[wikipedia:Zlib|zlib]]. This compression is optional, and files can be stored uncompressed so long as &amp;lt;code&amp;gt;UncompressedLength&amp;lt;/code&amp;gt; is set to zero.&lt;br /&gt;
[[Category:File Formats]]&lt;/div&gt;</summary>
		<author><name>Hyper</name></author>
	</entry>
	<entry>
		<id>https://hedgedocs.com/index.php?title=Sonic_the_Hedgehog_(2006)&amp;diff=1241</id>
		<title>Sonic the Hedgehog (2006)</title>
		<link rel="alternate" type="text/html" href="https://hedgedocs.com/index.php?title=Sonic_the_Hedgehog_(2006)&amp;diff=1241"/>
		<updated>2025-12-02T12:48:27Z</updated>

		<summary type="html">&lt;p&gt;Hyper: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Guides ==&lt;br /&gt;
&lt;br /&gt;
=== Level Editing ===&lt;br /&gt;
* [[How To Use Sonic GLvl with Sonic &#039;06|Sonic GLvl]]&lt;br /&gt;
&lt;br /&gt;
== Documentation ==&lt;br /&gt;
&lt;br /&gt;
* [[Section IDs]]&lt;br /&gt;
* [[Player State IDs]]&lt;br /&gt;
* [[Texture Tags]]&lt;br /&gt;
* [[Sonic the Hedgehog (2006)/Shaders|Shaders]]&lt;br /&gt;
&lt;br /&gt;
== Formats ==&lt;br /&gt;
=== Archive ===&lt;br /&gt;
* [[U8 Archive]]&lt;br /&gt;
=== Ninja ===&lt;br /&gt;
* [[NN Chunk Format]]&lt;/div&gt;</summary>
		<author><name>Hyper</name></author>
	</entry>
	<entry>
		<id>https://hedgedocs.com/index.php?title=U8_Archive&amp;diff=1240</id>
		<title>U8 Archive</title>
		<link rel="alternate" type="text/html" href="https://hedgedocs.com/index.php?title=U8_Archive&amp;diff=1240"/>
		<updated>2025-12-02T12:43:22Z</updated>

		<summary type="html">&lt;p&gt;Hyper: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&#039;&#039;&#039;&#039;&#039;U8 Archive&#039;&#039;&#039;&#039;&#039; is a hierarchical archive format developed by Nintendo during the GameCube era and was predominantly used on the Wii.&lt;br /&gt;
&lt;br /&gt;
== Titles using U8 Archive ==&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Sonic Heroes&#039;&#039;&#039; (PlayStation 2) - released 2004&lt;br /&gt;
* &#039;&#039;&#039;Sonic the Hedgehog&#039;&#039;&#039; (Xbox 360, PlayStation 3) - released 2006&lt;br /&gt;
* &#039;&#039;&#039;Sonic and the Secret Rings&#039;&#039;&#039;&amp;lt;sup&amp;gt;†&amp;lt;/sup&amp;gt; (Wii) - released 2007&lt;br /&gt;
* &#039;&#039;&#039;Sonic and the Black Knight&#039;&#039;&#039;&amp;lt;sup&amp;gt;†&amp;lt;/sup&amp;gt; (Wii) - released 2009&lt;br /&gt;
* &#039;&#039;&#039;Sonic Colours&#039;&#039;&#039; (Wii) - released 2010&lt;br /&gt;
* &#039;&#039;&#039;Sonic Colours: Ultimate&#039;&#039;&#039; (Windows, Xbox One, PlayStation 4, Switch) - released 2021&lt;br /&gt;
&lt;br /&gt;
&amp;lt;sup&amp;gt;†&amp;lt;/sup&amp;gt; — used for operating system only.&lt;br /&gt;
&lt;br /&gt;
== Specification ==&lt;br /&gt;
=== Header ===&lt;br /&gt;
The header consists of the following data structure:&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+Length: 0x20&lt;br /&gt;
!Offset&lt;br /&gt;
!Type&lt;br /&gt;
!Name&lt;br /&gt;
!Description&lt;br /&gt;
|-&lt;br /&gt;
|0x00&lt;br /&gt;
|UInt32&lt;br /&gt;
|Signature&lt;br /&gt;
|Always 0x55AA382D (big-endian) or 0x2D38AA55 (little-endian).&lt;br /&gt;
|-&lt;br /&gt;
|0x04&lt;br /&gt;
|UInt32&lt;br /&gt;
|FSTableOffset&lt;br /&gt;
|The offset of the file system table.&lt;br /&gt;
|-&lt;br /&gt;
|0x08&lt;br /&gt;
|UInt32&lt;br /&gt;
|FSTableLength&lt;br /&gt;
|The length of the file system table (including the string pool).&lt;br /&gt;
|-&lt;br /&gt;
|0x0C&lt;br /&gt;
|UInt32&lt;br /&gt;
|DataOffset&lt;br /&gt;
|The offset of the file data.&lt;br /&gt;
|-&lt;br /&gt;
|0x10&lt;br /&gt;
|UInt32[4]&lt;br /&gt;
|Reserved&lt;br /&gt;
|These fields appear to be populated in archives for &#039;&#039;&#039;Sonic the Hedgehog (2006)&#039;&#039;&#039;, but this is bogus data from uninitialised memory and should be ignored.&lt;br /&gt;
For the sake of tooling heuristics, writing &amp;lt;code&amp;gt;0xE4F91300&amp;lt;/code&amp;gt; (big-endian) to index 0 and &amp;lt;code&amp;gt;0x78013800&amp;lt;/code&amp;gt; (big-endian) to index 3 would be ideal for detecting whether an archive is from that game specifically.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== File System ===&lt;br /&gt;
The file system consists of an array of the following data structure:&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+Length: 0x0C (or 0x10 for Sonic the Hedgehog (2006))&lt;br /&gt;
!Offset&lt;br /&gt;
!Type&lt;br /&gt;
!Name&lt;br /&gt;
!Description&lt;br /&gt;
|-&lt;br /&gt;
|0x00&lt;br /&gt;
|Boolean (UInt8)&lt;br /&gt;
|IsDirectory&lt;br /&gt;
|Determines whether this node is a directory.&lt;br /&gt;
|-&lt;br /&gt;
|0x01&lt;br /&gt;
|UInt24&lt;br /&gt;
|NameOffset&lt;br /&gt;
|The offset of this node&#039;s name in the string pool.&lt;br /&gt;
If root, always zero.&lt;br /&gt;
|-&lt;br /&gt;
|0x04&lt;br /&gt;
|Union (UInt32, UInt32)&lt;br /&gt;
|DataOffset, ParentIndex&lt;br /&gt;
|&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+&lt;br /&gt;
|File&lt;br /&gt;
|The offset of this file&#039;s data.&lt;br /&gt;
|-&lt;br /&gt;
|Directory&lt;br /&gt;
|The index of the parent node for this directory.&lt;br /&gt;
If root, always zero.&lt;br /&gt;
|}&lt;br /&gt;
|-&lt;br /&gt;
|0x08&lt;br /&gt;
|Union (UInt32, UInt32)&lt;br /&gt;
|Length, NodeCount&lt;br /&gt;
|&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+&lt;br /&gt;
|File&lt;br /&gt;
|The length of this file&#039;s data.&lt;br /&gt;
|-&lt;br /&gt;
|Directory&lt;br /&gt;
|The total number of nodes in this directory.&lt;br /&gt;
If root, the total number of nodes in this archive.&lt;br /&gt;
|}&lt;br /&gt;
|-&lt;br /&gt;
|0x0C&lt;br /&gt;
|UInt32&lt;br /&gt;
|UncompressedLength&lt;br /&gt;
|This field is unique to archives for &#039;&#039;&#039;Sonic the Hedgehog (2006)&#039;&#039;&#039;.&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+&lt;br /&gt;
|File&lt;br /&gt;
|The uncompressed length of this file&#039;s data.&lt;br /&gt;
This field can be set to zero to disable compression for this file, allowing its data to be stored uncompressed.&lt;br /&gt;
|-&lt;br /&gt;
|Directory&lt;br /&gt;
|Undefined.&lt;br /&gt;
Much like the reserved bytes in the header, this field will appear to be populated, but again, this is bogus data from uninitialised memory.&lt;br /&gt;
|}&lt;br /&gt;
|}&lt;br /&gt;
The total number of nodes to read is determined by the root node&#039;s &amp;lt;code&amp;gt;NodeCount&amp;lt;/code&amp;gt; field. As this is a hierarchical file system, nodes should be read recursively to build the file system correctly.&lt;br /&gt;
&lt;br /&gt;
The first node &#039;&#039;&#039;must&#039;&#039;&#039; be a root node defined as a directory, with the &amp;lt;code&amp;gt;NodeCount&amp;lt;/code&amp;gt; field set to the total number of nodes in the archive. This is necessary for determining the length of the file system table.&lt;br /&gt;
&lt;br /&gt;
=== String Pool ===&lt;br /&gt;
The string pool offset can be calculated after reading the root node and using the following expression:&amp;lt;syntaxhighlight lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
FSTableOffset + (Root.NodeCount * 16)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;Each string in the pool is ASCII-encoded and null-terminated, the offsets to which are relative to the start of the pool.&lt;br /&gt;
&lt;br /&gt;
The string pool &#039;&#039;&#039;must&#039;&#039;&#039; have a single null terminator at the beginning for the root node, as it does not have a name.&lt;br /&gt;
&lt;br /&gt;
=== File Data ===&lt;br /&gt;
Files are aligned by 32 bytes per file after the string pool.&lt;br /&gt;
&lt;br /&gt;
In &#039;&#039;&#039;Sonic the Hedgehog (2006)&#039;&#039;&#039;, files may be compressed using [[wikipedia:Zlib|zlib]]. This compression is optional, and files can be stored uncompressed so long as &amp;lt;code&amp;gt;UncompressedLength&amp;lt;/code&amp;gt; is set to zero.&lt;br /&gt;
[[Category:File Formats]]&lt;/div&gt;</summary>
		<author><name>Hyper</name></author>
	</entry>
	<entry>
		<id>https://hedgedocs.com/index.php?title=Documentation&amp;diff=1239</id>
		<title>Documentation</title>
		<link rel="alternate" type="text/html" href="https://hedgedocs.com/index.php?title=Documentation&amp;diff=1239"/>
		<updated>2025-12-02T12:42:22Z</updated>

		<summary type="html">&lt;p&gt;Hyper: Added U8 Archive to Archives section&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This section lists documentation pages for resources you&#039;ll find in Sonic games. You&#039;ll find information about certain file formats and other general game resources.&lt;br /&gt;
&lt;br /&gt;
== Rendering ==&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+&lt;br /&gt;
!Name&lt;br /&gt;
!Info&lt;br /&gt;
|-&lt;br /&gt;
| [[Normal mapping]]&lt;br /&gt;
| How normal mapping works&lt;br /&gt;
|-&lt;br /&gt;
| [[Vertex Colors]]&lt;br /&gt;
| How vertex colors work&lt;br /&gt;
|-&lt;br /&gt;
| [[Mesh Layers]]&lt;br /&gt;
| Model mesh layers&lt;br /&gt;
|-&lt;br /&gt;
| [[Opacity]]&lt;br /&gt;
| The concept of opacity explained&lt;br /&gt;
|- &lt;br /&gt;
| [[Texture Blending]]&lt;br /&gt;
| The different ways to blend textures&lt;br /&gt;
|-&lt;br /&gt;
!&lt;br /&gt;
!&lt;br /&gt;
|-&lt;br /&gt;
|[[Hedgehog Engine Rendering|Hedgehog Engine]]&lt;br /&gt;
|Render engine first used in Sonic Unleashed&lt;br /&gt;
|-&lt;br /&gt;
|[[Hedgehog Engine 2 Rendering|Hedgehog Engine 2]]&lt;br /&gt;
|Render Engine first used in Sonic Forces&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Models ==&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+&lt;br /&gt;
!Name&lt;br /&gt;
!Info&lt;br /&gt;
!Extension&lt;br /&gt;
!Tools&lt;br /&gt;
|-&lt;br /&gt;
|[[SCA Parameters]]&lt;br /&gt;
|Model and material parameters stored in SCA file headers&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Shaders ==&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+&lt;br /&gt;
!Name&lt;br /&gt;
!Info&lt;br /&gt;
!Extension&lt;br /&gt;
!Tools&lt;br /&gt;
|-&lt;br /&gt;
|[[Shader Features]]&lt;br /&gt;
|Hedgehog engine 1 shader features&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Set-Data ==&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+&lt;br /&gt;
!Name&lt;br /&gt;
!Description&lt;br /&gt;
!Extension&lt;br /&gt;
!Tools&lt;br /&gt;
|-&lt;br /&gt;
|[[HSON Format|HSON]] (Hedgehog Set Object Notation)&lt;br /&gt;
|Universal object placement representation format.&lt;br /&gt;
|&amp;lt;code&amp;gt;.hson&amp;lt;/code&amp;gt;&lt;br /&gt;
|&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== User Interface ==&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+&lt;br /&gt;
!Name&lt;br /&gt;
!Description&lt;br /&gt;
!Extension&lt;br /&gt;
!Tools&lt;br /&gt;
|-&lt;br /&gt;
|[[NCP File Format|NCP]] (Ninja CellSpriteDraw Project)&lt;br /&gt;
|Describes a user interface in most Hedgehog Engine games.&lt;br /&gt;
|&amp;lt;span style=&amp;quot;text-align: center&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;&amp;lt;code&amp;gt;.xncp&amp;lt;/code&amp;gt;&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;&amp;lt;code&amp;gt;.yncp&amp;lt;/code&amp;gt;&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;&amp;lt;code&amp;gt;.gncp&amp;lt;/code&amp;gt;&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;&amp;lt;code&amp;gt;.sncp&amp;lt;/code&amp;gt;&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;/span&amp;gt;&lt;br /&gt;
|&lt;br /&gt;
* [[Kunai]]&lt;br /&gt;
* [[Shuriken]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Archives ==&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!Name&lt;br /&gt;
!Description&lt;br /&gt;
!Extension&lt;br /&gt;
!Tools&lt;br /&gt;
|-&lt;br /&gt;
|[[U8 Archive]]&lt;br /&gt;
|Hierarchical archive format.&lt;br /&gt;
|&amp;lt;code&amp;gt;.arc&amp;lt;/code&amp;gt;&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|[[NN Chunk Format|NN Chunk]]&lt;br /&gt;
|Generic container format.&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Animation ==&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+&lt;br /&gt;
!Name&lt;br /&gt;
!Description&lt;br /&gt;
!Extension&lt;br /&gt;
!Tools&lt;br /&gt;
|-&lt;br /&gt;
|[[PXD|PXD Animation]]&lt;br /&gt;
|Skeleton and skeletal animation format in Hedgehog Engine 2 Games&lt;br /&gt;
|&amp;lt;span style=&amp;quot;text-align: center&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;&amp;lt;code&amp;gt;.anm.pxd&amp;lt;/code&amp;gt;&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;&amp;lt;code&amp;gt;.skl.pxd&amp;lt;/code&amp;gt;&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;/span&amp;gt;&lt;br /&gt;
|[[Frontiers Animation Tools]]&lt;br /&gt;
|-&lt;br /&gt;
|[[PBA|PBA Skeleton]]&lt;br /&gt;
|Physics Based Animation Skeleton for Hedgehog Engine 2 Games&lt;br /&gt;
|&amp;lt;code&amp;gt;.pba&amp;lt;/code&amp;gt;&lt;br /&gt;
|&lt;br /&gt;
|}&lt;/div&gt;</summary>
		<author><name>Hyper</name></author>
	</entry>
	<entry>
		<id>https://hedgedocs.com/index.php?title=U8_Archive&amp;diff=1238</id>
		<title>U8 Archive</title>
		<link rel="alternate" type="text/html" href="https://hedgedocs.com/index.php?title=U8_Archive&amp;diff=1238"/>
		<updated>2025-12-02T12:40:37Z</updated>

		<summary type="html">&lt;p&gt;Hyper: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&#039;&#039;&#039;&#039;&#039;U8 Archive&#039;&#039;&#039;&#039;&#039; is a hierarchical archive format developed by Nintendo during the GameCube era and was predominantly used on the Wii.&lt;br /&gt;
&lt;br /&gt;
== Titles using U8 Archive ==&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Sonic Heroes&#039;&#039;&#039; (PlayStation 2) - released 2004&lt;br /&gt;
* &#039;&#039;&#039;Sonic the Hedgehog&#039;&#039;&#039; (Xbox 360, PlayStation 3) - released 2006&lt;br /&gt;
* &#039;&#039;&#039;Sonic and the Secret Rings&#039;&#039;&#039;&amp;lt;sup&amp;gt;†&amp;lt;/sup&amp;gt; (Wii) - released 2007&lt;br /&gt;
* &#039;&#039;&#039;Sonic and the Black Knight&#039;&#039;&#039;&amp;lt;sup&amp;gt;†&amp;lt;/sup&amp;gt; (Wii) - released 2009&lt;br /&gt;
* &#039;&#039;&#039;Sonic Colours&#039;&#039;&#039; (Wii) - released 2010&lt;br /&gt;
* &#039;&#039;&#039;Sonic Colours: Ultimate&#039;&#039;&#039; (Windows, Xbox One, PlayStation 4, Switch) - released 2021&lt;br /&gt;
&lt;br /&gt;
&amp;lt;sup&amp;gt;†&amp;lt;/sup&amp;gt; — used for operating system only.&lt;br /&gt;
&lt;br /&gt;
== Specification ==&lt;br /&gt;
=== Header ===&lt;br /&gt;
The header consists of the following data structure:&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+Length: 0x20&lt;br /&gt;
!Offset&lt;br /&gt;
!Type&lt;br /&gt;
!Name&lt;br /&gt;
!Description&lt;br /&gt;
|-&lt;br /&gt;
|0x00&lt;br /&gt;
|UInt32&lt;br /&gt;
|Signature&lt;br /&gt;
|Always 0x55AA382D (big-endian) or 0x2D38AA55 (little-endian).&lt;br /&gt;
|-&lt;br /&gt;
|0x04&lt;br /&gt;
|UInt32&lt;br /&gt;
|FSTableOffset&lt;br /&gt;
|The offset of the file system table.&lt;br /&gt;
|-&lt;br /&gt;
|0x08&lt;br /&gt;
|UInt32&lt;br /&gt;
|FSTableLength&lt;br /&gt;
|The length of the file system table (including the string pool).&lt;br /&gt;
|-&lt;br /&gt;
|0x0C&lt;br /&gt;
|UInt32&lt;br /&gt;
|DataOffset&lt;br /&gt;
|The offset of the file data.&lt;br /&gt;
|-&lt;br /&gt;
|0x10&lt;br /&gt;
|UInt32[4]&lt;br /&gt;
|Reserved&lt;br /&gt;
|These fields appear to be populated in archives for &#039;&#039;&#039;Sonic the Hedgehog (2006)&#039;&#039;&#039;, but this is bogus data from uninitialised memory and should be ignored.&lt;br /&gt;
For the sake of tooling heuristics, writing &amp;lt;code&amp;gt;0xE4F91300&amp;lt;/code&amp;gt; (big-endian) to index 0 and &amp;lt;code&amp;gt;0x78013800&amp;lt;/code&amp;gt; (big-endian) to index 3 would be ideal for detecting whether an archive is from that game specifically.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== File System ===&lt;br /&gt;
The file system consists of an array of the following data structure:&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+Length: 0x0C (or 0x10 for Sonic the Hedgehog (2006))&lt;br /&gt;
!Offset&lt;br /&gt;
!Type&lt;br /&gt;
!Name&lt;br /&gt;
!Description&lt;br /&gt;
|-&lt;br /&gt;
|0x00&lt;br /&gt;
|Boolean (UInt8)&lt;br /&gt;
|IsDirectory&lt;br /&gt;
|Determines whether this node is a directory.&lt;br /&gt;
|-&lt;br /&gt;
|0x01&lt;br /&gt;
|UInt24&lt;br /&gt;
|NameOffset&lt;br /&gt;
|The offset of this node&#039;s name in the string pool.&lt;br /&gt;
If root, always zero.&lt;br /&gt;
|-&lt;br /&gt;
|0x04&lt;br /&gt;
|Union (UInt32, UInt32)&lt;br /&gt;
|DataOffset, ParentIndex&lt;br /&gt;
|&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+&lt;br /&gt;
|File&lt;br /&gt;
|The offset of this file&#039;s data.&lt;br /&gt;
|-&lt;br /&gt;
|Directory&lt;br /&gt;
|The index of the parent node for this directory.&lt;br /&gt;
If root, always zero.&lt;br /&gt;
|}&lt;br /&gt;
|-&lt;br /&gt;
|0x08&lt;br /&gt;
|Union (UInt32, UInt32)&lt;br /&gt;
|Length, NodeCount&lt;br /&gt;
|&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+&lt;br /&gt;
|File&lt;br /&gt;
|The length of this file&#039;s data.&lt;br /&gt;
|-&lt;br /&gt;
|Directory&lt;br /&gt;
|The total number of nodes in this directory.&lt;br /&gt;
If root, the total number of nodes in this archive.&lt;br /&gt;
|}&lt;br /&gt;
|-&lt;br /&gt;
|0x0C&lt;br /&gt;
|UInt32&lt;br /&gt;
|UncompressedLength&lt;br /&gt;
|This field is unique to archives for &#039;&#039;&#039;Sonic the Hedgehog (2006)&#039;&#039;&#039;.&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+&lt;br /&gt;
|File&lt;br /&gt;
|The uncompressed length of this file&#039;s data.&lt;br /&gt;
This field can be set to zero to disable compression for this file, allowing its data to be stored uncompressed.&lt;br /&gt;
|-&lt;br /&gt;
|Directory&lt;br /&gt;
|Undefined.&lt;br /&gt;
Much like the reserved bytes in the header, this field will appear to be populated, but again, this is bogus data from uninitialised memory.&lt;br /&gt;
|}&lt;br /&gt;
|}&lt;br /&gt;
The total number of nodes to read is determined by the root node&#039;s &amp;lt;code&amp;gt;NodeCount&amp;lt;/code&amp;gt; field. As this is a hierarchical file system, nodes should be read recursively to build the file system correctly.&lt;br /&gt;
&lt;br /&gt;
The first node &#039;&#039;&#039;must&#039;&#039;&#039; be a root node defined as a directory, with the &amp;lt;code&amp;gt;NodeCount&amp;lt;/code&amp;gt; field set to the total number of nodes in the archive. This is necessary for determining the length of the file system table.&lt;br /&gt;
&lt;br /&gt;
=== String Pool ===&lt;br /&gt;
The string pool offset can be calculated after reading the root node and using the following expression:&amp;lt;syntaxhighlight lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
FSTableOffset + (Root.NodeCount * 16)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;Each string in the pool is ASCII-encoded and null-terminated, the offsets to which are relative to the start of the pool.&lt;br /&gt;
&lt;br /&gt;
The string pool &#039;&#039;&#039;must&#039;&#039;&#039; have a single null terminator at the beginning for the root node, as it does not have a name.&lt;br /&gt;
&lt;br /&gt;
=== File Data ===&lt;br /&gt;
Files are aligned by 32 bytes per file after the string pool.&lt;br /&gt;
&lt;br /&gt;
In Sonic the Hedgehog (2006), files may be compressed using [[wikipedia:Zlib|zlib]]. This compression is optional, and files can be stored uncompressed so long as &amp;lt;code&amp;gt;UncompressedLength&amp;lt;/code&amp;gt; is set to zero.&lt;br /&gt;
[[Category:File Formats]]&lt;/div&gt;</summary>
		<author><name>Hyper</name></author>
	</entry>
	<entry>
		<id>https://hedgedocs.com/index.php?title=U8_Archive&amp;diff=1237</id>
		<title>U8 Archive</title>
		<link rel="alternate" type="text/html" href="https://hedgedocs.com/index.php?title=U8_Archive&amp;diff=1237"/>
		<updated>2025-12-02T12:38:16Z</updated>

		<summary type="html">&lt;p&gt;Hyper: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&#039;&#039;&#039;&#039;&#039;U8 Archive&#039;&#039;&#039;&#039;&#039; is a hierarchical archive format developed by Nintendo during the GameCube era and was predominantly used on the Wii.&lt;br /&gt;
&lt;br /&gt;
== Titles using U8 Archive ==&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Sonic Heroes&#039;&#039;&#039; (PlayStation 2) - released 2004&lt;br /&gt;
* &#039;&#039;&#039;Sonic the Hedgehog&#039;&#039;&#039; (Xbox 360, PlayStation 3) - released 2006&lt;br /&gt;
* &#039;&#039;&#039;Sonic and the Secret Rings&#039;&#039;&#039;&amp;lt;sup&amp;gt;†&amp;lt;/sup&amp;gt; (Wii) - released 2007&lt;br /&gt;
* &#039;&#039;&#039;Sonic and the Black Knight&#039;&#039;&#039;&amp;lt;sup&amp;gt;†&amp;lt;/sup&amp;gt; (Wii) - released 2009&lt;br /&gt;
* &#039;&#039;&#039;Sonic Colours&#039;&#039;&#039; (Wii) - released 2010&lt;br /&gt;
* &#039;&#039;&#039;Sonic Colours: Ultimate&#039;&#039;&#039; (Windows, Xbox One, PlayStation 4, Switch) - released 2021&lt;br /&gt;
&lt;br /&gt;
&amp;lt;sup&amp;gt;†&amp;lt;/sup&amp;gt; — used for operating system only.&lt;br /&gt;
&lt;br /&gt;
== Specification ==&lt;br /&gt;
=== Header ===&lt;br /&gt;
The header consists of the following data structure:&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+Length: 0x20&lt;br /&gt;
!Offset&lt;br /&gt;
!Type&lt;br /&gt;
!Name&lt;br /&gt;
!Description&lt;br /&gt;
|-&lt;br /&gt;
|0x00&lt;br /&gt;
|UInt32&lt;br /&gt;
|Signature&lt;br /&gt;
|Always 0x55AA382D (big-endian) or 0x2D38AA55 (little-endian).&lt;br /&gt;
|-&lt;br /&gt;
|0x04&lt;br /&gt;
|UInt32&lt;br /&gt;
|FSTableOffset&lt;br /&gt;
|The offset of the file system table.&lt;br /&gt;
|-&lt;br /&gt;
|0x08&lt;br /&gt;
|UInt32&lt;br /&gt;
|FSTableLength&lt;br /&gt;
|The length of the file system table (including the string pool).&lt;br /&gt;
|-&lt;br /&gt;
|0x0C&lt;br /&gt;
|UInt32&lt;br /&gt;
|DataOffset&lt;br /&gt;
|The offset of the file data.&lt;br /&gt;
|-&lt;br /&gt;
|0x10&lt;br /&gt;
|UInt32[4]&lt;br /&gt;
|Reserved&lt;br /&gt;
|These fields appear to be populated in archives for [[Sonic the Hedgehog (2006)]], but this is bogus data from uninitialised memory and should be ignored.&lt;br /&gt;
For the sake of tooling heuristics, writing &amp;lt;code&amp;gt;0xE4F91300&amp;lt;/code&amp;gt; (big-endian) to index 0 and &amp;lt;code&amp;gt;0x78013800&amp;lt;/code&amp;gt; (big-endian) to index 3 would be ideal for detecting whether an archive is from that game specifically.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== File System ===&lt;br /&gt;
The file system consists of an array of the following data structure:&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+Length: 0x0C (or 0x10 for Sonic the Hedgehog (2006))&lt;br /&gt;
!Offset&lt;br /&gt;
!Type&lt;br /&gt;
!Name&lt;br /&gt;
!Description&lt;br /&gt;
|-&lt;br /&gt;
|0x00&lt;br /&gt;
|Boolean (UInt8)&lt;br /&gt;
|IsDirectory&lt;br /&gt;
|Determines whether this node is a directory.&lt;br /&gt;
|-&lt;br /&gt;
|0x01&lt;br /&gt;
|UInt24&lt;br /&gt;
|NameOffset&lt;br /&gt;
|The offset of this node&#039;s name in the string pool.&lt;br /&gt;
If root, always zero.&lt;br /&gt;
|-&lt;br /&gt;
|0x04&lt;br /&gt;
|Union (UInt32, UInt32)&lt;br /&gt;
|DataOffset, ParentIndex&lt;br /&gt;
|&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+&lt;br /&gt;
|File&lt;br /&gt;
|The offset of this file&#039;s data.&lt;br /&gt;
|-&lt;br /&gt;
|Directory&lt;br /&gt;
|The index of the parent node for this directory.&lt;br /&gt;
If root, always zero.&lt;br /&gt;
|}&lt;br /&gt;
|-&lt;br /&gt;
|0x08&lt;br /&gt;
|Union (UInt32, UInt32)&lt;br /&gt;
|Length, NodeCount&lt;br /&gt;
|&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+&lt;br /&gt;
|File&lt;br /&gt;
|The length of this file&#039;s data.&lt;br /&gt;
|-&lt;br /&gt;
|Directory&lt;br /&gt;
|The total number of nodes in this directory.&lt;br /&gt;
If root, the total number of nodes in this archive.&lt;br /&gt;
|}&lt;br /&gt;
|-&lt;br /&gt;
|0x0C&lt;br /&gt;
|UInt32&lt;br /&gt;
|UncompressedLength&lt;br /&gt;
|This field is unique to archives for &#039;&#039;&#039;Sonic the Hedgehog (2006)&#039;&#039;&#039;.&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+&lt;br /&gt;
|File&lt;br /&gt;
|The uncompressed length of this file&#039;s data.&lt;br /&gt;
This field can be set to zero to disable compression for this file, allowing its data to be stored uncompressed.&lt;br /&gt;
|-&lt;br /&gt;
|Directory&lt;br /&gt;
|Undefined.&lt;br /&gt;
Much like the reserved bytes in the header, this field will appear to be populated, but again, this is bogus data from uninitialised memory.&lt;br /&gt;
|}&lt;br /&gt;
|}&lt;br /&gt;
The total number of nodes to read is determined by the root node&#039;s &amp;lt;code&amp;gt;NodeCount&amp;lt;/code&amp;gt; field. As this is a hierarchical file system, nodes should be read recursively to build the file system correctly.&lt;br /&gt;
&lt;br /&gt;
The first node &#039;&#039;&#039;must&#039;&#039;&#039; be a root node defined as a directory, with the &amp;lt;code&amp;gt;NodeCount&amp;lt;/code&amp;gt; field set to the total number of nodes in the archive. This is necessary for determining the length of the file system table.&lt;br /&gt;
&lt;br /&gt;
=== String Pool ===&lt;br /&gt;
The string pool offset can be calculated after reading the root node and using the following expression:&amp;lt;syntaxhighlight lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
FSTableOffset + (Root.NodeCount * 16)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;Each string in the pool is ASCII-encoded and null-terminated, the offsets to which are relative to the start of the pool.&lt;br /&gt;
&lt;br /&gt;
The string pool &#039;&#039;&#039;must&#039;&#039;&#039; have a single null terminator at the beginning for the root node, as it does not have a name.&lt;br /&gt;
&lt;br /&gt;
=== File Data ===&lt;br /&gt;
Files are aligned by 32 bytes per file after the string pool.&lt;br /&gt;
&lt;br /&gt;
In Sonic the Hedgehog (2006), files may be compressed using [[wikipedia:Zlib|zlib]]. This compression is optional, and files can be stored uncompressed so long as &amp;lt;code&amp;gt;UncompressedLength&amp;lt;/code&amp;gt; is set to zero.&lt;br /&gt;
[[Category:File Formats]]&lt;/div&gt;</summary>
		<author><name>Hyper</name></author>
	</entry>
	<entry>
		<id>https://hedgedocs.com/index.php?title=Arc_File&amp;diff=1236</id>
		<title>Arc File</title>
		<link rel="alternate" type="text/html" href="https://hedgedocs.com/index.php?title=Arc_File&amp;diff=1236"/>
		<updated>2025-12-02T12:09:56Z</updated>

		<summary type="html">&lt;p&gt;Hyper: Hyper moved page Arc File to U8 Archive over redirect&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;#REDIRECT [[U8 Archive]]&lt;/div&gt;</summary>
		<author><name>Hyper</name></author>
	</entry>
	<entry>
		<id>https://hedgedocs.com/index.php?title=U8_Archive&amp;diff=1235</id>
		<title>U8 Archive</title>
		<link rel="alternate" type="text/html" href="https://hedgedocs.com/index.php?title=U8_Archive&amp;diff=1235"/>
		<updated>2025-12-02T12:09:56Z</updated>

		<summary type="html">&lt;p&gt;Hyper: Hyper moved page Arc File to U8 Archive over redirect&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&#039;&#039;&#039;&#039;&#039;Arc File&#039;&#039;&#039;&#039;&#039; is the &amp;lt;code&amp;gt;*.arc&amp;lt;/code&amp;gt; file format used for the packed file system for [[Sonic the Hedgehog (2006)]].&lt;br /&gt;
&lt;br /&gt;
These files are located in the &amp;lt;code&amp;gt;xenon&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;ps3&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;win32&amp;lt;/code&amp;gt; directories on the game disc in a subdirectory called &amp;lt;code&amp;gt;archives&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
== File System ==&lt;br /&gt;
The internal file system follows an organisational pattern where the directories starting from root are platform identifiers for the file formats contained within them.&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+&lt;br /&gt;
!Identifier&lt;br /&gt;
!Endianness&lt;br /&gt;
!Purpose&lt;br /&gt;
|-&lt;br /&gt;
|common&lt;br /&gt;
|N/A&lt;br /&gt;
|Used for files where endianness is non-applicable (e.g. files that are read manually in a specific byte order irrespective of the current platform).&lt;br /&gt;
|-&lt;br /&gt;
|xenon&lt;br /&gt;
|Big&lt;br /&gt;
|Used for files that are read directly into memory and mapped to structures where big-endian byte order is expected for the Xbox 360 platform.&lt;br /&gt;
|-&lt;br /&gt;
|ps3&lt;br /&gt;
|Big&lt;br /&gt;
|Same as above, but for the PlayStation 3 platform.&lt;br /&gt;
|-&lt;br /&gt;
|win32&lt;br /&gt;
|Little&lt;br /&gt;
|Used for files that are read directly into memory and mapped to structures where little-endian byte order is expected for the Windows (x86) platform.&lt;br /&gt;
These files would be read manually for endian swapping on big-endian platforms.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Specification ==&lt;br /&gt;
&#039;&#039;&#039;Arc File&#039;&#039;&#039; is a derivative of Nintendo&#039;s archive format, commonly known as &#039;&#039;&#039;U8 Archive&#039;&#039;&#039;. It&#039;s the same format, but with an extra field added to each file system node for uncompressed length, as Sonic Team added support for [[wikipedia:Zlib|zlib]] compression to the format.&lt;br /&gt;
&lt;br /&gt;
=== Header ===&lt;br /&gt;
The header consists of the following data structure:&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+Length: 0x20&lt;br /&gt;
!Offset&lt;br /&gt;
!Type&lt;br /&gt;
!Name&lt;br /&gt;
!Description&lt;br /&gt;
|-&lt;br /&gt;
|0x00&lt;br /&gt;
|UInt32&lt;br /&gt;
|Signature&lt;br /&gt;
|Always 0x55AA382D (big-endian).&lt;br /&gt;
|-&lt;br /&gt;
|0x04&lt;br /&gt;
|UInt32&lt;br /&gt;
|FSTableOffset&lt;br /&gt;
|The offset of the file system table.&lt;br /&gt;
|-&lt;br /&gt;
|0x08&lt;br /&gt;
|UInt32&lt;br /&gt;
|FSTableLength&lt;br /&gt;
|The length of the file system table (including the string pool).&lt;br /&gt;
|-&lt;br /&gt;
|0x0C&lt;br /&gt;
|UInt32&lt;br /&gt;
|DataOffset&lt;br /&gt;
|The offset of the file data.&lt;br /&gt;
|-&lt;br /&gt;
|0x10&lt;br /&gt;
|UInt32[4]&lt;br /&gt;
|Reserved&lt;br /&gt;
|These fields appear to be populated in archives for this game, but this is bogus data from uninitialised memory and should be ignored.&lt;br /&gt;
For the sake of tooling heuristics, writing &amp;lt;code&amp;gt;0xE4F91300&amp;lt;/code&amp;gt; (big-endian) to index 0 and &amp;lt;code&amp;gt;0x78013800&amp;lt;/code&amp;gt; (big-endian) to index 3 would be ideal for detecting whether this archive is from this game specifically.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== File System ===&lt;br /&gt;
The file system consists of an array of the following data structure:&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+Length: 0x10&lt;br /&gt;
!Offset&lt;br /&gt;
!Type&lt;br /&gt;
!Name&lt;br /&gt;
!Description&lt;br /&gt;
|-&lt;br /&gt;
|0x00&lt;br /&gt;
|Boolean (UInt8)&lt;br /&gt;
|IsDirectory&lt;br /&gt;
|Determines whether this node is a directory.&lt;br /&gt;
|-&lt;br /&gt;
|0x01&lt;br /&gt;
|UInt24&lt;br /&gt;
|NameOffset&lt;br /&gt;
|The offset of this node&#039;s name in the string pool.&lt;br /&gt;
If root, always zero.&lt;br /&gt;
|-&lt;br /&gt;
|0x04&lt;br /&gt;
|Union (UInt32, UInt32)&lt;br /&gt;
|DataOffset, ParentIndex&lt;br /&gt;
|&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+&lt;br /&gt;
|File&lt;br /&gt;
|The offset of this file&#039;s data.&lt;br /&gt;
|-&lt;br /&gt;
|Directory&lt;br /&gt;
|The index of the parent node for this directory.&lt;br /&gt;
If root, always zero.&lt;br /&gt;
|}&lt;br /&gt;
|-&lt;br /&gt;
|0x08&lt;br /&gt;
|Union (UInt32, UInt32)&lt;br /&gt;
|Length, NodeCount&lt;br /&gt;
|&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+&lt;br /&gt;
|File&lt;br /&gt;
|The length of this file&#039;s data.&lt;br /&gt;
|-&lt;br /&gt;
|Directory&lt;br /&gt;
|The total number of nodes in this directory.&lt;br /&gt;
If root, the total number of nodes in this archive.&lt;br /&gt;
|}&lt;br /&gt;
|-&lt;br /&gt;
|0x0C&lt;br /&gt;
|UInt32&lt;br /&gt;
|UncompressedLength&lt;br /&gt;
|&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+&lt;br /&gt;
|File&lt;br /&gt;
|The uncompressed length of this file&#039;s data.&lt;br /&gt;
This field can be set to zero to disable compression for this file, allowing its data to be stored uncompressed.&lt;br /&gt;
|-&lt;br /&gt;
|Directory&lt;br /&gt;
|Undefined.&lt;br /&gt;
Much like the reserved bytes in the header, this field will appear to be populated, but again, this is bogus data from uninitialised memory.&lt;br /&gt;
|}&lt;br /&gt;
|}&lt;br /&gt;
The total number of nodes to read is determined by the root node&#039;s &amp;lt;code&amp;gt;NodeCount&amp;lt;/code&amp;gt; field. As this is a hierarchical file system, nodes should be read recursively to build the file system correctly.&lt;br /&gt;
&lt;br /&gt;
The first node &#039;&#039;&#039;must&#039;&#039;&#039; be a root node defined as a directory, with the &amp;lt;code&amp;gt;NodeCount&amp;lt;/code&amp;gt; field set to the total number of nodes in the archive. This is necessary for determining the length of the file system table.&lt;br /&gt;
&lt;br /&gt;
=== String Pool ===&lt;br /&gt;
The string pool offset can be calculated after reading the root node and using the following expression:&amp;lt;syntaxhighlight lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
FSTableOffset + (Root.NodeCount * 16)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;Each string in the pool is ASCII-encoded and null-terminated, the offsets to which are relative to the start of the pool.&lt;br /&gt;
&lt;br /&gt;
The string pool &#039;&#039;&#039;must&#039;&#039;&#039; have a single null terminator at the beginning for the root node, as it does not have a name.&lt;br /&gt;
&lt;br /&gt;
=== File Data ===&lt;br /&gt;
Files are compressed using [[wikipedia:Zlib|zlib]] compression and are aligned by 32 bytes per file after the string pool. This compression is optional, and files can be stored uncompressed so long as &amp;lt;code&amp;gt;UncompressedLength&amp;lt;/code&amp;gt; is set to zero.&lt;br /&gt;
&lt;br /&gt;
== List of Arc Files ==&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+&lt;br /&gt;
!Name&lt;br /&gt;
!Description&lt;br /&gt;
|-&lt;br /&gt;
|cache.arc&lt;br /&gt;
|Core render scripts, event playbook, and optical camouflage noise texture &lt;br /&gt;
|-&lt;br /&gt;
|download.arc&lt;br /&gt;
|DLC episode mission and SET data&lt;br /&gt;
|-&lt;br /&gt;
|enemy_data.arc&lt;br /&gt;
|Boss textures and objects&lt;br /&gt;
|-&lt;br /&gt;
|enemy.arc&lt;br /&gt;
|Regular enemy textures and objects&lt;br /&gt;
|-&lt;br /&gt;
|event_data.arc&lt;br /&gt;
|Event-specific textures and objects&lt;br /&gt;
|-&lt;br /&gt;
|event.arc&lt;br /&gt;
|Event-specific sounds, particles, and scripts&lt;br /&gt;
|-&lt;br /&gt;
|game.arc&lt;br /&gt;
|Actor properties, light and camera parameters&lt;br /&gt;
|-&lt;br /&gt;
|human.arc&lt;br /&gt;
|NPC textures, objects, and scripts&lt;br /&gt;
|-&lt;br /&gt;
|object.arc&lt;br /&gt;
|Interactive object textures, objects, and scripts&lt;br /&gt;
|-&lt;br /&gt;
|particle_data.arc&lt;br /&gt;
|Particle textures and objects&lt;br /&gt;
|-&lt;br /&gt;
|particle.arc&lt;br /&gt;
|Particle definitions&lt;br /&gt;
|-&lt;br /&gt;
|player_*.arc&lt;br /&gt;
|Player-specific textures, objects, and animations&lt;br /&gt;
|-&lt;br /&gt;
|player.arc&lt;br /&gt;
|Player scripting and packages&lt;br /&gt;
|-&lt;br /&gt;
|radarmap.arc&lt;br /&gt;
|Mini-map objects, colour textures, and icons&lt;br /&gt;
|-&lt;br /&gt;
|scripts.arc&lt;br /&gt;
|Most Lua scripting, SETs and paths&lt;br /&gt;
|-&lt;br /&gt;
|shader_lt.arc&lt;br /&gt;
|Multiplayer shaders&lt;br /&gt;
|-&lt;br /&gt;
|shader.arc&lt;br /&gt;
|Singleplayer shaders&lt;br /&gt;
|-&lt;br /&gt;
|sound.arc&lt;br /&gt;
|Common sound banks&lt;br /&gt;
|-&lt;br /&gt;
|sprite.arc&lt;br /&gt;
|UI textures, layouts, and animations&lt;br /&gt;
|-&lt;br /&gt;
|stage_*.arc&lt;br /&gt;
|Stage-specific textures and objects&lt;br /&gt;
|-&lt;br /&gt;
|stage.arc&lt;br /&gt;
|Reflection areas and stage collision&lt;br /&gt;
|-&lt;br /&gt;
|system.arc&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|text.arc&lt;br /&gt;
|Font textures, maps, and string tables&lt;br /&gt;
|}&lt;br /&gt;
[[Category:File Formats]]&lt;/div&gt;</summary>
		<author><name>Hyper</name></author>
	</entry>
	<entry>
		<id>https://hedgedocs.com/index.php?title=U8_Archive&amp;diff=1234</id>
		<title>U8 Archive</title>
		<link rel="alternate" type="text/html" href="https://hedgedocs.com/index.php?title=U8_Archive&amp;diff=1234"/>
		<updated>2025-12-02T12:04:37Z</updated>

		<summary type="html">&lt;p&gt;Hyper: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&#039;&#039;&#039;&#039;&#039;Arc File&#039;&#039;&#039;&#039;&#039; is the &amp;lt;code&amp;gt;*.arc&amp;lt;/code&amp;gt; file format used for the packed file system for [[Sonic the Hedgehog (2006)]].&lt;br /&gt;
&lt;br /&gt;
These files are located in the &amp;lt;code&amp;gt;xenon&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;ps3&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;win32&amp;lt;/code&amp;gt; directories on the game disc in a subdirectory called &amp;lt;code&amp;gt;archives&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
== File System ==&lt;br /&gt;
The internal file system follows an organisational pattern where the directories starting from root are platform identifiers for the file formats contained within them.&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+&lt;br /&gt;
!Identifier&lt;br /&gt;
!Endianness&lt;br /&gt;
!Purpose&lt;br /&gt;
|-&lt;br /&gt;
|common&lt;br /&gt;
|N/A&lt;br /&gt;
|Used for files where endianness is non-applicable (e.g. files that are read manually in a specific byte order irrespective of the current platform).&lt;br /&gt;
|-&lt;br /&gt;
|xenon&lt;br /&gt;
|Big&lt;br /&gt;
|Used for files that are read directly into memory and mapped to structures where big-endian byte order is expected for the Xbox 360 platform.&lt;br /&gt;
|-&lt;br /&gt;
|ps3&lt;br /&gt;
|Big&lt;br /&gt;
|Same as above, but for the PlayStation 3 platform.&lt;br /&gt;
|-&lt;br /&gt;
|win32&lt;br /&gt;
|Little&lt;br /&gt;
|Used for files that are read directly into memory and mapped to structures where little-endian byte order is expected for the Windows (x86) platform.&lt;br /&gt;
These files would be read manually for endian swapping on big-endian platforms.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Specification ==&lt;br /&gt;
&#039;&#039;&#039;Arc File&#039;&#039;&#039; is a derivative of Nintendo&#039;s archive format, commonly known as &#039;&#039;&#039;U8 Archive&#039;&#039;&#039;. It&#039;s the same format, but with an extra field added to each file system node for uncompressed length, as Sonic Team added support for [[wikipedia:Zlib|zlib]] compression to the format.&lt;br /&gt;
&lt;br /&gt;
=== Header ===&lt;br /&gt;
The header consists of the following data structure:&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+Length: 0x20&lt;br /&gt;
!Offset&lt;br /&gt;
!Type&lt;br /&gt;
!Name&lt;br /&gt;
!Description&lt;br /&gt;
|-&lt;br /&gt;
|0x00&lt;br /&gt;
|UInt32&lt;br /&gt;
|Signature&lt;br /&gt;
|Always 0x55AA382D (big-endian).&lt;br /&gt;
|-&lt;br /&gt;
|0x04&lt;br /&gt;
|UInt32&lt;br /&gt;
|FSTableOffset&lt;br /&gt;
|The offset of the file system table.&lt;br /&gt;
|-&lt;br /&gt;
|0x08&lt;br /&gt;
|UInt32&lt;br /&gt;
|FSTableLength&lt;br /&gt;
|The length of the file system table (including the string pool).&lt;br /&gt;
|-&lt;br /&gt;
|0x0C&lt;br /&gt;
|UInt32&lt;br /&gt;
|DataOffset&lt;br /&gt;
|The offset of the file data.&lt;br /&gt;
|-&lt;br /&gt;
|0x10&lt;br /&gt;
|UInt32[4]&lt;br /&gt;
|Reserved&lt;br /&gt;
|These fields appear to be populated in archives for this game, but this is bogus data from uninitialised memory and should be ignored.&lt;br /&gt;
For the sake of tooling heuristics, writing &amp;lt;code&amp;gt;0xE4F91300&amp;lt;/code&amp;gt; (big-endian) to index 0 and &amp;lt;code&amp;gt;0x78013800&amp;lt;/code&amp;gt; (big-endian) to index 3 would be ideal for detecting whether this archive is from this game specifically.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== File System ===&lt;br /&gt;
The file system consists of an array of the following data structure:&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+Length: 0x10&lt;br /&gt;
!Offset&lt;br /&gt;
!Type&lt;br /&gt;
!Name&lt;br /&gt;
!Description&lt;br /&gt;
|-&lt;br /&gt;
|0x00&lt;br /&gt;
|Boolean (UInt8)&lt;br /&gt;
|IsDirectory&lt;br /&gt;
|Determines whether this node is a directory.&lt;br /&gt;
|-&lt;br /&gt;
|0x01&lt;br /&gt;
|UInt24&lt;br /&gt;
|NameOffset&lt;br /&gt;
|The offset of this node&#039;s name in the string pool.&lt;br /&gt;
If root, always zero.&lt;br /&gt;
|-&lt;br /&gt;
|0x04&lt;br /&gt;
|Union (UInt32, UInt32)&lt;br /&gt;
|DataOffset, ParentIndex&lt;br /&gt;
|&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+&lt;br /&gt;
|File&lt;br /&gt;
|The offset of this file&#039;s data.&lt;br /&gt;
|-&lt;br /&gt;
|Directory&lt;br /&gt;
|The index of the parent node for this directory.&lt;br /&gt;
If root, always zero.&lt;br /&gt;
|}&lt;br /&gt;
|-&lt;br /&gt;
|0x08&lt;br /&gt;
|Union (UInt32, UInt32)&lt;br /&gt;
|Length, NodeCount&lt;br /&gt;
|&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+&lt;br /&gt;
|File&lt;br /&gt;
|The length of this file&#039;s data.&lt;br /&gt;
|-&lt;br /&gt;
|Directory&lt;br /&gt;
|The total number of nodes in this directory.&lt;br /&gt;
If root, the total number of nodes in this archive.&lt;br /&gt;
|}&lt;br /&gt;
|-&lt;br /&gt;
|0x0C&lt;br /&gt;
|UInt32&lt;br /&gt;
|UncompressedLength&lt;br /&gt;
|&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+&lt;br /&gt;
|File&lt;br /&gt;
|The uncompressed length of this file&#039;s data.&lt;br /&gt;
This field can be set to zero to disable compression for this file, allowing its data to be stored uncompressed.&lt;br /&gt;
|-&lt;br /&gt;
|Directory&lt;br /&gt;
|Undefined.&lt;br /&gt;
Much like the reserved bytes in the header, this field will appear to be populated, but again, this is bogus data from uninitialised memory.&lt;br /&gt;
|}&lt;br /&gt;
|}&lt;br /&gt;
The total number of nodes to read is determined by the root node&#039;s &amp;lt;code&amp;gt;NodeCount&amp;lt;/code&amp;gt; field. As this is a hierarchical file system, nodes should be read recursively to build the file system correctly.&lt;br /&gt;
&lt;br /&gt;
The first node &#039;&#039;&#039;must&#039;&#039;&#039; be a root node defined as a directory, with the &amp;lt;code&amp;gt;NodeCount&amp;lt;/code&amp;gt; field set to the total number of nodes in the archive. This is necessary for determining the length of the file system table.&lt;br /&gt;
&lt;br /&gt;
=== String Pool ===&lt;br /&gt;
The string pool offset can be calculated after reading the root node and using the following expression:&amp;lt;syntaxhighlight lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
FSTableOffset + (Root.NodeCount * 16)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;Each string in the pool is ASCII-encoded and null-terminated, the offsets to which are relative to the start of the pool.&lt;br /&gt;
&lt;br /&gt;
The string pool &#039;&#039;&#039;must&#039;&#039;&#039; have a single null terminator at the beginning for the root node, as it does not have a name.&lt;br /&gt;
&lt;br /&gt;
=== File Data ===&lt;br /&gt;
Files are compressed using [[wikipedia:Zlib|zlib]] compression and are aligned by 32 bytes per file after the string pool. This compression is optional, and files can be stored uncompressed so long as &amp;lt;code&amp;gt;UncompressedLength&amp;lt;/code&amp;gt; is set to zero.&lt;br /&gt;
&lt;br /&gt;
== List of Arc Files ==&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+&lt;br /&gt;
!Name&lt;br /&gt;
!Description&lt;br /&gt;
|-&lt;br /&gt;
|cache.arc&lt;br /&gt;
|Core render scripts, event playbook, and optical camouflage noise texture &lt;br /&gt;
|-&lt;br /&gt;
|download.arc&lt;br /&gt;
|DLC episode mission and SET data&lt;br /&gt;
|-&lt;br /&gt;
|enemy_data.arc&lt;br /&gt;
|Boss textures and objects&lt;br /&gt;
|-&lt;br /&gt;
|enemy.arc&lt;br /&gt;
|Regular enemy textures and objects&lt;br /&gt;
|-&lt;br /&gt;
|event_data.arc&lt;br /&gt;
|Event-specific textures and objects&lt;br /&gt;
|-&lt;br /&gt;
|event.arc&lt;br /&gt;
|Event-specific sounds, particles, and scripts&lt;br /&gt;
|-&lt;br /&gt;
|game.arc&lt;br /&gt;
|Actor properties, light and camera parameters&lt;br /&gt;
|-&lt;br /&gt;
|human.arc&lt;br /&gt;
|NPC textures, objects, and scripts&lt;br /&gt;
|-&lt;br /&gt;
|object.arc&lt;br /&gt;
|Interactive object textures, objects, and scripts&lt;br /&gt;
|-&lt;br /&gt;
|particle_data.arc&lt;br /&gt;
|Particle textures and objects&lt;br /&gt;
|-&lt;br /&gt;
|particle.arc&lt;br /&gt;
|Particle definitions&lt;br /&gt;
|-&lt;br /&gt;
|player_*.arc&lt;br /&gt;
|Player-specific textures, objects, and animations&lt;br /&gt;
|-&lt;br /&gt;
|player.arc&lt;br /&gt;
|Player scripting and packages&lt;br /&gt;
|-&lt;br /&gt;
|radarmap.arc&lt;br /&gt;
|Mini-map objects, colour textures, and icons&lt;br /&gt;
|-&lt;br /&gt;
|scripts.arc&lt;br /&gt;
|Most Lua scripting, SETs and paths&lt;br /&gt;
|-&lt;br /&gt;
|shader_lt.arc&lt;br /&gt;
|Multiplayer shaders&lt;br /&gt;
|-&lt;br /&gt;
|shader.arc&lt;br /&gt;
|Singleplayer shaders&lt;br /&gt;
|-&lt;br /&gt;
|sound.arc&lt;br /&gt;
|Common sound banks&lt;br /&gt;
|-&lt;br /&gt;
|sprite.arc&lt;br /&gt;
|UI textures, layouts, and animations&lt;br /&gt;
|-&lt;br /&gt;
|stage_*.arc&lt;br /&gt;
|Stage-specific textures and objects&lt;br /&gt;
|-&lt;br /&gt;
|stage.arc&lt;br /&gt;
|Reflection areas and stage collision&lt;br /&gt;
|-&lt;br /&gt;
|system.arc&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|text.arc&lt;br /&gt;
|Font textures, maps, and string tables&lt;br /&gt;
|}&lt;br /&gt;
[[Category:File Formats]]&lt;/div&gt;</summary>
		<author><name>Hyper</name></author>
	</entry>
	<entry>
		<id>https://hedgedocs.com/index.php?title=U8_Archive&amp;diff=1232</id>
		<title>U8 Archive</title>
		<link rel="alternate" type="text/html" href="https://hedgedocs.com/index.php?title=U8_Archive&amp;diff=1232"/>
		<updated>2025-12-02T12:02:11Z</updated>

		<summary type="html">&lt;p&gt;Hyper: Hyper moved page U8 Archive to Arc File&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&#039;&#039;&#039;&#039;&#039;Arc File&#039;&#039;&#039;&#039;&#039; is the &amp;lt;code&amp;gt;*.arc&amp;lt;/code&amp;gt; file format used for this game&#039;s packed file system. It&#039;s derived from Nintendo&#039;s archive format, commonly known as &#039;&#039;&#039;U8 Archive&#039;&#039;&#039;. These files are located in the &amp;lt;code&amp;gt;xenon&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;ps3&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;win32&amp;lt;/code&amp;gt; directories on the game disc in a subdirectory called &amp;lt;code&amp;gt;archives&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
== File System ==&lt;br /&gt;
The internal file system follows an organisational pattern where the directories starting from root are platform identifiers for the file formats contained within them.&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+&lt;br /&gt;
!Identifier&lt;br /&gt;
!Endianness&lt;br /&gt;
!Purpose&lt;br /&gt;
|-&lt;br /&gt;
|common&lt;br /&gt;
|N/A&lt;br /&gt;
|Used for files where endianness is non-applicable (e.g. files that are read manually in a specific byte order irrespective of the current platform).&lt;br /&gt;
|-&lt;br /&gt;
|xenon&lt;br /&gt;
|Big&lt;br /&gt;
|Used for files that are read directly into memory and mapped to structures where big-endian byte order is expected for the Xbox 360 platform.&lt;br /&gt;
|-&lt;br /&gt;
|ps3&lt;br /&gt;
|Big&lt;br /&gt;
|Same as above, but for the PlayStation 3 platform.&lt;br /&gt;
|-&lt;br /&gt;
|win32&lt;br /&gt;
|Little&lt;br /&gt;
|Used for files that are read directly into memory and mapped to structures where little-endian byte order is expected for the Windows (x86) platform.&lt;br /&gt;
These files would be read manually for endian swapping on big-endian platforms.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Specification ==&lt;br /&gt;
&#039;&#039;&#039;Arc File&#039;&#039;&#039; is a derivative of Nintendo&#039;s archive format, commonly known as &#039;&#039;&#039;U8 Archive&#039;&#039;&#039;. It&#039;s the same format, but with an extra field added to each file system node for uncompressed length, as Sonic Team added support for [[wikipedia:Zlib|zlib]] compression to the format.&lt;br /&gt;
&lt;br /&gt;
=== Header ===&lt;br /&gt;
The header consists of the following data structure:&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+Length: 0x20&lt;br /&gt;
!Offset&lt;br /&gt;
!Type&lt;br /&gt;
!Name&lt;br /&gt;
!Description&lt;br /&gt;
|-&lt;br /&gt;
|0x00&lt;br /&gt;
|UInt32&lt;br /&gt;
|Signature&lt;br /&gt;
|Always 0x55AA382D (big-endian).&lt;br /&gt;
|-&lt;br /&gt;
|0x04&lt;br /&gt;
|UInt32&lt;br /&gt;
|FSTableOffset&lt;br /&gt;
|The offset of the file system table.&lt;br /&gt;
|-&lt;br /&gt;
|0x08&lt;br /&gt;
|UInt32&lt;br /&gt;
|FSTableLength&lt;br /&gt;
|The length of the file system table (including the string pool).&lt;br /&gt;
|-&lt;br /&gt;
|0x0C&lt;br /&gt;
|UInt32&lt;br /&gt;
|DataOffset&lt;br /&gt;
|The offset of the file data.&lt;br /&gt;
|-&lt;br /&gt;
|0x10&lt;br /&gt;
|UInt32[4]&lt;br /&gt;
|Reserved&lt;br /&gt;
|These fields appear to be populated in archives for this game, but this is bogus data from uninitialised memory and should be ignored.&lt;br /&gt;
For the sake of tooling heuristics, writing &amp;lt;code&amp;gt;0xE4F91300&amp;lt;/code&amp;gt; (big-endian) to index 0 and &amp;lt;code&amp;gt;0x78013800&amp;lt;/code&amp;gt; (big-endian) to index 3 would be ideal for detecting whether this archive is from this game specifically.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== File System ===&lt;br /&gt;
The file system consists of an array of the following data structure:&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+Length: 0x10&lt;br /&gt;
!Offset&lt;br /&gt;
!Type&lt;br /&gt;
!Name&lt;br /&gt;
!Description&lt;br /&gt;
|-&lt;br /&gt;
|0x00&lt;br /&gt;
|Boolean (UInt8)&lt;br /&gt;
|IsDirectory&lt;br /&gt;
|Determines whether this node is a directory.&lt;br /&gt;
|-&lt;br /&gt;
|0x01&lt;br /&gt;
|UInt24&lt;br /&gt;
|NameOffset&lt;br /&gt;
|The offset of this node&#039;s name in the string pool.&lt;br /&gt;
If root, always zero.&lt;br /&gt;
|-&lt;br /&gt;
|0x04&lt;br /&gt;
|Union (UInt32, UInt32)&lt;br /&gt;
|DataOffset, ParentIndex&lt;br /&gt;
|&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+&lt;br /&gt;
|File&lt;br /&gt;
|The offset of this file&#039;s data.&lt;br /&gt;
|-&lt;br /&gt;
|Directory&lt;br /&gt;
|The index of the parent node for this directory.&lt;br /&gt;
If root, always zero.&lt;br /&gt;
|}&lt;br /&gt;
|-&lt;br /&gt;
|0x08&lt;br /&gt;
|Union (UInt32, UInt32)&lt;br /&gt;
|Length, NodeCount&lt;br /&gt;
|&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+&lt;br /&gt;
|File&lt;br /&gt;
|The length of this file&#039;s data.&lt;br /&gt;
|-&lt;br /&gt;
|Directory&lt;br /&gt;
|The total number of nodes in this directory.&lt;br /&gt;
If root, the total number of nodes in this archive.&lt;br /&gt;
|}&lt;br /&gt;
|-&lt;br /&gt;
|0x0C&lt;br /&gt;
|UInt32&lt;br /&gt;
|UncompressedLength&lt;br /&gt;
|&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+&lt;br /&gt;
|File&lt;br /&gt;
|The uncompressed length of this file&#039;s data.&lt;br /&gt;
This field can be set to zero to disable compression for this file, allowing its data to be stored uncompressed.&lt;br /&gt;
|-&lt;br /&gt;
|Directory&lt;br /&gt;
|Undefined.&lt;br /&gt;
Much like the reserved bytes in the header, this field will appear to be populated, but again, this is bogus data from uninitialised memory.&lt;br /&gt;
|}&lt;br /&gt;
|}&lt;br /&gt;
The total number of nodes to read is determined by the root node&#039;s &amp;lt;code&amp;gt;NodeCount&amp;lt;/code&amp;gt; field. As this is a hierarchical file system, nodes should be read recursively to build the file system correctly.&lt;br /&gt;
&lt;br /&gt;
The first node &#039;&#039;&#039;must&#039;&#039;&#039; be a root node defined as a directory, with the &amp;lt;code&amp;gt;NodeCount&amp;lt;/code&amp;gt; field set to the total number of nodes in the archive. This is necessary for determining the length of the file system table.&lt;br /&gt;
&lt;br /&gt;
=== String Pool ===&lt;br /&gt;
The string pool offset can be calculated after reading the root node and using the following expression:&amp;lt;syntaxhighlight lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
FSTableOffset + (Root.NodeCount * 16)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;Each string in the pool is ASCII encoded and null-terminated, the offsets to which are relative to the start of the pool.&lt;br /&gt;
&lt;br /&gt;
The string pool &#039;&#039;&#039;must&#039;&#039;&#039; have a single null terminator at the beginning for the root node, as it does not have a name.&lt;br /&gt;
&lt;br /&gt;
=== File Data ===&lt;br /&gt;
Files are compressed using [[wikipedia:Zlib|zlib]] compression and are aligned by 32 bytes per file after the string pool. This compression is optional, and files can be stored uncompressed so long as the uncompressed length field is set to zero.&lt;br /&gt;
&lt;br /&gt;
== List of Arc Files ==&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+&lt;br /&gt;
!Name&lt;br /&gt;
!Description&lt;br /&gt;
|-&lt;br /&gt;
|cache.arc&lt;br /&gt;
|Core render scripts, event playbook, and optical camouflage noise texture &lt;br /&gt;
|-&lt;br /&gt;
|download.arc&lt;br /&gt;
|DLC episode mission and SET data&lt;br /&gt;
|-&lt;br /&gt;
|enemy_data.arc&lt;br /&gt;
|Boss textures and objects&lt;br /&gt;
|-&lt;br /&gt;
|enemy.arc&lt;br /&gt;
|Regular enemy textures and objects&lt;br /&gt;
|-&lt;br /&gt;
|event_data.arc&lt;br /&gt;
|Event-specific textures and objects&lt;br /&gt;
|-&lt;br /&gt;
|event.arc&lt;br /&gt;
|Event-specific sounds, particles, and scripts&lt;br /&gt;
|-&lt;br /&gt;
|game.arc&lt;br /&gt;
|Actor properties, light and camera parameters&lt;br /&gt;
|-&lt;br /&gt;
|human.arc&lt;br /&gt;
|NPC textures, objects, and scripts&lt;br /&gt;
|-&lt;br /&gt;
|object.arc&lt;br /&gt;
|Interactive object textures, objects, and scripts&lt;br /&gt;
|-&lt;br /&gt;
|particle_data.arc&lt;br /&gt;
|Particle textures and objects&lt;br /&gt;
|-&lt;br /&gt;
|particle.arc&lt;br /&gt;
|Particle definitions&lt;br /&gt;
|-&lt;br /&gt;
|player_*.arc&lt;br /&gt;
|Player-specific textures, objects, and animations&lt;br /&gt;
|-&lt;br /&gt;
|player.arc&lt;br /&gt;
|Player scripting and packages&lt;br /&gt;
|-&lt;br /&gt;
|radarmap.arc&lt;br /&gt;
|Mini-map objects, colour textures, and icons&lt;br /&gt;
|-&lt;br /&gt;
|scripts.arc&lt;br /&gt;
|Most Lua scripting, SETs and paths&lt;br /&gt;
|-&lt;br /&gt;
|shader_lt.arc&lt;br /&gt;
|Multiplayer shaders&lt;br /&gt;
|-&lt;br /&gt;
|shader.arc&lt;br /&gt;
|Singleplayer shaders&lt;br /&gt;
|-&lt;br /&gt;
|sound.arc&lt;br /&gt;
|Common sound banks&lt;br /&gt;
|-&lt;br /&gt;
|sprite.arc&lt;br /&gt;
|UI textures, layouts, and animations&lt;br /&gt;
|-&lt;br /&gt;
|stage_*.arc&lt;br /&gt;
|Stage-specific textures and objects&lt;br /&gt;
|-&lt;br /&gt;
|stage.arc&lt;br /&gt;
|Reflection areas and stage collision&lt;br /&gt;
|-&lt;br /&gt;
|system.arc&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|text.arc&lt;br /&gt;
|Font textures, maps, and string tables&lt;br /&gt;
|}&lt;br /&gt;
[[Category:File Formats]]&lt;/div&gt;</summary>
		<author><name>Hyper</name></author>
	</entry>
	<entry>
		<id>https://hedgedocs.com/index.php?title=Category:File_Formats&amp;diff=1231</id>
		<title>Category:File Formats</title>
		<link rel="alternate" type="text/html" href="https://hedgedocs.com/index.php?title=Category:File_Formats&amp;diff=1231"/>
		<updated>2025-12-02T11:46:51Z</updated>

		<summary type="html">&lt;p&gt;Hyper: Created page with &amp;quot;Category:File Formats&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Category:File Formats]]&lt;/div&gt;</summary>
		<author><name>Hyper</name></author>
	</entry>
</feed>