The University of Massachusetts Amherst
Categories
Operating System

Game Programming with Unity3D

Game Development? Where do I start?

First, let me give you the bad news: in order to make a decent game, you have to be a strong programmer. Now for the good news: in order to be a strong programmer, you need to make a game. Everyone has to start somewhere in game development and I recommend starting with a free program called Unity, a powerful cross-platform 3D engine. Unity is not only limited to creating 3D games, but it is also a great program to use to make 2D games as well. The interface and Unity projects might be overwhelming at first glance; however, in reality, learning Unity is no harder than learning ImpactJS or Phaser. Unity already has many tools that make it user-friendly and easy to understand: even for non-programmers. In fact, there are many online tutorials to follow and duplicate. You can find easy to read and short tutorials at the following link: https://unity3d.com/learn/tutorials.

 

Screenshot of my first Unity project

What Else Does Unity3D Offer Outside of Programming? Intro to Assets

In order to import visual aesthetics into your game, you would need to use other resources, besides code. This is where building a team makes it easier to obtain different resources faster, so you can start implementing the game’s functionality. Some resources include 3D models, textures, materials, audio, fonts, sprites, etc. Besides basic 3D objects, such as spheres and cubes, Unity cannot create these assets. There are 3D models, characters, textures, sound effects, music, tools, and even scripts for purchase or download on the Unity Asset store; some downloads are even free! To make your own assets, you could use third party programs, such as:

  • Maya1, 3D Studio Max2, “FilmBox SDK3, and Blender4 to create 3D models, textures, and materials
  • Adobe Photoshop5*, Adobe Illustrator6*, and GIMP7 to make 2D art (Unity suppots PNG, JPEG, TIFF and even layered PSD files directly from Photoshop)
  • Audicity8 and Adobe Audition9* to produce audio, etc.(Unity supports WAV and AIF, ideal for sound effects, and MP3 and OGG for music.

Free 3 year student license for 1 and 2

FilmBox SDK (3) can be used with autodesk’s 3D software and other third party software. 

Free AND open source software are 4, 7, and 8.

The Adobe programs listed (5, 6, and 9*) are discounted through Adobe Campus Agreement for eligible UMass members http://www.it.umass.edu/support/software/adobe-campus-agreement-low-cost-software-personal-use

 

 

What Are Scenes?

Once you have your assets, how do you implement them into your game? Scenes are where you could import your project assets and arrange them to make levels and game screens. On the right, there will be a Hierarchy panel, in which you can order your scenes. In the Project panel, you can create and maintain your assets so you can put them into your scenes.

… So What’s the Programming Bit? Scripting!

Finally, we have our static 3D models, materials, and textures; however, now we need them to have behaviors in order to make the game playable. Unity supports three different types of programming languages: C#, JavaScript and Boo (Boo is similar to Python). You can use whichever programming language you are most comfortable with. To create a new script, such as a C# script, you will need to follow the following steps:

  1. Click Assets > Create > New C# Script
  2. Rename the new script in the Project panel to PlayerScript
  3. Double click the script to open it in MonoDevelop

The default script should look something like this:

using UnityEngine;
using System.Collections;
public class PlayerScript : MonoBehaviour {
        // Use this for initialization
        void Start () {
        }
        
        // Update is called once per frame
        void Update () {
        }
}
Every script has a start() and update() method. The start() method runs once the object, which the script is attached to, is created. The update() method runs once per frame. The scripts would need to check every frame if a variable has been changed or if buttons have been pressed.

I’m Ready To Start Making Games With Other People! Where Do I Go?

You can start programming anywhere, at any time. Some places where you could practice your skills with partners, or with new faces, are at hackathons, game jams, or similar events such as QuackHack and Global Game Jam. Major League Hacking, MLH, also hosts many hackathons across the entire United States, and also in Europe.

 

 

 

 

 

 

 

 

Conclusion

Now that you know how the basics of Unity3D, you can start following tutorials and create the games you’ve always dreamed of making! Make sure to check out these resources listed below

http://answers.unity3d.com/index.html

http://answers.unity3d.com/index.html

 

Unity API for Script Templates:

 

http://docs.unity3d.com/ScriptReference/