top of page

Technical and Effects

Entry 1 - Sound & Lighting Effects, Interactable Triggers & Colliders
21st April 2019

Over the past week, I began production on the scripts while also applying effects to our updated environment (J.D added in the roof and also reduced the width of the warehouse), which I was able to get working after downloading it on an internal hard drive (last time, it was in my external hard drive, which appeared to be causing the error I experienced earlier - see Game Level page, Entry 1).

First up, I worked on adding effects to the environment which I managed to do fairly quickly; during that time, W.P sent me a package that included atmospheric fog [1], there were two types; the ground mist, which I used for the interiors, and fog particles were used for the outdoor area as they cover more space compared to the former (accompanied by the trees and dark skybox, this provided a very haunting aesthetic to the environment, as intended). As the darkness of the environment rendered the skeleton anatomy picture invisible, I also added a light source in the surgery room so the picture texture was visible again.

After dealing with the visuals, I moved on to adding in the audio sources for the two sound effects sent over by G.A. One audio source was placed near the shutter doors, while another was placed and duplicated around the roof of the warehouse; the former emits a sound of shutters smashing, as if someone - or a monster - is trying to force it open, while the latter emits the sound of rain hitting the roof with the occasional sound of thunder. I sized all the sources accordingly (making the shutter audio source bigger so the player can hear it upon picking up the key), while making sure that 'loop' was enabled to prevent the sound effects from stopping, and that 'Spacial Blend' was set to 3D so the volume of the sound increased/decreased based on the distance between the source and listener.

SFX_2.jpg

I then moved on to programming, where I began with the main objective of escaping the warehouse (this was the first priority so the level is at least in a completable state while I attempt to add more scripts to it). For the warehouse exit door, I duplicated the door object used for the surgery room and placed it on the left side of the warehouse, from there, I placed the asset into an empty game object with a box collider, the latter of which has 'is Trigger' enabled so the player can walk through it and trigger an event with an input (which in this case, will end the game). I also created a canvas (which forms a UI overlay within the game view) in order to create panels that tell the player when an object can be interacted with, then began work on the script (which will be attached to the warehouse exit collider); for the start, I made a public empty game object named 'OpenPanel' which will have the warehouse exit collider attached to it and will default to inactive the moment the player spawns, I then added both the 'OnTriggerEnter' and 'OnTriggerExit' methods so the panel switches between enabled or disabled depending on whether or not the player object has entered the box collider. Afterwards, a private bool was added to return an output where the panel is active in the hierarchy, so in the update section, an if statement can be added to check if the panel is active before allowing the player to interact with the warehouse door (in this instance, the door cannot be interacted with until the player passes through the trigger enabled box collider).

After learning how to  use triggers and box colliders to make objects interactive, I pretty much used the same process for the key pickup; I imported the key asset I made earlier (see Environment Assets - Entry 3) while also enabling the emissive setting so the key can easily be seen by the player, creating a second panel which would be named differently so it is entirely separate from the first panel, and carrying over the script I made for the warehouse exit collider. For the latter, I made a couple changes; for one thing, the public game object was named 'OpenPanel2' so both the panel objects can function independently, and in place of 'EditorApplication.isPlaying = false' (which will be changed before making the executable as it was used for testing within the editor) is a command that - once the player interacts with the key - will destroy the game object the script has been attached to.

With the warehouse exit and key being interactable, I had to figure out a way of keeping the warehouse exit panel inactive until the key object had been destroyed, so in the warehouse exit script, I made a new public game object for the key collider, and within the 'OnTriggerEnter' and 'update' methods, the first if statements will also check if the key game object is empty (which happens once the key collider has been destroyed by its respective player interaction). With both these scripts working, the player will now have to pickup the key before exiting out the warehouse door, and now that the foundation has been put in place, I'll use the remaining time I have on the prototype to try and build upon it.

Tutorial used for collider scripts: 

Jayanam. (2016). Unity 5.6 Open Door on Keypress tutorial. [online video] YouTube. Available at: https://www.youtube.com/watch?v=8nuJT1IDazo [Access Date - 17th April 2019]

References: 

RIVERMILL STUDIOS. (2016). Atmospheric Fog. [online] Unity Asset Store. Available at: https://assetstore.unity.com/packages/vfx/particles/environment/atmospheric-fog-58438 [Access Date - 16th April 2019]

----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

Entry 2 - Finalising the Collider Mechanics and Effects
24th April 2019

During the closing stages of development, I spent the past few days adding some final mechanics and effects to our prototype. For the start, I downloaded the Unity Effects pack from the store so I could include rain particle effects and a black cloud above where the window is; the reason behind this choice is due to the inclusion of the rain and thunder sound effect in the background, which would seem out of place if the player couldn't see any rainfall out the window, plus, it builds upon the creepy atmosphere provided by the dark skybox, atmospheric fog and twisted trees. I have also removed a vast majority of the ground fog from the interiors, leaving one patch of fog particles near the shutter doors so it feels like they are seeping through the slight opening at the bottom.

I then decided that it would be a good idea to include the main attraction of this prototype; the Specimen character, and before focussing on anything else, I made sure that he could be seen running past the window and later on trying to lift up the shutter doors. Given the short amount of time we had left, we were unable to give him animations, so W.P sent over some FBXs of the character in several poses (that he had used for the marketing) and luckily I knew exactly which ones to use. Firstly, I took the pose of him lying on the floor with his hands out and placed him near the shutter doors so it looks like he is trying to get through them.

Then, I used an object of him carrying a skull for the window scare; the intention here is that he will be zooming across the window once the FPSController walks past a trigger box collider, leaving the player wondering what it was. I then selected the Specimen character and created an animation (which subsequently creates an animator file) so at the beginning, he will be standing to the right side of the window (from the player's perspective) and then a second later the animation will end with him on the other side of the warehouse. I didn't make any changes to the Animator, however, I only wanted the animation to play once after activation so I unticked 'loop'. It was also suggested to add a flash of lightning that played when Specimen zooms across the window (so the player could only see his silhouette), so I added in a point light and followed the same process I used previously, except this time I'll be animating the intensity setting instead of the transformations.

All that was needed now was to get it working, so I created a script with two public animator variables (for both the Specimen and point light animations), both of which will enable once the playable character enters the trigger. I also made it so the trigger that the script is attached to will be destroyed afterwards to ensure that the animation can only be played once per playthrough.

To add a more hostile feel to our environment, I decided to implement a light flicker script that (once the game begins) starts a flashing coroutine where the light will constantly activate and deactivate at random intervals (between the minimum and maximum amount of time set), and then attach it to the light objects around the level. Using the same logics that were attached to trigger colliders, I have also made the locker door interactive, so once the player presses the input as prompted, the collider will be destroyed and an animation of the locker door being opened will play, revealing a decayed skeleton behind it.

Note: to rotate the door from its hinges, I created an empty game object, moved the pivot towards the hinged, then attached the locker door to the game object.

Upon receiving some sound files from G.A, I included the atmospheric background music (which was originally meant for the main menu, however, I thought that it was eerie enough to be included within our game environment) as well as the door sound for the interaction with the locker and a thunder sound (that I downloaded from SoundBible) that will play when the Specimen window animation is triggered. To get the latter two sounds working, I added an audio clip variable and a line that plays the sound from the position of the trigger, both of which were added to the appropriate scripts (the Specimen trigger and locker panel interaction). Before using the thunder sound, I had to import it into Adobe Audition so I could reduce a large amount of noise that plays in the background (as it would have broken the player's immersion had it been used in its original state).

Before finishing up with the mechanics, we needed the main menu so the player can either play the game or quit out. To make things easier, I decided to take a snippet shot of the hospital being in view from the surgery room window, then sent the JPG to W.P so he can add in the game and studio logo as well as on screen text telling the player which buttons to press. Before getting it working, both the main menu and warehouse scenes needed to be loaded into the scene manager so the scripts can access them. The script for the main menu consists of two input related if statements; so pressing down the 'E' key will prompt the scene manager to load the warehouse scene, while pressing 'ESC' will quit the application.

Tutorials Used During Development: 

  1. strups. (2015). Unity 5 How to play animation on trigger (Free Script Included). [online video] YouTube. Available at: https://www.youtube.com/watch?v=vL7CIvWxq4w [Access Date - 23rd April 2019]

  2. Chau Tran. (2016). Unity Quick Script - Flickering Light. [online video] YouTube. Available at: https://www.youtube.com/watch?v=WRVETgdB-qw [Access Date - 23rd April 2019]

References: 

  1. UNITY TECHNOLOGIES. (2016). Unity Particle Pack 5.x. [online] Unity Asset Store. Available at: https://assetstore.unity.com/packages/essentials/asset-packs/unity-particle-pack-5-x-73777 [Access Date - 22nd April 2019]

  2. Mike Koenig. (2011). Thunder Sounds. [online] SoundBible. Available at: http://soundbible.com/1907-Thunder.html [Access Date - 24th April 2019]

bottom of page