Monday, 28 November 2016
Wednesday, 23 November 2016
Fading In and Out
In my game I wanted to fade the screen in and out to simulate the player closing and opening their eyes at the start and end of each sequence.
I decided to use a sprite texture attached to the canvas and effect its alpha channel. By changing its alpha channel between 1 and 0 I can effect the GUI transparency.
However I quickly realised that standard 2D GUI does not work in VR. This is because VR can not render certain effects including standard GUI.
I found out however you can still use the canvas and 2D sprites for VR. In order to use the fading effect I wanted I had to effect the Canvas Group instead of the texture directly.
I also had to make sure that the canvas was up close to the player camera and also attached to it. This prevented any light or objects still being viable during the fading.
UI VR
Because you cant use standard GUI in VR (Virtual reality) text book UI (User Interface) and HUD (Heads Up Display) is flipped on its head.
Usually the canvas would be used to display the HUD such as menus, buttons, health bars or anything else the game designer feels appropriate. However because the canvas is always in view of the camera the HUD appears static no matter where the camera moves. This in VR can cause issues as static HUDs can cause simulation sickness.
The solution is not to have a standard 2D HUD at all and instead incorporate it into the 3D environment. For instance I decided to have my controller instructions and tutorial displayed on the TV in the environment. I then created a script to cycle through each image to display each step within the game.
The menus was more tricky. I couldn't use standard GUI button creation normally used for games in Unity. Instead I created 3D objects and box collider triggers. I then fire a raycast from the center camera. If the raycast hits the collider then the menu will activate.
However there was an issue with this method. The box colliders were too close together and the raycast would activate all buttons at the same time. I therefore decided to use one large trigger box which covered the entire menu. I then used different buttons on the xbox 360 controller to activate different menus. I created booleans which activate and deactivate when certain menus are activated. This helps prevent multiple menus activating at the same time when a single button is pressed.
For certain menus such as "how to play" I used multiple planes that are slightly rotated to help cover the peripheral vision, as well as help the player naturally look around.
For the pause menu in the main level I freeze the gameplay every time the game is paused. I make sure the game play is unfrozen both when resuming and when the player returns to the main menu. This not only helps the in game animations to continue, but also allows the light to bake as well.
I also used the fading script I created earlier but made the alpha freeze at 0.5. This helps tint the background making the menu more viable. I'm also playing a risk by attaching the pause menu HUD to the camera and therefore making it static. My hope is that the player wont be in the pause menu long enough for them to develop simulation sickness.
Controls
Controls was very tricky to figure out especially in VR. Because I'm planning on using an xbox 360 controller as my peripheral as well as the Oculus DK2 headset the character controller needed to be modified.
The main issue with using the xbox 360 controller for any VR experience is the camera stick. If the player uses the camera stick on the controller it will contradict the motion input from the headset. With two peripherals both trying to take control of the camera can cause simulation sickness very quickly.
For a while I couldn't solve this issue and considered changing the gameplay from walking simulation to just a sitting VR experience from the center of the room.
However after going to a nDreams VR talk and speaking to Patrick O'Luanaigh he helped explained that I should turn off the camera stick function entirely and use the xbox triggers to rotate the avatar or code a teleportation system to simulate walking.
I decided to use the xbox triggers to rotate the avatar. I set the rotation on the oculus character controller to 0 and added my own rotation script which allowed the triggers to rotate the player.
I also made sure that the whole character controller was switched off as well while the player is rotating. This is because after play testing it myself and to others I found that rotating while moving causes simulation sickness.I also reduced movement speed which also helps tackle simulation sickness.
Triggers
The first steps I took when I started to build the game mechanics is to start simple. I therefore focused on basic triggers. I also used a first person character controller as I wanted to make sure that my game worked as an FPS before I tried to add VR features.
I used trigger boxes to activate events within the game. The first event I wanted to create was a respawn sequence. I decided to use a similar approach from past projects for this.
I made sure once the player enters the trigger their transform equaled to the transform of the respawn location. This code was simply player.transform.position = respawn.transform.position.
I set the respawn position as a trigger box within the baby crib (Small cube trigger) so that the starting point was always in the crib. However this posed an issue on how the player was going to get out of the crib.
I therefore created another script and trigger at the end of the crib which when the player enters and presses a key or button the transform of the player will translate on the y axis allowing them to jump out of the crib. Once the player leaves the trigger box the transform will default back to zero and the player will stop rising. I used a boolean to detect whether the player has entered the trigger or not.
For the majority of the scripts as well as the climbing script I used a combination of booleans and coroutines. When the player enters a trigger the trigger will activate a boolean. Inside the coroutine there will be functions that will activate such as lights turning on and off or animations playing. Some functions can be called after a certain period of time using waitforseconds. Then I'll start the coroutine if the both the boolean equals true and the button or key is pressed.
Picking Up and Throwing
I want to include a picking up and throwing mechanic in my game. However due to my current programming knowledge this is easier said than done.
I used the same teleport code for respawning for my pick up objects. I attached the target area to the main camera so that the object will always move in relation to the camera. I also made sure that the object is also parented to the target area, so that I can attach the the collected object to the target area.
When the player drops the object the object is no longer parented to the target area and therefore can fall and land anywhere in the 3D space. This is where the issues arise. The dropped objects have the habit of either floating in space or falling through objects. Also on some occasions collected objects can clip outside the environment when the player turns the camera. Then when the player drops the object it will continue to fall through space.
I've tried solving this issue by creating a trigger on the floor. When the object is on the floor the gravity on that object is turned off. This prevents the possibility of the object falling through the floor. I then turn the gravity on when the player drops the object. That way the object can fall towards the floor and when it reaches the floor the gravity will turn off.
I've also made sure there are object colliders on the walls of the environment, but they do not stop objects leaving the environment 100% of the time. This is when the throwing mechanic becomes a nightmare.
I still haven't solved the throwing mechanic issues. For reasons I believe to be related to the VR camera mechanic objects cannot identify which direction the camera is pointing. The code allows the object when the player drops it to use physics to propel forward from the camera. However objects can fly in any direction. They also can either clip through or even get stuck on objects with colliders.
Until I solve this issue I've turned off the throwing mechanic entirely. I've only attached the pick up mechanic to the teddy to allow the player to activate the respawning sequence when done so. The idea is to try and build a sense of comfort and reliability between the player and the teddy.
Monday, 3 October 2016
First Steps: Greyboxing
I started greyboxing my environment in maya. However I caused a few complications. I forgot to take make sure everything was to scale. This was a big mistake as not only does this corrupts proportion removing the immersion of the player it will cause serious complications later on in development.
I therefore corrected the scaling by revisiting my research sources such as Mothercare and Ikea websites and re-scaling each object to the dimensions given for each objects specifications. I used the measuring tools in Maya to help line out the dimensions in 3D space. All objects were measures in centimeters.
![]() |
| Before |
![]() |
| After |
Once the scaling was correct in Maya I then exported the scene to the latest Unity Engine. However in the latest version the scaling setting in Unity are set to 1m not 1cm throwing the scaling of the scene off again. After tweaking the figures in the scaling settings I was able to fit the First Person Controller comfortably within the scene.
First Steps: Research
This year for the final project we'll have to make an interactive experience to a professional standard.With VR about to launch and having a passion for the technology myself it only seemed fitting to base my project around it. I've therefore decided to create a VR Horror WalkingSim.
I've based my concept and theme heavily on the popular First Person Horror title Among The Sleep. The game portrays you as an toddler roaming around different environments in the middle of the night in order to find your mother. I was really intrigued by this concept and their designs as there is little jump scares and little threat until the final levels. However they created a strong and uneasy atmosphere in all levels and environments, which puts the player on edge. This is the type of game I want to make. I've researched titles which use and achieve similar atmospheres from PT and Alien Isolation to even film titles like Paranormal Activity.
All these titles rely on the atmosphere created alone to create unease and danger towards the player rather than continuously throwing out jump scares. Jump scares are not popular as they are being considered easy and cheap. This is due to the jump scare being over used in all mediums in the same way. Having intense sound build and build, a moment of silence and then a loud noise introducing the threat. People argue that its not the threat that is scary but rather than the loud noise suddenly playing that creates the scare.
This is why I am going to use little jump scares and even try and use the intense build up of sound differently.
As I stated earlier my influences are heavily on Among the Sleep. Therefore my game will have the player portray a toddler in a home nursery. I'm also taking inspiration from PT and how they repeatedly used the same environment, but made subtle changes to keep the player on edge. To achieve this at the start of every sequence I will have the player wake up in their crib as if they were waking up from a nightmare.
I'm also taking inspiration from the Paranormal Activity film series for their use of lighting. They use a strong blue as their primary colour with a single bright light source often coming through a window or door and strong dark shadows. Among the Sleep used similar lighting techniques in their opening sequence.
Because I'm using VR I'm hoping that the peripheral alone will help create an uneasiness in the player. Therefore lighting is key especially for creating shadows. I'm planing to have the environment very abstract making use of squares and rectangles. The room will be square, the crib rectangle, the window square etc. I will have little organic objects in the scene so when they cast shadows it will feel more unfamiliar and uneasy for the player. I also want to use the objects in the environment to create silhouettes of threats that aren't there. With the player experiencing this in VR it will be extra terrifying.
I made it oval to make it look more appealing to the eye. I then came across a happy accident. When trying to use the magic wand tool to erase everything behind the logo it ended up duplicating the image instead creating an eerie effect.
This effect makes it look like someone is obsessed and has repeated the logo over and over again on a chalkboard. I then added lighting effects to help emphasis and draw the eye towards the title.
The use of blue helps identify the type of colour scheme and lighting I'll be using within the game. It also adds a nice level of contrast keeping the duplicated writing obscured and mysterious.
Subscribe to:
Posts (Atom)
























