Start

Presentation

The Tower

Gabriele Marini

Francesco Desogus

Ambienti Virtuali

Content

  • Game idea and mechanics
  • ​Project structure
  • Levels description and implementations
  • Virtual Reality and OpenVR
    • Issues and solutions
  • Assets: Meshes, Shaders and Sounds
  • Future improvements and ideas

Game idea and Mechanics

  • First person puzzle game
     

  • Inspired by Antichamber 

    • Unrealistic levels

    • Minimal, low poly graphics
       

  • Levels designed for HTC Vive
     

  • The Tower idea:

    • Levels are connected by an elevator

    • Completing a level will open elevator doors

Game idea and Mechanics

Project Structure

Project Structure

Game Manager

  • Level management
    • Initialization
    • Switching
    • Logic Update
    • Rendering
  • VR Support
    • Per-eye rendering
    • Teleportation feature

    class GameManager
    {
       var mIsVROn;
       var mGameStatus;
       var mCamera
    
       var mSoundManager;
       var mInputManager;
       var mAnimator;
    
       ...
    
       XVRRendering(eye);
       Render();
       UpdateLogic(dt);
    
    };

Input managers

Input managers


class InputManager
{
    var mIsVRon;		
    var mManager;
    var mCamera;	
    var mPreviousCameraPosition;

    // Public functions
    UpdateCamera();
    UpdateControllers();
    IsPressingPrimaryButton();
    IsPressingSecondaryButton();
    IsGripPressed();
    GetController();
    HasPressedMenuButton();
    VibrateController();
    GetPlayAreaSize();
};

Depending on the input device found the input manager will manage input from:

 

  • Keyboard and Mouse
  • Gamepad (Xbox 360 or Xbox One)
  • Vive Controllers
    • In this case it will use functions from a DLL to get controllers infos

Animator

  • Allows to create different types of animations:
    • Transition animation from point to point(s)
    • Rotation animation from angle to angle(s)
    • Scaling animation from scaling array to scaling array(s)
    • Rotation Around point
    • Mesh "diffuse" parameter animation, from value to value(s)
    • Light color transition from value to value
    • Generic value transition (tracked with an animationId), from value or array to value(s) or array(s)
       
  • For each of the above animations it is possible to define:
    • Looping and Execution Time
    • Easing: The kind of easing in or/and out desired:
      • Linear, Cubic, Quadratic.

Levels

Structure and mechanics

Levels

Each level has a predefined structure

     
    class Level {
        /* Variables */
    
        Init();
        Render();
        UpdateLogic();
        IsPointedPositionValid();
        DrawHUD();
        IsLevelCompleted();
        SetupOpenglLights();
    
        /* Level-specific functions */
    };

    function Level::Level{}

Common classes:

  • Room.s3d
  • Elevator.s3d
  • Utils.s3d
  • EventTrigger.s3d
  • Text.s3d

Level Menu

This level will show a list of all the levels allowing the player to choose one of the levels to play.
 

Classes used:

  • LevelMenuSelector.s3d
  • PreviewFrame.s3d

Pecularities:

  • Low poly "Sea"
  • No elevator in the room
  • Point and click with vive controllers

Level 0

A room with a 4-way portal cube where each side shows a different view

Pecularities:

  • Creates the elevator and initialize variables used by other levels.
  • Portals effect with stencil buffer

Level 1

Drawing Level. The player will have to connect the light cones by drawing in the air

Classes and Shaders:

  • DrawingConnectors.s3d
  • DrawingShader.glsl

Pecularities:

  • 3D drawing

Level 2

Drawing Level. The player will have to connect the opposite light cones by drawing in the air

Classes and Shaders:

  • DrawingConnectors.s3d
  • DrawingShader.glsl

Pecularities:

  • 3D drawing
  • "Mirror" effect for the controllers

Level 3

The player will have to walk through 5 coloured paths that will move each set of colored flying objects to form a code digit

  • Random meshes, each singularly animated
  • Fully customizable, interactive 3d keyboard

Classes and Shaders:

  • RandomMeshes.s3d
  • SpotShader.glsl
  • VirtualKeyboard.s3d

Level 4

A room with 4 walls full of blocks. Pressing all of the extruded blocks will open the elevator

Peculiarities:

  • Exploits Vive Controllers positions

Classes and Shaders:

  • ButtonsWall.s3d

Level 5

FPS Style. Targets will randomly spawn around the room. Shooting them without getting player life to 0 will unlock the elevator

 

  • Guns are moved and rotated with Vive Controllers
  • Each gun shoots different bullets

Classes and Shaders:

  • SimpleColorShader.glsl
  • Gun.s3d
  • Bullet.s3d
  • Target.s3d

Level 6

Final Level. Flying object and numbers will move according to player movements. Typing the correct code will unlock the ending game animation

Pecularities:

  • Time warp in certain parts of the room and with the clock
  • Mirror!
  • Ending sequence

Classes and Shaders:

  • Clock.s3d
  • Numpad.s3d

Virtual reality

Implementation, issues and solutions

Virtual Reality
Openvr

FrancoDLL.dll

  • Based on an OpenVR sample project, started by Franco Tecchia
  • Modified by us, adding getter methods to obtain:
    • Camera matrix
    • Controller matrices
    • Controller buttons states
    • Play area size

Virtual Reality

XVR - OpenVR interaction

 

  • The ViveManager class communicates with the DLL library in order to:
    • Update the camera position
    • Update the controllers position
    • Handle any inputs from the controllers
  • The ViveController class handles the appearance of a single controller
    • Draws the controller
    • Update the visual status of its buttons (when pressed)
    • Allows to change the mesh of the controller

Virtual Reality

Issues and Solutions

  • Design issue: player movements
    • The real room is quite small
    • Walking through the whole virtual room is impossible
  • Solution: Teleportation
    • Player points where he wants to go
    • Animations prevent motion sickness

Virtual Reality

Issues and Solutions

  • Problem with this solution:
    • Need to track the offset from the real position in XVR 
  • In order to actually move the player glTranslate() is used with this offset

Virtual Reality

Issues and Solutions

  • Design issue: player position in real life
     
  • When moving the player loses track of where he is inside the real room
  • We added the possibility to see the boundaries of the room and the position of the player inside
  • Rendering issues: Some XVR classes and functions for rendering don't work as expected 
  • XVR functions like SetClearColor() don't have any effects
  • The CVmLight class doesn't work
    • Used OpenGL functions to directly modulate lights
  • The Stencil Buffer doesn't work as expected
    • Can walk through "portals" even if it's not possible

Virtual Reality

Issues and Solutions

  • Some textures aren't rendered
    • Those embedded in a mesh work properly
    • Textures passed to shaders as parameter don't
    • Abandoned the use of post-processing effects

Virtual Reality

Issues and Solutions

Assets

Meshes, Shaders and Sounds

Assets

  • The idea of the game was to mostly use primitive shapes
    • Cubes, Spheres, Cylinders, Pyramids...
  • Vive 3D models were found in the OpenVR SDK
  • Other models were found online
    • Sketchfab, TF3DM
  • Modified and exported by using a combination of Blender 2.78 and Blender 2.49b with AAM exporter plugin

Meshes

  • ToonShader
    • Creates a cartoonish look
    • Used on most of the objects
    • Based on Phong Light model

Assets

Shaders

  • BorderShader: used to create silhouettes in objects using face culling

Assets

Shaders

  • DrawingShader: used for color interpolation when drawing in 3D 
  • DashedLineShader:  displays the ray when teleporting
  • PositionCircleShader: displays the circle when teleporting
  • PlayAreaTeleportShader: displays the play area when teleporting
  • PlayAreaBoxShader: displays the play area when pressing the grip buttons

Assets

Shaders

  • PostProcessingBlurShader: used for post-processing effect to blur the view;
    • Only works without the HTC Vive
  • Most of the sounds were found online or created using professional music software
    • Cubase 5.0
    • Converted with AVS Audio Converter

Assets

Sounds

  • The tracks used are:
    • Nexus - Tranquility
    • Deadmau5 - Ghost n Stuff
    • Interestellar OST - First Step

Work balancing

  • The amount of work was evenly splitted between us:
  • Idea and game basics definition: together in a train trip, talking about Antichamber
  • We worked together in the structure
  • Levels:
    • Level 0, 1, 2, 6: Francesco
    • Level 3, 4, 5, Menu: Gabriele
  • Based on our needs, each of us created (when not already made):
    • Classes, functions and shaders

Future Improvements

  • Many ideas were cut off because of time or implementation issues:
    • Physics based gameplay
    • More complex shaders
    • More FPS-style levels
    • Level Editor (Hard)

Thanks for your time!