Architecture & Tracking: Modding, Multi-Instance, VFS Overlay & Opt-In Networking Foundations (20 Core Milestones) #3045

Open
opened 2026-11-26 06:27:26 +00:00 by github-bot · 1 comment
Owner

@⁠hyperland956-lgtm on GitHub · 2026-11-26 05:13 UTC · original

Architecture & Tracking: Modding, Multi-Instance, VFS Overlay & Opt-In Networking Foundations

Context & Open-Ended Goal

As VIctory and its forks rapidly converge toward full single-player playability, the core runtime interfaces (victory-loader, victory-hle, victory-gpu, victory.toml) are stabilizing right now. Laying down clean, opt-in extensibility foundations now — while contributor velocity is high — ensures future community mods, scripting frameworks, and user-hosted multiplayer layers (LAN, P2P, or dedicated client-server) can plug into VIctory cleanly instead of maintaining invasive forks later.

The 20 milestones below (MOD-001–MOD-020) are a starting baseline, not a ceiling. Contributors and agents analyzing real workloads are encouraged to think beyond this list, refine designs where the codebase warrants it, and introduce any additional clean runtime seams (e.g., richer memory/thread hooks, crash diagnostics, hot-reloadable shaders/assets, audio/voice routing, or custom sync primitives) needed to make VIctory a rock-solid modding and multiplayer host. Everything remains opt-in (offline/single-player default behavior unchanged).

Pillar What It Unlocks
1. Plugin & Runtime Hooks (MOD-001–MOD-003) Native plugin loading, loader/HLE lifecycle & import chaining, and safe runtime memory/module queries
2. VFS & Asset Override Stack (MOD-004–MOD-006) Non-destructive file/DirectStorage overrides and merged directory enumeration ahead of game_dir
3. Multi-Instance & Profile Isolation (MOD-007–MOD-010) Running 2+ local clients on one machine with separate identities, saves, window/audio flags, and safe shared caches
4. Opt-In Local/LAN/Custom Transport (MOD-011–MOD-014) User-configured networking modes, port offsets, local XNetworking connectivity, and a dedicated plugin transport layer
5. Overlay, Input, Sync & Headless (MOD-015–MOD-019) Pre-present D3D12 UI overlays, input capture, multi-pad routing, frame/clock sync hooks, and headless second-client mode
6. Local IPC & Multi-Client Harness (MOD-020) Localhost control/telemetry bus for external launchers and automated dual-instance verification

Pillar 1 — Plugin & Runtime Hook Architecture

MOD-001 — Versioned Native Plugin Host & [mods] Config

  • Priority: P1 | Area: New crates/victory-mod, apps/victory/src/run.rs, victory.example.toml
  • Goal: Introduce a versioned C-ABI / Rust plugin host ([mods] config + --mod-dir / --no-mods CLI overrides, disabled by default) exposing host logging, lifecycle registration, and graceful ABI mismatch handling so mods load cleanly without DLL injection.

MOD-002 — Loader Lifecycle & HLE Import-Chaining Seams

  • Priority: P1 | Area: crates/victory-loader/src/{lib.rs,prepare.rs,resolve.rs}
  • Goal: Fire plugin callbacks after image preparation (on_image_loaded) and prior to entry (on_before_entry), and provide a thread-safe mechanism for plugins to wrap or chain specific Win32/GDK HLE imports cleanly rather than manually patching IATs.

MOD-003 — Safe Runtime Memory, Module & Thread Query API for Plugins

  • Priority: P1 | Area: crates/victory-mod, crates/victory-loader
  • Goal: Expose a controlled host API for loaded plugins to query mapped image bounds/sections, build identity hashes, memory protections, and thread creation/exit notifications so scripting and multiplayer sync plugins can inspect or hook runtime state reliably.

Pillar 2 — Non-Destructive VFS & Asset Override Stack

MOD-004 — Priority-Ordered VFS File Override Layer

  • Priority: P0 | Area: crates/victory-hle/src/modules/files.rs, victory.example.toml
  • Goal: Support ordered overlay directories ([mods] overlay_dirs = [...]) checked before game_dir on read opens (CreateFileW/CreateFileA/GetFileAttributesExW), falling back to game_dir on miss while routing all writes to data_dir.

MOD-005 — DirectStorage VFS Integration

  • Priority: P0 | Area: crates/victory-hle/src/modules/dstorage.rs, crates/victory-hle/src/modules/files.rs
  • Goal: Route IDStorageFactoryX::OpenFile through the same VFS overlay resolution path as Win32 file opens so overridden streamed archives and assets work seamlessly through DirectStorage.

MOD-006 — Merged Directory Enumeration Across Overlays

  • Priority: P2 | Area: crates/victory-hle/src/modules/files.rs
  • Goal: Merge FindFirstFileW / FindNextFileW results across configured overlay roots and game_dir with case-insensitive deduplication (highest-priority overlay wins) so mods can add brand-new files discovered via directory scans.

Pillar 3 — Multi-Instance & Profile Isolation

MOD-007 — Per-Instance --profile <name> Data & Save Isolation

  • Priority: P0 | Area: apps/victory/src/run.rs, crates/victory-hle/src/modules/{storage.rs,xgamesave.rs}
  • Goal: Add --profile <name> (and VICTORY_PROFILE) to isolate data_dir (saves, settings, logs) per instance while allowing concurrent local instances to share read-only game_dir and cache_dir.

MOD-008 — Configurable Local User Identity (XUID, Gamertag, Display Name)

  • Priority: P1 | Area: crates/victory-hle/src/modules/xuser.rs, victory.example.toml
  • Goal: Replace the hardcoded single offline user with configurable [profile] / CLI overrides (--gamertag, --xuid, or deterministic hash derived from --profile) so multiple local clients have distinct identities.

MOD-009 — Concurrent Cache File Locking & Atomic Writes

  • Priority: P1 | Area: crates/victory-gpu/src/shader_cache.rs, crates/victory-gpu/src/pipeline/library.rs
  • Goal: Eliminate fixed .tmp filename collisions (e.g., host-pipelines.tmp) using per-process/thread unique temp paths before atomic rename so simultaneous local instances sharing cache_dir never fail with sharing violations or corrupt caches.

MOD-010 — Multi-Client Window & Audio Flags

  • Priority: P2 | Area: apps/victory/src/run.rs, crates/victory-gpu/src/dxgi.rs, crates/victory-hle/src/modules/audio.rs
  • Goal: Add --window-title, --window-pos X,Y,W,H, and --mute flags for running side-by-side local clients cleanly during multiplayer development and testing.

Pillar 4 — Opt-In Local, LAN & Custom-Server Networking

MOD-011 — Opt-In [network] Mode & Endpoint Policy

  • Priority: P0 | Area: crates/victory-hle/src/modules/net.rs, victory.example.toml
  • Goal: Keep loopback as the default mode, and add opt-in lan (RFC1918 / ULA / link-local) and allowlist (explicit user-configured ip:port / CIDR entries for user-hosted servers or peers) modes so mods aren't locked to 127.0.0.1 when the user opts in.

MOD-012 — Local/LAN Interface Bind & Port-Offset Support

  • Priority: P1 | Area: crates/victory-hle/src/modules/net.rs
  • Goal: Allow sockets in opt-in modes to bind the configured local/LAN interface instead of forcing 127.0.0.1, and add --net-port-offset <N> so multiple local instances on the same host don't collide on fixed UDP/TCP ports.

MOD-013 — Opt-In Local Connectivity Provider in xnetworking.rs

  • Priority: P1 | Area: crates/victory-hle/src/modules/xnetworking.rs
  • Goal: When [network] is opted out of strict loopback, report local connectivity in XNetworkingGetConnectivityHint, honor configured UDP ports / offsets in QueryPreferredLocalUdpMultiplayerPort, and fire ConnectivityHintChanged callbacks properly.

MOD-014 — Dedicated Host-Side Transport Layer for Mod Plugins

  • Priority: P1 | Area: crates/victory-mod, crates/victory-hle/src/modules/net.rs
  • Goal: Provide a clean host-side UDP/TCP/WebSocket transport interface directly to loaded plugins (decoupled from the title's own sandboxed Winsock calls) so multiplayer mods can implement client-server or peer networking cleanly regardless of title socket behavior.

Pillar 5 — Overlay Rendering, Input & Sync Primitives

MOD-015 — Pre-Present D3D12 Overlay Hook & Resize Lifecycle

  • Priority: P1 | Area: crates/victory-gpu/src/{host.rs,queue.rs,dxgi.rs}
  • Goal: Expose a clean pre-present render hook in Host::present (with device, queue, command list, backbuffer RTV, dimensions, and frame index) plus on_before_resize / on_after_resize notifications so mod UIs (server browsers, chat, nametags, debug HUDs) render cleanly without DXGI hook conflicts.

MOD-016 — Mod Input-Capture Gate

  • Priority: P1 | Area: crates/victory-hle/src/modules/{gameinput.rs,lifecycle.rs}
  • Goal: Add an overlay input-capture toggle so when a mod UI or chat box is focused, keyboard/mouse events route to the overlay while the title receives neutral input until capture is released.

MOD-017 — Per-Instance Controller Slot (--pad-index) & --background-input

  • Priority: P2 | Area: crates/victory-hle/src/modules/gameinput.rs, apps/victory/src/run.rs
  • Goal: Let each instance bind to a specific controller index (0..3) and optionally keep receiving controller input when unfocused, enabling effortless single-PC dual-client testing.

MOD-018 — Frame-Boundary, Monotonic Clock & Sync Hooks

  • Priority: P1 | Area: crates/victory-gpu/src/queue.rs, crates/victory-hle/src/modules/kernel.rs
  • Goal: Expose a per-present on_frame_end(frame_index, delta_us) callback alongside host QPC epoch/time-scale hooks so multiplayer mods have a deterministic tick and shared timebase for interpolation, prediction, and replay debugging.

MOD-019 — Low-Overhead --headless & --fps-cap Second-Client Mode

  • Priority: P2 | Area: apps/victory/src/run.rs, crates/victory-gpu/src/{host.rs,dxgi.rs}
  • Goal: Support --headless (combinable with WARP and --mute) and --fps-cap so developers and CI can spin up a lightweight second client without desktop window overhead or full GPU load.

Pillar 6 — Local IPC & Multi-Client Test Harness

MOD-020 — Opt-In Local IPC Control/Telemetry Bus & Dual-Instance Harness

  • Priority: P1 | Area: New crates/victory-ipc, apps/victory/src/run.rs, crates/victory-hle/tests/
  • Goal: Add an opt-in localhost named-pipe JSON-RPC control/telemetry bus ([ipc] enabled = false) for external launchers/server browsers, paired with a dual-instance loopback integration harness verifying profile isolation, VFS overlays, concurrent cache safety, and local packet exchange.
**@⁠hyperland956-lgtm** on GitHub · 2026-11-26 05:13 UTC · [original](https://github.com/Marvisak/VIctory/issues/3045) # Architecture & Tracking: Modding, Multi-Instance, VFS Overlay & Opt-In Networking Foundations ## Context & Open-Ended Goal As `VIctory` and its forks rapidly converge toward full single-player playability, the core runtime interfaces (`victory-loader`, `victory-hle`, `victory-gpu`, `victory.toml`) are stabilizing right now. Laying down clean, opt-in extensibility foundations *now* — while contributor velocity is high — ensures future community mods, scripting frameworks, and user-hosted multiplayer layers (LAN, P2P, or dedicated client-server) can plug into `VIctory` cleanly instead of maintaining invasive forks later. The 20 milestones below (`MOD-001`–`MOD-020`) are a starting baseline, **not a ceiling**. Contributors and agents analyzing real workloads are encouraged to think beyond this list, refine designs where the codebase warrants it, and introduce any additional clean runtime seams (e.g., richer memory/thread hooks, crash diagnostics, hot-reloadable shaders/assets, audio/voice routing, or custom sync primitives) needed to make `VIctory` a rock-solid modding and multiplayer host. Everything remains opt-in (offline/single-player default behavior unchanged). | Pillar | What It Unlocks | |---|---| | **1. Plugin & Runtime Hooks (`MOD-001`–`MOD-003`)** | Native plugin loading, loader/HLE lifecycle & import chaining, and safe runtime memory/module queries | | **2. VFS & Asset Override Stack (`MOD-004`–`MOD-006`)** | Non-destructive file/DirectStorage overrides and merged directory enumeration ahead of `game_dir` | | **3. Multi-Instance & Profile Isolation (`MOD-007`–`MOD-010`)** | Running 2+ local clients on one machine with separate identities, saves, window/audio flags, and safe shared caches | | **4. Opt-In Local/LAN/Custom Transport (`MOD-011`–`MOD-014`)** | User-configured networking modes, port offsets, local `XNetworking` connectivity, and a dedicated plugin transport layer | | **5. Overlay, Input, Sync & Headless (`MOD-015`–`MOD-019`)** | Pre-present D3D12 UI overlays, input capture, multi-pad routing, frame/clock sync hooks, and headless second-client mode | | **6. Local IPC & Multi-Client Harness (`MOD-020`)** | Localhost control/telemetry bus for external launchers and automated dual-instance verification | ## Pillar 1 — Plugin & Runtime Hook Architecture ### `MOD-001` — Versioned Native Plugin Host & `[mods]` Config - **Priority:** `P1` | **Area:** New `crates/victory-mod`, `apps/victory/src/run.rs`, `victory.example.toml` - **Goal:** Introduce a versioned C-ABI / Rust plugin host (`[mods]` config + `--mod-dir` / `--no-mods` CLI overrides, disabled by default) exposing host logging, lifecycle registration, and graceful ABI mismatch handling so mods load cleanly without DLL injection. ### `MOD-002` — Loader Lifecycle & HLE Import-Chaining Seams - **Priority:** `P1` | **Area:** `crates/victory-loader/src/{lib.rs,prepare.rs,resolve.rs}` - **Goal:** Fire plugin callbacks after image preparation (`on_image_loaded`) and prior to entry (`on_before_entry`), and provide a thread-safe mechanism for plugins to wrap or chain specific Win32/GDK HLE imports cleanly rather than manually patching IATs. ### `MOD-003` — Safe Runtime Memory, Module & Thread Query API for Plugins - **Priority:** `P1` | **Area:** `crates/victory-mod`, `crates/victory-loader` - **Goal:** Expose a controlled host API for loaded plugins to query mapped image bounds/sections, build identity hashes, memory protections, and thread creation/exit notifications so scripting and multiplayer sync plugins can inspect or hook runtime state reliably. ## Pillar 2 — Non-Destructive VFS & Asset Override Stack ### `MOD-004` — Priority-Ordered VFS File Override Layer - **Priority:** `P0` | **Area:** `crates/victory-hle/src/modules/files.rs`, `victory.example.toml` - **Goal:** Support ordered overlay directories (`[mods] overlay_dirs = [...]`) checked before `game_dir` on read opens (`CreateFileW`/`CreateFileA`/`GetFileAttributesExW`), falling back to `game_dir` on miss while routing all writes to `data_dir`. ### `MOD-005` — DirectStorage VFS Integration - **Priority:** `P0` | **Area:** `crates/victory-hle/src/modules/dstorage.rs`, `crates/victory-hle/src/modules/files.rs` - **Goal:** Route `IDStorageFactoryX::OpenFile` through the same VFS overlay resolution path as Win32 file opens so overridden streamed archives and assets work seamlessly through DirectStorage. ### `MOD-006` — Merged Directory Enumeration Across Overlays - **Priority:** `P2` | **Area:** `crates/victory-hle/src/modules/files.rs` - **Goal:** Merge `FindFirstFileW` / `FindNextFileW` results across configured overlay roots and `game_dir` with case-insensitive deduplication (highest-priority overlay wins) so mods can add brand-new files discovered via directory scans. ## Pillar 3 — Multi-Instance & Profile Isolation ### `MOD-007` — Per-Instance `--profile <name>` Data & Save Isolation - **Priority:** `P0` | **Area:** `apps/victory/src/run.rs`, `crates/victory-hle/src/modules/{storage.rs,xgamesave.rs}` - **Goal:** Add `--profile <name>` (and `VICTORY_PROFILE`) to isolate `data_dir` (saves, settings, logs) per instance while allowing concurrent local instances to share read-only `game_dir` and `cache_dir`. ### `MOD-008` — Configurable Local User Identity (`XUID`, Gamertag, Display Name) - **Priority:** `P1` | **Area:** `crates/victory-hle/src/modules/xuser.rs`, `victory.example.toml` - **Goal:** Replace the hardcoded single offline user with configurable `[profile]` / CLI overrides (`--gamertag`, `--xuid`, or deterministic hash derived from `--profile`) so multiple local clients have distinct identities. ### `MOD-009` — Concurrent Cache File Locking & Atomic Writes - **Priority:** `P1` | **Area:** `crates/victory-gpu/src/shader_cache.rs`, `crates/victory-gpu/src/pipeline/library.rs` - **Goal:** Eliminate fixed `.tmp` filename collisions (e.g., `host-pipelines.tmp`) using per-process/thread unique temp paths before atomic rename so simultaneous local instances sharing `cache_dir` never fail with sharing violations or corrupt caches. ### `MOD-010` — Multi-Client Window & Audio Flags - **Priority:** `P2` | **Area:** `apps/victory/src/run.rs`, `crates/victory-gpu/src/dxgi.rs`, `crates/victory-hle/src/modules/audio.rs` - **Goal:** Add `--window-title`, `--window-pos X,Y,W,H`, and `--mute` flags for running side-by-side local clients cleanly during multiplayer development and testing. ## Pillar 4 — Opt-In Local, LAN & Custom-Server Networking ### `MOD-011` — Opt-In `[network]` Mode & Endpoint Policy - **Priority:** `P0` | **Area:** `crates/victory-hle/src/modules/net.rs`, `victory.example.toml` - **Goal:** Keep `loopback` as the default mode, and add opt-in `lan` (RFC1918 / ULA / link-local) and `allowlist` (explicit user-configured `ip:port` / CIDR entries for user-hosted servers or peers) modes so mods aren't locked to `127.0.0.1` when the user opts in. ### `MOD-012` — Local/LAN Interface Bind & Port-Offset Support - **Priority:** `P1` | **Area:** `crates/victory-hle/src/modules/net.rs` - **Goal:** Allow sockets in opt-in modes to bind the configured local/LAN interface instead of forcing `127.0.0.1`, and add `--net-port-offset <N>` so multiple local instances on the same host don't collide on fixed UDP/TCP ports. ### `MOD-013` — Opt-In Local Connectivity Provider in `xnetworking.rs` - **Priority:** `P1` | **Area:** `crates/victory-hle/src/modules/xnetworking.rs` - **Goal:** When `[network]` is opted out of strict loopback, report local connectivity in `XNetworkingGetConnectivityHint`, honor configured UDP ports / offsets in `QueryPreferredLocalUdpMultiplayerPort`, and fire `ConnectivityHintChanged` callbacks properly. ### `MOD-014` — Dedicated Host-Side Transport Layer for Mod Plugins - **Priority:** `P1` | **Area:** `crates/victory-mod`, `crates/victory-hle/src/modules/net.rs` - **Goal:** Provide a clean host-side UDP/TCP/WebSocket transport interface directly to loaded plugins (decoupled from the title's own sandboxed Winsock calls) so multiplayer mods can implement client-server or peer networking cleanly regardless of title socket behavior. ## Pillar 5 — Overlay Rendering, Input & Sync Primitives ### `MOD-015` — Pre-Present D3D12 Overlay Hook & Resize Lifecycle - **Priority:** `P1` | **Area:** `crates/victory-gpu/src/{host.rs,queue.rs,dxgi.rs}` - **Goal:** Expose a clean pre-present render hook in `Host::present` (with device, queue, command list, backbuffer RTV, dimensions, and frame index) plus `on_before_resize` / `on_after_resize` notifications so mod UIs (server browsers, chat, nametags, debug HUDs) render cleanly without DXGI hook conflicts. ### `MOD-016` — Mod Input-Capture Gate - **Priority:** `P1` | **Area:** `crates/victory-hle/src/modules/{gameinput.rs,lifecycle.rs}` - **Goal:** Add an overlay input-capture toggle so when a mod UI or chat box is focused, keyboard/mouse events route to the overlay while the title receives neutral input until capture is released. ### `MOD-017` — Per-Instance Controller Slot (`--pad-index`) & `--background-input` - **Priority:** `P2` | **Area:** `crates/victory-hle/src/modules/gameinput.rs`, `apps/victory/src/run.rs` - **Goal:** Let each instance bind to a specific controller index (`0..3`) and optionally keep receiving controller input when unfocused, enabling effortless single-PC dual-client testing. ### `MOD-018` — Frame-Boundary, Monotonic Clock & Sync Hooks - **Priority:** `P1` | **Area:** `crates/victory-gpu/src/queue.rs`, `crates/victory-hle/src/modules/kernel.rs` - **Goal:** Expose a per-present `on_frame_end(frame_index, delta_us)` callback alongside host QPC epoch/time-scale hooks so multiplayer mods have a deterministic tick and shared timebase for interpolation, prediction, and replay debugging. ### `MOD-019` — Low-Overhead `--headless` & `--fps-cap` Second-Client Mode - **Priority:** `P2` | **Area:** `apps/victory/src/run.rs`, `crates/victory-gpu/src/{host.rs,dxgi.rs}` - **Goal:** Support `--headless` (combinable with WARP and `--mute`) and `--fps-cap` so developers and CI can spin up a lightweight second client without desktop window overhead or full GPU load. ## Pillar 6 — Local IPC & Multi-Client Test Harness ### `MOD-020` — Opt-In Local IPC Control/Telemetry Bus & Dual-Instance Harness - **Priority:** `P1` | **Area:** New `crates/victory-ipc`, `apps/victory/src/run.rs`, `crates/victory-hle/tests/` - **Goal:** Add an opt-in localhost named-pipe JSON-RPC control/telemetry bus (`[ipc] enabled = false`) for external launchers/server browsers, paired with a dual-instance loopback integration harness verifying profile isolation, VFS overlays, concurrent cache safety, and local packet exchange.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 06:27:26 +00:00
Author
Owner

@⁠Marvisak on GitHub · 2026-11-26 06:45 UTC · original

Automated triage for the maintainers.

A roadmap proposal for plugin hooks, file overlays, multi-instance profiles, overlays and opt-in networking. On scope: the README states the project is offline by design ("the title cannot reach the network"), and crates/victory-hle/src/modules/net.rs enforces it by allowing loopback only and narrowing binds to loopback. The networking pillar (MOD-011 to MOD-014, and the multi-client parts that depend on it) therefore runs against the stated scope. Modding hooks, file overlays and multi-instance support are not covered by the README either way, so whether any of this belongs here is left to the maintainers.

If parts of it are wanted, separate issues or PRs per change are easier to review than one tracking list.


Generated by Claude Code

**@⁠Marvisak** on GitHub · 2026-11-26 06:45 UTC · [original](https://github.com/Marvisak/VIctory/issues/3045#issuecomment-7184747380) <!-- victory-issue-triage v1 verdict=tracked seen=2026-11-26T05:13:22Z at=2026-11-26T07:06:00Z --> Automated triage for the maintainers. A roadmap proposal for plugin hooks, file overlays, multi-instance profiles, overlays and opt-in networking. On scope: the README states the project is offline by design ("the title cannot reach the network"), and `crates/victory-hle/src/modules/net.rs` enforces it by allowing loopback only and narrowing binds to loopback. The networking pillar (MOD-011 to MOD-014, and the multi-client parts that depend on it) therefore runs against the stated scope. Modding hooks, file overlays and multi-instance support are not covered by the README either way, so whether any of this belongs here is left to the maintainers. If parts of it are wanted, separate issues or PRs per change are easier to review than one tracking list. --- _Generated by [Claude Code](https://claude.ai/code)_
This discussion has been locked. Commenting is limited to contributors.
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
github/Marvisak--VIctory#3045
No description provided.