REDCODE / DOCS

View: meshes, sound, TweakDB, LocKeys, and the REDnode loop

Draft 0.2, 2026-10-14, agreed with the owner the same day (decisions at the end). The C5 phase of the design: seeing and looking up what a mod is made of, without leaving REDcode. Five steps, each a commit or two with a hand test on the owner’s machine, in the order below. Each step is detailed when its turn comes, as with Ship (C4).

Two sources: the files, and the running game

  Offline, through REDbridge Live, through REDnode
Reads The game’s files: archives, tweakdb.bin, localization The running game: TweakDB as it is in play, with every mod’s changes
Needs REDbridge and the game folder The game running with REDnode, and a development endpoint REDcode can reach
Good for Writing a mod: browsing, looking up, previewing Testing a mod: live values, trying a change, logs, the debugger

REDcode reads offline first, since that works while a mod is being written. The live side arrives with the REDnode loop (V5). Where both exist, they share the shape of their answers, so a view can show the live value next to the file’s.

V1 Mesh viewer

A 3D view of meshes, so a modder sees what a .mesh is without Blender. Done 2026-10-14, hand-tested by the owner and released in REDcode 0.7.0: webview/meshViewer.ts (bundled with three.js 0.170.0 into media/mesh/viewer.js, its licence beside it), the CR2W editor’s mesh mode, src/meshExport.ts (export to the cache through project.export with all LODs and no materials, again only when the source is newer; a .gltf sent with its buffers inline) and src/meshViewer.ts (the .glb and .gltf viewer). Checked in Chrome on tower.mesh from the owner’s project (7 submeshes, 338 triangles) and the Nokota Osprey from the game (LOD 1 44,459 triangles, LOD 2 4,638). Found: WolvenKit names nodes submesh_NN_LOD_N with LOD 1 the most detailed, exports one LOD unless the LOD filter is off, and keeps each submesh’s material name in the mesh’s extras.

V2 Audio player

Listening to the game’s sounds and a mod’s own, in the editor. Done 2026-10-15, hand-tested by the owner and released in REDcode 0.8.0: src/audio.ts (no VS Code imports), src/audioPlayer.ts, media/audio/, and REDbridge 0.7.2 sound.events.

Settled at the start of V2, against the game:

Kind Where How REDcode plays it
Voice lines and some music, .wem with readable paths lang_en_voice.archive (most), audio_1_general.archive project.export writes Ogg Vorbis in about 0.1 s; cached by modification time, like the 3D view’s .glb
Sound effects, 73,139 sounds in 1,879 .opuspak files audio_2_soundbanks.archive, indexed by sfx_container.opusinfo (2 MB) Read straight from the pack: each sound is a RIFF header and then a plain Ogg Opus stream, which the webview plays as it is. WolvenKit’s export of the index writes nothing unless given sound hashes, so it is not used
Wwise soundbanks, 202 .bnk audio_2_soundbanks.archive Not covered

V3 TweakDB browser

Looking up records and flats while writing a mod: Items.Preset_Yinglong_Default, its type, every flat with its value, and the records it points to.

Bridge methods and MCP tools built 2026-10-14 (REDbridge 0.8.0, BridgeApi.TweakDB.cs; client methods tweak* in bridgeClient.ts; MCP tweakdb_*), ahead of the view because other sessions’ agents need TweakDB reads. The view is done too, hand-tested by the owner on 2026-10-15 and released in REDcode 0.9.0 (the one fix it asked for: the new tweak file is revealed in the Project view): src/tweakView.ts (the view, its data cache and the hover), src/tweakRecordPanel.ts with media/tweakdb/ (the record page), and src/tweakYaml.ts (no VS Code imports: New Tweak’s YAML and value text). A type’s records are fetched with tweakdb.records and filtered to the exact type, since the method includes subtypes, and grouped by the first part of the path above 200 records, at most 2,000 per group. Checked against the game: 843 types; Clothing has Items (1,991) and TEST (6); “quadra type66” finds 415 records in 38 ms; the record page follows links and back.

V4 LocKey browser

Finding the text behind LocKey#12345, and the LocKey for a text.

V5 The REDnode loop

Edit a REDnode mod in REDcode, deploy it into the running game without a restart, and get the game’s logs, events and a debugger back. This is the core of the “one loop” goal, and it spans two repositories.

Deferred

Decisions

Agreed with the owner, 2026-10-14:

  1. The mesh viewer is a mode of the CR2W editor, as the atlas and the table are; .glb and .gltf files open in the same viewer.
  2. New tweak from this record writes YAML, TweakXL’s common form.
  3. The order is V1 to V5, with the REDnode loop last.
  4. The script runner is dropped, on the owner’s condition that what WolvenKit’s scripts do can reasonably be done another way, such as by asking an agent. Checked against WolvenKit’s ScriptFunctions:

    WolvenKit scripts do In REDcode
    Read game files; convert to and from JSON, and between YAML and JSON An agent with the MCP tools (archive_*, cr2w_to_json, cr2w_from_json); YAML and JSON it converts itself
    Batch export, import, pack, and value edits over many files An agent with project_export, project_import, project_pack and the cr2w_* document tools
    Templates: named presets for new objects Partly: cr2w_create_instance gives the game’s defaults; named presets do not exist yet
    Hooks: a script run by itself on every export, import or save Not covered: an agent acts when asked. If a mod needs “always do X after import”, it comes back as a small REDcode setting or task, not a script runner