Presentation is loading. Please wait.

Presentation is loading. Please wait.

Quick Intro to Unreal Lecture 7.

Similar presentations


Presentation on theme: "Quick Intro to Unreal Lecture 7."— Presentation transcript:

1 Quick Intro to Unreal Lecture 7

2 My (totally-biased) Thoughts
Unity Very clean organization More programmer-friendly (than Unreal) A good model for (parts of) our engine. Strong mobile support Licensing Personal = free, slightly limited Subscription for others No royalties Unreal Very dis-organized Of course…I’m a n00b More powerful* Many FX turned on by default (FSAA, motion blur, etc.) Unity has many of these – just not on by default Probably more graphically advanced. A resource-hog: overheats my PC’s More for non-programmers Blueprints C++ scripting is totally for programmers Limited mobile support Licensing totally free until you make $3K/quarter using it, then unreal gets 5% of profits.

3 interface Start it up! There are a number of starting projects
1st person, 3rd person, puzzle, racing, etc. Let’s use 3rd person with starter content. World Outliner (like Unity’s Hierarchy): a Scene Graph Parent-child relationships Content Browser (bottom-left): collection of assets Details: (like Unity’s Inspector) View / create components (do this in blueprints) Edit component properties Scene (middle) Click the play button to enter “game mode”

4 View manipulation Virtually identical to Unity’s
‘F’: Frame selected object (or double-click name) Right-click + WASD + QE Scroll-wheel to zoom Click the view box in the upper-left of the 3d scene to change from: Perspective, Ortho-front, Ortho-side, etc.

5 Object manipulation [Add a 3d cube]
W, E, R toggle translate, rotate, scale Or the buttons in the upper-right of the 3d scene Local / Global button (earth icon next to ^) Numeric values in the Details panel

6 blueprints Similar, but more pervasive than Prefabs in Unity
Different Types To set up a template for a game object (and its components) – like a prefab To set up a game mode Default character The tick rate Default HUD A blueprint for the level (a carryover from UE3, sort-of deprecated)

7 Different base-types Used as a base when creating a new blueprint or C++ class Actor: close to Unity’s GameObject Very basic functionality Pawn: an actor that can be “possessed” and receive controller input Character: like a pawn, but adds a articulated mesh PlayerController: an input-drived controller for a pawn ActorComponent: a re-usable component that can be added to any actor. … (there are MANY others)

8 Scripting overview Two types Two examples Visual Scripting (Blueprint)
Connect Nodes together Like a flowchart Cool “power” effect while running Good for n00b programmers and artists C++ It is C++, but it doesn’t look like it Tons of pre-processor hacks to connect to the editor Builds a dll that is loaded by the engine at run-time Much faster than Visual Scripting at run-time Most professionals seem to recommend this Uses Visual Studio 2015 Two examples Bouncing, rotating coin (Visual) Character controller (C++)

9 Visual Scripting example
Import the coin fbx asset Make a new actor blueprint Add a static mesh component (the coin mesh asset) Add a box collider Add variables: rotate-speed (float) translateMin and Max (floats) translatePeriodMultipler (float) (not really required – just an excuse) Add a update_transform function Takes dt (float) as input Write the spaghetti code Hook it up to the EventTick in the Event Graph

10 tags and layers Tags Unreal doesn’t have these
You can certainly just make a variable for it, though.

11 Input System Axes and Actions (similar to Unity)
Actions: True / False (‘a’ button on gamepad) Axes: slider (-1 to 1 usually) (w/s or left-analog stick) Edit => Project Settings => Input Configurable (remappable) Note the names e.g. “MoveForward” / “Vertical” axes e.g. “Jump” Intentionally not a gamepad / key id or name. [Discuss benefits for game designers]

12 C++ “scripting” Create a new public C++ class (based on Character)
Look at the non-standard macros added to the class. Don’t mess with the “extra” stuff Xyz.Generated.h The macros in front of your class and methods We’ll need to mimic these when expanding the class. My example is from

13 C++ “scripting”, cont. [Do it and build it]

14 Interacting with other G.OBJ’s
Option1: Make a public GameObject variable plus: level-designer can set it negative: fixed before run-time Option2: Find it by name / tag GameObject.Find or method GameObject.FindGameObjectsByTag or FindGameObjectByTag Can modify what you search for at run-time.

15 Mecanim overview A rigged / animated model has n clips
walk, run, idle, etc. Mecanim does the following: Blends between two animation clips Models a state-diagram You modify animation variables in code. The state diagram will transition to a new animation. Frees you from a lot of repetitive code. First step: Import a model with animation clips (optional) Under import settings, set the clip to loop

16 mecanim overview, cont. Step2: Open Animator (not Animation) window
Step3: Drag clips onto stage Step4: Create transitions between clips Step5: Tweak transition criteria / variables Step6: Set variables in script. [There’s much more you can do with Mecanim] Modify how the two clips are blended over time. Mask off parts of the skeleton

17 GUI Overview A 2d overlay (HUD’s, minimaps, etc.) Composed of:
A canvas: Unity automatically creates one Buttons, Text-boxes, etc. The layout is pretty self-explanatory Unless you get into sprites…another topic! The 2D button (near the top) is very handy. These elements can (and often do) have scripts! NOTE: import UnityEngine.UI or you won’t see UI objects in script!


Download ppt "Quick Intro to Unreal Lecture 7."

Similar presentations


Ads by Google