Posts

Showing posts from November, 2019

UnityLearn - Beginner Programming - Swords and Shovels: Character Controller and AI - Pt. 03 - Finalizing and Extending Systems

Novemeber 21, 2019 Beginner Programming: Unity Game Dev Courses Beginner Programming: Unity Game Dev Courses Unity Learn Course - Beginner Programming Finalizing and Extending Systems Designing with NavMesh Obstacles This section just showed how obstacles work with NavMesh. Objects with colliders can be given NavMeshObstacle components to work as obstacles within the NavMesh. The Carve bool lets you determine if they "carve out" parts of the NavMesh to make them inaccessible for agents with NavMesh driven AI. Finishing the Patrol System The InvokeRepeating method has a delay paramter as well. This can be given various values between different objects so they are not all on the exact same cycle. This was used to offset the waypoint traveling cycles of the goblin NPCs. Fine Tuning the Agents and Animation The logic that was making the player character awkwardly slow down around the stairs and other obstacles is found within the obstacle avoidance pa...

UnityLearn - Beginner Programming - Swords and Shovels: Character Controller and AI - Pt. 02 - NPC Controller

Novemeber 21, 2019 Beginner Programming: Unity Game Dev Courses Beginner Programming: Unity Game Dev Courses Unity Learn Course - Beginner Programming NPC Controller Creating NPC Patrol The NPC has two main states: it will patrol within a set of waypoints or it will pursue the player. They create two main methods to control the NPC behavior, Patrol and Tick. Both of these are called in the Awake method of the NPCController through the use of the InvokeRepeating command. This is done because you can set a time value that needs to pass between each invocation, so basically they can perform these methods in a "slow Update" fashion. Tick is called every 0.5s, while Patrol is called every patrolTime, which was defaulted at 15s. The Patrol method used an inline ternary method to set the value of index, which is something I am not used to seeing. The line was as such: index = index == waypoints.Length - 1 ? 0 : index + 1; I believe this checks if index is...

UnityLearn - Beginner Programming - Swords and Shovels: Character Controller and AI - Pt. 01 - Overview and Character Controller

Novemeber 21, 2019 Beginner Programming: Unity Game Dev Courses Beginner Programming: Unity Game Dev Courses Unity Learn Course - Beginner Programming Overview and Character Controller Navigation and Animation Review This part of the tutorial just gets you familiar with the NavMesh setup they have and the animator they are using on the player character. Some of the items are a bit off since they are using an older Unity version (2017), like where the Navigation tab is located (it is now under Window -> AI). The player character animator has a blend tree that holds a speed parameter. This parameter appears to determine how much to blend between an idle animation and a running animation, as well as how fast the animation plays. Controlling Motion with C# and Unity Events This tutorial portion started with adding a NavMesh Agent component to the Hero character to have it interact with the baked NavMesh in the scene. The next step was to edit the MouseManager...

Sebastian Lague A* Tutorial Series - Algorithm Implementation - Pt. 03

November 20, 2019 A* Tutorial Series Pt. 03 - Algorithm Implementation A* Pathfinding (E03: algorithm implementation) Link - Tutorial By: Sebastian Lague Intro: Since these sections are very coding intensive, I just setup a breakdown into the different classes that are worked on. I try to discuss anything done within the class in that class's section here. As should be expected, they do not continuosly do a single section and move to the next, they jump back and forth so that the references and fields make more sense for why they exist, so I try to mention that if needed. Pathfinding This class begins to implement the psuedo code logic for the actual A* algorithm. It starts with a method, FindPath, that takes in two Vector3 values, one for the starting position and one for the target position. It then uses our NodeFromWorldPoint method in AGrid to determine which nodes those positions are associated with so we can do all the work with our node system. It...

Sebastian Lague A* Tutorial Series - Node Grid - Pt. 02

November 20, 2019 A* Tutorial Series Pt. 02 - Node Grid A* Pathfinding (E02: node grid) Link - Tutorial By: Sebastian Lague Intro: This started by creating the overall Node class to contain valuable information for each individual node, and the Grid class that would be dealing with the overall grid of all the nodes (I rename this to AGrid to avoid errors in Unity). Node For now, this simply holds a bool walkable, which represents whether this node contains an obstacle or not, and a Vector3 worldPosition, which contains data on its Unity real world position. AGrid This class has a couple parameters that influence the coverage and resolution of the overall A* system. The gridWorldSize represents the two dimensions covered by the entire grid (so 30, 30 will cover a 30 by 30 area in Unity units). The nodeRadius is half the dimension of a node square, which will be used to fill the entire grid. The lower the nodeRadius, the more nodes (so higher resolution, but...
Sebastian Lague A* Tutorial Series - Algorithm Explanation - Pt. 01 November 20, 2019 A* Tutorial Series Pt. 01 - Algorithm Explanation A* Pathfinding (E01: algorithm explanation) Link - Tutorial By: Sebastian Lague Notes: G cost = distance from starting node H cost (heuristic) = distance from the end node F cost = G cost + H cost A* starts by creating a grid of an area. There is a starting node (initial position) and an end node (destination). Generally, you can move orthogonally (which is normalized as a distance of 1) or diagonally (which would then be a value of sqrt of 2, which is approx. 1.4). Just to make it look nicer and easier to read, it is standard to multiply these distances by 10 so that moving orthogonally has a value of 10, and diagonally has a value of 14. The A* algorithm starts by generating the G cost and H cost of all 8 squares around the starting point (in a 2D example for ease of understanding). These are then used to calculate the F cost ...

Notes on Research Paper: Automatic Game Progression Design through Analysis of Solution Features by Butler et al.

November 19, 2019 Thesis Research Notes on Resources TITLE: Automatic Game Progression Design through Analysis of Solution Features AUTHORS: E. Butler, E. Andersen, A. M. Smith, S. Gulwani, and Z. Popović IEEE Citation - Zotero [1]E. Butler, E. Andersen, A. M. Smith, S. Gulwani, and Z. Popović, “Automatic Game Progression Design through Analysis of Solution Features,” 2015, pp. 2407–2416. ABSTRACT - use intelligent tutoring systems and progression strategies to help with mastery of base concepts  as well as combinations of these concepts - System input: model of what the player needs to do to complete each level - Expressed as either: - Imperative procedure for producing solutions - Representation of features common to all solutions - System output: progression of levels that can be adjusted by changing high level parameters INTRODUCTION - Level Progression: "how game introduces new concepts and grows in complexity as the player progres...

UnityLearn - Beginner Programming - Finite State Machine - Pt. 02 - Finite State Machines

Novemeber 18, 2019 Beginner Programming: Unity Game Dev Courses Beginner Programming: Unity Game Dev Courses Unity Learn Course - Beginner Programming Finite State Machines Building the Machine This part of the tutorial has a lot more hands on parts, so I skip some of the sections for note purposes when there is not much substance to them other than following inputs. A key in finite state machines is that an object can only ever be in exactly one state at a time. This helps ensure each state be completely self contained. Elements of a Finite State Machine: Context: maintains an instance of a concrete state as the current state Abstract State: defines an interface which encapsulates behaviors common to all concrete states Concrete State: implements behaviors specific to a particular state of context To get started in the tutorial, they created a public abstract class PlayerBaseState which will be the abstract state for this example. PlayerController_FSM is the c...

UnityLearn - Beginner Programming - Finite State Machine - Pt. 01 - Managing State

Novemeber 15, 2019 Beginner Programming: Unity Game Dev Courses Beginner Programming: Unity Game Dev Courses Unity Learn Course - Beginner Programming Managing State Project Overview This part of the tutorial has a lot more hands on parts, so I skip some of the sections for note purposes when there is not much substance to them other than following inputs. The basics covered in this section are: What is state and how to manage it Finite State Machine pattern Build your own finite state machine Introduction State: condition of something variable State Examples: Game state, Player state, NPC State Finite State Machine: abstract machine that can be in exactly one of a finite number of states at any given time Parts of a Finite State Machine: List of possible states Conditions for transitioning between those states State its in when initialized (initial state) Naive Approach to Managing State This naive approach focuses on boolean states and if staement...

Programming A* in Unity

November 14, 2019 A* Programming Unity A* Pathfinding (E01: algorithm explanation) Tutorial #1 - Link By: Sebastian Lague Unity - A Star Pathfinding Tutorial Tutorial #2 - Link By: Daniel Unity3D - How to Code Astar A* Tutorial #3 - Link By: Coding With Unity I have used A* before, but I would like to learn how to setup my own system using it so that I can make my own alterations to it. I would like to explore some of the AI methods and techniques I have discovered in my AI class and use that to alter a foundational pathfinding system built with A* to come up with some interesting ways to influence pathfinding in games. I would eventually like to have the AI "learn" from the player's patterns in some way to influenece their overall "A* type" pathfinding to find different ways to approach or avoid the player.

Maya Tutorials - Basics and Fish

November 11, 2019 Maya Modeling Basics and Fish Tutorials Maya Fish Tutorial Part 1 Modeling Tutorial #1 - Link By: Alberto Alvarez Cartoon animals). Fish 3d modeling in Autodesk Maya 2016 Tutorial #2 - Link By: Cartoon with MK 3D Shark Modeling Tutorial - Autodesk Maya 2018 Tutorial #3 - Link By: Vedant VFX I may explore transitioning one of my game projects that I worked on from a 2D game to a 3D game. It's mostly sea themed at this point so it would help to be able to put some basic fish shaped models together, so I gathered some sources on a wide variety here just to get started. These videos give me a detailed tutorial on a general fish, with a quick look at how people have made sharks and more cartoon styled fish.

UnityLearn - Beginner Programming - Observer Pattern - Pt. 03 - The Observer Pattern

Novemeber 7, 2019 Beginner Programming: Unity Game Dev Courses Beginner Programming: Unity Game Dev Courses Unity Learn Course - Beginner Programming The Observer Pattern The Observer Pattern Observer Pattern: software design pattern in which an object, called the subject, maintains a list of dependents, called observers, and notifies them of any state change, usually by calling one of their methods Observer Pattern Anatomy Subject collection of observers method: AddObserver method: RemoveObserver method: NotifyObservers Observer method: Notify (what to do when notified) An interface is a good way to ensure observers have the types of methods you need to exist when notified by the subject. Implementing the Observer Pattern This was an example of how to setup a basic observer pattern using the example project. First they created the interface for the observers, which was named IEndGameObserver. This simply held an empty method named Notify(). They t...

HFFWS Thesis Project - Theory for General Generation System Architecture

November 6, 2019 HFFWS Puzzle Generation System General System Architecture General Notes Pulley Varieties I wanted to start with sketching out the general structure of a single puzzle type to help me get a better idea of what a useful general structure might look like for the overall puzzle generating system I want to make. Hook on an end to latch onto other objects Object to move can be used as a platform Open heavy door Focus on rotation of wheel Build a pulley (Rope puzzle) Move two rope conjoined objects somewhere to accomplish a goal Breakdown of what I can currently alter/generate in rope/pulley tool Objects (at ends of rope) Objects (for wheels) Length (of rope) Position (of rope) Position(s) (of wheel(s)) I then quickly sketched out what I could change with the current controllable parameters to match the various puzzle variations (I only did the first three for now just to work it into testing quicker). Hook on end Objects at ends Hook...

UnityLearn - Beginner Programming - Observer Pattern - Pt. 02 - Working with Multiple Subscriptions

Novemeber 5, 2019 Beginner Programming: Unity Game Dev Courses Beginner Programming: Unity Game Dev Courses Unity Learn Course - Beginner Programming Working with Multiple Subscriptions Creating a Parameterized Event Parameterized Event: an event that takes in at least one parameter Points of Reference A subscriber must have a reference to the publisher (class raising the event) in order to be able to subscribe to that event. The general pattern for making delegates and events from how they have done it so far is that you create the overall delegate type that you will want the events to use outside of a class definition and public (so that all classes that want to make an event of this delegate type can use this single delegate type as a reference). The events themselves are then within the class definition, and use that newly created delegate type. Example Breakdown I broke down the tutorial example in order to better understand it. The parameterized event i...

UnityLearn - Beginner Programming - Observer Pattern - Pt. 01 - Handling Events

Novemeber 4, 2019 Beginner Programming: Unity Game Dev Courses Beginner Programming: Unity Game Dev Courses Unity Learn Course - Beginner Programming Handling Events The Demo Project This section focused on handling inter-object communications. They covered direct object calls, tight coupling, and loose coupling. This topic was covered using mostly delegates and events. Events: something that happens within the context of one object to be communicated to other The first objective of the tutorial was to restric the rate of fire of the player ship so that it could only have one projectile on the screen at any time. They could not fire again until that projectile was destroyed (which in this case, only occurred once it left the screen). Direct Object Calls Direct Object Calls: directly make a call from within one object to a method in another object (usually through public methods) Example: The ship needed to be able to fire again when the projectile reached the end ...