Saturday, April 28, 2018

Game Music

So, some of you might be wondering, how does one make music for the game? Well, there's a few stages in order for you to make one, so in this blog, I will be going down the steps with you, one by one.

Setup and Recording
So for this trimester unit, I collaborated with my audio colleague for the music track(s) for the game. The first thing we needed to note down was what type of song we wanted for the game. And once we've figured out what we want to make, we'll then have to record the audio, depending if you're playing an instrument or not. For the Easter Egg track, I decided to play Moonlight Sonata, meaning that we'll need to record myself playing the piano in one of the many studios here on campus. Once everything is set with the microphones, the software and other nooks and crannies, we can start with the recording. For this track, we used Adobe Audition CC, and we also used an AKG microphone, which from my experience, is very sensitive that it can pick up people's footsteps outside the studio!

Pre-Mixing and Audio Cleaning
Once we were done with the recording the audio, we had to clean the data, as there were white noise and noises from other people outside the studio. In order to do this, we had to clean, normalize and adjust all the levels, in order for us to get a cleaner sound sample. 





Equalizing and Effects Chain
During this step, what we're trying to do is make the audio sound a better, and fit the theme of the game. In order for us to achieve these goals, we needed to equalize the audio - EQ for short. And as a cherry on top, we decided to give it a radio filter, which would make the track sound a lot older and vintage. The following effects chain was used:
Parametric EQ - Radio Filter
Reverb - Gives ambience and width to the sound
Stereo Enhancer - Gives surround and depth to the sound







Mastering and Printing
With the audio file, we'll need to master it, something of a polishing touch, if you will. To do this, we used: Fabfilter Pro EQ 2, Fruity Maximus & Fruity Fast LP 2. After mastering we can then print it into a .wav file. Once we've printed to the .wav file, we can then import that file into the Unity project for us to use. 


Saturday, April 14, 2018

Flocking Steering Behavior

Earlier this year, my new trimester started, and we are tasked to do yet another game. The game my partner and I decided to do was a offline co-op puzzle game. For this trimester, one of the objectives which I needed to meet was a flocking steering behavior. In this blog entry, I will explain to you the things I have learnt for this steering behavior. 

Before I go on and give you a brief explanation on how to implement this steering behavior, I thought I would give you a small insight on the reasons why this steering behavior exists (If you want to know more, the link will be down in the reference list below). The steering behavior is made by Craig Reynolds, in 1986 to simulate a flock of birds and a school of fish, and this was then used in Tim Burton's film, Batman Returns, in 1992. So this shows that not only can this behavior be implemented in games, it can be implemented in film, animations and among other things as well.

On with the explanation then...

In order for me to learn and implement this flocking behavior within the project, I looked at some websites and books about it. One of which I kept coming back to was the tutsplus tutorial page on flocking (reference below). When you want to implement a flocking behavior within your game, you need 3 functions, Alignment, Cohesion and Separation, and the terms used in this behavior are Agents and Neighborhood.

Agents - A fancy word which replaces "game objects". 

Neighborhood - The radius in which an agent enters, will be part of a neighborhood


Alignment()
Alignment() - What this function does is it aligns one agent, with other agents close by, making one neighborhood, that's what this function does. But in terms of technicalities, what it does is it adds the velocity of those agents, and adds them to a computation vector - a total of the vectors, if you will - and it increments how many agents were added within its neighborhood count.



Cohesion()
Cohesion() - What this function does is that it forces all the agents within the flock, to move towards the "center of mass". The way this function accomplishes this is that it adds all the positions of the agents, and this allows the agents to move towards the center of mass.



Separation()
Separation() - This function does exactly what the name says, it separates an agent, away from its neighbors if it gets too close. What this function does is that it takes the positions of the agents, and adds it to the computation vector, and once it gets close enough, the value will be negated, allowing the agent to steer away from the neighborhood. 



References:
Pemmaraju, V. (2013, January 21). 3 Simple Rules of Flocking Behaviors: Alignment, Cohesion, and Separation. Retrieved April 14, 2018, from https://gamedevelopment.tutsplus.com/tutorials/3-simple-rules-of-flocking-behaviors-alignment-cohesion-and-separation--gamedev-3444

Reynolds, C. (Photographer). (2001, September 6). Separation. [digital image]. Retrieved from http://www.red3d.com/cwr/boids/

Reynolds, C. (Photographer). (2001, September 6). Neighborhood. [digital image]. Retrieved from http://www.red3d.com/cwr/boids/

Reynolds, C. (Photographer). (2001, September 6). flocking_around_19 . [digital image]. Retrieved from http://www.red3d.com/cwr/boids/