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.





























































































Monday, December 18, 2017

Lets Talk about: Showcase

Yesterday was showcase, where people, ranging from people from the industry and the public, came out to test out our projects! Our Games Lab was filled with students from further Studio units, and of course the people that came to try our game. 




The Experience:
My first showcase experience went rather eventful. There were a few bugs within the game, but with the help from my lecture, I managed to get the game back up on its feet.. sort of. But we managed to get the core mechanics working, and a panel popping up when the character dies, however there was a bug that prevented the users to restart the game using the buttons and a winning panel wouldn't pop up after the character had escaped. So in order to restart the game, we had to press Alt + F4 and re-launch the unity launcher. 

The Feedback:
After the audience had tested our game, we had them to leave their feedback on a form which we stored. The feedback we received was good, it was what I expected. The majority of the feedback said that the level was too dark, the buttons needed to be fixed and instead of restarting the game using Alt + F4 and re-launching the game. For future projects, I will focus on the game state changes to ensure smooth game transitioning, and learn more on how to make an effective game manager. 

Overall, showcase was a fun experience, and I can't wait to proceed next to Studio 2, where we learn more about AI, and we will be mixed in with the Studio 3 students, which will allow our game to have a multiplayer aspect in our project. With the showcase event and the new found knowledge of AI and other new things that I learnt in this trimester, I wish to add onto this project during the break as a side project.

Saturday, December 16, 2017

Lets talk about: Animators and their pipeline

So for this week, I managed to do some animating! Nothing big, I animated a simple wooden axe, with the help from my group member, Yousef Atout. This post might be a bit long, but if you guys want to know how they work and how I animated a model, read below!

How I animated my model:
So, the process of animating a model goes as follows:
At first, I tried to look for a reference image. What this means is that I was looking for an image to base my model off of. Essentially, it serves as a means of guideline for the me, just so that it resembles and looks like an axe, in my case atleast. Once I found my reference image, now I had to make the object. To start off with, I made a plane, and then this turned out to the handle of the axe. I forgot to mention, the software I was using was 3dsMax. In 3dsMax, I was able to play around with the vertices, which allowed me to change the shape of an object. So for an example, if I were to take a square, and move one of the vertices, I would have an uneven 4 sided shape. In order to make a shape which has more curves or a much more sophisticated model, I would need to make this object an editable poly, which allows me to edit the object to have more edges, more vertices, faces and much more. For the first step, its more of a rinse and repeat sort of thing, where you have to make more edges, or more vertices if the model you're making doesn't add up with the reference model. 

Once the overall model was complete, it was time for me to texture the object. In order to texture, you need to unwrap the model, with a process called UVW unwrap. What a UVW unwrap essentially does is it makes the model flat, and whatever is inside this unwrap, will be textured. During this process, you need to isolate and separate which parts of the model should be what texture. So with the axe, I would need to separate the metal head and the wooden handle from one another, as they should have different textures. 

Then, after the unwrap process has been done, I can now start to texture my model. To do this, I needed to export my model as an FBX file, which allowed Substance Painter, a texturing program, to recognize this file. Once I've imported the file into substance painter, I could now start texturing. The reason why I used Substance Painter was that the program allows the animator to texture the model like as if they were painting the texture onto the model. In substance, you can add textures and more materials onto each other or as an individual material/texture, and you can play around with it, to find a texture/material to suit your needs. And voila, a fully textured and modeled axe was made!

The ways of the trade, animators' pipeline:
So for this unit, I had to sit down and see how the animators work, in general. So their pipeline goes as follows:
1 - Concept Arts: In this step, the animators will start to make simple concept arts for the project that the group has agreed to. So the concept arts will include the characters (both enemies and main character(s)), props, vehicles, map design and whatnot.

2 - Referencing: In this step, they will have to find mood boards. What mood boards are is a way for the animators to show their facilitators on how the game will look like. The animators were allowed to find images from games to help the facilitators know what type of aesthetic and visual effects the project might have, in relation to the mood boards. 

3 - Modelling the props and characters: This step is a little straight-forward. After showing the concept art, references and mood boards, to the facilitator and being approved by them, they will now be able to start working on the props and characters.

4 - Unwrapping and texturing the models

5 - Skinning and rigging characters: Skinning and rigging are methods one needs to do in order to animate a model. Animations will be applied to models which needs modelling, this is the case for the main character and other characters within the game/project. 

6 - Environment assembly and environment texturing/polishing: In this step, it allows the animators to give the games developers a fully textured map, with all the lighting and props available within the scene. What this means is that they make the map, model the map and texture map, including the environment (props, walls, etc.)

7 - Animating, baking and exporting the animations to the games developer(s)

8 - Rendering and composing the renders into a video format: For this last step in their pipeline, the animators will have to render all the models that they have made and put them onto a turntable. A turntable is like a podium or platform with all the models that they made, like a showcase. This will allow the facilitators to grade their work.