Torch
Loading...
Searching...
No Matches
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](Display List Resource)
0x46669697 LGTS [Light](Light Resource)
0x4F4D5458 OMTX [Matrix](Matrix Resource)
0x4F464C54 OFLT [Float](Float Resource)
0x56433346 VC3F [Vec3f](Vector 3 Float Resource)
0x56433353 VC3S [Vec3s](Vector 3 Short Resource)
0x4F424C42 OBLB [Blob](Blob Resource)
0x4F544558 OTEX [Texture](Texture Resource)
0x4F565458 OVTX [Vertex](Vertex Resource)
0x4F565054 OVPT [Viewport](Viewport Resource)
0x41415252 AARR [Asset Array](Asset Array Resource)
0x47415252 GARR [Generic Array](Generic Array Resource)