Intro To Unity
Hello! Welcome to Intro To Unity. This page functions as an overview of what we will cover during the course, full of links to resources and further reading.
The specific meeting dates for the A1 section of this micro course are Sep 14, Sep 21, Sep 28. The specific meeting dates for the A2 section of this micro course are Oct 27, Nov 3, Nov 10.
The course meets in Hunt Library room 106C, 4pm-6:50pm.
This course is designed for students with little to no experience working with game engines as entry point into the field of game development. Students will learn the basics of the Unity3D engine, and to creatively and effectively build their own simple games. This course will cover topics such as navigating and using the engine, basic game programming in C#, user interface development and introductory game design principles. Students will be assessed based on the functionality of their games and will receive further feedback on their implementation, execution and creativity.
Table Of Contents
- Intro To Unity
- Table Of Contents
- Course Topics
- Assignment Information
About The Course
This course takes place over 3 weekends. The final project is to make a game. The course is pass/fail, which means that how much you get out of the course is largely up to you. Ie: effort in -> knowledge out. There is a minimum passing amount to learn, so yes - if you have previous experience with programming, you will have at least somewhat of an easier time. I encourage you to explore more (and ask questions) in the direction of your interests, and focus on making sure you get the most out of the course.
Unity has a significant initial learning curve. The abstract goal of the course can be simplified to two parts:
- Provide an introduction to the fundamentals of the Unity Game Engine, Game Design conepts, and C# programming.
- Provide the "tools" to continue teaching yourself unity.
That second one requires further breakddown: I want to teach you how to teach yourself Unity. That means problem solving techniques, ways to think about situations, and the ability to navigate, filter, and utilize resources.
What is Unity
Unity is a lot. Its's a game engine. It's an Interactive Environment Editor. It's a System for controlling states with user input. It's an input->output piping system. It's a complex digital media manipulator. It's a 3D environment with fluff. It's a platform.
Unity Makes Making Games Easier
With this goal, it makes making many things that are not games easier too. People make interactive art, live projections, apps, and, like, just SO MCUH with Unity.
Difficult things Unity makes easier: - Real Time 3D Object manipulation and display - Cross Platform Input Control - Camera Effects and Manipulation - Terrain Generation - Multiplayer Networking - AI Navigation and Pathfinding - 3D Sound Handling - Connecting to third party services - Animation (timeline, curves, frame-based, event triggering) - UI - Real Time Physics Calculations - Sprite Maps, Tile Maps, - VR Platform Integration - Multi-target Builds (write code once, publish anywhere)
This list is inexhaustive. Unity is a lot. Unity is extensisible, which means we can add code other people wrote to it. Not just game assets like 3D models, but things that make Unity itself more powerful. For example, a recent update folded a 3D modeling tool called ProBuilder into the official release!
Games made in Unity
- Monument Valley
- I Am Bread
- Crossy Road
- Gang Beasts
- Kerbal Space Program
- Tilt Brush
- Her Story
- Manifold Garden
- The Long Dark
What Unity Is Not
While Unity makes making games easier, it does not make making games easy. It cares about lowering the technical bar (and the "tedius" bar, if that's a thing) to executing game design. It does not care about lowering the conceptual bar to executing game design.
It is just a tool. It's an interface. It's piping. It does not create assets or design things or implemenet mechanics. It will not realize your dream for you.
The asset store is good... but it isn't great.
There are some things you need to know before you take this class.
- You should play video games. Play some games this week and think about all you can with crafting the experience you are having.
- You should understand 3-Dimensional spaces. This means algebra but probably not calculus. You should know how we represent 3 dimensional spaces on 2 dimensional screens. Keywords that you should have an understanding of: (axis, x,y,z, perspective, orthographic, depth of field, speed/velocity/acceleration).
- Cartesion Coordinate Systems. You should be able to represent an objects position in 3 dimensional space on an XYZ grid, and how we talk about it.
- Vectors. You need to know what Vectors are. You will not need to, yet, understand euclidian angles, which Unity also uses. Here's a video about Vectors. You need to know what it means to add Vectors together, and what it means to multiply a vector by a number, and what it means to "normalize" a vector.
- Basic Software and Computer Skills. I will be talking quickly about user interface elements, keyboard shortcuts, alt-tabbing around, file types, folder structures, and lots of other computer things you should know.
- Researching and Documentation Using. You should be able to google things real good, and filter out bad, unrelated, and out of date information. This will get easier as you learn more about unity and programming. You need to learn how to ask the right questions, anbd you should have a general idea of what that might mean.
- Be able to have bad ideas. You should be able to fail gloriously. Lose well. Embrace weirdness. Look at ugly things and see the little beautiful thing inside of them. You shoul dbe able to come up with a list of 10 ideas where 10 of them are really bad ideas you are not proud of.
- You should have unity installed before class.
Unity updates regularly, on a 3 month calendar. This is a new update schedule, it used to be occasional versions. So you used to have Unity 4.1, 5.4, 5.6, so on. Now it's 2017.1, 2017.2, 2017.3, 2017.4. There are four stable ("LTS" or "Long Term Support") releases they will put out each year.
You can use any version of Unity that is at least version 5. If you don't know, get the most recent non-beta version. If you already have one installed, then your don't have to worry about messing with updates. Consider updating to 2018.3, as I will make source code for projects available.
Unity is free, but you do need a Unity account.
Generally, developers will use one version of Unity for a project, and not risk updating during that projects development. Many developers have multiple versions of unity installed. It's sort of a running gag in the community. Unity recently made this mess easier to manage with something called the Unity Hub. It manages multiple versions of Unity, and helps manage projects - making sure you open them in the right version. If you are installing Unity for the first time, install the Unity Hub and 2018.3.2, which is the most recent stable version as of me typing this.
Go to this page and click "Download Unity Hub (Preview)", and with the hub, install 2019.2. For Add-ons, make sure Windows Build Support is installed. I recommend WebGL build support too.
Setting a Text Editor up with Unity
Unity is NOT a text editor. The coding will be done in another piece of software. You can use lots of other pieces of software. You can use notepad.txt, or vim, or emacs. I recommend none of these.
I recommend Visual Studio Code. Not to be confused with "Microsoft Visual Studio" (which also easily supports unity). It's nicer looking and easier to extend than MonoDevelop, and has the easiest and clearest instructions to setup with Unity. (ie: don't use sublime or atom unless you already use them and know how to mess with packages).
- Visual Studio Code (install, Setup for Unity, Unity theme, ).
- Sublime Text (Install, Setup for Unity.
- Atom (Install,C# support)
The Course Has Three Parts
- Unity, The engine
- C# Programming
- Game Design Concepts
I assume no prior programming knowledge. Many of you will have prior programming knowledge. This course will be easy and slow at times. That's fine. Work ahead while I talk. Feel free to not follow along while very bored, but run off and challenge yourself to do something interesting in Unity.
What we will cover, and links to resources/videos that also cover this. The course is interesting because there is really no ideal order to teach things in. I have to start with a whole bunch of seemingly disconnected things that won't make much sense until more things start to fall into place.
But don't worry, get past this initial phase, trust that I am teaching you important things, and one day it's going to start clicking.
Please please please jump around, follow you interests, and dig around in the documentation.
- The Unity Interface. (Review: Unity docs, Docs: The main windows, Unity for Creative Coders, some youtuber, pdf not video).
- The Inspector (docs)
- Scenes (Docs)
- Game Objects and Components (Review: Short Official Video,, Board to Bits)
- Transforms (docs)
- Unity Project Structure (Board to Bits)
- C# in Unity 101 (official training videos, hour long training for beginner, rbarraza's videos help too)
- Rigidbody components (docs)
- Game Design (Game Feel, HL2 Invisible Tutorial, Mega Man Classic vs. Mega Man X, Keeping Players Engaged)
By the end of the class, you will have a project that is similar to if you followed this online tutorial.
You may want to check out this Interactive Tutorial too.
- Review Assignments/Show us something!
- Prefabs (Board to bits)
- Tags and Layers (docs)
- Physics Settings (docs)
- Instantiating Object (yt)
- Code Flow and Loops (YT For Loops 1, YT For loops 2)
- Collision Events and Collisions
- What scripts do/when to seperate things
- Accessing information that is "over there" (public and private)
- Communicating between scripts and objects (board to bits)
- BOX project submission folder
- Playtesting and Emergent Gameplay
- Follow along Lets make a game!
- Problem Solving Workflow
- Switching Scenes
- Lists (Unity official tut, fast, Slower YT tut).
- Using the Asset Store
- Building the Game
- Final project brainstorming/open Q&A
Assignment 1: Make a level for the ball rolling, become an expert on ONE RANDOM SMALL THING, and incorporate it into the ball rolling game.
Assignment 2: Make a mechanic, Watch a Mark Brown game design video and be ready to talk about it.
Final Assignment: Make a game. Information below.
Most unity resources exist on youtube. Sadly, this is not usually an -efficient way to learn, as most educational youtubers tend to go very slow, explain things poorly, merely talk aloud as they work, are just bad or all of the above.
My most important piece of advice is to search the unity Manual and the Scripting API before googling the open internet. Always always always. Open the page of the official docs on a function before googling how to use it.
Links to youtube Series on Unity that I think are at least okay:
Assignment One: Level/Become an expert on one thing.
Three parts. All fairly simple.
First, watch a video on game design by Mark Brown or [Game Array]. Don’t pick Boss Keys, but otherwise it’s up to you. Find one that looks interesting to you and give it a watch.
Second, make a level for your roll-a-ball game. A beginning, a middle, and end. What qualifies as a “level?” what makes levels good? Do your best, and during class this Saturday we are going to talk about level design, and use our successes and failures with the roll-a-ball as a jumping off point for that conversation. The point here is to open unity, add a bunch of blocks, and practice moving them around.
Third, the real meat of this weeks assignment, you are going to look up and become an expert in one very small thing in unity, and implement it with your roll-a-ball level. Theres a list of ideas below. Some easier than others.
That’s all. This assignment should take about half an hour plus watching a youtube video. If you find yourself really struggling or taking longer (and it isn’t because you’re challenging yourself with something harder), try to meet with me during office hours and I’ll help clear everything up.
IDEAS - Skyboxes (what's a cubemap? What's equirectangular?) - Collision events! OnCollisionEnter() (a platform that falls after you hit it; by changing rb.usegravity) - Triggers and OnTriggerEnter() - Playing a sound (make a crazy piano) - Physics materials. Make a bounce platform! - make Item Pickups - An object that rotates as an obstacle, like a windmill on a minigolf course. - Add various lights of various types and edit and adjust them to make a good-looking level and not necessarily like a disco-wonderland. - Emission Materials and Static Objects. - Tag's Getting all items by a tag and doing something with that. - Layer Masks (and physics collision layers) - Navigation, NavMeshes, And NavMeshAgents, - Unity's Terrain tools - Make the ball have color Selection (change material.color on button press, or maybe just activate and deactivate child objects). Also, activating and deactivating objects. - Trail Renderer component. It's wonderful. (and easy and fun) - Particle Effects. (Be warned, it's easy to get something but hard to get something good. Lots of tweaking and fiddling) - Importing and using textures (make a texture in photoshop (filter>render>clouds, filter>noise>add noise, gradient map, etc); don't use asset store for this. - Import a 3D model and put it inside an invisible sphere (collider), or a super-monkey-ball style mostly-transparent sphere (bonus points for you) - Restart the level on: (easy: a reset button press. harder: collision with a block that has the 'Goal' tag. that you create). - Unity UI and the ever-obtuse rect. Transform., add some overlay text.
Assignment 2: Implement A Mechanic
Brainstorm a handful of ideas for games and their mechanics. Implement a half-working game mechanic in a Unity project.
Pick a game genre. Any game genre (say, platformer). What are the verbs? The actions? What the player can do? In a platformer, that’s run and jump. What are the behaviors? Well, we can single or double jump but no more than that. And the player changes direction instantly, they don’t slide around on the ground usually.
Okay, make just that. Move left right, jump, jump again, don’t be allowed to jump more until you touch the ground again. That’s the mechanic.
So some booleans or int’s (canJump, times Jumped) and some if statements (when input, if (canJump==true), jump); and some collision checks (when we hit something, canJump = true).
There. Mostly working. Done. Close Unity. Go outside. Relax. Play some games. Watch more youtube videos about game design. Sure, this player can jump again when you touch the sides of things or if your player hits their head on the bottom of a platform but… solvable problems. that’s why this assignment is a half-working mechanic, not a fully implemented mechanic.
Puzzle game? Try making item pickups as the mechanic (bool hasKey = true).
Shooting game? Instantiate a bullet from a prefab and give it a force in the direction the player is facing. Can they shoot different types of bullets? Right or left click for now is fine, “gun switching” sounds like more work we don’t need to tackle right now.
Flying game? When you collide with something you should die and maybe spawn some crash particles and make a timer and restart the level after a second or two. Oh man, coroutines! IEnumerators! Fancy!
Gravity controlling puzzle game where you try to get different items into different containers but they all react to your input? One script with a public vector2 that takes the player input, another script you can put on any game object that gets that vector2 (hmm, accessing other script properties? A thing to learn!) and adds the force to itself.
Lemmings game? Make a basic AI that walks forward and turns around when it hits something.
A mechanic where the player has a flashlight and can only use it for a limited time to see anything. Timers! Also known as numbers that count up!
A super monkey ball game where… the player is a rolling ball …(wait no. don’t do this one. No more rolling balls!)
A pinball game? Rigidbody has a nifty AddTorque function. It’s basically addForce but… the object spins instead of moves. But the paddle spins too far? Okay just stick an empty game object with a collider to block it. No code required. Oh wait, the ball hits that thing now? Time to google that “collision layers” thing. (Also maybe physics materials to give things varying degrees of friction and bounciness)
I don’t care what your mechanic is. I just want you to practice implementing a behavior into Unity. I’ve given some ideas above, but part of the assignment is the “what should I do?” and the “how do I do it?” part. I care more about this abstract from-idea-to-logic problem-solving puzzle than your coding ability.
Come to class with something that doesn’t work at all, but you can tell me how you would make it work if you could just figure out how unity does xyz? You’ll still get credit for the assignment if you can show me your attempts.
This assignment should not be a lot of coding work, and if it your idea IS a lot of coding work, simplify it or just ignore parts of it for now (again, half-working). This assignment IS brainstorming an idea for a game mechanic, and puzzling out how might you use basic game logic and functions and scripting to turn that into a reality.
One last thing... Unlike roll-a-ball, you can end up using this for your final project (a game), if you choose.
Final Assignment: Make a game
You will submit a Windows Build of the game (so that I, a windows user, can play it). You should also submit a mac build so everyone can check your game out.
You will also submit a "readme.txt" (or pdf or html or whatever) file that includes your name, information about the game, how to play it, the controls, any credits for anything you have used that you didn't make even if it's public domain, and anything else you want me to know about it before I play.
Thats what I expect. A windows game build and instruction file. NO instruction file? You fail the final assignment. Oof.
What do I mean by "a game"? More like "The Bones of a game". You don't need a menu or multiple levels (probably, but you need a level that has a beginning, middle, and end), and you don't need an instruction/tutorial section. I will read your readme's before playing.
First, some ground rules.
- Rule 1: It can't be roll-the-ball. Period. Not even if it's like, super good.
- Rule 2: You will not be judged on art assets except you should change the default skybox.
- Rule 3: This is a game for a computer. Input options are keyboard, mouse, or gamepad controller (xbox or ps4 via usb). No VR, no AR, no wii-mote, no PS-Eye, no kinect, no LEAP Motion, no Wacom, no webcam. No mobile games. You can build for web and put your game online or on itch.io, but you must still submit a desktop version to me.
- Rule 4: No multiplayer games. Local or online.
- Rule 5: While 2D or 3D is okay, I strongly recommend 3D as that is what we talked about. You can make a "3D"-in-quotes game where things only move about on one plane.
- Rule 6: No following along online step-by-step tutorials. No using complete projects from the asset store. No cheating.
- Rule 7: You must code your core mechanic yourself.
- Rule 8: No text-based, twine, dialogue-tree as mechanic, or other such games. I love them too but sorry. If you want to do a dating sim, let's talk first.
- Rule 9: No group projects. You can work together and help each other (please do), but everyone must submit their own unique game.
The game must demonstrate the following things:
- At least one working, implemented, game mechanic.
- Something that drives player engagement (the fun, the emotion, the challenge, the design)
- Principles of Level and Game Design (Beginning, middle, end, obstacle, winnable. Enemies are clearly enemies. Paths are clearly defined. Player's experiences are guided.)
Question: What about an alternative non-game post-game art-game poem-game? Golan Levin showed me this work by Everest Pipkin, and i'm so inspired!
Answer: No. Go off and do that next, I love it. But this assignment is a game. A game game. No subverting expectations of interactions with games, or whatever.
Question: **I made a roll-the-ball game. ** Answer: You have done nothing.
Question: My game doesn't work/isn't finished! Answer: You must submit SOMETHING by the deadline. Submit the broken game. Do not submit nothing. Email me and ask for an extension and explain why. I will only consider granting an extension if there is a submitted, unfinished/broken game in the folder.
Question: I followed this online tutorial step-by-step! Answer: Literally cheating. Fail.
Question: My game isn't done, but look at all of the amazing 3D models I made for it! I spent 3 straight all-nighters working on the main character. Answer: Good job! Except you didn't do the assignment. Fail.
In the shared BOX folder, you must have a "Your Name" folder.
Inside that folder, a "Windows" subfolder for the windows build. (and, hopefully but not technically required, a "Mac" subfolder with the mac build).
Inside that folder, a zipped (.zip) file containing:
- gamname_Data folder
for windows, and
Inside the "Your Name" folder, you must have a readme file (gamename_readme.txt) that explains the following:
- The name of the game
- A short description of the game
- Credits for all assets and anything used you did not create yourself. Een if it's free to use without credit. If you do not credit something, it may be interpreted as cheating.
- Any credit for anything fancy you DID make yourself, like 3D models. I will probably assume you did not make them, so let me know.
- An explanation of the games core mechanics/systems
- How to play the game
- The controls
- Anything else I should know
- Anything else you want me to know
- You'll get appreciation points if you include a knock-knock joke, proving you read this document.
Again, please submit a broken game over nothing. It may even be enough to pass, even if it doesn't live up to your goals.
- Setup a meeing with me while you work on your final project! I'm way more helpful 1-1 than in class.
- I recommend capturing screenshots and gifs of your process, for your own sake.
- Take a very very small idea and do it okay.
- Do not do a big idea badly.
- Don't make your dream game. This is a learning project, not an execution/perfection project.
- Be absurd. let it be stupid and silly.
- Don't try to shove a 3 act story in here
- Change the damn skybox
- A "get as far as you can" or "try for the high schore" arcade style game is fun. This approach grants you some levity in the "beginning, middle, end" part of the game design. But the game should loop without restarting, in this case.
- It's okay to use assets from the asset store. Please don't buy anything. You cannot use an asset for your core mechanic, and you cannot use a game-asset that has everything done for you. But grab some 3D models, yeah. Unsure if something is okay? email me.
- Work together. Not on the same project, but get together while you work on the assignment.