HZC (File Format): Difference between revisions

From Wexos's Wiki
Jump to navigationJump to search
(Created page with "'''HZC''' is a collision format used in Cartoon Network Racing DS. = File Format = The file byte order is always little endian. == Header == The file starts with the following header: {| class="wikitable" ! Offset !! Type !! Description |- | 0x00 || UInt16 || {{Unknown-left|'''Unknown'''. Magic or file version? Always 0x0103.}} |- | 0x02 || UInt16 || '''Number of vertices''' ('''V'''). |- | 0x04 || UInt16 || '''Number of triangles''' ('''T'''). |- | 0x06 || UInt16...")
 
 
(5 intermediate revisions by the same user not shown)
Line 1: Line 1:
'''HZC''' is a collision format used in [[Cartoon Network Racing DS]].
'''HZC''' is a collision format used in some [[Nintendo DS]] and [[Nintendo 3DS]] games developed by ''[https://en.wikipedia.org/wiki/Firebrand_Games Firebrand Games]'' such as ''[https://en.wikipedia.org/wiki/Cartoon_Network_Racing Cartoon Network Racing DS]'' and ''[https://en.wikipedia.org/wiki/Race_Driver:_Create_%26_Race Race Driver: Create & Race]''.


= File Format =
= File Format =
Line 10: Line 10:
! Offset !! Type !! Description
! Offset !! Type !! Description
|-
|-
| 0x00 || UInt16 || {{Unknown-left|'''Unknown'''. Magic or file version? Always 0x0103.}}
| 0x00 || UInt16 || '''[[#Version List|Version number]]'''.
|-
|-
| 0x02 || UInt16 || '''Number of vertices''' ('''V''').
| 0x02 || UInt16 || '''Number of vertices''' ('''V''').
Line 20: Line 20:


== Vertex Data ==
== Vertex Data ==
Followed by the header, there's plain vertex position data stored as a sequence of groups of 3 Int32s (one per axis). The values are divided by 1024.
Followed by the header, there's plain vertex position data stored as a sequence of groups of 3 Int32s (one per axis). The values need to be divided by 4096.


{| class="wikitable"
{| class="wikitable"
Line 78: Line 78:
| 0x00 || Int32 || '''Number of links''' ('''L''').
| 0x00 || Int32 || '''Number of links''' ('''L''').
|-
|-
| 0x04 || UInt16[2]['''L'''] || '''Triangle index''' and '''next index'''. The next index is 0xFFFF at the end of a cell's chain, otherwise another index into this same array (?)
| 0x04 || UInt16[2]['''L'''] || '''Triangle index''' and '''next index'''. The next index is 0xFFFF at the end of a cell's chain, otherwise another index into this same array.
|}
|}


Line 107: Line 107:
| 0x02 + '''K''' || UInt16 || '''Value string length''' ('''PV''').
| 0x02 + '''K''' || UInt16 || '''Value string length''' ('''PV''').
|-
|-
| 0x04 + '''K''' || String (Char['''PV''']) || '''Attribute value'''. Always ''float(SurfaceType)='''X'''.000000''.
| 0x04 + '''K''' || String (Char['''PV''']) || '''Attribute value'''. Always ''float(SurfaceType)='''X'''.000000'' in Cartoon Network Racing DS.
|}
|}


{| class="wikitable"
{| class="wikitable"
|+ Seen attributes
|+ Seen attributes (Cartoon Network Racing DS)
! Key !! Value !! Found in
! Key !! Value !! Found in
|-
|-
Line 180: Line 180:
* MandarkLab.hzc
* MandarkLab.hzc
* MountRush.hzc
* MountRush.hzc
|}
= Version List =
= Version List =
{|class="wikitable"
! Version !! Found in
|-
| 1.3
|
* [https://en.wikipedia.org/wiki/Cartoon_Network_Racing Cartoon Network Racing DS]
* [https://en.wikipedia.org/wiki/Ferrari_Challenge:_Trofeo_Pirelli Ferrari Challenge: Trofeo Pirelli DS]
|-
| 1.4
| [https://en.wikipedia.org/wiki/Race_Driver:_Create_%26_Race Race Driver: Create & Race]
|-
| 1.5
|
* [https://en.wikipedia.org/wiki/Cars_2:_The_Video_Game Cars 2: The Video Game DS]
* [https://en.wikipedia.org/wiki/Colin_McRae:_Dirt_2 Colin McRae: Dirt 2 DS]
* [https://en.wikipedia.org/wiki/Hot_Wheels:_Track_Attack Hot Wheels: Track Attack DS]
* [https://en.wikipedia.org/wiki/Need_for_Speed:_Nitro Need for Speed: Nitro DS]
* [[Need for Speed: Nitro-X]]
* [https://en.wikipedia.org/wiki/Need_for_Speed:_Undercover Need for Speed: Undercover DS]
* [https://en.wikipedia.org/wiki/Race_Driver:_Grid Race Driver: Grid DS]
* [https://en.wikipedia.org/wiki/SpongeBob's_Boating_Bash SpongeBob's Boating Bash]
|-
| 1.12
|
* [[Planet 51: The Game DS]]
* [https://en.wikipedia.org/wiki/TrackMania_DS TrackMania DS]
|-
| 1.14
| [https://en.wikipedia.org/wiki/TrackMania_Turbo_(2010_video_game) TrackMania Turbo (2010)]
|-
| 1.18
|
* [https://en.wikipedia.org/wiki/Cars_2:_The_Video_Game Cars 2: The Video Game 3DS]
* [https://en.wikipedia.org/wiki/NASCAR_Unleashed NASCAR Unleashed]
|-
| 1.19
| [https://en.wikipedia.org/wiki/Need_for_Speed:_The_Run Need for Speed: The Run 3DS]
|-
| 1.22
| [https://en.wikipedia.org/wiki/Fast_&_Furious:_Showdown Fast & Furious: Showdown 3DS]
|-
| 1.23
|
* [https://en.wikipedia.org/wiki/Hot_Wheels:_World's_Best_Driver Hot Wheels: World's Best Driver 3DS]
* [https://en.wikipedia.org/wiki/WRC_FIA_World_Rally_Championship WRC FIA World Rally Championship 3DS]
|}
|}



Latest revision as of 18:36, 28 July 2026

HZC is a collision format used in some Nintendo DS and Nintendo 3DS games developed by Firebrand Games such as Cartoon Network Racing DS and Race Driver: Create & Race.

File Format

The file byte order is always little endian.

Header

The file starts with the following header:

Offset Type Description
0x00 UInt16 Version number.
0x02 UInt16 Number of vertices (V).
0x04 UInt16 Number of triangles (T).
0x06 UInt16 Number of custom attributes (A).

Vertex Data

Followed by the header, there's plain vertex position data stored as a sequence of groups of 3 Int32s (one per axis). The values need to be divided by 4096.

Offset Type Description
0x00 Int32[3][V] Vertex XYZ coordinates.

Triangle Index Data

After the vertex data, there's a list of T * 3 UInt16s that correspond to the indices of each triangle.

Offset Type Description
0x00 UInt16[3][T] Triangle indices.

Triangle Normal Data

Directly after the triangle indices there are the triangle's face normals, consisting of 3 Int32s per triangle. They seem to match the cross product of the triangle's first two edges with a magnitude of 4096.

Offset Type Description
0x00 Int32[3][T] Triangle XYZ normals.

Grid

Followed by the triangle normal data, there's a spatial grid consisting of 3D cells used for better collision detection. Each cell corresponds to an index to the Linked List Array.

Offset Type Description
0x00 Int32 Number of cells (C).
0x04 UInt16[C] Cell indices. 0xFFFF if empty.

Grid Info

Offset Type Description
0x00 Int32[3] Number of cells in the grid's XYZ dimensions.
0x0C Int32[3] Grid bounding box minimum XYZ position.
0x18 Int32[3] Grid bounding box maximum XYZ position.
0x24 Int32 Unknown. Always 0?

Linked List Array

After the grid data there's an array of triangle/cell links.

Offset Type Description
0x00 Int32 Number of links (L).
0x04 UInt16[2][L] Triangle index and next index. The next index is 0xFFFF at the end of a cell's chain, otherwise another index into this same array.

Custom Attribute Table

This section is only present if A > 0. It contains a list of T UInt16s that link each triangle to a Key-Value Property in a string table. Some tracks contain unused attributes.

Offset Type Description
0x00 UInt16[T] Attribute IDs. 0xFFFF if none.

String Table

Offset Type Description
0x00 Key-Value Property[A] Key-value property strings.

Key-Value Property

Offset Type Description
0x00 UInt16 Key string length (PK).
0x02 String (Char[PK]) Attribute key.
0x02 + K UInt16 Value string length (PV).
0x04 + K String (Char[PV]) Attribute value. Always float(SurfaceType)=X.000000 in Cartoon Network Racing DS.
Seen attributes (Cartoon Network Racing DS)
Key Value Found in
COL_grass float(SurfaceType)=1.000000
  • CrossTown.hzc
  • evilGlade.hzc
  • IslandDash.hzc
grass float(SurfaceType)=1.000000 Townsville.hzc
Grass float(SurfaceType)=1.000000
  • AronSpeed.hzc
  • MandarkLab.hzc
  • MidNowhere.hzc
heavyTerrain float(SurfaceType)=2.000000
  • CrossTown.hzc
  • MandarkLab.hzc
  • SnowSunday.hzc
HeavyTerrain float(SurfaceType)=3.000000
  • IslandDash.hzc
  • MandarkLab.hzc
MudPuddle float(SurfaceType)=5.000000 IslandDash.hzc
not_track
  • float(SurfaceType)=1.000000
  • float(SurfaceType)=4.000000
  • MandarkLab.hzc
  • MidNowhere.hzc
  • Townsville.hzc
raceTrackFloor DextersLab.hzc
raceTrackWalls DextersLab.hzc
RoughGround
  • float(SurfaceType)=0.000000
  • float(SurfaceType)=4.000000
  • AronSpeed.hzc
  • MandarkLab.hzc
  • MidNowhere.hzc
terrainLight float(SurfaceType)=0.000000
  • MandarkLab.hzc
  • MountRush.hzc

Version List

Version List

Version Found in
1.3
1.4 Race Driver: Create & Race
1.5
1.12
1.14 TrackMania Turbo (2010)
1.18
1.19 Need for Speed: The Run 3DS
1.22 Fast & Furious: Showdown 3DS
1.23

Tools

The following tools can handle HZC files:

  • (none)