Unity 3D - fenix.tecnico.ulisboa.pt · What is Unity? “Unity is the ultimate game development...

40
Unity 3D Rafael Kuffner dos Anjos

Transcript of Unity 3D - fenix.tecnico.ulisboa.pt · What is Unity? “Unity is the ultimate game development...

Page 1: Unity 3D - fenix.tecnico.ulisboa.pt · What is Unity? “Unity is the ultimate game development platform. Use Unity to build high-quality 3D and 2D games, deploy them across mobile,

Unity 3DRafael Kuffner dos Anjos

Page 2: Unity 3D - fenix.tecnico.ulisboa.pt · What is Unity? “Unity is the ultimate game development platform. Use Unity to build high-quality 3D and 2D games, deploy them across mobile,

Now is the moment I draw your

attention to this class by showing

some cool videos

Page 3: Unity 3D - fenix.tecnico.ulisboa.pt · What is Unity? “Unity is the ultimate game development platform. Use Unity to build high-quality 3D and 2D games, deploy them across mobile,

Showcase Video 2018- Book of the Dead

Page 4: Unity 3D - fenix.tecnico.ulisboa.pt · What is Unity? “Unity is the ultimate game development platform. Use Unity to build high-quality 3D and 2D games, deploy them across mobile,

Demo - Iluminação

Page 5: Unity 3D - fenix.tecnico.ulisboa.pt · What is Unity? “Unity is the ultimate game development platform. Use Unity to build high-quality 3D and 2D games, deploy them across mobile,

Best of Unity

Page 6: Unity 3D - fenix.tecnico.ulisboa.pt · What is Unity? “Unity is the ultimate game development platform. Use Unity to build high-quality 3D and 2D games, deploy them across mobile,

• What is Unity? Pros and Cons

• Scenes, Game Objects, Components and Prefabs

• Unity Editor

• UI Development

• Project asset folder structure and organization

• Team workflow issues and solutions

• Editor extensions and tooling

• Editor target platform

• Unity Cloud Build

AGENDA

Page 7: Unity 3D - fenix.tecnico.ulisboa.pt · What is Unity? “Unity is the ultimate game development platform. Use Unity to build high-quality 3D and 2D games, deploy them across mobile,

What is Unity?

“Unity is the ultimate game development platform. Use Unity to build

high-quality 3D and 2D games, deploy them across mobile, desktop,

VR/AR, consoles or the Web, and connect with loyal and enthusiastic

players and customers.” – Unity themselves

Page 8: Unity 3D - fenix.tecnico.ulisboa.pt · What is Unity? “Unity is the ultimate game development platform. Use Unity to build high-quality 3D and 2D games, deploy them across mobile,

Unity – Pros and Cons

Pros 25+ platforms across mobile, desktop, console, TV, VR, AR and the Web.

Same code-base for all platforms.

Out-of-the-box engine features: animation; physics; lighting; etc.

Quick integration of assets: images, audio, 3D models, animations, etc.

Everybody uses it. Lots of support.

Everyone works in the same tool (developers, designers, etc).

Quick prototyping.

Page 9: Unity 3D - fenix.tecnico.ulisboa.pt · What is Unity? “Unity is the ultimate game development platform. Use Unity to build high-quality 3D and 2D games, deploy them across mobile,

Unity – Pros and Cons

Cons

Web browser WebGL target platform is recent, and has limitations.

In mobile/tablet devices, the Unity app consumes more battery than a

native app.

Still needs some effort to make a game fully supported by several

platforms (graphics, input, networking, etc).

Requires some team effort to properly manage development with large

teams.

No access to source code, limits some interactions.

Defaults are not that pretty.

Page 10: Unity 3D - fenix.tecnico.ulisboa.pt · What is Unity? “Unity is the ultimate game development platform. Use Unity to build high-quality 3D and 2D games, deploy them across mobile,

Basic concepts

Tanks Tutorial (files in the asset store)

https://oc.unity3d.com/index.php/s/n6P1VcTa4NWQbyn?_ga=

2.155302844.647951730.1524485268-605512209.1524485268

Page 11: Unity 3D - fenix.tecnico.ulisboa.pt · What is Unity? “Unity is the ultimate game development platform. Use Unity to build high-quality 3D and 2D games, deploy them across mobile,

Game Objects & Components

Game Objects are containers for Components. Which can be Colliders, Meshes, Audio sources, Scripts, Visual effects, etc.

Every Game Object has a Transform component with its position, orientation and scale.

One object in the game can be composed of several game objects (remember scene graph from CG)

Links:

http://docs.unity3d.com/Manual/class-GameObject.html

http://docs.unity3d.com/Manual/Components.html

Page 12: Unity 3D - fenix.tecnico.ulisboa.pt · What is Unity? “Unity is the ultimate game development platform. Use Unity to build high-quality 3D and 2D games, deploy them across mobile,

Scenes

Scenes contain the objects of the game (Game Objects).

In each Scene the environments, obstacles, and decorations can be

placed, essentially designing and building the game in pieces.

The Scene also contains objects that manipulate the game but have no

visual representation.

Page 13: Unity 3D - fenix.tecnico.ulisboa.pt · What is Unity? “Unity is the ultimate game development platform. Use Unity to build high-quality 3D and 2D games, deploy them across mobile,

Prefabs Prefabs are pre-configured Game

Objects that can be used as

templates in the Scene.

They can be instantiated at any time

(through code, or dragging them into

the scene).

Changes made to the Prefab can be

spread to its instances even in

different scenes.

Can be tricky to manage if you start

making local changes.

Link:

http://docs.unity3d.com/Manual/Prefabs.html

https://unity3d.com/learn/tutorials/modules/beginner/editor/

prefabs-concept-usage?playlist=17090

Page 14: Unity 3D - fenix.tecnico.ulisboa.pt · What is Unity? “Unity is the ultimate game development platform. Use Unity to build high-quality 3D and 2D games, deploy them across mobile,

MonoBehaviour

Base class for most of the Unity things

Has defined events that are automatically

called at the appropriate time (Start, Awake,

Update, OnDisable, OnGui, OnPreRender, etc)

Can be minimal so each specific behaviour has

its own individual script attached to na object

(movement, shooting, camera, visual effects,

etc)

Page 15: Unity 3D - fenix.tecnico.ulisboa.pt · What is Unity? “Unity is the ultimate game development platform. Use Unity to build high-quality 3D and 2D games, deploy them across mobile,

Unity Editor

Links:

http://docs.unity3d.com/Manual/LearningtheInterface.html

http://docs.unity3d.com/Manual/UsingTheEditor.html

Page 16: Unity 3D - fenix.tecnico.ulisboa.pt · What is Unity? “Unity is the ultimate game development platform. Use Unity to build high-quality 3D and 2D games, deploy them across mobile,

Scene and Game windows

Links:

http://docs.unity3d.com/Manual/UsingTheSceneView.html

http://docs.unity3d.com/Manual/GameView.html

Scene view is where we construct the

game

Game window shows the final result

Clicking Play the game is executed in

the editor

Cannot make changes during play

mode (won’t save)

Useful to have both visible for debug.

Game window can be adjusted to

several different window sizes to test

different devices.

Page 17: Unity 3D - fenix.tecnico.ulisboa.pt · What is Unity? “Unity is the ultimate game development platform. Use Unity to build high-quality 3D and 2D games, deploy them across mobile,

Hierarchy and Project

Links:

http://docs.unity3d.com/Manual/Hierarchy.html

http://docs.unity3d.com/Manual/ProjectView.html

Hierarchy describes textually

everything that is in the scene.

The object hierarchy can be seen and

altered here (or through code)

Project window shows everything

inside the “Assets” folder of your

Unity Project.

You can drag things from the Project

to the Scene or Hierarchy.

Page 18: Unity 3D - fenix.tecnico.ulisboa.pt · What is Unity? “Unity is the ultimate game development platform. Use Unity to build high-quality 3D and 2D games, deploy them across mobile,

Inspector

Link:

http://docs.unity3d.com/Manual/UsingTheInspector.html

The Inspector is used to view and edit the properties and settings of Game

Objects, Assets, and other preferences and settings in the Editor. Adding

components can be done through here.

Page 19: Unity 3D - fenix.tecnico.ulisboa.pt · What is Unity? “Unity is the ultimate game development platform. Use Unity to build high-quality 3D and 2D games, deploy them across mobile,

Profiler

Link: http://docs.unity3d.com/Manual/ProfilerWindow.html

Shows you where your resources are being

spent. Network, CPU, GPU, Memory, etc.

If “Deep Profile” is enabled, you can go to

function level.

Page 20: Unity 3D - fenix.tecnico.ulisboa.pt · What is Unity? “Unity is the ultimate game development platform. Use Unity to build high-quality 3D and 2D games, deploy them across mobile,

UI development

In Unity the UI can be developed as a set of special Game Objects that

contain “Rect Transforms” instead of Transforms.

This allows apply anchors to the UI element or configure it to stretch

when responding to different screensizes.

Links:

http://docs.unity3d.com/Manual/UICanvas.html

http://docs.unity3d.com/Manual/UIBasicLayout.html

http://docs.unity3d.com/Manual/UIVisualComponents.html

Page 21: Unity 3D - fenix.tecnico.ulisboa.pt · What is Unity? “Unity is the ultimate game development platform. Use Unity to build high-quality 3D and 2D games, deploy them across mobile,

Particles Objects that emid small particles in different shapes

Can be fine tuned to create effects such as smoke, fire, trails, etc.

Accessible through code so can be activated on special events

Page 22: Unity 3D - fenix.tecnico.ulisboa.pt · What is Unity? “Unity is the ultimate game development platform. Use Unity to build high-quality 3D and 2D games, deploy them across mobile,

Asset Store Lots of basic models so you can get started with something

Tutorials added by Unity people

Tools to help you develop things.

You can sell your tools and make some Money.

Cons: The best things are incredibly expensive

Page 23: Unity 3D - fenix.tecnico.ulisboa.pt · What is Unity? “Unity is the ultimate game development platform. Use Unity to build high-quality 3D and 2D games, deploy them across mobile,

Recommended

Literature

(this is a joke)

Page 24: Unity 3D - fenix.tecnico.ulisboa.pt · What is Unity? “Unity is the ultimate game development platform. Use Unity to build high-quality 3D and 2D games, deploy them across mobile,

Virtual Reality

Supports all popular headsets.

Your camera object uses

orientation (and possibly

position) information from

device.

Setup is litteraly a couple of

clicks, your programming won’t

change.

Page 25: Unity 3D - fenix.tecnico.ulisboa.pt · What is Unity? “Unity is the ultimate game development platform. Use Unity to build high-quality 3D and 2D games, deploy them across mobile,

Project asset Folder & Organization

In an Unity project, the project asset folder is

usually structured by the type of assets.

Inside each type folder, the assets can be

organized by context/functionality.

Note: There are some asset folder names

which are reserved for special behaviours:

“Editor”, “Gizmos”, “Plugins”, etc.

Things that can be loaded in real time have to

be inside the “Resources” folder

Link:

http://www.glenstevens.ca/unity3d-best-practices/#Structure

http://docs.unity3d.com/Manual/SpecialFolders.html

Page 26: Unity 3D - fenix.tecnico.ulisboa.pt · What is Unity? “Unity is the ultimate game development platform. Use Unity to build high-quality 3D and 2D games, deploy them across mobile,

Team workflow Issues and SolutionsIssues:

Scenes are complicated to “share” between developers.

It is not easy (and not recommended) to merge changes in Scenes.

Same thing happens for Prefabs.

Solutions:

Create as many Scenes and Prefabs as needed.

Separate Scenes for development (e.g., UI development Scene, Puzzle

development Scene, ...) and for release.

Create Prefabs for development and release.

Page 27: Unity 3D - fenix.tecnico.ulisboa.pt · What is Unity? “Unity is the ultimate game development platform. Use Unity to build high-quality 3D and 2D games, deploy them across mobile,

Editor Extensions and Tooling

It is possible to extend the Unity Editor with custom-made windows.

Components can be extended for extra interactions or debug tooling.

Page 28: Unity 3D - fenix.tecnico.ulisboa.pt · What is Unity? “Unity is the ultimate game development platform. Use Unity to build high-quality 3D and 2D games, deploy them across mobile,

Editor target platform

In Unity, it is possible to change which platform the project will be developed in.

This allows to simulate some constraints from the target platform, such as, graphical constraints, screen sizes, etc.

Page 29: Unity 3D - fenix.tecnico.ulisboa.pt · What is Unity? “Unity is the ultimate game development platform. Use Unity to build high-quality 3D and 2D games, deploy them across mobile,

Unity Cloud Build

Unity Cloud Build is a continuous-integration platform that allowsdevelopers to perform builds directly from the project’s repository.

This platform is web-based, therefore there is no need for the Unity Editorto make a new build of the game.

• It allows to share build links to

external parties.

• Has a mobile webpage which

allows to directly download and

install any build version.

• After the project is configured,

any collaborator can issue a build!Link:

https://unity3d.com/services/cloud-build

Page 30: Unity 3D - fenix.tecnico.ulisboa.pt · What is Unity? “Unity is the ultimate game development platform. Use Unity to build high-quality 3D and 2D games, deploy them across mobile,

The End of what I had to tell you guys about

Unity.

Page 31: Unity 3D - fenix.tecnico.ulisboa.pt · What is Unity? “Unity is the ultimate game development platform. Use Unity to build high-quality 3D and 2D games, deploy them across mobile,

Who wants to try to beat me in the

tanks game?

Page 32: Unity 3D - fenix.tecnico.ulisboa.pt · What is Unity? “Unity is the ultimate game development platform. Use Unity to build high-quality 3D and 2D games, deploy them across mobile,

Now I will talk about myself and what I’ve been

doing in order to persuade you to do some really

cool things with us.

Page 33: Unity 3D - fenix.tecnico.ulisboa.pt · What is Unity? “Unity is the ultimate game development platform. Use Unity to build high-quality 3D and 2D games, deploy them across mobile,

3D Flashback: an Application for Video-Based

Rendering Using Color and Depth Cameras.

Rafael Kuffner dos Anjos

Main goal: Enable the user to revisuallize an event on video

from a new freely chosen point of view.

Page 34: Unity 3D - fenix.tecnico.ulisboa.pt · What is Unity? “Unity is the ultimate game development platform. Use Unity to build high-quality 3D and 2D games, deploy them across mobile,

Image segmentation

3D reconstruction

Point cloud visualization

Depth Layered images

Related topics

Main research topic How can massive sequences of point clouds be efficiently

represented in order to enable a viewpoint-free interaction?

Page 35: Unity 3D - fenix.tecnico.ulisboa.pt · What is Unity? “Unity is the ultimate game development platform. Use Unity to build high-quality 3D and 2D games, deploy them across mobile,

http://blackbox.fcsh.unl.pt

Page 36: Unity 3D - fenix.tecnico.ulisboa.pt · What is Unity? “Unity is the ultimate game development platform. Use Unity to build high-quality 3D and 2D games, deploy them across mobile,

We are currently working on virtual reality

applications for Dance.

Page 37: Unity 3D - fenix.tecnico.ulisboa.pt · What is Unity? “Unity is the ultimate game development platform. Use Unity to build high-quality 3D and 2D games, deploy them across mobile,
Page 38: Unity 3D - fenix.tecnico.ulisboa.pt · What is Unity? “Unity is the ultimate game development platform. Use Unity to build high-quality 3D and 2D games, deploy them across mobile,

We are currently working with making this algorithm

run in real time with Kinect video data.

Maybe we (you) can create a Van Gogh painting in

real time!

Page 39: Unity 3D - fenix.tecnico.ulisboa.pt · What is Unity? “Unity is the ultimate game development platform. Use Unity to build high-quality 3D and 2D games, deploy them across mobile,

Other things we are working with

Holograms

Human markerless tracking

3D reconstruction

Page 40: Unity 3D - fenix.tecnico.ulisboa.pt · What is Unity? “Unity is the ultimate game development platform. Use Unity to build high-quality 3D and 2D games, deploy them across mobile,

The End.