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

ARE Format (Area Static Blueprint)

The Area (.are) blueprint format operates as the static environmental foundation of any game module. It establishes the rigid, overarching properties of a level, orchestrating the terrain’s grass rendering definitions, dynamic sunlight and fog constraints, ambient audio scale, and the primary interior/exterior state configurations. It effectively constructs the structural ‘stage’ that dynamic entities (like creatures and doors) populate later on.

At a Glance

PropertyValue
Extension(s).are
Magic SignatureARE / V3.2
TypeArea Static Blueprint
Rust ReferenceView rakata_generics::Are in Rustdocs

Data Model Structure

Rakata maps the Area definition directly into the rakata_generics::Are struct. To view the exhaustive binary schema and strict GFF field mappings, please refer to the Rustdocs for this struct, where each field is explicitly documented.

Engine Audits & Decompilation

The following documents the engine’s exact load sequence and field requirements for .are files mapped from swkotor.exe.

(Decompilation logic for this section was entirely audited and verified via native Ghidra pipeline against swkotor.exe, explicitly pulling from CSWSArea::LoadArea at 0x0050e190.)

The initial LoadArea dispatch branches out to parse the .are GFF, .lyt layout, .git instance tracking, and .pth bounds. The engine processes roughly 61 scalar fields, 4 scripts, 3 lists, and a nested minigame struct natively within the LoadAreaHeader subroutine.

Core Environmental Identity

Field CategoryEngine Property & Behavioral Quirk
IdentityName (LocString), Comments (String), ID (Int) -> Standard definition strings.
IdentityTag (String) -> Lowercased on load (via CExoString::LowerCase). The only tag to behave this way!
ScriptsOnHeartbeat, OnUserDefined, ... -> CResRef script payloads.
State FlagsFlags (DWord) -> Bit 0 explicitly marks an Interior environment.
State FlagsRestrictMode (Byte) -> Hardcoded Event: Changing this to a non-zero value during gameplay forces CSWPartyTable::UnstealthParty.

Note

Internal Weather Truncation If Flags (Bit 0) marks the area as an interior space, the engine zeros out all weather properties upon load, actively discarding any prior weather assignments.

Weather & Terrain Generation

FieldTypeEngine Evaluation
ChanceFogINTStored persistently as an integer.
ChanceRain, ChanceSnow, ChanceLightning, WindPowerINTWarning: The engine explicitly truncates these INT properties to 8-bit bytes at runtime. Values over 255 silently wrap around.
Grass_TexNameResRefIf empty or invalid, the engine forces a hard fallback to "grass".
AlphaTestFLOATDefaults to 0.2 (older tools commonly assume 0.0).

Area Lighting & Sun/Moon Tracking

KOTOR handles dynamic sunlight constraints separately between Sun and Moon.

Property GroupsTypeEngine Evaluation
Fog Ranges (MoonFogNear/Far, SunFogNear/Far)FLOATDefaults to an immense distance of 10000.0. The engine aggressively clamps values to be ≥0.0.
Tints (*AmbientColor, *DiffuseColor, *FogColor)DWORDProcessed seamlessly as standard DWORD color masks.
Environment Shadows (ShadowOpacity, *Shadows)BYTEBasic toggles and opacities orchestrating render limits.

Map Transitions & Saving states

Feature CategoryEngine Evaluation & Triggers
Minimap LogicGeographic vectors (MapResX, spatial coordinate structs like WorldPt1X) are only loaded if an actual Minimap TGA/TPC asset matching the level name exists on disk!
Parsing TypeIf read, the engine parses MapPt along a dual-path logic checking if it is formally a FLOAT or INT type.
Zoom BiasArea maps evaluate MapZoom to a default scaling scalar of 1, not 0!
Stealth Save-StatesThe stealth framework leverages the .are struct to snapshot .StealthXPMax and .StealthXPCurrent directly as DWORDs when parsing the layout.

The Minigame Struct

Read via CSWMiniGame::Load (0x006723d0). If a minigame context triggers, the .are reads the nested Type (DWORD mapping 1=Swoop, 2=Turret). It injects highly specialized float properties modifying basic terrain speeds:

FieldInjection Default / Constraint
LateralAccelDefaults safely to 60.0.
MovementPerSecScales to 6.0 (Swoops), 90.0 (Turrets), or 0.0 otherwise!
Bump_PlaneBounds are heavily clamped to 0..3.
Nested ArraysThe struct natively requires sub-struct Player arrays (Models, Camera, Axes) and Enemy/Obstacles lists to operate properly.

Rakata Linter Rules

The core priority of rakata-lint is shielding users from fields that look valid in older editors but fail in the K1 engine. E.g., there are 19 distinct fields generated by standard modding tools (like DisableTransit, KOTOR 2 ForceRating, etc) that are completely evaluated as dead data by the vanilla engine.

(Seven crucial engine-read fields were previously obfuscated by strict model bindings, but now pass through source_root validation.)

Lint Diagnostics Implemented:

  1. Weather Truncation: Identifies Rain/Snow/Lightning chance above 255 before they wrap around as bytes.
  2. Context Discards: Flags interior environments that contain weather parameters the engine will inevitably zero out.
  3. Index Fallbacks: Informs the developer that an empty Grass_TexName operates identically as "grass".
  4. Behavioral Flags: Warns that area Tag edits are natively lowercased during instantiation.