menu

ArchiLeapVR

Introduction

ArchiLeapVR is a first-person VR platformer with an in-game level editor focused on intuitive level creation and iteration in VR. The level editor allows basic operations on game entities to afford creation of end-to-end levels while in VR. Designers can switch between play and edit modes to test levels and iterate on them, and save these levels for players to play directly.

Duration: August 2024 - Present

Technologies: Rey Engine (Custom C++ Game Engine) | DirectX11 | OpenXR

Role: Sole Developer

Key Features

  • Virtual Reality (VR) integration in my custom C++ game engine using OpenXR to support simultaneous VR and desktop rendering.
  • Reusable VR module integrated with the engine to allow any game to be ported to VR using Oculus Rift.
  • Support for editing on computer (using keyboard + mouse) or VR (using VR controllers).
  • 3D platforming with intuitive VR controls during gameplay, including grabbing objects and ledges and punching enemies.
  • In-game level editor with intuitive VR controls, allowing creation of end-to-end levels for the game by creating, translating, rotating, scaling and cloning entities.
  • Custom binary file format for saving and loading maps with perforce integration to check out maps when editing.

VR Integration: Keeping It Super Simple

  • Super easy for game code to integrate VR- define USE_OPENXR in EngineBuildPreferences.hpp, render the scene two times for left and right eye views, and manage XR cameras.
  • OpenXR uses a triple-buffering strategy, so the OpenXR system gets the swapchain textures and depth stencils using xrEnumerateViews, and the renderer queries these when rendering for an eye.
  • There are conversions between three coordinate systems- the game coordinate system, the DirectX11 coordinate system and the OpenXR coordinate system.

Intuitive VR Controls

Virtual Reality headsets and controllers allow for very different interactions with a 3D world as compared to traditional computers, and one important part of the project was to account for these VR affordances and design intuitive editing controls for this input modality.

  • VR controllers are 2 point-and-click interfaces with 6 degrees of freedom as opposed to a single point-and-click interface on a computer with 2 degrees of freedom (mouse).
  • The editor uses raycasts from controller positions based on the controller orientations to determine positions for entities being spawned or translated.
  • Rotating entities involves grabbing them and rotating the controller.
  • Users can scale entities using both hands to grab the entity and pull hands towards or away from the center of the entity.
  • The editor also allows users to create links between specific levers/buttons and doors/moving platforms, delete entities or drop entities to the ground.

Platformer Mechanics

Platformer games often involve standard mechanics such as jumping, pickups, puzzles involving levers, buttons, doors and moving platforms, and combat mechanics involving enemies. ArchiLeap consists of all of these and accounts for the difference in input modality when implementing these.

  • Carefully chosen entities to demonstrate differences in interaction with entities on a computer vs a VR headset.
  • Levers are moved by reaching out with a controller, grabbing the handle and moving the controller.
  • Ledge grab involves reaching out with controllers and grabbing the ledge using the grip buttons followed by pulling controllers down to emulate pulling yourself up onto a ledge.
  • Animated enemies with simple transform animations on different model groups.
  • Enemies can be defeated by punching or grabbing enemies and throwing them off platforms.
  • Crates can be picked up with the grip button and placed on buttons.

Map Save/Load

  • Custom binary file format to save and load maps.
  • Gaps in map array are stored as 0xFF bytes to ensure EntityUID matches index in the std::vector.
  • Specific state variables are stored for each entity, other variables have a predefined value initialized during entity construction.

				

Perforce Integration

  • Users can connect to perforce using their username, server and workspace.
  • Error messages for invalid configuration and valid configuration with project directory not in workspace.
  • Map save files submitted to perforce are checked out automatically if connected to perforce.

Undo/Redo Actions

  • Both controllers perform identical options- users can move entities with either hand, etc.
  • Each controller maintains its own undo/redo stacks.
  • Actions involving both controllers (scaling) only pushes onto one controller which is considered the controller responsible for scaling.
  • Undoing an action pushes the opposite action onto the redo stack- for example, undoing a create action performs a delete action and pushes a create action on the undo stack.

				

Off-Center Perspective Projection

  • Using a centered perspective projection matrix for stereo views causes double-vision blur.
  • The same object appears in different positions for the different cameras, causing this blur.
  • The solution is to use an off-center perspective projection matrix, which creates a view frustum that is asymmetric around the camera axis.
  • The off-center perspective projection can be split up into a centered perspective projection matrix and a shear matrix with the latter creating the asymmetry.

					
				

Polished Experience through Iterations with Designers

  • Conducted playtests with designers to iterate on the editor interface.
  • Designers enjoyed editing in VR and had insightful comments on how they would go about creating levels.
  • Designer comment after a playtest: "I would block out the main layout of the level on the computer since it's faster on that, and do fine-tuning in VR which allows for faster iteration."