Pathfinding in Unity
5.0 (2 ratings)
Instead of using a simple lifetime average, Udemy calculates a course's star rating by considering a number of different factors such as the number of ratings, the age of ratings, and the likelihood of fraudulent ratings.
65 students enrolled
Wishlisted Wishlist

Please confirm that you want to add Pathfinding in Unity to your Wishlist.

Add to Wishlist

Pathfinding in Unity

implementing A* search and graph search algorithms in Unity
New
5.0 (2 ratings)
Instead of using a simple lifetime average, Udemy calculates a course's star rating by considering a number of different factors such as the number of ratings, the age of ratings, and the likelihood of fraudulent ratings.
65 students enrolled
Created by Wilmer Lin
Last updated 9/2017
English
English [Auto-generated]
Current price: $10 Original price: $30 Discount: 67% off
5 hours left at this price!
30-Day Money-Back Guarantee
Includes:
  • 4 hours on-demand video
  • 1 Article
  • 27 Supplemental Resources
  • Full lifetime access
  • Access on mobile and TV
  • Certificate of Completion
What Will I Learn?
  • Understand the fundamentals of graph search algorithms
  • Implement your own basic version of A*
View Curriculum
Requirements
  • Unity 3D version 2017 or above (personal FREE edition)
  • Mac or PC
  • OPTIONAL Photoshop or image-editing program to customize level data
Description

Description

This course is designed for intermediate users of Unity (see the Prerequisites for specific topics you should be familiar with before joining). 

Though Unity comes pre-packaged with an excellent pathfinding system, we explore beyond using a black box to calculate paths through your game levels.

Pathfinding and search algorithms are a core component of game development.  If you want to level up your skills, enroll today and dive into implementing your own version of A* search!

Through a carefully crafted set of lectures we learn search algorithms, starting with Breadth-First Search, diving in Dijkstra's algorithm and culminating with the industry-standard A* search for pathfinding.

All concepts are presented with easy-to-understand visuals! 

Some other bonus features of those course:

  • learn to use text files or texture maps to drive level data in Unity
  • learn how to implement a priority queue (binary heap) in C#
  • learn to structure a small project using the MVC(Model View Controller) design pattern



Who is the target audience?
  • intermediate Unity developers with good working knowledge of C#
  • anyone who wants to implement graph search algorithms in Unity
Students Who Viewed This Course Also Viewed
Curriculum For This Course
32 Lectures
04:09:47
+
Introduction
3 Lectures 11:22

Welcome to Pathfinding in Unity!

Preview 01:22

Before you begin this course, please review the prerequisites.  This course is intended for Intermediate Unity developers with experience in C# scripting.

Preview 04:00

Here let's review the naming conventions that we use for the included Unity project.

Preview 06:00
+
Constructing a Maze
11 Lectures 01:17:10

Let's review the basics of pathfinding.   Graphs are a set of interconnected nodes, which are joined by edges.  We will apply this data structure to a physical map, allowing us to solve for a path through a maze.

Preview 03:18

Each graph is made of nodes.  Let's define a class for our most basic object, the Node.

The Node class
06:00

In this lesson, we define a MapData class, designed to read the level data into the Graph.

The MapData class
05:29

We will create a Graph class to manage the various nodes which will comprise our level.

The Graph class
06:07

Our nodes will be connected by proximity.  In this lesson, we define a set of compass directions and establish how nodes and their neighbors are connected.

Neighbor Nodes
07:26

Let's use the MVC (Model View Controller) design pattern to create some new components.  We will make an interface class called the NodeView specifically designed for displaying a Node onscreen.

NodeView
08:25

Let's create another user interface class, the GraphView, for managing all of our NodeViews.

GraphView
08:54

In this lesson, we review creating level data as a Text Asset, allowing us to store our map as a simple set of ASCII characters on disk.

Text Mapdata Part 1
07:54

In this lesson, we create the MakeMap method in the MapData class, allowing us to read the 1's and 0's from our ASCII Text Asset.  Now we have a much easier means of generating our level maps!

Text MapData Part 2
08:56

We can use the Resources command to help organize our project folders.  Setting up the default Resources folder allows us to look for map data without needing to browse for files explicitly in the Inspector! 

Resources
04:42

If using a text editor to create your level map is too cumbersome, let's use our favorite image editor to create a level!  Using a one-pixel brush we can save our maze in a super small image file.  This is a super interactive way to create new levels!

Image Mapdata
09:59
+
Pathfinding Algorithms
18 Lectures 02:41:14

The Pathfinder class
10:12

Search Part 1
05:32

Search Part 2
06:22

Node Arrows
10:12

Path Nodes
09:16

Breadth First Search
11:59

Dijkstra's Algorithm
05:06

Node Distance
04:41

Dijkstra's Search
11:09

Priority Queue Part 1
06:59

Priority Queue Part 2
12:27

Priority Queue Part 3
11:34

Terrain Cost Part 1
12:52

Terrain Cost Part 2
14:01

Greedy Best-First Search
11:58

In this lesson, we tweak our Pathfinder search routine to implement A* search!

A* Search
12:35

Code Comments
00:01
About the Instructor
Wilmer Lin
4.8 Average rating
609 Reviews
6,578 Students
4 Courses
Game Developer / Visual Effects Artist

Wilmer Lin is a 3D and visual effects artist with over fifteen years of industry experience and has trained several hundred artists over the course of a decade. Now an independent game developer, Wilmer helps aspiring gamedevs learn the craft of programming and designing video games using Unity3D, Maya and Photoshop.