Unity Using Events and Building Effective UI Systems

September 7, 2021

Unity Events

UI Systems


Title:
C# Events in Unity! – Intermediate Scripting Tutorial

By:
Unity


Youtube Link – Tutorial #1

Description:
Brief introduction to using Events in Unity.


Title:
How To Build An Event System in Unity

By:
Game Dev Guide


Youtube Link – Tutorial #2

Description:
Quick showing of implementing a basic Event system in Unity for gameplay reasons.


Title:
Delegates, Events, Actions and Funcs – The Observer Pattern (Unity & C#)

By:
One Wheel Studio


Youtube Link – Tutorial #3

Description:
Covers Events, as well as Delegates, Actions, and Funcs specifically through the Observer Pattern in Unity.


Title:
Game Architecture Tips – Event Driven UI – Unity

By:
Dapper Dino


Youtube Link – Tutorial #4

Description:
An Event system built in Unity specifically with a focus on UI.


Title:
Building Unity UI that scales for a real game – Prefabs/Scenes?

By:
Jason Weimann


Youtube Link – Tutorial #5

Description:
General coverage of building effective UI systems in Unity.


Overview

I wanted to delve further into using Event systems in Unity specifically when building UI systems, so I collected a few resources I thought would help with researching that. These tutorials cover everything from the basic foundations of Events themselves to fully fledged UI system tutorials near the end implementing those tools and concepts covered in the earlier tutorials.

I think Event heavy systems are very effective ways to build out UI in games, so I want to get a better grasp of setting that up. I especially think the final tutorial by Jason Weimann will help bring those topics together as well as cover other important factors for building larger scale UI systems.

via Blogger http://stevelilleyschool.blogspot.com/2021/09/unity-using-events-and-building.html

Adobe Photoshop – Introductory Tutorials – Game Art Focus – Part 1

August 12, 2021

Adobe Photoshop

Game Art Tutorial List


Title:
Total BEGINNERS guide to drawing in photoshop 2021

By:
Trent Kaniuga


Youtube – Tutorial #1

Description:
Quicker coverage of just a lot of general tools and what they do in Photoshop.


Title:
Learning the basics of drawing in Photoshop

By:
Michael Clarida Arts


Youtube – Tutorial #2

Description:
Shows a drawing example within Photoshop to show some of the tools at work to create a piece.


Title:
HOW TO PAINT 2D GAME ART IN PS – STEP BY STEP TUTORIAL

By:
Blackthornprod


Youtube – Tutorial #3

Description:
Very quick example on some tips for drawing 2D game assets.


Title:
How To BLEND COLORS Like A Pro (For Beginners) | Photoshop Digital Painting Tutorial

By:

The Geek Artist


Youtube – Tutorial #4

Description:
Quick example of how to blend colors in Photoshop.


Title:
Lava Potion Game Asset Tutorial in Photoshop – full game design tutorial

By:
Jaysen Batchelor


Youtube – Tutorial #5

Description:
Tutorial for creating a 2D potion game asset in Photoshop.


Title:
Game Design Character in Photoshop – full character design art in Photoshop

By:
Jaysen Batchelor


Youtube – Tutorial #6

Description:
Tutorial for creating a 2D shadow creature game asset exploring character design in Photoshop.


Title:
Creature Game Design in Photoshop – Cute turtle creature tutorial

By:
Jaysen Batchelor


Youtube – Tutorial #7

Description:
Tutorial for creating a 2D turtle creature game asset exploring creature design in Photoshop.


Overview

Photoshop being one of the most used artistic softwares seemed like a good point to start exploring tutorial to use with my new Wacom tablet, so I compiled a lot of tutorials that seem good for getting me started. I’ve used it before, but not to the extent of actually drawing full assets, and I want to be able to draw out decent characters and creatures. I figure I will cover the basics again just to get comfortable with all the tools available, and I hope these tutorials are a good starting step for that as well as transitioning into learning how to actually apply these tools to get started making some solid sketches.

Tutorial #1 covers a lot of the tool basics, and Tutorial #4 with color blending was a good example of something I believe will be something I will like to explore extensively while getting started making creatures and characters, so those seem like strong basics coverage. The rest generally cover examples of making some kind of 2D art asset, and I will be using those as guides to show me how to use some of those tools to actually create the assets. Getting those examples from a few different sources can help show different approaches, but the final 3 are all from the same creator since they do just appear to be nice quick examples that I can grasp fairly quickly.

via Blogger http://stevelilleyschool.blogspot.com/2021/08/adobe-photoshop-introductory-tutorials.html

Coroutine Fundamentals in Unity

May 20, 2021

Coroutines

Unity


Title:
Introduction to Game Development (E21: coroutines)

By:
Sebastian Lague


Youtube – Tutorial #1

Description:
Covers the basics of coroutines in Unity.


Title:
Coroutines In Unity – What Are Coroutines And How To Use Them – Coroutines Unity Tutorial

By:
Awesome Tuts


Youtube – Tutorial #2

Description:
Covers some intermediate complexity uses of coroutines as well as tying them in with Invoke calls.


Title:
Coroutines – Unity Official Tutorials

By:
Unity


Youtube – Tutorial #3

Description:
Old official Unity tutorial on the fundamentals of coroutines in their system.


Overview

Coroutines appear to be a strong tool within Unity that I still am looking for ways to implement better in my systems. While understanding the basic uses for them with timing related events, I feel like they offer a lot more that I am not utilizing, so I wanted to further my understanding of them by following up on one of my older tutorial blogs and going through the tutorials it offers.

Tutorial #1 Notes

Coroutines are part of the Unity engine, and are not native to C#. They also belong to the Monobehaviour base class, so they class they are used in must inherit from Monobehaviour.

The coroutine return type is IEnumerator. Because of this, coroutines can also be stored in IEnumerator variables. This also allows them to be passed in as a paramter for the yield return statement within a Coroutine.

Use a reference to properly control the starting and stopping of a specific coroutine instance.

Tutorial #2 Notes

You can call a Coroutine from within itself (the same Coroutine). This is one way to cycle a Coroutine continously.

WaitForSecondsRealtime is similar to WaitForSeconds, except that WaitForSecondsRealtime is independent of Unity’s timescale. WaitForSeconds however is affected by the timescale. WaitUntil suspends the coroutine until the given delegate returns true.

Invoke Notes

  • Invoke – call a method after a given amount of time
  • InvokeRepeating – call a method every given amount of time, after a starting given time
  • CancleInvoke – stops an InvokeRepeating call

Tutorial #3 Notes

Coroutines are functions which execute in intervals. They work with special yield statements which return the code execution out of the function. Then, when the function continues, execution begins from where it left off.

Combining coroutines with properties can allow for efficient code which produces execution only when a value is changed, without the need to check for variable changes every frame with the Update() method or something similar.

Coroutine Return Statements

A substantial part of using and controlling coroutines is the various return statements you can use within them to determine when they should run and when they should pause execution. As such I listed several of these options and how they work within the coroutines.

yield return null

waits a frame before progressing to the next step

seems similar to the rate of the Update() method

yield return new WaitForSeconds(float time)

waits the given amount of seconds between each run of the process

yield return WaitForSecondsRealtime(float time)

waits the given amount of seconds, regardless of Unity’s timescale

yield return StartCoroutine(DoSomething())

waits until the given Coroutine “DoSomething” is finished running

yield return new WaitUntil(bool test)

suspends coroutine until the given parameter is true (opposite of WaitWhile)

yield return new WaitWhile(bool test)

suspends coroutine until the given paramter is false (opposite of WaitUntil)

Summary

Coroutines are starting to become a bit more clear to me, and this helped me learn a few more ways to incorporate them into my projects. Just seeing that they are specifically a Unity native concept was helpful to me as I did not think about that before, and that makes their somewhat strange nature make more sense in my head. This made it more clear that Unity is doing a lot of work behind the scenes to accomplish their main goals of determining when to start, pause, resume execution based on their yield values. Also the Unity note on tying them in with properties is very interesting and something I want to experiment with more myself for more efficient code.

via Blogger http://stevelilleyschool.blogspot.com/2021/05/coroutine-fundamentals-in-unity.html

Linear Algebra and Vector Math – Basics and Dot Product – by Looking Glass Universe

April 8, 2021

Linear Algebra

Vectors and Dot Product


Title:
Vector addition and basis vectors | Linear algebra makes sense


Youtube – Link #1

Description:
Introduction to this series and the basics of linear algebra and vectors.


Title:
The meaning of the dot product | Linear algebra makes sense


Youtube – Link #2

Description:
Deep dive into the dot product and what it represents and how to determine it.


Overview

I wanted to brush up on my vector math fundamentals, particularly with my understanding of the dot product and its geometric implications as it is something that comes up often in my game development path. While I am able to understand it when reading it and coding it for various projects, I wanted to build a more solid foundational understanding so that I could apply it more appropriately on my own. This video series has been very nice for refreshing my learning on these topics, as well as actually providing me a new way of looking at vector math that I think will really further my understanding in the future.

Video #1 – Vector addition and basis vectors

This was the introductory video to the series, and starts with vector addition. They then move on to linear combinations as an extension of basic vector addition. Next they show for 2D vectors that as long as you have two independent vectors, you can calculate any other vector using those two in some linear combination. This then relates to how vectors are normally written out, but they are simply using linear combinations of the standard orthonormal basis of something like x and y, or x, y, and z in 3D space.

This means a vector is simply 2 or 3 vectors created with the unit vector in the x, y, or z direction multiplied by some scalar and then summed up to create the resulting vector. This was actually a new way for me to look at vectors, as this is more intuitive when you are looking to create a new vector set to base vectors off of different from the standard x, y, z, but I never really thought to also apply it in the standard case. The x, y, z, or even i, j, k, became some standardized to me that I generally ignored them, but I think looking at them in this way will help make much more of linear algebra more consistent in my thinking space.

They then continue on to explain spans, spaces, and the term basis a bit more. A set of vectors can be called a span. If that span is all independent vectors, this indicates it is the smallest amount of vectors which can fully describe a space, and this is known as a basis. The number of basis elements is fixed, and this is the dimension of the space (like 2D or 3D). And for a given basis, any vector can only uniquely be defined in one linear combination of the basis vectors.

Video #2 – The meaning of the dot product

Dot Product

A really simple way of describing the dot product is that it shows “how much one vector is pointing in the same direction of another vector”. If those two vectors are unit vectors, the dot product of two vectors pointing the same direction is 1, two vectors that are perpendicular would have a dot product of 0, and two vectors pointing directly opposite directions would have a dot product of -1. This is directly calculated as the cosine of the angle between the two vectors.

However, the dot product also factors in the magnitude of the two vectors. This is important because it makes the dot product a linear function. This also ends up being more useful when dealing with orthonormal basis vectors, which are unit vectors (vectors of length 1) that define the basis of a space and are all orthogonal to each other.

They cover a question where a vector u is given in the space of the orthonormal vectors v1 (horizontal) and v2 (vertical) and ask to show what the x value of the u vector is (which is the scalar component of the v1 vector part of the linear combination making up the vector u) with the dot product and vectors u and v1. Since v1 is a unit vector, this can be done directly by just the dot product (u . v1). They then show that similarly the y component would just be the dot product (u . v2). They explain this shows the ease of use of using the dot product along with an orthonormal basis, as it directly shows the amount of each basis vector used in the linear combination to create any vector. This can also be explained as “how much of u is pointing in each of the basis directions”.

Since the dot product is linear, performing the dot product function on two vectors is the same whether done directly with those two vectors, or even if you break up one of the vectors before hand into a linear combination of other vectors and distribute it.



Example:

a . b = (x*v1 + y*v2) . b = x*v1 . b + y*v2 . b

Projecting a Vector onto Another Vector

They then cover the example I was very interested in, which is what is the length of the vector resulting in projecting vector A onto vector B in a general sense. The length, or magnitude, of this vector is the dot product divided by the magnitude of vector B. This is similar to the logic in the earlier example showing how vectors project onto an orthonormal basis, but since they had magnitudes of 1 they were effectively canceled out originally.

This then helped me understand to further this information to actually generate the vector which is the projection of vector A onto vector B, you then have to take that one step more by multiplying that result (which is a scalar) with the unit vector of B to get a vector result that factors in the proper direction. This final result ends up being the dot product of A and B, divided by the magnitude of B, then multiplied by the unit vector of B.



Example:

Projection vector C

C = (A . B) * ^B / ||B|| = (A . B) * B / ||B||^2

Dot Product Equations

They have generally stuck with the dot product equation which is:

a . b = ||a|| ||b|| cos (theta)



They finally show the other equation, which is:

a . b = a1b1 + a2b2 + a3b3 + …

But they explain this is a special case which is only true sometimes. It requires that the basis you are using is orthonormal. So this will generally be true in many standard cases, but it is important to note that it does require conditions to be met. This is because the orthonormal basis causes many of the terms to cancel out, giving this clean result.

via Blogger http://stevelilleyschool.blogspot.com/2021/04/linear-algebra-and-vector-math-basics.html

Intro to Unreal: Basics and Intro to Blue Prints

March 17, 2021

Intro and Blue Prints

Unreal


Title:
Unreal Engine 4 Complete Beginners Guide [UE4 Basics Ep. 1]

By:
Smart Poly


Youtube – Tutorial

Description:
A quick introduction to using the Unreal engine and just getting acquainted with the main editor window.


Title:
Unreal Engine 4 – Blueprint Basics [UE4 Basics Ep. 2]

By:
Smart Poly


Youtube – Tutorial

Description:
Quick introduction to using Unreal’s blueprints.


Title:
Unreal Gameplay Framework

By:
Unreal


Unreal – Link

Description:
Unreal Gameplay Framework, the official Unreal documentation.


Learning the Basics

It has been a while since I have used Unreal in any significant capacity, so I am going back to the basics to try and make sure I have all the fundamentals covered.

Tutorial #1

Moving/Positioning Objects

By default, Unreal has all the transformation functions snap. So moving an object, rotating it, and scaling it all occur in steps as opposed to smooth transforms. This can easily be changed in the top right of the viewport at any time.

Extra Camera Controls

F: focuses on object (like Unity)

Shift + move an object: Camera follows the moving object

You can directly change the camera speed in the top right of the viewport.

Adding Content Pack Later

If you find that you want to add the starter content to a project later than the start, this can easily be done through “Content” in the “Content Browser” window, then “Add New”, and choosing “Add Feature or Content Pack”. The starter content options will be one of the first to show up by default under the “Content Packs”.

Lighting Basics

“LIGHTING NEEDS REBUILT” Error Message

The static meshes want the lighting to be rebuilt when added so they are accounted for. Fixed with:

Go to: Build -> Build Lighting Only

Light Mobility Options

Lights by default have 3 mobility options: Static, Station, Movable

  • Static: can’t be changed in game; fully baked lighting
  • Station (Default): only shadowing and bounced lighting from static objects baked from Lightmass; all other lighting dynamic; movable objects have dynamic shadows
  • Movable: fully dynamic lighting, but slowest rendering speed

Tutorial #2

General Structure of Blue Prints

Components:

area where different components can be added

what allows you to place objects into the viewport of the blue print

this is where colliders are shaped to the proper size/shape


Details:

all the different details for this particular blue print


Event Graph:

this is the tab where visual scripting is majorly done


Function:

effectively contained event graphs with more specialized functionality


Variables:

representation of fields as you’d expect

Events

These are events which call the given functions when something in particular occurs. These functions are created within the blue print Event Graph.

Actions (Examples)

On Component Begin Overlap: occurs when something initially enters a collider
– Similar to Unity’s OnTriggerEnter

On Component End Overlap: occurs when something initially leaves a collider
– similar to Unity’s OnTriggerExit

E: occurs when the “E” key is pressed

Action: Timeline

Timeline:

allows you to visually create a graph of how a variable changes over a particular set of time

By default, the x-axis is the time and the y-axis is the variable value.
Points can be added as wanted to act as key frames for the variable.
Also allows for easy modifications to the interpolation between points, such as changing it from a line to a cubic interpolation by selecting multiple points.

Make sure to pay attention to the time Length set in the time line. Even if you didn’t put points somewhere in particular, if that is way longer than where your points are, you can get strange results since it will perform the action over the entire length of time.

Debugging Blue Prints

If you select Play from within the blue print, you can get a separate play window while leaving the blue print window visible. This can be helpful for example with the Event Graph, as you can actually see when different events occur according to the system and when inputs are read. This also shows the variables changing in some nodes, such as Timeline.

Classes (as covered by the Gameplay Framework Quick Reference)

Agents

Pawn

Pawns are Actors which can be possessed by a controller to receive input to perform actions.

Character

Characters are just more humanoid Pawns. They come with a few more common components, such as a CapsuleComponent for collision and a CharacterMovementComponent by default.

Controllers/Input

Controllers are Actors which direct Pawns. These are generally AIController (for NPC Pawns) and PlayerController (for player controlled Pawns). A Controller can “possess” a Pawn to control it.

PlayerController

the interface between a Pawn and the human player

AIController

simulated AI control of a Pawn

Display Information

HUD

Focused on the 2D UI on-screen display

Camera

The “eye” of a player. Each PlayerController typically has one.

Game Rules

GameMode

This defines the game, including things such as game rules and win conditions. It only exists on the server. It typically should not have much data that changes during play, and definitely should not have transient data the client needs to know about.

GameState

Contains the state of the game.
Some examples include: list of connected players, score, where pieces in a chess game are.
This exists on the server and all clients replicate this data to keep machines up to date with the current state.

PlayerState

This is the state of a participant in the game (which can be a player or a bot simulating a player). However, an NPC AI that exists as part of the game would NOT have a PlayerState.
Some examples include: player name, score, in-match level for a MOBA, if player has flag in a CTF game.
PlayerStates for all players exist on all machines (unlike PlayerControllers) and can replicate freely to keep machines in sync.

via Blogger http://stevelilleyschool.blogspot.com/2021/03/intro-to-unreal-basics-and-intro-to.html

Intro to Unreal: Basics Tutorial Compilation

March 16, 2021

Intro and Basics

Unreal


Title:
Unreal Engine 4 Complete Beginners Guide [UE4 Basics Ep. 1]

By:
Smart Poly


Youtube – Tutorial

Description:
A quick introduction to using the Unreal engine and just getting acquainted with the main editor window.


Title:
Unreal Engine 4 – Blueprint Basics [UE4 Basics Ep. 2]

By:
Smart Poly


Youtube – Tutorial

Description:
Quick introduction to using Unreal’s blueprints.


Title:
Unreal Engine 4 Beginner Tutorial: Getting Started

By:
DevAddict


Youtube – Tutorial

Description:
A more in depth intro to getting through the Unreal editor and starting to apply it to some general case uses.


Title:
Unreal Engine Beginner Tutorial: Building Your First Game

By:
Devslopes


Youtube – Tutorial

Description:
A good introduction focusing on building more of your own assets instead of using the Unreal given assets.


Title:
Unreal Engine 4.26 Beginner’s Tutorial: Make a Platformer Game

By:
DevAddict


Youtube – Tutorial

Description:
A large tutorial focusing on fleshing out the functionality of a given project and assets in Unreal.

Summary

This is a quick list of some Unreal tutorials just to get familiar with the engine. I listed them in order of a progression that I believe makes sense, where the first couple simply introduce the main Unreal editor and some of the tools it gives you, and the later tutorials start to implement those individual components to varying degrees. Some of these focus on using blue prints, while some focus on applying parameters to assets just through the Unreal editor directly. Finally, some of the tutorials near the end beging to show these tools making more complete systems and projects.

via Blogger http://stevelilleyschool.blogspot.com/2021/03/intro-to-unreal-basics-tutorial.html