VIS (Visibility Graph)
VIS is an ASCII graph structure used extensively by the rendering engine to calculate occlusion culling. It plots mathematical relationships defining which room meshes are visible from any given observer room.
At a Glance
| Property | Value |
|---|---|
| Extension(s) | .vis |
| Magic Signature | None |
| Type | Room Graph |
| Rust Reference | View rakata_formats::Vis in Rustdocs |
Data Model Structure
The rakata-formats crate parses raw VIS text blocks into a strongly typed Vis structure. Rather than storing flat arrays of strings, Vis models room visibility as an adjacency list using BTreeMap<String, BTreeSet<String>>. This structural choice guarantees deterministic lookups while automatically mimicking the engine’s internal deduplication algorithms.
Engine Audits & Decompilation
The following documents the engine’s exact load sequence for Visibility graphs mapped from swkotor.exe.
(Decompilation logic for this section was audited and verified via native Ghidra pipeline against swkotor.exe, explicitly pulling from Scene::LoadVisibility at 0x004568d0.)
| Pipeline Event | Ghidra Provenance & Engine Behavior |
|---|---|
| Text Loading | Function: Scene::LoadVisibility (0x004568d0)The .vis file is executed purely as raw text. The engine continuously extracts observer and child string pairs by looping AurResGetNextLine() over the file buffer. |
| Silent Forgiveness | Function: Scene::LoadVisibility (0x004568d0)If the parser extracts a room reference (either observer or child) that does not exist in the active area layout (which it verifies via a FindRoom call), the visibility entry is quietly dropped without crashing or generating logs. |
| Bidirectional Application | Function: Scene::SetVisibilityCalling SetVisibility(room_a, room_b, 1) inherently maps both visualization paths. The function inserts room_b into room_a’s visibility list, and immediately mirrors by adding room_a to room_b’s list while executing native deduplication. |
| Write Generation | Function: Scene::SaveVisibilityWhen generating a .vis file natively, the engine relies on an _sscanf block structure mapping to "%s%d" and uniformly pads a dual-space indent onto all child elements beneath observer headers. |