blob: 026d42ae93f229751ba501290caf0af30c8fcea6 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
|
@page otr_format OTR File Format Specification
# OTR File Format Specification
## Overview
The OTR (Ocarina of Time Recompiled / Open Texture Resource) format is a custom archive format used to store game assets. It is primarily a ZIP archive containing individual asset files with specific binary headers.
## Container Format
The `.otr` or `.o2r` file is a standard **ZIP archive**. Files inside the archive can be named arbitrarily, but typically follow a directory structure mirroring the original game's asset paths.
## Asset Structure
Each file within the ZIP archive begins with a standard 64-byte header, followed by resource-specific data.
### Standard Header (64 bytes)
| Offset | Size | Type | Description |
| :--- | :--- | :--- | :--- |
| 0x00 | 1 | int8 | Byte Order |
| 0x01 | 1 | bool | Is Custom Asset (0 = Original, 1 = Custom) |
| 0x02 | 2 | - | *Padding* |
| 0x04 | 4 | u32 | Resource Type (Magic Number) |
| 0x08 | 4 | u32 | Version |
| 0x0C | 8 | u64 | Unique Asset ID |
| 0x14 | 44 | - | *Reserved / Padding* |
**Note:** All multi-byte integers are stored in **Little Endian** format.
### Resource Types
The `Resource Type` field identifies the kind of data stored in the asset.
| Magic Value | ASCII | Description |
| :--- | :--- | :--- |
| `0x4F444C54` | ODLT | [Display List](@subpage otr_display_list) |
| `0x46669697` | LGTS | [Light](@subpage otr_light) |
| `0x4F4D5458` | OMTX | [Matrix](@subpage otr_matrix) |
| `0x4F464C54` | OFLT | [Float](@subpage otr_float) |
| `0x56433346` | VC3F | [Vec3f](@subpage otr_vec3f) |
| `0x56433353` | VC3S | [Vec3s](@subpage otr_vec3s) |
| `0x4F424C42` | OBLB | [Blob](@subpage otr_blob) |
| `0x4F544558` | OTEX | [Texture](@subpage otr_texture) |
| `0x4F565458` | OVTX | [Vertex](@subpage otr_vertex) |
| `0x4F565054` | OVPT | [Viewport](@subpage otr_viewport) |
| `0x41415252` | AARR | [Asset Array](@subpage otr_asset_array) |
| `0x47415252` | GARR | [Generic Array](@subpage otr_generic_array) |
|