We may earn an affiliate commission when you visit our partners.
Penny de Byl and Penny Holistic3D

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.

Read more

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.

Enroll now

What's inside

Syllabus

Introduction

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.

Read more

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 section students unfamiliar with navigation mesh systems in Unity will have the chance of gaining a quick overview of all the tools needed to complete this course.

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.

In this section students will learn how goal-oriented action planning can be deployed to develop complex behaviours in game characters.

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 section students will learn how planning is achieved in the GOAP architecture and the role that goals and states have in constructing plans for characters to implement.

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 section students will expand their work on GOAP to examine the role world resources and inventories play in the planning and action completion 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.

In this section more complex and multiple plans will be added to the characters to give them a choice in which actions to perform that will make their behaviour dynamic.

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 section students will follow along as new functionalities are added to the GOAP system while examining where issues can arise in the code base, how to identify them and fix them.

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 section the GOAP system will be refactored to remove redundancy and allow for expansion of the game environment and available resources.

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 section students will learn some basic Unity methods for interacting with the environment that will assist them in turning their GOAP system into a game.

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.

In this section Penny provides some words on wisdom on the learning journey thus far and ideas for future studies.

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.

Save this course

Save Advanced AI For Games with Goal-Oriented Action Planning to your list so you can find it easily later:
Save

Activities

Be better prepared before your course. Deepen your understanding during and after it. Supplement your coursework and achieve mastery of the topics covered in Advanced AI For Games with Goal-Oriented Action Planning with these activities:
Review A* Pathfinding Algorithm
Reviewing A* pathfinding will help you understand how GOAP agents navigate the environment efficiently.
Show steps
  • Read articles and watch videos explaining the A* algorithm.
  • Implement A* in a simple environment.
  • Compare A* with other pathfinding algorithms.
Read 'Programming Game AI by Example' by Mat Buckland
Reading this book will expose you to other AI techniques and help you compare them to GOAP.
Show steps
  • Read the chapters related to behavior trees and state machines.
  • Compare the advantages and disadvantages of each approach.
  • Consider how these techniques could be combined with GOAP.
Read 'Artificial Intelligence for Games' by Ian Millington and John Funge
Reading this book will provide a broader understanding of AI in games and different approaches to behavior modeling.
Show steps
  • Read the chapters related to pathfinding and decision-making.
  • Take notes on key concepts and algorithms.
  • Relate the concepts to the GOAP system being built in the course.
Four other activities
Expand to see all activities and additional details
Show all seven activities
Practice Implementing Different Action Preconditions and Effects
Practicing with different preconditions and effects will improve your ability to design complex agent behaviors using GOAP.
Show steps
  • Create a list of different action preconditions and effects.
  • Implement each precondition and effect in the hospital simulation.
  • Test the behavior of the agents with the new preconditions and effects.
Create a Video Tutorial on a Specific GOAP Concept
Creating a tutorial will force you to deeply understand a specific GOAP concept and explain it clearly to others, reinforcing your own learning.
Show steps
  • Choose a specific GOAP concept (e.g., action preconditions, goal selection).
  • Prepare a script and examples to illustrate the concept.
  • Record and edit the video tutorial.
  • Share the tutorial with other students for feedback.
Implement a Simple GOAP System in a Different Game Engine
Implementing GOAP in a different engine will solidify your understanding of the underlying principles and improve your ability to adapt the system to different environments.
Show steps
  • Choose a game engine other than Unity (e.g., Godot, Unreal Engine).
  • Design a simple scenario with a few agents and goals.
  • Implement the GOAP planner and action execution system.
  • Test and debug the system to ensure it functions correctly.
Contribute to an Open-Source GOAP Project
Contributing to an open-source project will give you experience working with a real-world codebase and collaborating with other developers.
Show steps
  • Find an open-source GOAP project on GitHub or GitLab.
  • Read the project's documentation and contribution guidelines.
  • Identify a bug or feature to work on.
  • Submit a pull request with your changes.

Career center

Learners who complete Advanced AI For Games with Goal-Oriented Action Planning will develop knowledge and skills that may be useful to these careers:
Artificial Intelligence Programmer
An Artificial Intelligence Programmer designs and implements AI systems in video games. This includes creating believable character behaviors and intelligent decision-making processes. This course on Goal-Oriented Action Planning is directly relevant, as GOAP is a powerful AI architecture for developing intelligent game characters. Through hands-on workshops, you can build a reusable GOAP library and API, which are invaluable assets for an Artificial Intelligence Programmer. The course's exploration of goals, actions, states, beliefs, navigation meshes, and inventories all help build a foundation to creating compelling AI.
AI Designer
An AI Designer specializes in creating and implementing artificial intelligence systems within games. They focus on ensuring that the AI not only functions correctly but also enhances the gameplay experience. This course provides a practical understanding of creating intelligent and dynamic character behaviours using Goal Oriented Action Planning, giving the AI Designer specific techniques to create engaging non-player characters. The hand-on approach to building the GOAP library coupled with the examples shown in the hospital demonstrate how the AI can be integrated in to the gameplay.
Serious Game Developer
A Serious Game Developer creates games for purposes beyond pure entertainment, such as training, education, or healthcare. This course's focus on Goal-Oriented Action Planning is highly relevant, as GOAP can be used to create realistic and engaging simulations for training purposes. The course's hospital simulation project provides a direct example of how AI can be used to model complex real-world scenarios. Serious Game Developers in fields such as medical training or emergency response simulation will find this course extremely valuable for creating effective training tools. Consider that the final project has doctors, nurses, and janitors.
Gameplay Programmer
A Gameplay Programmer is responsible for implementing the mechanics and systems that make a video game interactive and engaging. This often involves creating AI for non-player characters. This course on Goal-Oriented Action Planning directly benefits a gameplay programmer by providing a solid understanding of how to create intelligent and dynamic character behaviors without relying on complex finite state machines. The course's focus on building a GOAP library from scratch, along with the hospital simulation, provides a practical understanding of how AI can be integrated into gameplay systems. Experience with Unity's NavMesh system, also covered in the course, is especially helpful for a Gameplay Programmer.
Simulation Engineer
A Simulation Engineer develops and implements simulations for various purposes, including training, research, and entertainment. The course's construction of a hospital simulation provides direct experience in developing a complex simulation environment. The use of Goal-Oriented Action Planning to control the behavior of characters within the simulation offers a powerful approach to creating realistic and dynamic simulations. Simulation Engineers, particularly those working in fields like healthcare or emergency response, could leverage the skills learned in this course to develop more sophisticated and realistic simulations. You may find inspiration in the fact that this course includes a hospital simulation.
Software Engineer
A Software Engineer develops software applications, and in the context of gaming, they could work on game engines, tools, or AI systems. This course on Goal-Oriented Action Planning provides valuable insight into AI design and implementation, particularly for creating intelligent agents. The course's hands-on approach to building a GOAP library and API, coupled with the hospital simulation project, offers practical experience in software design and development. A Software Engineer who understands AI principles can contribute significantly to game development projects. This course may be helpful if you want to develop core AI components for games.
Game Engine Developer
A Game Engine Developer works on the underlying technology that powers video games. This course on Goal-Oriented Action Planning can provide valuable insights into AI design and implementation for game engines. By understanding the principles of GOAP, a Game Engine Developer can create tools and systems that allow game developers to easily create intelligent and dynamic character behaviors. The course's hands-on approach to building a GOAP library and API offers practical experience that can inform the design of game engine features. You may find that this course enhances your understanding of game engine architecture.
Game Designer
A Game Designer conceptualizes and designs the various elements that make up a video game, including gameplay, characters, and AI. This course on Goal-Oriented Action Planning enhances a game designer's ability to create engaging and believable non-player character behaviors. By understanding the principles of GOAP, a Game Designer can design AI systems that allow characters to make smart decisions and react dynamically to the game environment. The course's focus on goals, actions, states, and beliefs provides a framework for designing compelling AI-driven interactions. This course may be useful for Game Designers seeking to deepen their understanding of AI.
Virtual Reality Developer
A Virtual Reality Developer creates immersive experiences for various applications. This course on Goal-Oriented Action Planning can be valuable for creating believable and interactive characters within virtual environments. By understanding the principles of GOAP, a Virtual Reality Developer can design AI systems that allow characters to react dynamically to user interactions and the virtual environment. The insights on Unity's NavMesh system could be particularly useful for developing realistic movement and navigation within virtual spaces. This may be useful if you want your non-player characters to show believable actions.
Augmented Reality Developer
An Augmented Reality Developer creates applications that overlay digital content onto the real world. Similar to virtual reality, this course's AI techniques can enhance the interactivity and realism of augmented reality experiences. The course's focus on Goal-Oriented Action Planning and character behavior can be applied to creating intelligent agents or virtual assistants that interact with users in augmented reality environments. The skills you learn will enhance your ability to design compelling AR experiences. You may find this course helpful for building robust augmented reality applications.
AI Research Scientist
An AI Research Scientist conducts research to advance the field of artificial intelligence. While this course focuses on a specific AI technique for games, it can provide a foundation for understanding more advanced AI concepts. The course's exploration of Goal-Oriented Action Planning and its implementation in a practical setting can be valuable for AI Research Scientists interested in areas such as planning, decision-making, and agent-based systems. An advanced degree, such as a Master's or PhD, is typically required. You may find the course beneficial for understanding AI planning paradigms.
Robotics Engineer
A Robotics Engineer designs, builds, and programs robots for various applications. While this course focuses on game AI, the principles of Goal-Oriented Action Planning can be applied to robotics to create intelligent and autonomous robots. The course's exploration of goals, actions, states, and beliefs provides a framework for developing robot control systems that can make decisions and execute plans in dynamic environments. The hands-on approach to building a GOAP library and API offers valuable experience in software design and implementation for robotics applications. You may consider this career if you enjoyed the GOAP framework.
Technical Artist
A Technical Artist bridges the gap between art and programming in game development. While this course is primarily focused on AI programming, the principles of character behavior and animation can be relevant to a Technical Artist. By understanding how AI drives character actions, a Technical Artist can create more realistic and engaging animations. The course may provide a broader understanding of how different game development disciplines interact. Technical Artists who want to understand how AI impacts character animation may find this course useful.
Machine Learning Engineer
A Machine Learning Engineer develops and deploys machine learning models. Though this course focuses on GOAP, a rule-based AI system, it may provide context for how AI agents make decisions and interact with their environment. Machine Learning Engineers might draw parallels between GOAP's planning process and reinforcement learning algorithms, where agents learn optimal behavior through trial and error. The course's emphasis on goals, actions, states, and beliefs can be useful framing for understanding agent behavior in machine learning contexts. You may appreciate how to structure agent decision making.
Data Scientist
A Data Scientist analyzes data to extract insights and develop predictive models. While this course primarily focuses on game AI, the underlying principles of planning and decision-making can be applied to data science. The course's exploration of goals, actions, states, and beliefs provides a framework for developing AI systems that can make data-driven decisions. Data Scientists interested in applying AI techniques to areas like recommendation systems or fraud detection may find the course directionally helpful. This course may be useful if you intend to apply AI planning principles.

Featured in The Course Notes

This course is mentioned in our blog, The Course Notes. Read one article that features Advanced AI For Games with Goal-Oriented Action Planning:

Reading list

We've selected two books that we think will supplement your learning. Use these to develop background knowledge, enrich your coursework, and gain a deeper understanding of the topics covered in Advanced AI For Games with Goal-Oriented Action Planning.
Provides a comprehensive overview of AI techniques used in games, including pathfinding, decision-making, and behavior modeling. It offers a strong theoretical foundation and practical examples that complement the GOAP concepts taught in the course. It valuable resource for understanding the broader context of game AI and exploring alternative approaches.
Provides practical examples of various AI techniques used in games, including finite state machines, pathfinding, and behavior trees. While it doesn't focus specifically on GOAP, it offers valuable insights into alternative AI architectures and can help you compare and contrast different approaches. It useful resource for expanding your knowledge of game AI beyond GOAP.

Share

Help others find this course page by sharing it with your friends and followers:

Similar courses

Similar courses are unavailable at this time. Please try again later.
Our mission

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.

Affiliate disclosure

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.

© 2016 - 2025 OpenCourser