CTIN 583
Welcome!
background image credit: all-free-download.com
So We're Online
- Currently through January 24
- This will be week by week


One projection for California

-
Read through the slides and get started on the W2 self-assessment assignment
-
Come up with questions, preferably starting with "why"
-
I will chat with you in pairs outside, and ask you for your question
-
At the end we will do a somewhat silly self-intro
Why are We Here?
Curiosity
Persistence
Creativity
Forgiveness
About the Course
Feel comfortable prototyping in Unity
Make something you're proud of


Eiffel Tower image credit: Wikimedia
About the Course
-
Unity the application
-
C# and the Unity API (how you talk to it from code)
-
Visual Studio, a tool for writing code
-
Perforce, a tool for managing code
-
Tools and techniques specific to game development
What is it like to learn to code?
image credit: Sascha Kasper

image credit: Sascha Kasper

image credit: devops.com


This part of the curve feels terrible
image credit: Wikimedia
Learning is feeling like you don't know what you're doing and making mistakes.
image credit: Wikimedia
Procedural knowledge
set up a collision, import an animation
Conceptual knowledge
what is a component? what is the game loop?
Abstract reasoning and pattern recognition
should I use a list here? what is the information in
my game and how will I represent it?
Kinds of Learning
image credit: Wikimedia
A lot of what you do in Unity consists of following a procedure like "click this, type that".
Many of these procedures are very long, with dozens of steps.
What can you do to manage this?
Memorize the Odyssey
What are some ways you can make this course harder for yourself?
Challenge:
Make Your Life Harder
Stretch break
Open Unity
Challenge:
Make Your Life Harder
- Don't do the work (including in class)
- Don't take care of yourself, esp. SLEEP
- Use a trackpad and avoid external monitors
- Only open Unity 1-2 days a week
- Struggle for hours at a time, don't come to office hours or ask for help
Challenge:
Make Your Life Harder
- Compare yourself to others, or tell yourself you're bad at game dev
- Don't take notes or synthesize
- Expect no bugs
- Assume that anything is easy :}
- Only work with friends
Class Resources
Discord, Drive, Perforce
These tools are an extension of the classroom. Be polite and professional.
Don't understand the homework? Need tech support?
#questions channel
Going to be absent? Have a question about a grade?
DM me on Discord
Please don't email me.
Change your name on the server:
- If you don't see a list on the right, click the human shapes at the top.
- Right-click on your name and choose Server Settings.
- Type your real name in the Nickname field.
On Discord
-
Your name, preferred pronouns, and degree
-
An example of a game character OR animal you think is cool. You can explain if you want.
"I'm Margaret, I use she/her, and my MFA was in Design and Technology. I like pelicans because they fly in formations."
On Discord
In the #for-fun-and-memes channel, introduce yourself:
About Me
- game designer/developer, teaching at USC Games since 2013
- previously web developer/UX for 14 years: MTV Networks, Synopsys, various startups
- interested in representing environmental issues, experimental narrative structures, how to teach technology better
About You
About You
- You're a smart, talented, hardworking person
- You've got some familiarity with Unity
- You've worked with code, even if you don't feel comfortable with it
- You want to understand Unity better so you can use it as a creative tool
Stretch break
Now let's meet
Unity
Editor Panels
image credit: gamedevacademy.org

See if you can make your Unity window look like this.
Try this!
Create a cube (or sphere or capsule or cylinder):
GameObject -> 3D Object -> Cube
What changes?

image credit: gigi.nullneuron.net
Try this!
Press the W key.
Then click on the cube in the Scene and drag it around.
What changes while you are dragging? (There are at least two things on screen that change.)

Try this!
Now create a Material:
Assets -> Create -> Material
What changes?

Try this!
Hint: it's not the Scene view or the Inspector. Keep making materials if you need to.

Editor Panels
image credit: gamedevacademy.org

Can you figure out what each of these is for?

image credit: noobtuts.com
Editor Panels
- Project - Your files
- Hierarchy - Your game level
- Scene - Also your game level
- Game - Your game (when it's running)
- Console - Messages from Unity and your scripts
- Inspector - The components of whatever you've selected
What is
A CUBE,
really?

Try this!
Create an empty GameObject:
GameObject -> Create Empty
Click on it and look at the Inspector.

Try this!
Create a Light:
GameObject -> Light -> Directional Light
Click on it and look at the Inspector. What is different?

What is a GameObject?
It's just a container for components.
You can make a GameObject act like a light, a camera, or your favorite game character by adding the right components.
Everything you can see in the Hierarchy or Scene is a GameObject.
Try this!
Click on your cube again.
- Look at the Inspector and find the component called "Cube (Mesh Filter)".
- Click on the tiny target on the right side. You'll see a little window.
- In the window, choose Cylinder.


Try this!
You'll see something like this. Can you tell what's going on?

Try this!
The green shape is the Collider, which is still a box. But the Renderer component was told to render a cylinder.
So in the game it looks like a cylinder, but will act like a box as far as physics.

What are all these components?
Transform: where
Mesh Filter: visible shape
Box Collider: physics shape
Mesh Renderer: draws the Mesh
Components need information
Transform: three sets of three numbers
Mesh Filter: mesh (file)
Box Collider: numbers for gravity etc.
Mesh Renderer: material (file)
Set a phone timer for five minutes. Make a terrible sculpture out of cubes, cylinders, spheres, etc.
Challenge:
Make A Sculpture
Stretch break
What is a game engine?
A game engine is a piece of software that helps you make games.
Modern engines usually have two parts:
- the engine itself, a library of code that you can talk to from scripts to tell it what to do
- a visual editor where you can assemble your assets (sounds, models, sprites, etc.)
Some engines are specialized. For example, Twine makes it easy to write interactive text stories.
RPGMaker has special tools for making role-playing games, like inventory, maps, and skill trees.


Twine image credit: pixelkin.org, RPGMaker image credit: softpedia.com
Unity and Unreal
Unity and Unreal are general purpose engines. They take care of some common things that many kinds of games need to do, like
- simulating physics, including collisions
- drawing stuff onto the screen (rendering)
- processing input from game pads, mouse, etc.
The alternative would be writing your own code to
- read and write files
- read in a 3d model, add perspective, lighting and shadows, and turn it into pixels
- check for collisions between objects
- process input from the serial port
Tradeoffs
- You can only make games for the platforms (PlayStation, Android, OS X) that the engine supports
- You have to understand how the engine works
- You are accepting a particular idea of what a game is and isn't. For example, Twine thinks a game is a text story and it would be hard to make an FPS with it
Think of a game and game engine that go poorly together. That is, choose a genre of game and then think of an engine that would make it hard to develop.
Challenge:
Bad Combo
Habits


Image credit: Bitmoji

Image credit: Hyperbole and a Half
Changing a habit is the hardest thing.
Make sure you succeed early and often.
Look forward and imagine setbacks.
When you fail, treat it as a problem to solve.
Unity Concepts
A scene is the basic file you are working on in Unity.





.docx
.psd
.unity
A scene contains GameObjects.

Image credit: Nintendo, via gamerevolution.com



GameObjects can "contain" other GameObjects. In Unity terms, one transform can be the parent of another.
GameObjects in turn have components that determine what they do.



So this is one way to think about the hierarchy.
If you want to draw (render) an object onto the screen, it needs a renderer component.

If an object moves or collides with other objects, it needs physics components like colliders and rigidbodies.

Other built-in Unity components can help with networking, animation, AI, audio, and more.

When you write a C# script, it's just one more kind of component.

Why do the GameObjects called "Grnd" and "Cloud" have different components?
In other words, what does the ground do that the cloud doesn't?
Challenge:
Components
Stretch break
Games have to update stuff constantly. Game engines use a loop to update everything in the game world. One time through the loop is called a frame.
Here is a simplified version of Unity's core loop.
The Core Loop
Unity can do things like play animations and simulate things colliding without any code.
With code, you can tell Unity to respond to events: move things when the player presses a key, play a sound when two objects collide, and so on.
The Core Loop
Unity gives you ways to tie into different parts of its core loop from code and tell it what to do. This is what you're doing when you write code for Unity – hooking into things it's already doing.
We'll talk about the details more in the next class.
The Core Loop
Syllabus
On the shared drive
Syllabus Highlights
- Late work policy
- Attendance
- Grading of Unity homework
- Academic integrity
- Ask me to explain or show something again. I am happy to do this. Interrupting is okay.
- If you have a problem that's only affecting you, e.g. in a lab or demo, you can message the SA on Discord.
In class
Academic Integrity
- It's normal and good to copy or adapt someone else's code. If you copy 3 or more lines and do not modify them, you must provide credit.
- Provide credit (usually just a URL) for all art, sound, and other assets that you don't personally make.
- You'll get a template with a bare-bones credits scene in a couple of weeks. Meanwhile you can provide a Google doc with your builds.
Challenge
See if you can add, remove, enable, disable, and modify the components of a GameObject. You will probably have to look online to understand enable/disable.
Challenge
Create a Material, change its Albedo color and apply it to a Cube.
Next Time
- Review class schedule and syllabus.
- Get started writing scripts that run in Unity.
- Assemble a game from parts and make a build.
Homework
See the assignments page.
Here is the direct link to the
W2 self-assessment
It is not due until next week -- the idea is to give you a goal as you are reading the materials for today.
CTIN 583 - W1 Mon Jan 10 - 2022 Spring
By Margaret Moser
CTIN 583 - W1 Mon Jan 10 - 2022 Spring
Welcome. Why are we here? What is a game engine? GameObjects and components.
- 453