My second production was called Exodroid and was made in Unity3D using C# and Visual Studio Express. This production took place in March 2009 while I was writing my essay and master thesis , so these are somewhat interconnected.
As game programmer on this project, I gained experience using C# with Unity3D. Furthermore, I took an active part in developing the design and the production itself.
I participated in the project while writing my master thesis, therefore much of the discussion and conclusion is somewhat related to this project.
// Put this script on the triggerbox that has to change the theme music publicclass AudioThemeTrigger : MonoBehaviour { // enable these controls in the editor publicfloat fadeTime = 5.0f; public ThemeFader themeFader;
void Update() { if(triggered) { switch(themeFader) { case ThemeFader.FirstToSecond:
CrossfadeAudio(AudioTheme1,AudioTheme2); break; case ThemeFader.SecondToThird:
CrossfadeAudio(AudioTheme2,AudioTheme3); break; default: break; } } }
privatevoid CrossfadeAudio(Transform t1, Transform t2) { if(t1.transform.audio.volume> t1.transform.audio.minVolume) { //fade out
t1.transform.audio.volume-= t1.transform.audio.maxVolume* Time.deltaTime/ fadeTime; } else {
t1.transform.audio.volume= 0.0f;
t1.transform.audio.Stop(); } if(!t2.transform.audio.isPlaying) { //start the new sound if it is not allready running
t2.transform.audio.Play();
// Get the first child transform with the speified name publicstatic Transform getChildByName(Transform transform, string name) { for(int i =0; i < transform.GetChildCount(); i++) { if(transform.GetChild(i).name== name)return transform.GetChild(i); } thrownew Exception("Cound not find child "+ name +" in "+ transform.name); }
// Returns a random audio clip from the specified array of AudioClips publicstatic AudioClip getRandomAudioClip(AudioClip[] clips) { if(clips !=null) { // Create a list with available clips
List<AudioClip> clipsToChoose =new List<AudioClip>(clips);
// Remove the previous clip from the list if it is there if(lastClip !=null) { for(int i =0; i < clipsToChoose.Count; i++) { if(clipsToChoose[i].name== lastClip.name) {
clipsToChoose.RemoveAt(i); break; } } }
if(clipsToChoose.Count>0) { int randomNb = UnityEngine.Random.Range(0, clipsToChoose.Count);
lastClip = clipsToChoose[randomNb]; return clipsToChoose[randomNb]; } elsethrownew Exception("At least one audioclip has to be passed"); } else { thrownew Exception("At least one audioclip has to be passed"); } }
publicstaticfloat adjustVolumeToDistance(GameObject soundSource, float distanceToZeroVol) {
GameObject player = GameObject.FindGameObjectWithTag("Player"); //getting distance to camera float distance = Vector3.Distance(soundSource.transform.position, player.transform.position); //calculate newVolume float newVol =1-(distance / distanceToZeroVol); //scale according to maxVolume
newVol *= soundSource.audio.maxVolume; //make sure volume is positive or zero if(newVol > 0.0f) soundSource.audio.volume= newVol; else newVol = 0.0f; return newVol; }
// Sets layer for a given transform and for all its children recursively publicstaticvoid setLayer(Transform t, int layer) {
t.gameObject.layer= layer; for(int i =0; i < t.GetChildCount(); i++)
setLayer(t.GetChild(i), layer); } }
Spending time in “the real world” was a great lesson for me. Besides the academic work, described below, I gained first hand experience in what it takes to deliver production quality flash games. Go see the cases Jul i Sonofonhuset and Tron – Light Cycles.
This was a project where I took part as game design and programming intern in Titoonic a/s in late 2008. The production time was one month. My main tasks on the project was game design, sound design, and sound programming (where the sound engine was added to the company’s codebase).
In the early days of computer games the sound was created using simple synthesis techniques, but as the development of better processors and larger storage media, the development lead towards the use of wave-table synthesis, which has become the most used technique in current computer games. Since the introduction of the wave-table synthesis the development in audio creation and playback in games has stagnated.
One of the latest fields within sound synthesis is physically modelled, which holds great potential, within games and interactive environments, because of its more dynamic nature. An area in which very sparse research has been done is measuring the impact of physically modelled sound in computer game environments. This has lead to the following problem statement to be formulated: To which degree does physically modelled sound enhance physical immersion in first person computer games?
This project has analysed theories proposed by several authors within the fields: immersion, narrative and gameplay in computer games, audio in computer games. These fields and their different theories have formed an ontology for the project, upon which an application has been build. The application consists of a Half Life 2 modification, which makes use of the Nintendo Wii controllers, together with a modal sound synthesis.
As human beings, we are dependent on our ability to hear sound in three dimensions since it provides us with many clues about how we are to navigate and behave in our surroundings. The fact that we from birth have been equipped with two ears placed on each side of our head makes us able to perceive the azimuth of a given sound, in fact we are able to localise a sound source within 2 degrees of azimuth; the design of the pinna or outer ear and our torso provides us with the ability to perceive the elevation of a given sound.
During the past decade there has been an increase in interest within 3D sound or spatial audio, both within entertainment, industry, and research; within this period several methods and systems has been developed to reproduce spatial audio. One of the methods is called head-related transfer functions (HRTF), which uses several audio cues in order to provide the listener with a broad spatial soundscape.
Having done my bachelor on games, it is time to move on to something more specific, namely how head-related transfer functions can be used in real time – or actually we have found research on efficient algorithms that simulates HRTF but does not directly use HRTF-databases.
Anyway, as 7th semester medialogy master student at Aalborg University in Copenhagen, I take part in creating an audiovisual augmented reality (AR) installation that uses visual tracking and simulates HRTFs. My interest lies in how 3D-audio can become more vivid without using too much system resources and how important it is (i.e. to what extend people notice differences of off-location spatial audio).
From my part, and my associate mr. Anders Fredslund, we will create an external for Max/MSP that handles HRTF and hopefully it can be used to other than testing our theses.
In this project we did a lot of research in the social factors in play and gaming. We established a framework for describing the immersive factors in a game and tested the framework with a computer augmented card game that displayed the players’ stats in a pseudo–holographic display, which enabled face–to–face communication while following the displayed stats.
How can we improve the advantages of a board game with the technologies provided by a computer?
When the tendency of playing games becomes an asocial thing, it is a scream to the developers to change the course.
The ever growing and impressive features of computer games have long suppressed the power of conventional games. The still fast development in technologies allow for still more extraordinary graphic engines. But what is happening to good old tabletop games.
We have delved into this aspect and investigated the relation between immersion and socialization as a method to create a relation between the idea of board games and the power of computers.
The first production was called Hængerøv and was made in Source SDK using Lua, C++ and Visual Studio 2005. The production took place May 2008.
The game was a 3D platformer where you would play a young boy, that accidentally broke his sister’s new cell phone while secretly tampering with it in his tree house one night. The objective is to collect the missing buttons while evading the furious sister who threatens to embarrass you by showing a picture of your bare bottom to the entire school, but that is not all.
The dark garden is a treacherous place to sneak around. Garden gnomes have come to life and they yodel awfully loud when tripped over, and that is what your sister is waiting for, so she can find you and take your picture.
Your parents aren’t of much help as they are having a garden party. Empty wine bottles can also give up your position, and so can the (not-so-scary-almost-pathetic) ghosts that are haunting the garden.
Fortunately you are armed with your Bug Vacuum Gun, that can suck up the ghost. The downside of it is that it attracts your sister’s attention as well.
The only chance of avoiding total embarrassment is to return the fixed mobile to your sister before her boyfriend calls her.