Modular VR Game Architecture: Design for Performance & Scalability
In our practice, a VR game built without a well-thought-out architecture turns into an untouched minefield by the third month of development. Every class knows about every other class: XR Origin directly calls GameManager, which pokes AudioManager, which for some reason holds a reference to the Player — and when you try to add support for a second platform, the whole construct requires a complete rewrite. Our 10 years of experience in game development show that proper architecture pays off already during porting or adding new mechanics.
VR adds specific architectural challenges beyond the ordinary: multiple input sources (left controller, right controller, hand tracking, gaze), platform-dependent APIs (OpenXR vs OVR vs SteamVR), strict framerate requirements (90 fps — 11 ms budget), and the need to isolate platform code from game logic.
Why Input Abstraction Is Critical for VR
The first and most important architectural decision is abstraction over XR input. If game logic directly uses OVRInput.Get(OVRInput.Button.PrimaryIndexTrigger), porting to another platform requires changing every place that handles input. The correct approach: input abstraction layer — an interface IXRInputProvider with methods like GetGripAxis(), GetTriggerAxis(), GetPrimary2DAxis(), and separate implementations per platform/SDK. Game logic only knows about the interface. In Unity, this is natively supported via OpenXR + Input System: InputActionAsset with bindings for different devices, InputAction with callbacks. One InputActionAsset with two binding paths (<XRController>{LeftHand}/trigger and <OculusTouchController>/trigger) works on any OpenXR-compatible platform without extra code.
The Interaction System is the second key layer. XR Interaction Toolkit provides IXRInteractable and IXRInteractor interfaces, but for complex projects it’s not enough. You need a custom event system: InteractionEventBus with typed events (GrabStarted, GrabEnded, HoverEntered, ActivatePerformed) and subscription without direct dependencies between objects.
A State Machine for player state is mandatory in VR due to specific states: Grounded, Teleporting, InMenu, GrabbingObject, UsingTool. Without an explicit state machine, these states scatter across bool flags in different components and start conflicting.
How to Design a Modular Architecture for Multi-Platform Support
Follow these steps to design a modular architecture for a Unity VR project:
- Core — platform-independent interfaces:
IXRInputProvider,ILocomotionController,IHapticController,IHandTrackingProvider. No dependencies on Unity-specific or XR-specific classes, only C# interfaces. - Platform — implementations of Core interfaces:
OculusInputProvider,OpenXRInputProvider,SteamVRInputProvider. Platform code is concentrated here and only here. A Bootstrap component at scene start detects the active platform and registers the needed implementations via Dependency Injection (Zenject or custom IoC container). - XR — interaction logic:
XRInteractionManager,HandPresenceController,GrabSystem,LocomotionSystem. Works through Core interfaces, knows nothing about specific platforms. - Gameplay — game logic: mechanics, progression, AI, saves. Works through events from the XR layer, does not know about XR directly.
- UI — all game interfaces via World Space Canvas + UGUI or custom spatial UI. Does not access Gameplay directly — only through events or the ViewModel pattern.
This separation allows testing Gameplay logic with Unity Test Framework without starting an XR session — using mock implementations of Core interfaces.
Example IXRInputProvider Interface
public interface IXRInputProvider
{
float GetTriggerAxis(XRHand hand);
Vector2 GetPrimary2DAxis(XRHand hand);
bool GetGripPressed(XRHand hand);
event Action<XRHand> OnTriggerPressed;
event Action<XRHand> OnTriggerReleased;
}
Performance as an Architectural Constraint
In VR, every architectural decision is evaluated through the lens of performance. 90 fps means an 11 ms frame budget. Patterns that are painless in regular games kill framerate in VR:
-
FindObjectOfType<T>()in Update — full scene scan every frame. In a VR scene with 500+ objects, that’s easily 2–3 ms. Using cached references instead is 200x faster. - C# allocations in hot path — GC pauses are physically noticeable in VR because a dropped frame is not just “stuttering”; it triggers motion sickness instantly. In Update/FixedUpdate — zero allocations, everything via object pool and struct-based events. Object pooling reduces GC pauses by 80%.
- Synchronous operations on the main thread — resource loading, network requests. In VR everything is async:
AddressableAssets.LoadAssetAsync,async/awaitwith correct synchronization context.
Job System and DOTS for VR projects with many physics objects or NPCs are not just an optimization — they are an architectural requirement. IJobParallelFor for calculations that can be vectorized (collision checks, proximity queries for grab system) offloads the main thread by 30–50% in typical scenarios — 2–3 times more efficient than the classic approach.
| Method | Time on main thread (ms) | Allocations |
|---|---|---|
| FindObjectOfType | 2–3 | 1 object |
| Cached reference | 0.01 | 0 |
| Event-based delegation | 0.05 | 0 (struct) |
| Platform | SDK | Integration Complexity | Porting Cost Savings |
|---|---|---|---|
| Meta Quest | OVR / OpenXR | Low | Up to $5,000 |
| SteamVR | SteamVR SDK / OpenXR | Medium | Up to $7,500 |
| Pico | PicoXR / OpenXR | Medium | Up to $5,000 |
| PSVR2 | Sony SDK | High | Up to $10,000 |
What Our VR Game Architecture Design Service Includes
We deliver a comprehensive set of deliverables to guarantee quality at every stage:
- Documentation: architectural diagrams (UML), module descriptions, interfaces, and dependencies.
- Proof-of-concept: implementation of critical modules (e.g., input abstraction or interaction system).
- Performance report: profiling results, budget analysis, and optimization recommendations.
- Integration support: assistance during integration and code review of your team.
- Training session: a 1-hour session to familiarize your team with the architecture.
- Repository access: full access to the project repository with GitHub integration.
OpenXR guarantees compatibility. We assess your project in 1–2 days — contact us to discuss the details. Our architecture design starts at $2,500 for a single-platform MVP — a proven approach that saves up to $10,000 in porting costs for multi-platform projects.
Estimated Timelines for Architecture Design
| Scope | Estimated Duration |
|---|---|
| MVP architecture (single platform, 3–5 modules) | 1–2 weeks |
| Multi-platform architecture (3+ SDKs) | 3–4 weeks |
| Full architecture with multiplayer and save system | 4–6 weeks |
Design includes documentation, dependency diagrams, and proof-of-concept implementation of critical modules. Pricing is determined after analysis of requirements and target platforms.





