Make My First Video Game in 4 Weeks

Hi, thanks for checking out my first video game project!

I've never done any kind of video game programming before but I've always thought it would be cool to be able to make my own games. This seemed like a great opportunity for a beginner like myself. I currently have zero experience using any 3D programs. I've only worked with Photoshop and Illustrator but I have a lot of ideas and I'm eager to transform them into unique gaming experiences! Let's get started...

Create a basic scene inside Unity with primitive game objects in various rotation, scale, and position.

Create and position camera and lighting to adjust the look of the game.

Add materials to objects to give them a fresh look!

Try out the asset store and download new assets for your scene

Build a PC/Mac app or a Web app from the Build Settings menu

I've been following the video guides closely. I haven't strayed far from the program yet. I created a scene that looks a lot like the one in the course videos. I'm still getting familiar with the controls and layout. Here's what I've got so far...

Week 2 - Create a scene with basic movements and interactions using PlayMaker

Tasks

Click on an object to rotate

Press a key to toggle a color change for an object

Make a sound when clicking on an object

Move, rotate, and scale different objects in the scene

Rotate camera once when the game starts, or rotate camera continuously during the game

Press a key to toggle lighting on and off

Progress! I'm still using the previous scene I created, but I've made a few changes. Now the scene has user interaction! You can click on the box to find a surprise inside!!! The camera pans back and forth and I've added sound effects. The background music is a beat I made using Reason. Below is a list of key commands that control the functionality of the scene.

As I finished watching the course videos for week 3 I had a basic version of Breakout constructed but I wanted more...

Personal Goal #1 - Make a scoring system and scoreboard

My first goal was to make a scoring system with a scoreboard displayed at the top corner of the screen. Also to make a variety of objects in the game that trigger different point rewards. I found a tutorial on the Playmaker website that helped me do this easier and faster than I would have done on my own. Here's the link below for anyone interested in creating a scoreboard.

After working the bugs out and finally getting the game to run properly I started feeling a little more comfortable using Playmaker so I decided to try some things out on my own without the help of a tutorial.

Personal Goal #2 -Make a game object change the size of the ball

I wanted to make an object in the game trigger the ball to change in size. Actually two different types of objects, one to make the ball grow in size and one to shrink the ball back to its original size. To do this I created two different global events. One called "Gain Mass" and one called "Lose Mass" (Global events are used to trigger an event to occur from a different object in the game). Then I made a state for each of them:"Grows" and "Shrinks".

After that I made a variable (type: Vector 3) to represent the size of the ball and I named it "Ball Size".

Then I created an action in the "Grows" state called "Vector3 Add XYZ". "Vector3 Add XYZ" is used to add XYZ values to a Vector3 variable. In this action I set the Vector3 Variable to the "Ball Size" variable I created. Then I set Add X to 0.1 and the same for Add Y and Add Z.

Next I made an action in the "Shrinks" state called "Set Scale" and set the value of each X, Y, and Z to 0.1 and left the vector setting at "none".

Then I selected a game object that would trigger the ball to get bigger. In this case I used a trash bag. After creating a Playmaker component on the trash bag and applying a rotate action in the Idle state, I created a "Collision Enter" transition on the Idle state. Then I connected it to a new state called "Destroy". I set an action in this state called "Destroy Self". Above "Destroy Self" I set another action called "Send Event". In this action I set "GameObject" to "Ball" (the object I'm using as the ball in my game) and "Send Event" to "Gain Mass" ("Gain Mass" is the global event I created earlier).

I did the same thing for the object that makes the ball smaller, except in the "Send Event" action I set the "Send Event" setting to "Lose Mass" instead of "Gain Mass".

Finally, I created another action in the "Grows" state called "Set Scale". Set scale is used to set the scale of a game object. I set the vector setting to "Ball Size" and left the XYZ values at "none". It took some trial and error before I figured out that I needed to add this action! I think I just assumed that using the "Vector3 Add XYZ" action would automatically set the new scale. Don't assume. After a few cups of coffee I got it working! :)

I also created a new start state in the "Ball" Playmaker component. This state has a "Set Scale" action that resets the ball size back to its original size every time the game starts over. If this wasn't here the ball would remain whatever size it was before hitting the floor's restart trigger.

Personal Goal #3 -Make a game object change the speed of the ball

I decided to make the speed of the ball increase when it collides with the larger "oil tank" object. This resulted in an effect that I think looks pretty cool. As the ball hits the "oil tank" its explodes and looks as if the force of the explosion launches the ball at a faster speed than it was traveling before.

First I created 2 more global events, one for "Gain Speed" and one for "Lose Speed". Then I made a state for each of them, "Faster" and "Slower".

In the "Faster" state I added an action called "Set Float Value". I did this twice. One for the "X Movement" variable and one for the "Y Movement" variable. In each action I set the float value to -4. This changes the speed the ball travels on each axis from -3 to -4.

Then I went to the Playmaker component of the "Oil Tank" object and added a "Send Event" action to the "Destroy" state (I made sure to put this action above the "Destroy Self" action so that it triggers before the object is destroyed). In the "Send Event" action I set the "GameObject" to "Ball" and I set "Send Event" to "Gain Speed" ("Gain Speed" is the global event I created earlier).

I did the same thing for the "Slower" state except in the "Set Float Value" actions I set the float values to -3 instead of -4 (which returns the ball to its original speed). It all works pretty good besides a few minor glitches here and there (sometimes when the ball hits directly into the corner it moves around all crazy). So far I'm happy with how my game is turning out and I feel like I've been learning a lot these past couple of weeks!

Personal Goal #4 -Make second group of breakable objects appear after first group

After the first scene was looking and functioning OK I set out to make a second group of breakable "barrel" objects. My goal was to make a second group of objects appear on screen after the last remaining object in the first group is destroyed.

The first thing I did was make a parent object named "Group1" and drag all the breakable "Barrel" and "Oil Tank" objects into it, making them child objects. Then I added a Playmaker component to the new "Group1" parent object.

I disabled Group1 and copied it into a new group of barrels under a new parent object named "Group2".

This next part was a bit tricky to figure out. At least for me anyway.

What I did was make it so that when a barrel or oil tank from "Group1" gets broken it sends an event which tells the "Group1" parent object to run a check to see how many children it has left.

I made a global event for "Group1" called "Count Children". This is where the "Send Event" action above gets sent to. "Group1" checks to see how many children it has left by an action called "Get Child Count" located in its Idle state.

After some trial and error I figured out that the "Send Event" action was reaching the "Get Child Count" action in the Idle state of "Group1" sooner than I wanted it to (Group1 would count its number of children before the last child destroyed itself). To avoid this from happening I created a delay in the chain of command. The global event "Count Children" leads to a state I called "Delay Check Out" This state has a "Send Event" action with a delay of 5 seconds, which sends an event to the global event called "Delay Check In" which is connected to the idle state.

Now in the idle state I created another action called "Int Switch". "Int Switch" action is used to send an event based on the value of an integer variable. I also created a new float variable called "Barrel Counter". Then I went back to the "Int Switch" action and set the "Int Variable" to "Barrel Counter". I also set "Int Switches" to 1 and set "Compare Int" to 0. (What this does is triggers an event as soon as the barrel count reaches 0)

Then I created a new state called "Create Group2" and a new global event called "Create Next" and linked them together. I went back to the "Int Switch" action again and set the "Send Event" setting to "Create Next" (the global event I just made).

I set up the "Create Group2" state with an action called "Active Game Object" and linked the game object to "Group2". I checked the boxes for "Activate" and "Recursive".

Finally I linked the "Create Group2" state with a new state called "Destroy" and set it up with a "Destroy Self" action. Then I disabled the "Group2" Parent object and reactivated the "Group1" parent object.

Personal Goal #5 - Find the right sound effects

I found the sound effects I was looking for by searching on Google. The first sound I needed was a metal barrel being struck, for when the ball hits the "barrel" object. I found the specific sound I was looking for fairly quick as Google linked me to a website called freesfx.co.uk. I also found the sound for the "Oil Tank" exploding on the same website. (To download without signing up just right click on the sound you want to download and select "Save Link As") Although I did slightly edit them on Protools after I downloaded them (to clip off the slight delay at the beginning of the sound file). The background music is a beat I made using Logic.

Conclusion - Week 3

Sorry if this read was a bit dry, hopefully it can be of help to someone. Thanks a lot for taking the time to read about my first video game! If you haven't played it yet give it a try here. So far I've spent more of my time toward building the functionality of the game verses trying to make it look pretty. I've had a great time working on it so far and will update my progress soon! Please feel free to comment your opinions and constructive criticisms below.