How raicuparta/two-forks-vr works
Project Type & Purpose
• Two Forks VR is a Unity-based VR mod for the Firewatch game. It delivers full motion-control support by packaging:
• A .NET mod plugin (TwoForksVr) that Harmony-patches the original game at runtime via BepInEx.
• A console patcher tool (TwoForksVrPatcher) to prepare class data / metadata.
• A Unity-Editor project (UnityHelper) that builds AssetBundles for VR assets (models, UI, shaders).
High-Level Structure from the File Tree & README
• Top-Level Solution (.sln) contains three projects:
a. TwoForksVr (C# .NET plugin)
b. TwoForksVrPatcher (console app)
c. UnityHelper (Unity Editor project for AssetBundles)
• TwoForksVr/ModFiles: BepInEx loader files + openvr_mod.cfg + manifest.json + "CopyToGame" staging folder
• TwoForksVr/src: modular C# code grouped by VR subsystem (Input, Camera, LaserPointer, Locomotion, UI, PlayerBody, etc.)
• UnityHelper/Assets & /Editor: scripts and content to generate VR AssetBundles
Runtime Architecture & Interactions
• Firewatch.exe (Unity Player)
↓ (Injector)
• BepInEx Preloader
→ loads BepInEx.Core, reads BepInEx.cfg
→ discovers plugins in ModFiles/BepInEx/plugins/TwoForksVr.dll
• TwoForksVr.dll (plugin entry point – TwoForksVrMod)
→ uses Harmony to patch game methods (in Firewatch assemblies)
→ invokes VrAssetLoader to load AssetBundles from TwoForksVrAssets
→ initializes subsystems:
– VrInput (SteamVR_Input → BindingManager → IActionInput)
– VrCamera (overrides game cameras, injects OpenVR rendering)
– Locomotion (TeleportController, TurningController, patched Navigation)
– LaserPointer (VrLaser + PlayerTargetingPatches)
– PlayerBody (VR limb transforms, body renderer manager)
– UI (Static and Interactive UIs patched to world-space)
– Tools & Inventory (ToolPicker, Patches for Map, Compass, etc.)
– Settings menu extension (VrSettingsMenu)
– Liv SDK integration (LIV.cs, SDKBridge → mixed-reality capture)
• VR SDK Layer
→ OpenVR (SteamVR plugin) drives headset & controllers
→ openvr_fsr plugin (configurable via openvr_mod.cfg) can be injected
Build / Deployment Pipeline
• UnityHelper Project
– Editor scripts (CreateAssetBundles.cs) → outputs AssetBundles into TwoForksVrAssets/AssetBundles
• TwoForksVrPatcher
– Reads classdata.tpk and other metadata → packages or tweaks game IL as needed
• TwoForksVr Project
– Compiles plugin DLL + copies ModFiles (BepInEx loader, openvr_mod.cfg, asset bundles manifest)
– Packaging step (manifest.json, CopyToGame) prepares everything for the installer (RaiManager or itch.io)
Diagramming Guidance
• Development Tools (UnityHelper, TwoForksVrPatcher, TwoForksVr build)
• Firewatch Game + BepInEx Loader
• TwoForksVr Plugin
• VR Subsystems (Input, Camera, Locomotion, LaserPointer, UI, PlayerBody, Tools, Liv)
• VR SDK (OpenVR, openvr_fsr)
• Build outputs feed into ModFiles & AssetBundles
• Firewatch → BepInEx → TwoForksVr.dll
• TwoForksVr.dll → Harmony patches → game code
• TwoForksVr.dll → VrAssetLoader → AssetBundles → instantiate VR prefabs
• TwoForksVr.dll ↔ OpenVR & Liv SDK
c. Architectural Patterns & Principles:
• Plugin architecture via BepInEx + Harmony AOP patches
• Modular subsystem separation (one folder per VR subsystem)
• AssetBundle-driven resource loading
• Clear separation of development/build pipeline vs. runtime injection
d. Technologies & Frameworks:
• Unity Editor (2017/2018) for AssetBundles
• BepInEx (mod loader)
• Harmony (method patching)
• SteamVR OpenVR plugin (SteamVR_Input system)
• LIV SDK (mixed reality capture)
• .NET Core console for patcher