Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

LYT (Layout File)

LYT files are ASCII configuration arrays that define the spatial 3D placement and orientation of independent room models to construct a complete area map.

At a Glance

PropertyValue
Extension(s).lyt
Magic SignatureNone
TypePlain Text Layout
Rust ReferenceView rakata_formats::Lyt in Rustdocs

Data Model Structure

The rakata-formats crate parses LYT files into the strongly-typed Lyt container. The parser segregates the raw nested lines into distinct rooms, tracks, obstacles, and doorhooks collections, natively mapping coordinate strings into engine-standard Vec3 and Quaternion structs for immediate mathematical interoperability.

Engine Audits & Decompilation

The following documents the engine’s exact load sequence for Layout configurations mapped from swkotor.exe.

(Decompilation logic for this section was audited and verified via native Ghidra pipeline against swkotor.exe, explicitly pulling from CLYT::LoadLayout at 0x005de900.)

Pipeline EventGhidra Provenance & Engine Behavior
Newline BoundsThe parser heavily expects explicit \r\n (CRLF) endings. Scanning extracts target strings utilizing _sscanf("%[^\r\n]", ...) patterns and frequently relies on blind +2 byte pointer leaps to manually clear the terminators.
Preamble SkippingAll file lines existing prior to the beginlayout execution marker (such as the ubiquitous #MAXLAYOUT ASCII header) are deliberately skipped and ignored.
Sequential ParsingThe structure mandates a rigid sequential ingestion. Data collections must explicitly appear geographically in the exact order: roomcounttrackcountobstaclecountdoorhookcountdonelayout.

Warning

Boundary Oversight While the engine systematically verifies donelayout boundaries separating the primary collections, the underlying parse loop functionally neglects to verify the final donelayout signature upon closing the doorhooks segment.