Goal-Oriented Action Planning (GOAP) is an AI architecture that provides game characters with the ability to select goals and make plans to achieve those goals based on the state of the environment and available resources. It can be used across a wide range of game genres from first-person shooters to real-time strategies, to develop intelligent characters capable of making smart decisions without the need for large finite state machines. The codebase is deceptively simple and yet logical, reusable and extremely powerful. The library is written in C# and implemented in Unity V.2019, however will easily port to other applications.
Goal-Oriented Action Planning (GOAP) is an AI architecture that provides game characters with the ability to select goals and make plans to achieve those goals based on the state of the environment and available resources. It can be used across a wide range of game genres from first-person shooters to real-time strategies, to develop intelligent characters capable of making smart decisions without the need for large finite state machines. The codebase is deceptively simple and yet logical, reusable and extremely powerful. The library is written in C# and implemented in Unity V.2019, however will easily port to other applications.
The projects in this course have been tested with and work in Unity 6.
In this course, Penny demystifies the advanced AI technique of GOAP used for creating believable and intelligent game characters 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 take you through every step of putting together your own GOAP API. You will build the entire GOAP library from the ground up while building a hospital simulation scenario in parallel, to test the API as you go.
Learn how to program and work with:
A GOAP Library and API that's reusable across a wide range of game projects.
Goals, Actions, States and Beliefs that define the state of the game environment, what individual characters want to do and how they understand their world.
Navigation Meshes and Agents that provide advanced path planning and navigation capabilities for characters.
Dynamic Building of NavMeshes to allow for the repositioning of resources in the environment.
Inventories for each character for use in completing tasks that satisfy character goals.
The Unity UI system to move draggable resources into a game environment.
Contents and Overview
Throughout the course, you will follow along while a GOAP library and API are constructed from the ground up, to allow you intimate knowledge of the codebase. Alongside this, a simple hospital simulation will be constructed to test out the functionality of the library as it is put together. The simulation will also rely on Unity's NavMesh System for navigation and path planning.
The course begins with an overview of Unity's NavMesh System and covers the basic functionality needed for the hospital simulation. It then goes on to cover the concept of GOAP, where students will discover how goals, actions and plans interact. A planner will be constructed that dynamically builds each character's sequence of actions, based on what they believe their goals are while in the simulation.
Following this, inventories will be introduced and developed to hold resources for individual characters. The resources in the inventories will be required for plan completion and also assist in directing a character's navigation around the environment. This will then build to the design of more complex behaviours in which two characters must collaborate to complete a plan.
As the course continues, more characters with differing roles will be added and dynamically created and resources will be added and removed to develop a complex simulation. By the end of the course, students will have a hospital simulation with patients, nurses, doctors and janitors each with their own roles, goals, actions and required resources.
Although this course is not about building a completed game, a final section will provide some further knowledge on Unity development and examine methods for interacting with the environment such as: dragging and dropping items, dynamic NavMesh baking, user interface creation and camera movement to provide students with some direction on how such a simulation could be turned into a game.
At the completion of this course, students will have a fully-fledged GOAP library and API that they can reuse in their own game projects to provide game characters with complex intelligent behaviours.
What students are saying about Penny's courses:
Turns out, the hardest part of this course for me is finding the words to describe how glad I am to have enrolled in it.
I honestly love Hollistic's teaching approach and I've never learned so much within a few hours about coding effectively with such detailed explanations.
Penny is an excellent instructor and she does a great job of breaking down complex concepts into smaller, easy-to-understand topics.
This video provides a welcome to the course and overview of the content.
H3D has a bustling online student community. Here's how to get involved.
How to contact us
Here's how to get the best experience from studying this course and answers to some popular student questions.
In this video students will learn how to setup the AI Navigation package for the versions of Unity that it is not automatically included with. This package will be used later in this course.
While this course was developed in a previous version of Unity, we've tested the projects and they work with Unity 6. This video is a guide to help you adjust your learning in this course to use Unity 6.
In this lecture you will be introduced to the concept of navigation meshes and go through the settings available in Unity.
In this lecture you will follow along as a navigation mesh is constructed from some game object prototypes and learn how to set agent radii, jump distances, drop heights and bake the environment.
In this video students will learn how to program a NavMeshAgent to travel between locations on a navigation mesh where the user can designate a location by clicking on the game environment.
This lecture introduces the AI technique of Goal-Oriented Action Planning or GOAP. It demonstrates how a powerful behaviour planner can be created by decoupling actions and goals.
This video introduces the starter file that will be used for this section. Each part of the game project will be examined with respect to the nav mesh setup, the agents and the simulation about to be created.
Before jumping into the coding of a GOAP system the agents involved in the scenario will be examined and their planning process and actions discussed.
In this video we will start building the world states classes that hold, set and manipulate the states of the game environment required for GOAP planning.
In this lecture we will create the base class for actions. It will be used later on to create all the actions an agent requires by specifying their preconditions, effects, durations and locations.
In this video we will create the basic structure of a class that will drive the GOAP Agent.
In this lecture we will start working on the basic structure of the GOAP Planner class. It will be the workhorse of the project matching actions in a plan with goals, preconditions and effects.
In this video we will complete writing the basic GOAP Planning class by adding in its all important recursive graph building method.
In this video we will write the code that controls the execution of a plan and that's the contents of the agent's LateUpdate method.
In this video we will begin creating multiple actions that need to be strung together to create a longer plan that will have the agent moving around the environment.
In this video we will begin building queues to hold game objects as resources that can be used in the planning process.
In this video we will start working with multiple resources being available in the world and put together an inventory system for agents to have ownership over these resources.
In this video we will work on creating an action that is dependent on items in the agent's inventory. With this we'll program the patient to go to the cubicle.
This video presents just one way to solve the challenge posed at the end of the previous one and that is how to get the nurse to follow the patient to the cubicle.
In this video we will add an extra goal to the patient to make them go home after they are treated and fix a pesky little bug in the navigation mesh system.
In this final video on the GOAP system we will a time based trigger for a nurse and then finalise the little simulation by adding a multitude of nurses.
In this video students will undertake a challenge to add in a new doctor character to the simulation.
In this two part lecture I will demonstrate how to add a new model that is to become a resource and debug and little issues that arise when adding new functionality to the system.
In this video we complete the addition of a toilet cubicle to the simulation and program the doctor to visit it as a goal.
In this video you will be challenged to repeat the adding of a new resource to the environment and add in a toilet cubicle that can be used by the doctors.
In this video we will add the same action originally created for the doctor onto the other agent types and trouble-shoot its addition and use.
In this video you will learn how to refactor the GWorld class to make adding queues of resources simpler.
In this video you will build a class to monitor a particular state of an agent and if the agent is in that state too long a resource will be produced.
In this video you will begin with a challenge to have the Janitor clean up the puddles that appear in the environment.
In this video you will learn how to use the mouse to select a location in the environment to add a new resource and then drag it around.
In this video we will examine how to make a dynamic Navmesh that can be added to and rebaked at runtime.
In this video you will learn how to reselect an existing resource and reposition it in the environment.
In this video we will add in the functionality to delete a resource.
In this video we will rework the WInterface code to be more flexible when working with multiple resources and add scriptable objects to help hold onto the resource data.
In this video we will add a simple user interface with buttons to allow you to select the resource you would like to add into the environment.
In this video we will work on the reposition of resources to make it more predictable to ensure they stay on the floor.
In this video we will add some simple script to the camera to make it pan, zoom, tilt and rotate around the game environment.
Here are some final words about the course now you've finished.
Where you should take your game development learning journey next.
In this article students are provided with guidelines on extending their GOAP system with a chase and attack scenario.
OpenCourser helps millions of learners each year. People visit us to learn workspace skills, ace their exams, and nurture their curiosity.
Our extensive catalog contains over 50,000 courses and twice as many books. Browse by search, by topic, or even by career interests. We'll match you to the right resources quickly.
Find this site helpful? Tell a friend about us.
We're supported by our community of learners. When you purchase or subscribe to courses and programs or purchase books, we may earn a commission from our partners.
Your purchases help us maintain our catalog and keep our servers humming without ads.
Thank you for supporting OpenCourser.