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

RIM (Resource Image)

RIM files operate as a radically leaner alternative to ERFs. They are used exclusively by the game engine for distributing absolutely essential or lightweight modules without the hefty structural metadata overhead of an ERF file. They provide rapid, self-contained loading for core engine environments.

At a Glance

PropertyValue
Extension(s).rim
Magic SignaturesRIM (version V1.0)
TypeLightweight Archive
Rust ReferenceView rakata_formats::Rim in Rustdocs

Data Model Structure

RIM files are a lightweight twin to the ERF format, and Rakata treats the pair the same way: separate readers per container, one merged surface per module.

  • Reading one archive: rakata_formats::rim::RimIndex parses the header and entry table once and reads entry bytes on demand. ErfIndex is the ERF equivalent. They stay separate types because the tables genuinely differ, even though the job is the same.
  • Reading a module: rakata_extract::CompositeModule merges a module’s .rim, _s.rim, _dlg.erf and .mod parts behind one lookup, so a caller asking for a resource never has to know which container answered.

Engine Audits & Decompilation

The following information documents the KOTOR engine’s exact load sequence and field requirements for genuine .rim capsule variants. All behavior was mapped natively from swkotor.exe during clean-room reverse engineering.

Resource Image Overrides (CExoKeyTable::AddResourceImageContents)

Mapped from 0x0040f990.

ActionEngine Behavior
Signature CheckExplicitly validates the exact RIM magic and the V1.0 version string implicitly upon loading.
Header EvaluationThe engine physically reads the entry_count (offset 0x0C) and the keys_offset (offset 0x10) from the header to explicitly navigate the file structures.

Tip

The 96-Byte “Dead Zone” Exactly like the ERF dead zone, RIM files feature a massive 96 bytes of completely inert padding sitting physically between offsets 0x18 and 0x77 inside the 120-byte header. The engine blindly sweeps right past it during initialization. It is perfectly safe to zero out this region when generating new synthetic fixtures.