Difference between revisions of "Unity Course Notes"

From Wikicliki
Jump to: navigation, search
Line 242: Line 242:
  
 
* it happens when the overlap is WITHIN the same object - is 3d modelling issue not because you overlap 2 objects in a scene (if they are seperate object, they will not trigger)
 
* it happens when the overlap is WITHIN the same object - is 3d modelling issue not because you overlap 2 objects in a scene (if they are seperate object, they will not trigger)
 
=== Creating lightmap ===
 
 
* View the baked lightmap on top right
 
* Lightmap format - EXR
 
 
[[File:lightmappanel1.png]]
 
[[File:lightmapexample1.png]]
 
[[File:lightmapexample2.png]]
 
[[File:lightmapexample3.png]]
 
[[File:lightgizmo.png]]
 
[[File:lightbake.png]]
 
 
 
  
 
== Lesson 4 - Intro Scripting in Game Dev==  
 
== Lesson 4 - Intro Scripting in Game Dev==  

Revision as of 03:04, 12 September 2020

Debbie's own notes on a Unity course I am taking towards the Unity Certification.

Lesson 1 - Welcome to Unity Certified Developer Courseware

Conducted by Koh Siang Leng, 5 Sept 2020, 10am

Unityhublts.png

Note how some versions in unity hub have LTS and some do not.

Are you irritated cos unity updated and everything BROKE? Use version of unity LTS "Long term support" - a version which does not accept any new features but will be supported for about 2 years.

Also remember to have a 3 button mouse.

Economics of Games

Unityunity.png

Unity has its own ad platform which makes it easier for a developer to integrate advertising for monetisation. Analytics is used extensively in mobile gaming too. Should be integrated in from the very start... (How?)

Monetise in the form of...

  • Physical Purchase
  • Download
  • Subscription
  • Freemium
  • In game purchase
  • Advertising

Game Genres to think about...

  • Action
  • Adventure
  • Arcade
  • Fighting
  • Non-Game (<-- probably me)
  • Platformer
  • Puzzle
  • Racing
  • RPG
  • Shooter
  • Simulation
  • Sports
  • Strategy
  • Survival
  • Open world etc

Game Design Document and Technical Design Document

  • For small company - the document is nice to read but in practice sometimes along the way people do not update along the way as they are building and playtesting the game.
  • For big company - there is probably a dedicated team doing this all day, that's their job to make the roadmap updated all the time!

Game Production Pipeline

Step 1 Pre-production

  • Create the game design document and technical design document

Step 2 Production

  • Implementing assets and creating game play
  • building the game for release

Step 3 Maintenance

  • Fixing bugs and releasing patches
  • Incremental functionality improvements

Step 4 Upgrade

  • Building and releasing new content
  • Major additions and mods, such as new levels, seasonal content, special release (like upsize of your happy meal - it is easy to upsell when they are always interested in your product)

Job Roles

Unityjobroles.png

THEY WILL TEST THIS IN THE EXAM. take note on art director vs concept artist in particular.

  • Concept art = provides unifying point for art direction (hence commonly confused with art director role)

Getting Started / User Interface

Install the IDE

Set up the interface in an ergonomic way

Unityinterfaceorgsuggested.png

Can even put inspector on its own on a 3rd col on the right.

Creating Game Object

Creategameobject.png

Child & Parent Objects

Creategameobjectchild.png

Tagging

Tagginggameobject.png

  • What is the purpose of tagging? (common question in unity exam) - We say its used to find gameobjects (not grouping). It doesn't matter to Unity what is the gameobject tag. Its for the developer to find items with same tags.

Importing from Asset Store

Importzombie.png

GameObject Settings

Linkspritesheet.png

Transform (moving)

You can be precise about the position you move in Inspector

Transformunity.png

Importing Packages the right way

Importcustom.png

  • Often there are clashes with basic assets like main camera, you can overwrite them all usually and ignore the warning.

Arranging Prefabs

  • (Mac) Command-D to copy, Command drag to drag with snapping (Ctrl-D for windows)
  • Command-delete to delete the prefab
  • Common rookie mistakes by students - trying to drag into the game instead of scene editor, or double clicking into editing the prefab itself instead of the scene
  • Create empty gameobject, put all the blocks inside it so this container holds all your blocks

Navigation

  • Window > AI > Navigation > Clear & Bake
  • Change Agent size and other values to tune your pathfinding

Createsceneandbakenavigation.png

  • Created an empty and put the maincamera as a child of the hero and its like a fps (3rd person view)! It works! (trainer approved)

Basicgamenityplatform.gif

Game Level Design

  • A game could be composed of several different levels.
  • With level design, you can progressively teach the player new skills in the game (hidden tutorials)

Examples of Game Level Design:

  • Basketball shooter game: a level design would occupy a finite space, be bounded to a basketball size with walls, have a basket on either end, and floor markings to indictate the play area.
  • 2D platformer games: consists of one continguous continuous background. level design elements are to facilitate game mechanic, placement of elements don't correspond to real world placement as much as game mechanic.
  • 3D shooter: level design dictated by mechanics of the game - cover mechanism allows player to duck behind objects, placement of objects and lighting allows game to be played effectively.
  • Endless Runner: obstacles test the player's reflexes, bounding or side wall conditions, overhead and underfoot tracks/wires elements.
  • Zombie Toys: cover for player, enemies in form of props, concealment point
  • Trainer shared an example of a game level design map drawn by his children. boss levels and all. :-D

Difficulty of game level

  • must not be too hard
  • must allow user to gain mastery progressively
  • after user has mastery, they will find it harder to stop playing your game

Lesson 2 - Managing Project, assets, game level

Additional Box Collider

  • Let's say you have many elements, what if your player decides to do a weird wall hug and squeeze thru your buildings and perhaps fall off the game map entirely?
  • In Inspector > Add additional box collider > Extend your collider
  • Remember to set your collidable items as "static"

Rigidbody

Rigidbodyunity.png

Raycast

Project Management

  • Naming convention
  • can be simple (human readable) or have a system (requires a legend for universal understanding amongst team members
  • eg in animation, dope sheet

Shaders

Shaderunity.png

  • Albedo map - flat colour without light
  • Normal map - makes detail on surface
  • Occlusion - shadow map
  • Emission - emit light

Cutout

Unitycutout.png

  • Shader > Cutout For alpha channel artwork - adds complexity quickly

Cookie

Cookieandcutoutps.png Cookieandcutout.png

quiz qn examples

  • The breadcrumb in project window shows: FILE PATH OF SELECTED ASSET (you must select it first)
  • Acceptable formats for audio are: AIFF, MP3, WAV, and OGG. (Unacceptable -> MIDI, RCA, IFF, QuickTime, Egg, wav, avi)
  • Project Window toolbar allows searching assets by: Label and Type
  • Modifying organisation of assets is done in PROJECT WINDOW (assets is just your files on the computer)
  • The 2 script types supported are C# and UnityScript
  • specular property controls COLOUR and STRENGTH of reflection
  • the material property controls spreading of light on microsurface details: SMOOTHNESS
  • material rendering mode uses black in an alpha channel to define where material is exactly NOT appearing - CUTOUT
  • The albedo of a material is defined as: colour of the material without lighting data

debbie tries... to make it a mobile app

Myfirstmobilegame1.png Myfirstmobilegame2.png

  • result: had to reinstall OpenJDK. must add open scene. build is fine. but colours look washed out. why?

answer from trainer: mobile must use mobile shader, AR must use AR shader.

  • what i have learnt: cannot anyhowly just compile your desktop version as mobile version, have to redo all the shaders and interface and everything

Skybox

Window > Rendering > Lighting Setting > can set different skybox environment and other overall lighting settings

Lightingunityskybox.png

Reflective / Metallic Shader

  • Can use reflection probe to calculate it.
  • A Reflection Probe is rather like a camera that captures a spherical view of its surroundings in all directions. The captured image is then stored as a Cubemap that can be used by objects with reflective materials.
  • Several reflection probes can be used in a given scene and objects can be set to use the cubemap produced by the nearest probe. The result is that the reflections on the object can change convincingly according to its environment.

Lesson 3 - Lighting and animation

Introduction to Game Lighting

  • The scene can look very different by just changing the light (number, placement, rotation, type of light) - use to create different feeling in the game

Examplelightinggames.png Examplelightinggames2.png

  • Using lighting to highlight elements to place certain things in focus and get dynamic effects
  • Using normal maps to create more surface detail for an object

Debbie's digression: how to create photoshop normal map =

  • Open texture in Photoshop as you would normally any image. Image must be set to RGB.
  • Choose Filter > 3D > Generate Normal Map

Photoshopgeneratenormals1.png


Games vs film

  • Games lighting - baked (pre-enabled) and calculated real time, performance and number of lights depend on platform, ray-traced shadow may cause performance lag, but realtime global illumination is possible depending on platform used, all rendering is on one platform
  • Film lighting - completely rendered before showing, no platform dependent performance, ray-traced shadows used extensively, pre-calculated global illumination is widely used (even more realistic), rendering power can be distributed to renderfarm
  • Debbie wonders: why doesnt everyone just go and use realtime game lighting? It is because it has to be done on one platform, cannot be distributed to speed up the production.


Types of Lights in Unity

  • Spot Light
  • Directional Light
  • Point Light
  • Area Light - rectangular light used for baking only (WILL NOT SHOW IF NOT BAKED, unlike the rest of the lights) - governed by width and height, you probably won't use this unless lighting an interior design or something pretty fixed. Is used to fake certain glows.
  • Skybox

Objects in scene with overlapping UV

Overlappinguvalert.png Please see this webpage for more information about objects with overlapping UVs: https://docs.unity3d.com/Manual/ProgressiveLightmapper-UVOverlap.html

  • it happens when the overlap is WITHIN the same object - is 3d modelling issue not because you overlap 2 objects in a scene (if they are seperate object, they will not trigger)

Lesson 4 - Intro Scripting in Game Dev

Lesson 5 - navigation / pathfinding / player allies enemies

Lesson 6 - Particle Systems

Lesson 7 - audio, camera, player selection, system, user interface

Lesson 8 - building and prepping for mobile deploy

Certification Exam

  • 100 questions pulled randomly from a bank - mcq, drag and drop, matching, hotspot
  • 90 mins to complete
  • must score 70% to earn Unity Certified Developer
  • Unity Exam shortcut section - based on PC

Beyond Unity

  • Unity isn't the game for every sort of game. Can also consider Cocos-2dx.