Sunday, September 9, 2018

Networking - Database Pt. II

After creating your localhost database, with the table containing the user's variables, we can now move on to the next step, putting the database online!

Before we start, you'll need to create an account on 000webhost.com. Their services gives out spaces for your database online, free of charge. And through this blog entry, I will be writing the steps I have taken.

After finishing the php code and finalizing the table, we will need to import our table(s). Concurrently, you'll also have to sign in to your 000webhost site, and create a database there. You will also have to keep track of where you kept your php code (which should be under C > Program Files x86 > XAMPP > htdocs > [PROJECT_NAME]). Underneath 000webhost, there will be a Database tab. From here, you can access their php page, the only difference being that this is the online database, as opposed to your localhost php. You'll also have to access the File Transfer tab, where you'll need to put your php code. And just like that, your game is now online and ready to accept user variables, but, you'll need to do some more code within Unity.

Networking - Database Pt. I

Throughout this trimester, I have been assigned to create the database and the back end coding for our project, Dreadlight. A database or back end essentially means the data storage for all the user ID's, preferences and all. For the Dreadlight project, what we needed were the user's password, email and their username. In this blog, I will be writing about how I managed to tackle this issue.

In order for you to create a database, you will need to download XAMPP. XAMPP allows you to create your own database by using localhost. Imagine localhost as the birth place of your database, it hasn't been published on the internet yet, meaning that no one can use it online. However, you can still use it for testing purposes. Once this step is done, you can create a table. A table keeps the contents in which you want it to keep. A table can be used to keep the properties of objects within the games, such as Item ID's, summary and all, under one big table. For the project, I just created one table, keeping all the user pref's variables (Username, Password and Email). Once your table is complete by filling in the desired fields, you'll have to do some coding with php. There are some tutorials online, especially on YouTube, which can help you out. Link here:
https://www.youtube.com/watch?v=EByl95OMG2o&list=PLTm4FjoXO7ndjPE8JXrJ9MjMfsJv956Qm

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/

Monday, March 5, 2018

A small talk about: Aesthetics and Culture

For this blog entry, I decided to put an info-graphic for my cultural perspectives class. This info-graphic is a way of me arguing that beauty is in the eyes of the beholder, essentially, arguing that beauty is subjective, and this effect could have been a result of your up-bringing, culture and your overall environment whilst growing up.











Compare Starry Night and The Scream. Which painting do you like? Why do you like the painting? Since some argue that beauty or aesthetics have their fundamentals or basics in what makes something beautiful, I've decided to pick paintings. Although beauty or looks or aesthetics can objective, the eye of the beholder will judge if something is beautiful or not.