Thursday, 13 March 2014

unit 73 - sound

----Audio-----
We all had to add our own music and sounds to our games.
This in turn gave each of our games a unique sound and original sourced sound.

So I set off to the sound rooms to record audio for my game, I accomplished this by using a Zoom microphone, which each time that I recorded a sound it was split into a new audio file which I then sent to audacity and tweaked to fit my needs.
A similar process to what I did for my 'Zero Hour' zombie movie project:
http://kassianzerohour.blogspot.co.uk/
During the production of 'Zero Hour' the dialogue was recorded post production to ensure the cleanest cut of audio possible without any background interference, a similar method to what I did for my game sounds.
 

A selection of the audio clips I gathered for this project using the zoom microphone.
Tristan and I recorded a variety of sounds for our projects ranging from pushing toy cars for a rattling sound to a metal screw falling onto the floor to emulate a coin sound, through the miracle process of foley effects I was able to get sounds that sounded like other things and make parts that already worked well into smaller segments so that I could work with.

For example; blowing into an empty bottle provided a nice ambient wind sound effect, this could have become part of a level to give it a more open and wild feel. That is the basic principal of Foley effects and a technique that is used as an industry standard among radio, film and interactive media.

In addition to the recorded sounds I had created I also had various music that I had made in garage band which I also added into my game.
as no game is complete without music i didn't want to leave this one unchecked, and the music creation process for garage band was simple enough to get some nice sounding tracks with ease.
Garage band has a repository of audio samples that I was able to put together to create music for my project ranging from drums, classical piano to more elaborate instruments such as japanese flutes.
and using the short pre-recorded clips (averaging at  a second to 2 seconds) I put it together to make fitting music for each of the games.

After recording I had a bountiful selection of different sounds that all had practical uses, however, I found that a lot of things I had recorded didn't have any place within the games, maybe I could keep them for a later project or maybe they were utterly pointless, I didn't know. but it was definitely good practice to have a wide selection of audio i could use and play with in hopes of getting stuff I could utilize.



Once i had finished recording the audio it came down to the process of trimming the RAW audio down into usable segments.

Starting with the full audio segment i select parts i don't need and cut them out, (this includes such things s describing the sound before recording it so i could name it post editing)

Once trimming was done I had to edit the clip.
Now, i'm net exactly an expert so most of what I did was very basic, changing pitch or tempo to give the audio a different feel.

 With the trimming and editing the original raw audio that was comprised of yawning during a conversation has now been altered into a blood curdling dinosaur roar.


the whole process i had done before on another scale when i did a short radio play with friends, having used audacity in the past did help to create these sound effects
https://soundcloud.com/kassiantyler/public-transport-man
once editing was finished I ended up with a few sound effects of about 1-3 seconds long
in fact i was able to get more use out of sounds that were not originally intended to be recorded thanks to editing effects of audacity.
With sound effects acquired i applied them to my games and was set to go from there.
Although the process of using original sounds does give the game it's own unique sounding appeal doing it myself is both time consuming and taxing, and another reason why game companies are often comprised of many people working with different aspects.
i do appreciate this method of gathering sounds but it's definitely not for everyone.



Essay:


Sound, well we all know what sound is to an extent, it's anything we hear, but there is more technical variations on sound. for example, sound is considered to be a wavelength, that travels through means of air pressure. causing vibrations in the air which our eardrums can recognise as sound.
and as a vibration it is a myth that an opera singer can sing at a pitch that would shatter glass, all though impossible it can be done with sound.

Now, to a recording device, sound is picked up in a wave format which is often visually represented like the below picture.
if you could hear said picture it would become louder as the intensity of the lines grows.
so if you were to listen to the first few seconds it would be louder than if you were to sample the last few seconds.

A more easy to show example would be a file of mine hosted on sound based website soundcloud/
https://soundcloud.com/kassiantyler/public-transport-man
as you can see, or hear, the volume increases or decreases at the spikes or drops in what i like to call "the audio mountains"


This graph shows amplitude over time. “Amplitude is directly related to the acoustic energy or intensity of a sound. Both amplitude and intensity are related to sound's power. All three of these characteristics have their own related standardised measurements… Amplitude is measured in the amount of force applied over an area. The most common unit of measurement of force applied to an area for acoustic study is the Newtons per square meter (N/m2).” - http://www.indiana.edu/~emusic/acoustics/amplitude.htm - 05/03/14




so that leaves us with the all important question, what is the meaning of life?
OK, maybe not that question, more like, how is this relevant information with interactive media and games design?
quite simply because sound can express a lot of things visuals cannot.
say you wanted a game where a player walked down a spooky hallway to a scary skeleton that pops out and gives the player a right fright, sure it may make you jump a little bit if you did it without sound, but if you had footstep sounds or even a faint beating heartbeat you would increase the tension dramatically.

Sound can be used for so many things, in fact Hollywood have twisted our perception of sounds in some cases, something like a gunshot would be different when fired, much quieter in fact.
granted fortunately most of us don't hear gunshots frequently, but it's still a notable point where sound overcomes reality in film.

“Up to 40% of a film’s emotional impact is being caused by its music.” Tristan remains unsure where this quote is from, though i myself have heard it over the years.
but the idea that 40% is sound, it's very much a significant thing in film.
and as games have become a lot more cinematic and more advanced than a simple side scrolling platformer, it stands to reason that sound is definitely at that 40% point in video games too.

As sound editor Marvin M. Kerner says in The Art of the Sound Effects Editor, "the function of sound effects is three-fold:
To simulate reality.
To add or create something off scene that is not really there.
To help the director create a mood.
-
http://www.infoplease.com/cig/movies-flicks-film/sound-effects-functions.html


that's a lot of detail about sound in industry, time for some more nitty gritty stuff.
on the technical side of sound there are different types of audio, analogue audio and digital. Now what are they? “It all has to do with how you record a sound. An analog recording copies sound as a continuous electronic signal. A graph of an analog signal might look like this.”



now a days, advances in analog-to-digital conversion methods have vastly increased the quality of digital recordings. it's often stated that high sampling rates and increased precision remove any distinction between digital and analog. all though you can find a sizable faction arguing against this, some should be refereed to as "Audiophiles" people who want the highest quality in sound systems possible. they often tend to say that an analogue system would provide better sound than a digital system.

“Generally, the air pressure variations are first converted (by a transducer such as a microphone) into an electrical analog signal in which either the instantaneous voltage or current is directly proportional to the instantaneous air pressure (or is a function of the pressure). The variations of the electrical signal in turn are converted to variations in the recording medium by a recording machine such as a tape recorder or record cutter—the variable property of the medium is modulated by the signal.” - http://en.wikipedia.org/wiki/Comparison_of_analog_and_digital_recording - 05/03/14

Two prominent differences in functionality are the bandwidth and the signal-to-noise ratio (S/N); however, both digital and analog systems have inherent strengths and weaknesses. The bandwidth of an analog system is dependent by the physical capabilities of the analog circuits. The bit depth of the digitisation process first limits the S/N of a digital system, but the electronic implementation of the digital audio circuit introduces additional noise. In an analog system, other natural analog noise sources exist, such as flicker noise and imperfections in the recording medium.

A digital recording is produced by converting the physical properties of the original sound into a a sequence of binary (or something similar). This sequence can then be stored and then decoded and played.
mostly you're looking at digital sound being a wav, mp3 or any other digital file format, preferably if you're working with making a sound you want it to be in a file format that is the least compressing, so an mp3 would lower the audio quality, whereas a Flac file wouldn't as much.

in closing, audio is a strange world that is intertwined with almost all forms of media, aside from something like print, but that's a given.
but you will find audio in almost anything.

Thursday, 6 February 2014

goals

thursday 6th feb:
 Till break:

   Continue concept art for final major project

 till lunch:
    Work on music for game (3D)

Tuesday, 14 January 2014

Unity games



 I started this first project by following a tutorial found on youtube.
as my knowledge of javascript, and coding is general is limited i found this a great help to creating the game.
 Firstly I had to put in some controls that allowed me to move the ball around.
this code allows me to move along the horizontal plane using the 'A' and 'D' keys; which is the basics for a 2d game.

in the scene view I put in some objects, the ball and the large rectangle.
the ball is the player and the rectangle is the ground.

the above script was applied to the ball to give it the ability to move along the X axis.
______________________________________________________________


















After i had the ability to move along the X axis, i needed to add more functionality, so the ability to jump was added. Using the 'w' key the player object/ball was able to raise by 8 on the Y axis.
originally there was an issue where you could jump indefinitely, but thanks to some "if" statements it was made possible to only give the 'w' key functionality when it was in contact with the ground.

















i then set the camera to always focus on the ball and move with it accordingly, so instead of a static camera the focused on a single area, the camera now followed the ball as it moved.
after the ability to jump was implemented and the following camera i also added a skybox to the main camera giving the game a better look, rather than the basic blue background.

____________________________________________________________

i had to add a function to reset the game if the player fell off the platform.
when the player get's lower than '-10' on the Y axis they are returned to the start of the level.
this prevented the player from falling indefinitely.

I also switched the light from a point light to a directional light.
unfortunately the free version of Unity doesn't offer a point light with shadows, and the point light was only illuminating a single area.
the directional light (or as I named it '_sun') has the ability to give objects shadows, and applies to the whole scene, making it a better solution than having multiple light throughout the level





I added a coin collectable into the game to add more of a goal for the player to gain. these coins disappeared on collision with the player, and were later changed to give a score when collected. 

__________________________________________________
i added a rotation animation to the coin so that it spun and slightly moved up and down in a looping fashion before it was collected.

Particle effects were added to the coin, this made firework like visuals to appear for two seconds when the player collided and 'destroyed'/collects the coin

Alltough the coins seemed to be collected on collision with the player, they didn't actually have a real function, because of this, a score system had to be implemented


A new GUI was implemented to keep track of the score when the player picked up a coin.
however this function if broken at the time this part of the post is being written.
when the coin is turned into a Prefab to use around the level in the scene view you can place multiple coins at different areas within the level.
however when the game is played the coins turn into a single coin and give points = to the amount of coins used in game.

for example if i were to put 5 coins around a level and played the game, there would only be 1 coin, but instead of a single point, it would give me 5. 



This is the point where the web tutorial ended, so I decided to browse the unity assets store to find something nice to improve the game.
I found a nice terrain to add in to make the game seem more in depth.
instead of being a brick wall floating in the sky, now this new terrain game it a feeling of more depth and a more 3D looking environment.










I toyed with the idea of moving the game over to a 3D environment as i was completely stuck for ideas.
and it somewhat worked, although i couldn't get the camera or movement to work the way i wanted, so i gave up on that pipe dream


i could have put in a final little ending for this game, although due to time constraints i was unable, despite it being as simple as modifying the code for the coins and placing it on a platform that sends you to the next level.


______________________________________________________________

 3D game:

with the loss of my original 3D game idea i had little over a week to start and finish a full game, in hindsight not the best plan, but i was determined to at least have something that functions 
So after a few "fun"larious discussions with a few people i had my idea.
the adventures of Jizz-e the pimp, now i knew i wouldn't be able to get a full working game start to finish out, but i atleast thought i could get something done.
so i got to work, with a simple beginning, and unlike the previous game, unity has the character controller needed for 3d First person games, so i was able to just add that and be free from messing with the camera.

i put in a little light and a floor and you were able to move around,
...on a block with nothing to do in the middle of nowhere.

still, another easy thing to do i learned from the last project was to just add the skybox, so i threw on the nice night time one.

now this game was to be a little different from the basicball one, here you needed to actually kill stuff.
so this melee system was worked in.

However, there was a fatal flaw i could hardly work out.
i toiled and toiled trying to find the soloution
 then i found my answer:

i had forgotten to capitalise the "U" in "Function Update ( )"
so despite casing me half a day in headaches, that issue was over. 


i added in a cylinder to become an enemy and that was out of the way.
-----------------------------

With the melee system functioning i needed to have a weapon, and what other weapon would a pimp use other than a pimp cane.... aside from a gun, but that's not important.

i modeled this cane in cinema4D and at first it had issues when importing.
the textures only showed on the inside of the model.

i tried everything, exporting to FBX or keeping it as a c4d file.
in the end i decided to move on a find a solution later.

at this point i changed the light from a point light to a directional light to allow shadows to render.

then i added a crosshair, it has a little flair to it with the dollars, but i wanted it to be a little over the top.

And atlast, i was able to fix my imported model, the issue was easily solved,
all i had to do was "Reverse normals" in c4d to make it render properly.

i animated several functions, so it had a movement when you walked as if you were using the cane to walk with, although not really fluid, it worked slightly well.

there was also another animation for sprinting when you hold shift, although that hadn't come out right, and a sprint function didn't even work.
still you can hold shift to see this animation.

and finally the attack animation, i wanted a swing that hit with the end of the cane, and it's there.
although there is an issue where the animation doesn't play over other animations, an issue i tried in vain to fix, but i gave up as time was running short, so then i moved on.

i did also try to get the attack damage apply mid animation, but that didn't work out, so i scrapped that idea.

i got skankzilla out of the way, using a model i found online, then i edited the texture and changed the model slightly. and there you have skankzilla

after placing her in the game i applied a mesh and she was ready to be worked on
 (although i completely forgot to add the enemy script to her)

with that done, i created the terrain.
i wanted to have a slightly different feel in a few environments  so i added a few in
  • a grassy lane
  • the woods
  • canyon
  • dead plains (dead grass and red and orange)
  • the final zone
i think they did work quite well, although they do feel empty



 then i had to edit the actual trees, and good god it took a long time.
at first i thought i could just brush them in using the terrain options.


but there was a problem.
once they were brushed in they didn't have a mesh so you could walk through them, combined with the fact that they dont render as anything other than an unlit 2d image when you were far enough away.

so i had to change it up and add every single tree manually, and that took a long time

----audio-----

thanks to dayrls intervention we all had to add our own music and sounds to our games.

me and tristan recorded a variety of sounds, and i also had various music that i had made in garageband.
so i was able to add them in.

although most of the sound effects were just from random things i thought i should record just in case.

most of the sound effects i did get seemed pointless and unusable.
but a few were salvageable



i then got down to trimming the sounds down from their 30 second audio tracks.
and ended up with a few sound effects of about 1-3 seconds long
infact i was able to get more use out of sounds of coughing or tristan yawning thanks to editing effects of audacity.
i applied them to the game, but some were very problematic, and still as it stands the game lacks the required amount of sounds... still 1 day to hand that bit in, i can still do it... i hope.


------------------------------things i forgot to mention----------------------
there were a few things that deserve honourable mention.
first of all is this bridge.
i really love the way that this model came out, i wasn't expecting anything amazing, but from what it turned out to be i think this bridge worked pretty well.
there are 3 across the map that lead the player to more of the jewels.

 I did take the score system from my basic ball game and apply it to these jewels, it was my hope i could change it up to become ammo for the weapon shown. (dollar wad) so that if you got a 1 for score you would have 1 shot of ammo to use.
this never came to fuition despite how much the game was driven by this idea.

another thing you may notice in this screenshot is the money.
this is a projectile based weapon that would shoot dollar bills at enemies, although i never had time to implement it.
it does have a nice glowing effect with the particle dollars that float around it.

this torch was also modeled, although i was aiming for something more rustic and bent looking, this seemed like a better idea when it came to having it everywhere on the map.

the fire is created by particles, 2 particle systems in fact, one for the flames themselves, and another for the smoke that rises from the flames.
this also generates light and is one of the only things other than the jewels to do so.




another major thing i wanted to implement was another GUI, a health bar, 
i designed this on myself. and it worked on 10hp per bar (assuming the player has 100 hp to start with)



i'm a little disappointed i was unable to implement this, as i really love the look and feel of the bar.

so that's my "game" i gave it my all as soon as i had the idea, and in the future i'll probably work on it again as a personal side project, until then though final major project time.