The Beginner's Guide to Artificial Intelligence in Unity.
- Description
- Curriculum
- FAQ
- Reviews
Do your non-player characters lack drive and ambition? Are they slow, stupid and constantly banging their heads against the wall? Then this course is for you. Join Penny as she explains, demonstrates and assists you in creating your very own NPCs in Unity with C#. All you need is a sound knowledge of Unity, C# and the ability to add two numbers together.
In this course, Penny reveals the most popular AI techniques used for creating believable character behaviour in games using her internationally acclaimed teaching style and knowledge from over 25 years working with games, graphics and having written two award winning books on games AI. Throughout, you will follow along with hands-on workshops designed to teach you about the fundamental AI techniques used in today’s games. You’ll join in as NPCs are programmed to chase, patrol, shoot, race, crowd and much more.
Learn how to program and work with:
-
vectors
-
waypoints
-
navmeshes
-
the A* algorithm
-
crowds
-
flocks
-
animated characters
-
vehicles
Contents and Overview
The course begins with a detailed examination of vector mathematics that sits at the very heart of programming the movement of NPCs. Following this, systems of waypoints will be used to move characters around in an environment before examining the Unity waypoint system for car racing with AI controlled cars. This leads into an investigation of graph theory and the A* algorithm before we apply these principles to developing navmeshes and developing NPCs who can find their way around a game environment. Before an aquarium is programmed complete with autonomous schooling fish, crowds of people will be examined from the recreation of sidewalk traffic, to groups of people fleeing from danger. Having examined the differing ways to move NPCs around in a game environment, their thinking abilities will be discussed with full explanations and more hands-on workshops using finite state machines and behaviour trees.
The follow-along workshops included in the course come with starter Unity asset files and projects complete with solutions. Throughout, there are also quizzes and challenge exercises to reinforce your learning and guide you to express your newfound knowledge.
At the completion of this course you will have gained a broad understanding of what AI is in games, how it works and how you can use it in your own projects. It will equip you with a toolset to examine any of the techniques presented in more depth to take your game environments to the next level.
What students are saying about this course:
-
This has been my favourite Udemy-Unity course so far. It took me from literally 0% knowledge of how game AI is achieved, and took me to a whole new level. Waypoints, pathfinding, state machines, etc etc etc are all covered in-depth and will reveal the magic (spoiler alert: it isn’t magic) behind making your computer characters seem like they really have a mind of their own.
-
Oh My God. I love her way of teaching things. I haven’t finished this course yet. But all i can say is that it is another brilliant course from her. Artificial intelligence by itself is a tricky thing to do. And before starting this course i never thought that i will understand anything in it. But i was wrong. With her style of teaching, you will learn how to move your characters in an ”intelligent“ way. This course is perfectly sliced and the pace is wonderful.
-
1IntroductionVideo lesson
This lecture introduces the course by outlining all the content that will be covered with a section by section breakdown.
-
2Join the H3D Student CommunityVideo lesson
H3D has a bustling online student community. Here's how to get involved.
-
3FAQ'sText lesson
-
4Not So Scary Vector MathematicsVideo lesson
In this lecture we will get an overview of vectors and why they are an important concept to have an understanding of before you launch into programming the movement of an NPC.
-
5Vector Mathematic Basics Cheat SheetText lesson
-
6Test your vector mathematics knowledgeQuiz
-
7Important Note Regarding Unity Updates to FBX Model ImportingVideo lessonUnity uses the FBX file format by default to represent 3D models. Within Unity 2017 and greater the way the files are dealt with has changed slightly and may cause you to lose the textures from your models. Take note of the process in this lecture that will assist you in fixing this issue when you encounter it later in the course.
-
8Vectors and Moving in a Straight LineVideo lesson
In this lecture we will take a quick look at the nature of vectors and then discuss through a practical application how they can be used to move a character forward at a constant speed.
-
9Traveling to a Goal LocationVideo lesson
Follow along in the lecture as we setup a goal location for the character to move towards. You will also be shown how to change the facing direction of a character such that it looks in the direction it is travelling.
-
10Pushing the Character ForwardVideo lesson
In this lecture we will examine a different approach to moving the character. This time instead of setting a vector to travel along we will turn the character towards a goal and then push the character in a forward direction.
-
11SlerpingVideo lesson
Instead of snapping a character around to face a goal in a single update you may want more smooth turning behaviour to occur that makes the movement appear more natural. In this lecture we will examine the slerp method for achieving this.
-
12About Animation and TranslationVideo lesson
In this lecture we will take a quick look at the difference between animation translation and translating with code. Eitherway is acceptable and it will depend on what you are trying to achieve with the look of your character as to which one is more appropriate.
-
13WaypointsVideo lesson
In this lecture we will look at the simplest form of AI navigation: waypoints. Using the code we've developed thus far by giving the NPC an array of goals we can change its behaviour from chasing to patrolling.
-
14ChallengeText lesson
-
15Unity's Waypoint SystemVideo lesson
If you import the Utilities from Unity's included assets you'll find code for setting up waypoints and navigating a circuit. In this lecture we will look at how to integrate these Unity asset's with our own code.
-
16Car Racing with WaypointsVideo lesson
In this lecture we will examine how to create a simple car NPC that can accelerate and brake while following a circuit tracker.
-
17Customising Car BehavioursVideo lesson
Continuing where we left the previous lecture we will add in another car and set about making the properties of the movement behaviour customisable.
-
18Unity's Vehicle SystemVideo lesson
Inside Unity's Standard Assets you will find the setup for a Waypoint following AI car with many customisable properties. In this lecture we will explore this feature as well as discuss how to add your own custom model into the system.
-
19Graph Theory and PathfindingVideo lesson
Graph Theory underpins so many AI techniques and it certainly deserves some focussed attention. In this lecture we will examine the structure of graphs and several path searching algorithms will be discussed.
-
20Pathfinding through WaypointsVideo lesson
In this lecture we will apply the A* algorithm to finding a path through a system of waypoints converted into a graph.
-
21Pathfinding through Waypoints Part 2Video lesson
In part 2 of this hands-on workshop to put together a waypoint graph traversal system using the A * algorithm we will add UI buttons to send location commands to the NPC.
-
22ChallengeText lesson
-
23Waypoints in 2DText lesson
This short article will explain how the code for dealing with 3D waypoints can be modified for 2D environments.
-
24NavMesh BasicsVideo lesson
In this lecture we will modify the pathfinding exercise created thus far and introduce the concept of a NavMesh. This will reduce the amount of code we need to write as well as the time taken to setup a waypoint system manually.
-
25From Waypoints to NavMeshVideo lesson
In this lecture we will turn the previous waypoint system with the tank into a navmesh based project.
-
26NavMesh Agents Part 1Video lesson
In this lecture we will start taking a closer look at the navmesh agent component and explore the various settings for the baked nav mesh agent that controls how the navmesh is generated.
-
27NavMesh Agents Part 2Video lesson
Agents can be assigned different areas of the NavMesh through which to travel. In this lecture we will look at how to set up different areas with different costs and associate the agents with them.
-
28Following a Player on A NavMesh and Setting-Up Off Mesh LinksVideo lesson
The test of a NavMesh is to try it out with a real character in a real situation. It's then you'll find glitches in the default settings and automatically generated paths. Without having to remodel the environment, off-mesh links can be generated to provide smooth paths were their aren't any. In this lecture we will make a character follow a first person player character around a map while tweaking the NavMesh to handle different situations when gaps and drops appear in the NavMesh.
-
29Fixing Mixamo TexturesText lesson
This video link describes how to fix textures on imported FBX files from Mixamo.
-
30Animating on a NavMeshVideo lesson
In this lecture we will examine how the NavMesh agent code and be coordinated with character animation to provide smooth and believable movement of a character when pathfinding over a NavMesh.
-
31Syncing Animation Speed with NavMesh Agent SpeedVideo lesson
In this short lecture I will demonstrate how to sync the animation speed with the nav mesh agent speed.
-
32Multiple NavMeshes for Different Agent SizesVideo lesson
In order to include multiple navmeshes to cater for multiple different navmeshagent sizes we need to turn to some beta code that isn't currently included in Unity but available for download and inclusion. In this lecture we will walk through the setups of creating multiple navmeshes after a quick refresher on setting up humanoid animations with strafe sets.
-
33ChallengeText lesson
-
34Seek and FleeVideo lesson
In this video students will follow along to implement simple seek and flee methods for a Nav Mesh agent.
-
35PursuitVideo lesson
In this video students will learn about the differences in dynamics between the seek and pursuit behaviours and add an new method for moving an agent into the code.
-
36EvadeVideo lesson
In this video students will be challenged to create their own evade method which will see the agent move away from the predicted location of the target.
-
37WanderVideo lesson
In this video students will examine one method of producing a wandering behaviour that will have the agent freely walk around the environment with smooth randomness.
-
38Hide Part 1Video lesson
In this video students will take a look at the basics behind the hide behaviour. In it we will create a simple hide method that will have the agent hide behind the closest obstacle in the environment.
-
39Hide Part 2Video lesson
In this video students complete the development of the hiding behaviour and work to calculate a more accurate hiding location and reduce the number of calls to the method in the update.
-
40Complex BehavioursVideo lesson
In this video students will learn how to combine a number of steering behaviours with simple geometric conditions to produce complex behaviours in agents.
-
41Behaviour ChallengeVideo lesson
In this video students will be challenged to integrate the wander behaviour into the complex behaviour to have the agents go into a wander when the target cop is out of range.
-
42Crowd SimulationVideo lesson
There are many factors to included in a crowd simulation... or are there? Seemingly very complex movement behaviour can be generated for groups of characters with some very simple rules. This lecture will show you how.
-
43Creating a City Crowd Part 1Video lesson
In this series of lectures we will set up a city scene with a crowd walking along the sidewalk.
-
44Creating a City Crowd Part 2Video lesson
This lecture continues on from the last adjusting animation behaviours and speeds to vary from agent to agent as well as introduces the concept of a dynamic obstacle that can move around a navmesh and be avoided by the agents.
-
45FleeingVideo lesson
A behaviour seen in NPC movement is fleeing. This is a technique for steering a character away from danger. In this lecture we will look at the mathematics involved in the movement and apply it to the crowd simulation.
-
46Flocking Part 1Video lesson
Flocking is capable of producing incredible behaviour from three simple vector calculations. In this lecture you will learn how to apply this to the development of schooling fish.
-
47Flocking Part 2Video lesson
In this second part of the flocking workshop we will add extra behaviours to the fish by controlling the boundary of their swimming range.
-
48Flocking Part 3Video lesson
The third part of the flocking workshop will explore ways in which the fish can avoid obstacles in their environment through raycasting and vector calculations.
-
49Challenge 1Text lesson
-
50Challenge 2Text lesson
-
51Challenge 3Text lesson
-
52Line of SightVideo lesson
In this lecture we will develop an NPC that can detect the presence of a player and act accordingly. We will implement step-by-step this algorithm which is one of the simplest AI techniques used.
-
53Finite State Machines Part 1Video lesson
Finite State Machines are a staple AI method used in games as they elegantly segregate the states, behaviours and logic used by NPCs. In part one we will begin looking at how the Unity animation system can be used to create such a machine.
-
54Finite State Machines Part 2Video lesson
In this second part of the FSM workshop we will add a base NPC class to enable sharing of properties between behaviour scripts and then add in the functionality to move from patrol to chase and back again.
-
55Finite State Machines Part 3Video lesson
In the final FSM lecture, steping you through the setup for a FSM, we will complete the example by adding in bullet shooting functionality and states onto the NPC tank.
-
56Converting the FSM to Work on a NavmeshVideo lesson
In this short lecture I'll show you how to convert the waypoint system used to move the tank around to have the same FSM work on a navmesh.
-
57ChallengeText lesson
-
58Introduction to Behaviour TreesVideo lesson
In this lecture Behaviour Trees will be introduced. Well take a look at their structure and the theory of their execution.
-
59Sequence Nodes Part 1Video lesson
This lecture begins by taking you through the setup for our behaviour tree project before starting with a very simple sequencial behaviour tree as a demo.
-
60Sequence Nodes Part 2Video lesson
We continue our examination of sequences in this lecture by creating a longer set of actions and modifying different behaviour tree specific returns discover what makes sequences run and fail. Towards the end we will start creating a new behaviour tree for attacking and take a look at the wait leaf node.
-
61Embedding Logic in Behaviour TreesVideo lesson
In this lecture we will take a look at the while decorator node that allows you to invert the value of an action and also perform logic tests in the tree at a higher level than leaf nodes.
-
62Selector NodesVideo lesson
This lecture will introduce the selector node. This type of node can be used when any (but only one) of the children nodes need to run.
-
63More Logic for Complex BehavioursVideo lesson
In this lecture we will complete the full set of single behaviour trees that will define all behaviours of the agent by adding the abilities to flee from danger and die.
-
64Putting Together a Complex Behaviour TreeVideo lesson
To finish our investigation into Behaviour Trees all the smaller trees made throughout this section will be combined to inform the total behaviour of the agent droid. A final version of the project is attached as a download.
-
65ChallengeText lesson
-
66Introduction to GOAPVideo lesson
Goal-Orientated Action Planning is an AI technique that turns Finite State Machines on their head. It decouples goals from actions and provides for a very dynamic NPC behavioural system.
-
67Getting Started with GOAP in UnityVideo lesson
In this lecture we will get started with GOAP by setting up a simple scene and adding an agent.
-
68Adding Actions to GOAPVideo lesson
In this lecture the GOAP agent will be given its first set of actions.
-
69Adding Multiple Plans to GOAPVideo lesson
To create more complex behaviours in an agent you can add multiple plans that it can execute when the world states are right. In this lecture we will do this by extending the baker behaviour.
-
70Global States and Multiple AgentsVideo lesson
Even more complexity can be added when multiple inventories and agents are introduced to the system. This lecture will take you through the addition of a world inventory as well as a new agent type.

External Links May Contain Affiliate Links read more