Making the Music Cont. 3/4

header_01

After my last blog post, Alex placed the music in the game to see how complimentary it would be in-game. It is fascinating to see how a game – and even the music – changes when they are brought together. After a few highly competitive trial rounds, we ran into a problem….

When we listened to the music on its own, we collectively agreed that it would be a great fit for the socCar level. It had a nice electronic sound, seemed to have a soccer anthem within it, and we couldn’t wait to see how it played. Since it was a backbone, there was initial feedback asking for some more depth and added sounds. ß do we need this? I’d say get rid of it.

BUUUUUUT………as soon as we began to play the game with the music in it, we realized that intead of adding personality to the game, it actually slowed it down. The game seemed to drag, the cars felt slower and scoring a goal didn’t feel as exciting as it should. The music needed to be faster, with more energy.

At this point there are two ways to handle the situation: 1. trash everything and start from scratch, or 2. make some changes to what you have in an effort to salvage and recover.

paper1

Now I am the kind of guy who crumples the whole piece of paper up and tosses it frustratingly at the waste bin. Luckily, my friend Mike – who works with me at Ivory One – stopped me from what I call “rage quitting”. With a simple tempo adjustment, and an added melody, he actually turned the song around. Not only did the song grow, but it now met the requirements we’d set for it after our initial test run.

I brought it to the team, plugged it in the game, and I could see the smiles grow as they raced the soccer ball from one side to the other, smashing, crushing, blasting anything that got in their way. Goals were accompanied by physics defying jumps and wrestle mania taunts. The music no longer got in the way, and the game could breath again. Goooooaaaaaal!!!!

Check out the latest version here:

Making the Music Cont. 2/4

So, the last time we spoke I gave a brief overview of how I create the music for Super Truckin’. As promised, starting today we’ll begin a more in-depth look at that process, as it pertains to each individual level. Although my mind changes depending on my mood, the Future Soccer level is my current favorite, and thus we will begin there…

Imagine playing soccer in space. What would that sound like? This was the challenge Alex and Jason brought to me for this level. A futuristic setting calls for some type of electronic music, so I immediately knew I wanted some nice synths. I didn’t, however, want to lose sight of the fact that this was still a soccer match…it needed an anthem, something with a catchy melody that would be easy to chant. What I needed was the lovechild of the Fifa’s Ole’ and Depeche Mode. Inspiration in hand, I went to work. Once I achieved something that I liked, I used a place holder synth to hold that melody and put it on repeat. With that on loop, I can start to play around with some new ideas.

Next, I started testing out drum patterns until something felt right. Often, I don’t know what I am about to play and begin by just simply hitting random notes. Hearing them play will often spark an idea – as if I am not really playing it, only listening and anticipating what the music might do next. I expected to come out of this song with a simple 4 to the floor kick, with a snare on 2 and 4 (which is common in most electronic music), so I am pleasantly happy with the drums because they have a bit of a hiccup by dropping the last kick.

So at this point I have a melody and a basic drum rhythm…which means it’s time to add some personality – a little bit of flair, if you will. Creativity and an open mind can go far, but patience is really the key in this department. I found this sound that when held sounded neat, but when played percussively had such awesome and different character. I’m a big advocate for trying every avenue when you are creating something – you’ll never know when you’ll create something beautiful out of an idea you almost dismissed for insanity.

Now the song is at a point where it is ear friendly – basically meaning that it’s listenable and easy to understand.  At this point, I’ll let the team listen and get feedback, as well as any concerns. Compliments never hurt either 😉

Our journey for the week is at an end and I’m pleased to share all the put together pieces that make up what I consider the backbone of the music for the Soccer Level.

On an ending note….a word of advice. If I ever find myself overwhelmed and hitting a wall, I either take a break, or start on a different song. It can be frustrating, but even a little bit of progress can create momentum towards completion and sometimes taking a step back is the best thing for the big picture.

Creating Music For The Game

I consider several things when writing music specifically for a video game. Who is going to play the game? What is the content of the game? And most importantly, what does the client want?

Usually the first source of inspiration comes from the people making the game. In this scenario, I ask Alex and Jason what they want to hear. They are good at feeding me ideas that help me understand the feeling they would like to capture. Since the game has various levels – each with a unique theme – we want to make sure to complement each level with the appropriate music.

It is also important to consider the audience of the game and its content.  For example, Super Mario Brothers would not be the same without the iconic kid-friendly melodies that accompany you through the game.  In Super Truckin’ – much like Super Mario Brothers – we hope we can appeal to our inner child in a way that will transcend generational gaps. Because of this, the music will need to have catchy melodies, upbeat rhythms and extend the character of each level.

Giving music structure is important. I don’t sweat the details until I know I have a strong foundation. I typically have at least half of the song composed in some sort of crude fashion before I attempt to perfect anything. In the coming weeks, I will share pieces of music from each level. These examples will show the initial structure of the music. But don’t worry! These are only the crude rough drafts of what will eventually evolve into the stuff that sticks in your head.

I liken my music making process to that of an untalented sculptor. I throw a bunch of stuff together…start to mold and shape it…get rid of anything that isn’t attractive…smooth out the edges…and hopefully end up with something that I wouldn’t mind putting in my garden.

So, I have to write 3 songs for the levels that are currently in Super Truckin’. The team has brainstormed and we have a grasp of what we think will work.  Ill check in next week with my progress. I should probably get to work writing music instead of this blog…

Oh yeah! If you would like to hear some of my music you can check out the following websites:

Latest Track from Ivory One:

www.ivoryone.com/portfolio/

www.dommin.com

Artificial Intelligence (AI) for Super Truckin’

With AI comes many complications. We not only wanted AI for racing, but we wanted it for all of our game types.  I would like to go over what we needed for the game type, what problems happened and how we battled it. If you’d like to see some code let me know! Want be in the beta? contact us!  https://twitter.com/in8bitgames

 -Soccer-

Need: Each AI follows the ball to knock it into the opposing goal.
First thing we needed to add was how to track a single way-point. This is pretty standard and allowing our trucks to follow a way-point was pretty straight forward.
Image

You want to hit a ball… you make the ball the way-point and your done. Right? Wrong! this will allow the AI to just smash into the ball with no clear direction. The soccer field will be like a 5 year old playing pool and smashing the ball off every wall in hopes to  make it in the pocket.

So we thought about adding direction.  Adding this was a little bit more complicated, we had to basically get the AI to get behind the ball and aim it towards the goal. Math cant do this? or can it! We need to know the goal and ball location, the direction in which to hit the ball towards the goal and some math magic to get the arch to go around the ball. Our first test results with this logic.

Image

Whew… we started playing with it… and wow… this made it a lot harder to play against. They would steal the ball away from you and try to knock it towards their goal. It is not perfect but it works pretty well.

The problem with this approach is it acts as if the target is stationary for that moment in time. By the time the next update happens the trajectory changes. This makes the AI not as accurate when the ball is moving quickly.

That is all it really took to get AI working for soccer. Can we make it better? Oh yes, there are many ways to improve it. We could look at the trajectory of the ball, and speed of the vehicle and account that in the algorithm to where it needs to hit the ball. Eventually we will add this but for now the AI is already pretty challenging. If you guys want it to be harder then we wont want to disappoint.

-Hay-

Need: Each player tries to go for the hay and knock it out of the arena
We now have single way-point navigation, all we need to really do is turn off ability for aiming it towards a soccer goal. Sweet! Done and done…  until we tried it….
Image

They became experts in finding the hay, and knocking it out before you ever have a chance to get to it as well.  They were impossible to play against and it wasnt fun.

So we added Object avoidance Which i will explain later. not only are they trying to always hit the hay, but they are actively trying to avoid it as well. This nifty trick made them just easy enough to be playable. They don’t score every time they get the hay just like a real player would.

-Racing-

Need: Each player follows the track.
So adding onto the single way-point system we already have. we needed to add more to be able to allow the AI to follow a track. Awesome, easy enough. Just make the way-point a list of way-points and when it gets close to the current way-point make it go to the next one.
Image

So now we have an AI set up for our racing level but this is when we saw problems we were not expecting.

The problem we had with this approach was we have several areas that a vehicle can get knocked into (such as the quad jump and hills they can fall off of) and how does the AI react when this happens? Right now they will keep trying to get to the next way-point and get stuck on a wall. So how we battled this was to implement zones. This allowed the AI to validate that this is the zone it should be in, and if not to react by either going to a new way-point or follow the track where it dropped like a normal player would.

Bad behavior:
Image
Good behavior with Zones:
Image

AWESOME! it looks like we have a way-point system and a zone system that the AI follows and if knocked out of either system it can figure its way back. We now have pretty amazing race AI.

-Object Avoidance-

I believe this needed its own section because we have now integrated this behavior in each of our AI’s.
  • In every Level (especially racing) the trucks would pile up  leaning into each other as they go to a way-point, ball or hay. This caused the trucks to crash and slow down and didn’t look fluid. I could easily pass them when they are in this state. 
  • Early tests on the Soccer level you would see the vehicles stuck against a wall because they were trying to go through the wall to get to the other side of the ball.
  • Testing the hay level they would pile up more than hitting the hay as well as clipping edges of jumps and causing them to lose control all the time.

The answer to these issues is to make the cars see. we basically gave them eyes so that they can listen to things around them and react. This changed our game. This made the AI react in ways that were more what a player would. It felt they were more human when obstacles popped up.

 Image

we added ray’s in front of the vehicles  that listen to touching objects such as cars, sides of jumps, and walls. Left ray is touched turn to the right, right ray is touched turn to the left.

We could add the barral mine to the things to avoid but this gif wouldn’t have been as awesome.

It has been a lot of trial and error. Testing constantly with and without people. We think we have solid AI for each level and each having completely different behaviors. Are we done with the AI? nope! We do plan to constantly improve and balance each level to make them as fun as possible.

Thank you guys for reading and check back often for more awesome posts! If you guys want more information about anything else we have done please let us know!

Compiling Super Truckin’ for Ouya

We received a free Ouya (thanks Ouya!) at the GDC Next event last week and I spent today with the goal of trying to compile our Super Truckin’ Soccer level for it. For those of you that don’t know, the Ouya is essentially an Android based game console, so it should be simple to take an Android game and port it over.

We took the first step today and thanks to some friendly Redditor’s over on the /R/Unity3D forum, we got some excellent advice and tutorials that guided us through the process.

Largely we followed this tutorial (http://www.stevetack.com/ouya_unity_tutorial_01.html) which got us just about 90% there, but we did run into two problems not mentioned in the tutorial.

  1. We struggled with getting the ADB driver installed because Windows 8.1 doesn’t allow you to install unsigned drivers unless you are in a special startup mode. HowToGeek.com had me covered though http://www.howtogeek.com/167723/how-to-disable-driver-signature-verification-on-64-bit-windows-8.1-so-that-you-can-install-unsigned-drivers/
  2. When I first launched the game on the Ouya it immediately crashed and we found another forum that recommended compiling the Java, Plugin, and NDK components that are available on the Ouya Panel in Unity3D in addition to the normal compile. A quick recompile of those (in any particular order it seems) and a Rebuild + Run and Super Truckin’ was running on the Ouya!OuyaPanel

Unfortunately at this point the game is running at a lackluster frame rate, so I am going to have to now consider two things. Do we spend the time optimizing for the Ouya (reducing poly’s, textures, particles…) so that it runs well, and then if so, how much of the controller support should we implement? The Ouya controller has some reputation on the internet and after utilizing it it’s not a horrible controller, but it’s definitely not the best.

What do you think, should we take the extra effort and try and make the game work for the Ouya? Please add a comment in addition to your vote in the poll. We would like to know a little bit more about your reasoning behind the Yay or Nay.