Monday, 21 February 2011

Game Audio

Audio is not only essential for bringing life to a game but also for creating atmosphere. This I feel would be a great addition to Rove. I have already started recording my own audio for door and wind sounds. But I feel to add a subtly eerie soundtrack to Rove would give it a more polished ambiance. I play a lot of instruments and have been writing and recording music for a long time now. I am also an avid user of Reason 4 which is a music hardware emulator that can be used as a virtual studio to create music. Using Reason 4 I have begun to create a minimal soundtrack for Rove.

Saturday, 19 February 2011

Team Meeting 3 - Main Menu Disscussion

We had decided from the early stages of creating our game documents that we would like to incorporate a main menu to Rove and that it would feature some sort of subtle narrative element.

As Rove begins with the protagonist waking up in her hallucination we thought it would be interesting to communicate this in the main menu. The design of the main menu will be a 3D scene modeled by myself of the protagonist's bedroom and the protagonist model by Andrew. The scene will show a view of looking down upon the protagonist as she is sleep on her bed with the Rove title above her head whilst the 'Play/Enter' and 'Credits/Contact' buttons are under her feet. Another idea is to have audio playing sounds of the inside of a average suburban house. For example, birds singing, a gentle breeze and the occasional car. This will give the player an impression of the a normal bedroom where someone is sleeping. Once the enter button is activated, the game begins and the 'Eyes Opening' sequence is activated. The player will then be aware that they are in the bedroom from the main menu and will have the impression that they are playing as the protagonist. Also the audio from the main menu will have cut out and as the player explores the room they will be aware that they are not in a house. Hopefully this progression between the main menu and the game will give the player an impression of the protagonists progression from reality to hallucination.

Sunday, 13 February 2011

Test - Eyes Opening and Triggered Events

Triggered Events

To begin this test I created a simple environment of two platforms (one raised higher than the other) with stairs connecting them. I also created several coloured boxes on the first platform which I would later use as buttons.


Using the triggerAnimtion script from the last test I created a simple staircase puzzle. By attaching the script to colliders placed above the coloured boxes they would act as buttons so that when the player walked on a button, animations for the steps of the staircase would be triggered. To do this I created a large button which can not be avoided by the player, so when they walk on it the steps to the staircase move and it becomes no longer accessible. The player then has to walk on the other buttons to activate other step animations which bring the steps back to their original position allowing the player to progress onto the second platform.


Above is an example of the staircase from the players perspective after the first button is activated.

Secondly I created a new script which I also attached to the button colliders so that when the steps move an audio clip is played with a sound of stones grinding. Here is an example of the script which I have called audioTrigger:


function OnTriggerEnter (other : Collider)
{
audio.Play();
}

function OnTriggerExit (other : Collider)
{
audio.Stop();
}


Eyes Opening


To achieve this effect I simply placed two black planes in front of the main camera (this is camera that the player sees through in game). I then animated both planes to open and then flicker and set the animation to 'Play on awake' so that when the test begins the two planes flicker to give the impression of eyelids. So that the planes follow the camera (this is incase the player moves the mouse while the animation is playing) I attach them to the main camera. I then found a free to use script on unifycommunity.com called FadeInOut, I attached this script to the main camera and applied a plane black texture to it. What this script does is fade from the texture to full transparency in a certain time, which you can manipulate using the scripts GUI. So now as well as the eyelids flickering the screen fades from black to give a good impression of a first-person perspective of waking up.

Saturday, 5 February 2011

Test - Lure Mechanic

To begin this test I created a very simple environment of three corridors.


The player begins at the bottom left horizontal corridor. From there they are able to see a particle system which represents the Lure for this test. Below is an example of the players perspective at the beginning of the test as well as the particle system which represents the Lure.


I created a simple Javascript which activates an animation that is attached to the particle system. This script which I call triggerAnimation is attached to a invisible collider which is placed just before where the particle system can be scene in the image above. Here is an example of the triggerAnimation:


var myBox : Animation;

function OnTriggerEnter( other : Collider){

if(other.gameObject.name == "Player"){

myBox.Play();


}
}

Unity then runs the script above when the player walks into the invisible collider just before they reach the particle system, this then activates the animation attached to the particle system which animates it disappearing around the corridor.

This worked perfectly but I had hit a problem, the particle system was now sitting around the next corner waiting for the player and due to the lack of my scripting knowledge I was unable to write a script which would then animate the particle system disappearing around the next corner upon the player walking through a second collider.

To get by this problem I created a second script which would delete the particle system from the game once it was out of view from the player. That way I could have a second particle system waiting around the second corner with its own animation, corresponding collider and triggerAnimation script. To delete the first particle system I had to place a collider just before the corner of the first corridor so that when the player walks into this collider my script which I have called destroyLure is activated and deletes the first particle system from the game. Here is an example of the destroyLure script:


function OnTriggerEnter (other : Collider)
{

Destroy(gameObject.Find("lure"));
}

I continued the process above until I had three particle systems each with their own corresponding triggerAnimation and destroyLure scripts.


The image above shows the placement of the triggerAnimation scripts which are attached to three colliders (green boxes). The sun symbols represent the position of each particle system.


The image above shows the position of the destroyLure scripts which are attached to three colliders (green boxes).

Now that all the colliders, scripts and animations are in place when the player approaches the particle system it disappears around the corner encouraging the player to follow it. Just before the player walks around the corner of the corridor the first particle system is deleted from the game and only the second particle system can be seen. This gives an illusion that to the player that they are following only the one particle system around the corridors when in fact there are three placed in the scene.