This VR project involves building an Escape room for a user to engage with and try to solve, as well as scripting some key implementations to make the experience more interactive. Furthermore, the project tracks key data such as movement and object interaction to analyze how the user is moving as well as how they are interacting with objects.
Experience Description
The Escape Room is based on the Fictional Harry Potter Universe. Specifically, the User must collect the Three Deathly Hallows (i.e., the invisibility cloak, the resurrection stone, and the elder wand). users must collect the three correct items by stepping on the platform in front of the tables which the items are placed before. if they have collected the correct three items, then stepping on the platform next to the wall-enclosed platform will lower the walls, and you will be able to teleport out of the room by stepping on the golden platform. Otherwise, you will be returned to the start of the game with all the objects placed back on their original tables, and the user must start over. To make things harder, floating brooms are placed inside the room and if the user bumps into them, they are returned back to the beginning.
Video Walkthroughs
Sample Walkthrough of Experience
How to collect Objects
Harry Potter Virtual Escape room Images
Scripting: The Player Controller
The Update loop here is called every frame and updates the total distance traveled (using Euclidean Distance) by the user, the position of the User, and displays Text for different events that may occur throughout the experience.

Update Distance Traveled and Update Position Tracking File will be explained later, but the rest of the code handles the display of different events that occur within the experience. If the users happens to escape the room successfully, there will be a Win Text that will appear for 3 seconds, and then disappear. Similarly, if The user is unsuccessful in retrieving the correct 3 objects, a Retry text will appear for 3 seconds. Finally, if the user bumps into an enemy broom object, a specific text related to bumping into an enemy will appear for 3 seconds as the user is transported back to the front of the room.
The On Collision Enter function has several uses. First, it checks whether the collision that was made was that of an enemy, and if it is it transports the user back to the starting position. Second, it checks whether the user has stepped on the final platform to lower the walls surrounding the golden platform. If the user has collected all three of the correct deathly hallows and steps on the final platform, the walls will come down and the golden teleport platform will be free to step on. If not, the user will be transported back to the start and must start over
Although not the most efficient implementation, this segment of On Collision Enter checks to see if the user is standing on any one of the six item Collection Platforms, and "collects" the object if it is triggered. More can be done to simplify this code segment, but for now, it essentially performs the same operation for each of the 6 object collection platforms.
There is one teleport platform which is within the enclosed walls. If the user steps on this platform, it means it has successfully collected all 3 deathly hallows and the User will be teleported out of the room and across to the next one, and the "win" text will be displayed.
These are Helper functions to the implementations described above. to the left are functions that simply set the text to be displayed for different stages of the experience as described above. Below are functions that reset the experience whenever the user bumps into an enemy or unsuccessfully tries to reveal the final teleport platform.
The following functions are used to track data and update the text files which are recording the tracking Data.
Scripting: The Enemy Controller
The enemy controller script controls the movement of the enemy broomsticks. Their main function is to reset the position of the user if the user bumps into them. However, that functionality is executed by the Player Controller script. Instead, the enemy controller will execute the broomstick movements from one side of the room to the other. We can do this by creating waypoints. 
The path of the enemy broomsticks is as follows: start at one side of the room, head towards the opposite side, and then once it reaches head back to the other side of the room. 
It continues this sequence for the duration of the session
check distance to waypoint checks the current location of the broomstick and depending on how close it is to one of its endpoints, will change the direction of the movement. This is done repeatedly.
Scripting: Data Analysis
The script here demonstrates the use of the C# file writing and reading classes (specifically, Streamreader and StreamWriter) and using them to write data tracked from the Experience to files for further analysis.
Additional Steps or Extensions
Some additional steps I would love to add to this project include:
More machine learning implementations and more AI (such as other people you could interact with).
Levels (Multiple escape rooms or rooms to have to go through in order to reach the end).
User interfaces for the user to interact with (Perhaps having puzzles to solve in order to acquire an object instead of just stepping on a platform).
A Note From Umar
I avoid simply placing my computer science projects on GitHub. I personally believe that GitHub doesn't do as well of a job as showcasing the process of constructing a computer science project as a portfolio would. Therefore, I aim to display all my personal and internship projects on this site, showing not only my code but also my thought process in constructing the program.

You may also like

Back to Top