Posts

Showing posts from September, 2019
UnityLearn - Intermediate Programming - Pt. 01 September 30, 2019 Intermediate Programming: Unity Game Dev Courses Swords and Shovels: Game Managers, Loaders, and the Game Loop Intermediate Programming: Unity Game Dev Courses Unity Learn Course - Intermediate Programming What is a GameManager? Game Systems Many parts of your game will need to communicate with one another. You can directly makes these connections between different objects as needed as a way to accomplish this. This method however does not scale well, and becomes very complicated and hard to debug. This is where the concept of having a GameManager comes in. This provides a central location where systems can communicate through. They can also hold important central data. The tutorial's basic definition of a GameManager was "A central location for data" which can serve one of the following purposes or both: Determines who can change what Informs other systems of changes This Swords and
Unity Learn Premium - First Look Tutorials September 28, 2019 Unity Learn Tutorials and Courses Unity Learn Link - Unity Learn The Humble Bundle had a sale on a lot of interesting Unity content, including a year subscription to some learning tools such as Unity Learn Premium so I decided to finally grab it and look into it. There are definitely a lot of courses and videos I am interested in checking out, so I just wanted to quickly go through and list a few to do as soon as I can. I am not sure how well these links will work since they will mostly be through this paid service of Unity Learn Premium, but I am hoping they at least work to get me back there when I want to use them. Intermediate Programming: Unity Game Dev Courses Unity Learn Course - Intermediate Programming Advanced Programming: Unity Game Dev Course Unity Learn Course - Advanced Programming Introduction to ScriptableObjects Unity Learn Tutorial - ScriptableObjects These three stood out to me

Course on HLSL - Shader Fundamentals

September 26, 2019 Intro to HLSL Shaders Shader Tutorials 80 lv - Series on HLSL Shader Fundamentals Article By: 80.lv Introduction - HLSL Shader Creation 1 - HLSL Shader Fundamentals Tutorials - Youtube List By: Ben Cloward The first link leads to the following youtube video list that contains the full course on HLSL shader fundamentals. This may be exactly what I was looking for (although apparently the course was first published in 2007, so some of the information is a bit dated). Regardless of age, this is supposed to be a very good run down of HLSL and shaders in general. This will help my search for understanding the basics of shader language while I continue to learn about Unity's shader graphs separately.

AI State Machine Tutorials: Tutorial #3

September 25, 2019 Tutorial #3 From Blog Post: Unity Basic AI State Machine Tutorials Youtube - ADVANCED AI IN UNITY (Made EASY) - STATE MACHINE BEHAVIORS Tutorial #3 By: Blackthornprod NOTES This tutorial actually dealt with using the Unity Animator to create a sort of state machine setup. You can add behaviours to animation states, which are already setup in a very similar way to the last AI State Machine tutorial I did from Joey the Lantern (Tutorial #2 in this recent tutorial list). These behaviours already have methods such as OnStateEnter, OnStateExit and OnStateUpdate (as well as several other more animation focused methods). This tutorial uses these to setup the logic for their state machine. While this seems nice for getting something running very quickly, especially from an animation focused perspective, I think I would rather use the setups from the other tutorials that start more from scratch and allow you to develop the full system yourself. I would muc

AI State Machine Tutorials: Tutorial #2

September 25, 2019 Tutorial #2 From Blog Post: Unity Basic AI State Machine Tutorials Youtube - Unity 3D - Make a Basic AI State Machine Tutorial #2 By: Joey The Lantern General Structure There is a general state machine class, a class for each individual state, and then the class for whatever will be using these states. This format is very similar to the first AI state machine tutorial I followed by UnityCollege3D. State Machine They created a new namespace, StateStuff. This was because they did not want anything to be a monobehaviour. This namespace then holds the StateMachine class as well as a public abstract class State . They mention that could be used in place of to allow you to specify what types can use this class, but they went with because it's more ambiguous and works with more things. This is something I will need to look into, but I am guessing at this point T just means any type. So basically anything can use the StateMachine. The state

Unity AI with Basic State Machine

September 24, 2019 Basic State Machine Setup Unity Tutorial Youtube - Unity3D AI with State Machine (FSM), Drones, and Lasers! Tutorial #1 By: Unity3d College Tutorial #1 This tutorial goes over a "good" version and a "bad" version of setting up state machines. The bad version will work, and is ok for very small scale projects and objects, but it does lack scalability and has some poor design choices going on. The real state machine covered in this tutorial is not a monobehaviour, but is still able to access components of objects. This was a point they wanted to make sure they covered with the laser object reference. To start going over the state machine, they go through the Drone class and its variables. Target is a public Transform but has a private setter. The Team variable Team uses an expression body property to allow the setting of team from the inspector without letting anything else change it. The next class they go over is the State

Unity Basic AI State Machine Tutorials

September 23, 2019 Basic AI State Machines Unity Tutorials Youtube - Unity3D AI with State Machine (FSM), Drones, and Lasers! Tutorial #1 By: Unity3d College Youtube - Unity 3D - Make a Basic AI State Machine Tutorial #2 By: Joey The Lantern Youtube - ADVANCED AI IN UNITY (Made EASY) - STATE MACHINE BEHAVIORS Tutorial #3 By: Blackthornprod State machine is just a term I have come across when researching and working with AI projects, so I wanted to delve into it a bit more to understand it better. It is my hope that this will be useful as both game design experience as well as general programming experience. These tutorials I grabbed are mostly from well know Unity devolepers that put out generally good learning content, especially when it comes to the programming side. I am also looking to take a general AI course and do some more advanced AI work in my thesis, so it makese sense to start finding some more interesting or well defined AI systems and learn how t

HFFWS Modify Prototype to Handle Building Multiple Scenarios

Image
September 20, 2019 Furthering Prototype Level Generator Prototype Enhancement Allowing for Multiple Scenarios to Be Created at Once This started as a thought for just generally helping with testing the classes to see if they were working properly, but then it seemed like it could just be a powerful addition to the system in general so I decided to implement it more properly into the system. The basic idea was simply adding a "Test Counter" which I could adjust to create a number of instances of the generic scenario I was generating. The idea was that this would let me see more instances of the variance the system has at once, so I could more quickly test if it seemed like the system was working or not. This also helps give me a better picture of the overall variance the system has as well, so it was actually more helpful than I first realized. I have also dabbled in machine learning (ML) and a key portion of using that is creating several test environments to m

HFFWS Building Prototype Setup

September 19, 2019 Building Prototype Level Generator Prototype Frame The idea of this prototype design is simply to show the general concept of the final hoped for result of my thesis project. It will cover the core concepts of: creating the proper objects for a puzzle type, varying parameters of those objects, communication between objects. This prototype will be a very simple puzzle. It will simply be an elevated ledge that the player must be able to climb up onto by using a block in the environment. This will demonstrated the concept of tying specific object types to a puzzle type (connected the instantiated block to an elevated ledge puzzle). It will have varied parameters by varying the position of the ledge (most notably the height) and the size of the block. Finally, the system demonstrates communication between objects by using information on the ledge's position to control the range of the block size. PROTOTYPE CLASSES Class: Generator System This cla

HFFWS Prototype Setup

September 18, 2019 Setting Up Prototype Level Generator Prototype Frame The idea of this prototype design is simply to show the general concept of the final hoped for result of my thesis project. It will cover the core concepts of: creating the proper objects for a puzzle type, varying parameters of those objects, communication between objects. This prototype will be a very simple puzzle. It will simply be an elevated ledge that the player must be able to climb up onto by using a block in the environment. This will demonstrated the concept of tying specific object types to a puzzle type (connected the instantiated block to an elevated ledge puzzle). It will have varied parameters by varying the position of the ledge (most notably the height) and the size of the block. Finally, the system demonstrates communication between objects by using information on the ledge's position to control the range of the block size.

Unity - Testing Collision on Instantiation for HFFWS

September 17, 2019 General Testing HFFWS Rigidbody Collision on Instantiation Since having the system place objects itself is an eventual goal of my project, I wanted to see if rigid body gameobjects with colliders would collide immediately with each other if one was instantiated within the bounds of the other. I also wanted to check with collision checks would work best (or at all) for this, between OnEnter, OnExit, Stay, or anything else I could find. To test this, I placed a cube (with collider and rigid body component) in the virtual space in the editor, and an empty gameobject that would be the TestSpawner at the same transform location. The TestSpawner simply instantiated an input gameobject at Start. This object was a simple sphere that had a collider and rigid body component. I think created a CollisionDetector script that I placed on both of these objects. This just had methods for OnCollisionEnter, OnCollisionExit, and OnCollisionStay to return a debug.log sta

Intro to Unity's Shader Graph

Image
September 13, 2019 Unity Shader Graph Intro Tutorial Youtube - Basics of Shader Graph - Unity Tutorial Tutorial #1 By: Brackeys This tutorial introduces you to Unity's shader graph, so it starts with the bare minimum and goes over some simple features to get you started. Messing with vertex colors got me back into shaders in Unity, and shader graphs provide a really simple way to get some interesting visual effects when I need a break from trying to figure out shader coding. I already ran into a lot of snags that kept things from working initially. I missed the step at the beginning of the tutorial where they change the Unity project template to Lightweight RP as they're creating the project. I was able to get around this by doing what they did in their vertex color tutorial, where I created a Lightweight Renderer Pipeline Asset and dragged that into the Graphics tab of the Project Settings. I then found out that Unity does not like it when you change the na

Brackeys Tutorials: Terrain Generation and Vertex Colors (Cont.)

Image
September 12, 2019 Graphics Tutorials Mesh Generation/Alteration and Vertex Colors Youtube - MESH GENERATION in Unity - Basics Tutorial #1 By: Brackeys Youtube - PROCEDURAL TERRAIN in Unity! - Mesh Generation Tutorial #2 By: Brackeys Youtube - MESH COLOR in Unity - Terrain Generation Tutorial #3 By: Brackeys Tutorial #3 Tutorial #3 actually covers UVs and applying textures to surfaces, as well as vertex colors and shaders in Unity. It starts by covering UVs and applying textures, and the main take away is that you want to normalize your UV vectors so they are within the range of [0, 1]. Textures are applied in a normalized fashion when dealing with UVs. It then gets into setting the vertex colors. This is done by creating a Color array and then simply setting the Mesh.colors of the mesh equal to that array. We created a colors array that was the same size as our vertices, which leads me to believe that a mesh colors array generally has the same number of ind

HFFWS - Further Testing Modifying Prefabs Before Instantiation

September 12, 2019 HFFWS Prefab Editing and Instantiation Testing TESTING How does altering prefab directly affect process of creating multiple instances? Can altering prefab help set the axis of moving platform? Can altering prefab help set the axis of moving platform? Yes, this approach worked. Setting the axis rotation on the prefab directly, THEN instantiating instances of the prefab had the platforms move in the newly set direction. How does altering prefab directly affect process of creating multiple instances? This does not appear to have any effect on previously instantiated instances of the prefab. Once an instance is created, changing the parameters of the prefab was NOT changing those parameters for the already instantiated. This gives more support to using this approach FINAL NOTES These tests do give this approach more support in being the one to use for now, since it does seem to accomplish all of the goals necessary at this time. It still makes me

Brackeys Tutorials: Terrain Generation and Vertex Colors

September 11, 2019 Graphics Tutorials Mesh Generation/Alteration and Vertex Colors Youtube - MESH GENERATION in Unity - Basics Tutorial #1 By: Brackeys Youtube - PROCEDURAL TERRAIN in Unity! - Mesh Generation Tutorial #2 By: Brackeys Youtube - MESH COLOR in Unity - Terrain Generation Tutorial #3 By: Brackeys Tutorial #1 This tutorial just covers the basics of creating meshes in Unity. This covers the basics of vertices and tris in Unity, as well as the back-face culling done. This just means when creating tris for the triangle array that they must be input in a clockwise manner to display in the proper direction. Tutorial #2 This tutorial gets into using the basics of Tutorial #1 to create an entire terrain. This process simply starts by creating a grid of a bunch of vertices, filling them in with tris, and then modifying the positions of some of those vertices. This started with a process I have used before in mesh generation, where you use several for l

General Graphics in Unity - Vertex Colors, Shaders, Meshes, UVs

Image
September 11, 2019 General Graphics Information Meshes, Shaders, Vertices, UVs Youtube - MESH COLOR in Unity - Terrain Generation Tutorial #1 Youtube - Learning Shaders in Unity - Everything about Meshes in under 5 Minutes Info #1 Youtube - Pico Tanks: Vertex shader in Unity Info #2 Tutorial #1 I was interested at looking into using vertex colors for objects, which led me to a few interesting videos on various aspects of 3D modeling in general. Tutorial #1 was a nice example of using vertex colors in Unity, as well as giving me a simple tutorial to look into on mesh deformation as well. It uses Unity's shader graph to apply vertex colors, and just simply sets colors with a gradient onto the vertices themselves based on their height (y position). Info #1 Info #1 was a very brief but general overview of topics on meshes. UVs: It explained how UVs are used to map textures onto faces of objects, which was the biggest topic I had not really covered up to th

HFFWS - Instantiating Conveyor Belt

Image
September 10, 2019 Human Fall Flat Workshop Conveyor Instantiation Today we are finally going to try setting the parameters of a conveyor object on instantiation and seeing which we can and cannot, and trying to fix as many that we cannot as possible. We will also use this as a comparison point for the vertical moving platform generator to start designing the foundation of a tool that can instantiate many different types of objects. At the very least, it could potentially lead to the start of an interface or an abstract class that can be used as the base for classes that instantiate objects. Parameters to Set on Instantiation Item Prefab Segment Count Length Radius Speed TESTING Test #1: ISSUE: Want to properly set some conveyor prefab parameters on instantiation. Using a similar start to creating the platform prefabs, my first attempt to instantiate these conveyors began with instantiating the conveyor prefab and casting that as a gameObject. As most of the p

Hex Based 4X Game Tutorial

September 9, 2019 Unity 4X Game Tutorial Part Based Mostly Civilized: A Hex-Based 4x Game Engine for Unity - Part 1 Youtube - Link By: quill18creates I was looking to add another Unity game genre tutorial that I could follow along with, and happened to come across one for a fairly complex genre I enjoy so this seemed like a nice more advanced tutorial program to go through. I have checked out some of quill18creates content before and it usually serves as some good practice for more advanced topics, while also helping teach you some fundamentals about optimization and general project architecture. This immediately caught my attention with the hex tile map math shown at the beginning of the video. There they show how to use various coordinate systems, such as cube coordinates, in a hex tile system in a very efficient and sensible way. The link to this information can be found here: Hexagonal Grids from Red Blob Games Red Blob Games - Link

Unity - Latest Prefab System 2019 - Nested and Variants

September 5, 2019 Unity Prefabs Nested Prefabs and Prefab Variants Youtube - NEW Unity Prefab Workflow - How to use Nested Prefabs Video #1 Youtube - NEW Prefab Workflow - How to use Unity3D Prefab Variants Video #2 I have been meaning to learn more about Unity's latest prefab system updates they put out in Unity 2019, and Unity3D College is a really good place to learn good practices for working in Unity so this seemed like a good place to get some information on the topic. These videos cover both nested prefabs and prefab variants in an in depth manner using some real game object examples to help explain their uses and benefits.

Unity - Accessing All Children Objects Throughout Entire Various Sized Hierarchies

September 4, 2019 Accessing Full Gameobject Hierarchy Unity StackOverflow - Get All children, children of children in Unity3d Link #1 Unity Answers - Find children of object and store in an array Link #2 For a project we were looking into applying a material color change to some more complex Unity objects/models which are made up of many children objects with many materials. To do this, I needed a way to be able to grab all the materials all throughout a gameobject's hierarchy and change them simultaneously. This led me to think of a recursive approach, and sure enough there was already one explored that I could reference online in Link #1. Link #1 also showed me a useful feature that I did not know about Unity. You can use a foreach loop on a transform and it will go through all of the children transforms automatically. This helped make the recursive solution much easier to read, and is just a good feature to know about in the future.

Highlighting a Selected 3D Object in Unity

September 3, 2019 Highlight and Selection Materials and Color Change REFERENCES: Unity - Color.Lerp By: Unity Unity - Mathf.PingPong By: Unity Youtube - Mini Unity Tutorial - How To Select And Highlight Objects In Game Realtime With C# Tutorial #1 By: Jimmy Vegas Youtube - Color.Lerp Unity Once using Coroutines | No Update Function Beginner Tutorial Tutorial #2 By: iUnity3Dtutorials Unity Answers - Change color to multiple Materials in one gameObject? By: Unity (lachesis) I wanted to create a generic object highlight/selection feature for a project, so I turned to a method I found searching for highligting techniques online where you just change the material color of the currently selected object over time. This is a very simple (conceptually) and often used feature for showing a user what object is currently in focus. It would turn out that it's a bit more complicated when you are working with models that have many different materials on separat

Tower Defense Project - Fixing UI Text

September 2, 2019 Tower Defense Tutorial Project UI Text GOAL: Fix game over UI text and look into round text references to see why they update strangely. NOTES: For the GameOver screen producing weird text results, my first thought was to the check the inspector references. I know tying the stats into text UI elements uses inspector references, so making sure those were correct was the first check. Sure enough, it looked like the wrong text was dragged into the GameOver UI inspector field. I must have grabbed the wrong one initially, as the generic text was dragged in there as opposed to the text that should be holding the round number. As for the issue with the round text timing being off, I figured that had to do with the way the coroutine to animate the text was setup. It should count up from 0 to the final round number the player ended on (whether they won or lost), but it was starting on that final round number, THEN going to 0 and counting back up again. This ju