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

Do your non-player characters (NPCs) 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.

Read more

Do your non-player characters (NPCs) 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.

This course uses Unity Version 2021.3 LTS

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 30 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

  • and industry standard techniques such as goal-oriented action learning and behaviour trees.

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.

Enroll now

What's inside

Learning objectives

  • Design and program npcs with c# in unity
  • Explain how ai is applied in computer games
  • Implement ai-related unity asset plugins into existing projects
  • Work with a variety of ai techniques for developing navigation and decision making abilities in npcs

Syllabus

By the end of this section students will understand what will be covered in the course and how to join our student community.

This lecture introduces the course by outlining all the content that will be covered with a section by section breakdown.

Read more

In this unit students will gain an understanding of the field of artificial intelligence and how it pertains to game development.

H3D has a bustling online student community.  Here's how to get involved.

Important Reading on Common Issues students have and how to ask for help.

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.

Vector Mathematics Basics Cheat Sheet
Test your vector mathematics knowledge
By the end of this section students will be able to apply vector mathematics and trigonometry to move an AI controlled character.

In this lecture students will learn about the Cartesian coordinate system and how points are defined in the space as well as 2D and 3D nature of a game environment.

In this video students will begin an exploration of vectors and discover their importance in measuring game environment space as well as defining direction of movement of game characters.

In this lecture students will learn how to normalise the movement of a game character by calculating a velocity to gradually move it from one location to another.

In this lecture students will learn how to determine the size of a vector to determine when a character has reached its goal as well as have AI characters follow a player character.

In this lecture students will learn to use Pythagorus' theorem to calculate the distance between points in a game environment and the length of a vector.

In this lecture students will learn how to use Unity methods to calculate distance.

In this lecture students will learn about the derivation of the dot product formulae and how it is used to calculate the angle between vectors for the purposes of rotating a game character.

In this lecture students will be challenged to calculate the angle between vectors to turn a game character to face another.

In this video students will learn about the derivation of the cross product and discover why it is important to include in processes involving the rotation of characters.

In this video students will be challenged to built an autopilot system to drive a character towards a goal and include turning in increments.

A Simple AI Pet Challenge Project
By the end of this section students will understand how physics principles are applied with respect to AI and use the principles to predict future character movement.

In this lecture students will examine the differing game loops that Unity runs and investigate how it affects the timing of character movements.

In this lecture students will learn how to smooth update values to give consistent rates of movement in game characters.

In this lecture students will learn how to work with velocity to control the speed of a rigid body.

In this lecture students will learn how to use velocity vectors to predict where a moving game object will be in the future.

In this lecture students will complete the code that works with a quadratic equation to predict the hit location between a projectile and enemy.

In this unit students will be introduced to acceleration as a means of calculating the shell's velocity and also introduced gravity into the equation.

In this lecture students will add the shell to fire from the red tank and also program it to move under speed and acceleration.

In this lecture students will complete their exploration of projectiles by examining drag and gravity.

In this unit students will learn about the parabola formed by projectile motion and use physics calculations to start programming an automatic attacking tank.

In this lecture students will learn how to calculate the trajectory of an arc made by a moving physics object to determine a hit location.

In this lecture students will learn how to use the trajectory calculations to have a Unity Physics system operated bullet hit its mark as well as create a simple AI character that will shoot at and follow an enemy.

By the end of this section students will be able to explain the A* algorithm and apply it to pathfinding scenarios.

In this lecture students will learn about the concepts behind the A* algorithm and take an in-depth look at its inner workings.

In this lecture students will write some preliminary code to get their project ready for the dedicated AStar method.

In this unit students will begin writing the A* algorithm by creating a start and goal location as well as marking them inside a maze.

In this lecture students will complete most of the code focused on running the A* algorithms logic.

In this lecture students will complete all but the last part of the code focused on running the A* algorithms logic.

In this lecture students will finalise their A* Pathfinding code to search from a starting location to an ending location and then determine the path points between them.

By the end of this section students will be able to explain how waypoints and graphs are used in the context of AI and create a map of waypoints for character movement.

In this unit students will learn about waypoints, how to place them on a map to form a circuit and how to program a vehicle to automatically navigate between them.

In this lecture students will learn how rotational speed and waypoint accuracy affect an AIs ability to traverse waypoints.

In this lecture students will create copies of many tanks with different driving attributes and explore the issues that using waypoints may incur.

In this lecture students will create a tracker object that will make its way around a circuit while the tanks follow.

In this lecture students will learn how to setup waypoints on a map that can later be used with the A* algorithm for finding a path around an environment.

In this lecture we will start writing a new set of classes to store a graph, with it's nodes and edges.

In this lecture students will learn how to introduce the A* algorithm into the graph class.

In this lecture students will complete writing the Graph class with the A* Algorithm code and be ready to continue working on the waypoint system.

In this lecture students will learn how to add the waypoints and edges to the graph and begin programming the AI code for their NPC.

In this lecture students will implement a waypoint path following code for the tank NPC.

In this lecture students will complete programming the waypoint navigation system by adding command buttons to the environment.

By the end of this section students will be able to use the Unity Vehicle Physics system to construct a car and write code have it drive a circuit automatically with acceleration, steering and brakes.

In this lecture students will learn how to apply a wheel collider and rigid body to a tyre.

In this lecture students will learn about wheel spring dampening and create a script to apply torque to the wheel.

In this lecture students will learn how to construct a car physics object by combining wheel colliders with meshes.

In this lecture students will learn how to turn the wheel collider so the front wheels can be used to determine a direction of travel.

In this lecture students will learn how to setup a waypoint system to define a circuit for the AI car to drive around.

In this lecture students will learn how to get a simple car NPC up and driving around waypoints using a steering mechanic.

In this lecture students will learn how to apply braking to slow a car as it approaches waypoints.

In this lecture students will learn about the forces placed on tires when driving and create code to flip the cars over when they flip onto their roof.

In this lecture students will learn how improve on the acceleration and braking based on the turning direction.

In this lecture students will learn how to add a progress tracker that can be used to guide the car around the track.

In this lecture students will learn how to add an antiroll bar onto the car to stabilising it from tipping over.

In this lecture students will learn how they can reconfigure the AIController code to organise all the variable settings for their cars.

In this lecture students will learn to create code to assist cars in avoiding other cars on the road.

In this lecture students will learn how to improve the avoiding behaviours and add reversing to their cars.

By the end of this section students will be able to construct a navigation mesh and use it to move characters around a game environment.

In this lecture students will learn about the principles and theory behind navigation meshes and how to construct one in Unity.

In this lecture students will learn how to convert a waypoint system to use the Navigation Mesh API that comes with Unity to achieve the same thing.

In this lecture students will practice setting up a navigation mesh from scratch and program a simple AI agent.

In this lecture students will learn some code optimisation techniques as well as program in the animations to synchronise with agent movement.

In this lecture students will learn how to restrict agents from going into certain areas on a navmesh.

In this lecture students will learn how to program AI navmesh characters to follow a player character in addition to using off mesh links to traverse gaps in the navmesh.

By the end of this section students will be able to program a finite state machine to create an intelligent non-player character that will react to the presence of a player.

In this lecture students will setup an environment ready for creating a finite state machine.

In this lecture students will start coding for the environment and design a state class.

In this lecture students will write up the state code for Idle and Patrolling.

In this lecture students will create the code to control the AI and provide an interface to the states.

In this lecture students will begin developing code so the NPC can determine if it senses the player and then act on it.

In this lecture students will complete the AI code that will cause the NPC to chase and shoot at the player as well as lose interest if the player goes out of range.

In this lecture students will be challenged to add a new state into the NPCs behaviour to make it run away when it is threatened.

By the end of this section students will understand the fundamental AI steering behaviours and be able to program and combine them to generate complex character behaviour.

In this lecture students will follow along to implement simple seek and flee methods for a Nav Mesh agent.

In this lecture students will learn the difference between seeking and pursuit and be able to add predictive code to their agent to make assumptions about where the target will be in the future.

In this unit students will be challenged to create their own evade method which will see the agent move away from the predicted location of the target.

In this unit students will examine one method of producing a wandering behaviour that will have the agent freely walk around the environment with smooth randomness.

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.

In this unit 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.

In this lecture students will learn how to implement code to stop the robber from moving if it can't see the cop.

In this video students will learn how to combine a number of steering behaviours with simple geometric conditions to produce complex behaviours in agents.

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.

By the end of this section students will be able to generate a crowd of animated humanoid characters that react to their environment as well as create animal flocking simulations.

In this lecture students will learn about the dynamics of crowd behaviour and watch some simple simulations.

In this lecture students will set up a navmesh with numerous animated humanoid agents and begin programming a crowded street scene.

In this lecture  students will finalise their work on creating a crowded city scape where humanoid agents walk from one end of a sidewalk to another.

In this lecture students will setup a project to drop an obstacle into the scene that the agents in the crowd will flee from.

In this lecture students will complete the fleeing simulation by adding code to the agents controller to calculate a flee direction.

In this lecture students will learn how the flocking algorithm works and begin setting up a project to create a schooling fish simulation.

In this lecture students will write a basic flocking algorithm to create a school of fish.

In this lecture students will learn how to add a goal position to the flocking simulation.

Good to know

Know what's good
, what to watch for
, and possible dealbreakers
Provides strategies for creating realistic AI behaviors, such as waypoint navigation and state machines, which are essential for believable and responsive NPCs
Emphasizes vector mathematics and physics principles, giving learners a strong foundation for understanding AI algorithms and their practical applications
Offers hands-on workshops and interactive materials designed to reinforce learning and provide practical experience in developing AI-powered characters
Led by an experienced instructor with over 30 years of expertise in game development and AI, providing learners with expert insights and guidance
Covers the latest AI techniques used in game development, ensuring that learners are up-to-date with industry standards
Requires a sound understanding of Unity, C#, and basic math concepts, making it suitable for intermediate to advanced learners

Save this course

Save The Beginner's Guide to Artificial Intelligence (Unity 2022) to your list so you can find it easily later:
Save

Reviews summary

Highly recommended unity ai guide

Learners say this course is highly recommended and leaves them pleasantly surprised. They commend the engaging lectures which they say are easy to understand and provide additional bonus tips and tricks for using Unity. Students highly recommend this guide and report feeling ecstatic after taking it.
Overwhelmingly positive reviews
"I had never used Udemy prior to this course and I have to say I was highly skeptical but I was very surprised (and ecstatic) to find how wrong I was!"
Knowledgeable and engaging instructor
"Udemy is amazing and this instructor is amazing."
Easy to understand with bonus tips
"Normally when watching a tutorial if you come away understanding 50% of what you were after then you are lucky but I felt I learned all I was after in this course plus tons of extra little bits about Unity."

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 The Beginner's Guide to Artificial Intelligence (Unity 2022) with these activities:
Organize and Review Course Materials
Helps students stay organized and reinforces understanding by encouraging them to review and compile the materials covered in the course.
Show steps
  • Gather all course materials
  • Organize the materials into a logical structure
  • Review the materials on a regular basis
Follow a Tutorial on Pathfinding Algorithms
Provides additional practice and reinforcement of pathfinding algorithms, a fundamental concept covered in the course.
Browse courses on Pathfinding
Show steps
  • Find a tutorial on pathfinding algorithms
  • Follow the tutorial and implement the algorithm in Unity
  • Test the algorithm using different scenarios
Attend an AI for Games Workshop
Provides an immersive and interactive learning experience by allowing students to attend a workshop focused on AI for games.
Browse courses on Game Programming
Show steps
  • Research and find an AI for games workshop
  • Register for the workshop
  • Attend the workshop
  • Participate actively in the workshop
  • Apply the knowledge gained from the workshop to your own projects
Five other activities
Expand to see all activities and additional details
Show all eight activities
Implement a Basic AI Controller
Reinforces fundamental AI concepts by implementing a simple AI controller using the concepts learned in the course.
Browse courses on Game Programming
Show steps
  • Create a new Unity project
  • Add an AI agent to the scene
  • Implement a simple seek behaviour
  • Implement a simple flee behaviour
  • Implement a simple patrol behaviour
Participate in a Class Discussion on AI for Games
Fosters collaboration and knowledge sharing by encouraging students to participate in discussions on AI for games, reinforcing key concepts.
Browse courses on Game Programming
Show steps
  • Attend the class discussion
  • Participate actively in the discussion
  • Ask thoughtful questions
  • Share your own insights and experiences
Read Artificial Intelligence for Games
Provides a comprehensive overview of AI techniques used in game development, reinforcing concepts covered in the course.
Show steps
  • Read Chapter 1: Introduction to AI for Games
  • Read Chapter 2: Steering Behaviours
  • Read Chapter 3: Finite State Machines
  • Read Chapter 4: Navigation Meshes
  • Read Chapter 5: Pathfinding
Design and Implement an NPC with Complex Behaviours
Challenges students to design and implement an NPC with complex behaviours, integrating multiple AI techniques covered in the course.
Browse courses on Game Programming
Show steps
  • Design the NPC's behaviours and state machine
  • Implement the NPC's behaviours using C# and Unity
  • Test and debug the NPC's behaviours
  • Create a video or written tutorial demonstrating the NPC's behaviours
  • Share the tutorial with the class or online community
Develop a Game with AI-Controlled Characters
Provides a comprehensive and challenging project that allows students to apply the AI techniques learned in the course to a real-world game development scenario.
Browse courses on Game Development
Show steps
  • Design the game concept and mechanics
  • Create the game environment and assets
  • Implement the AI for the game characters
  • Test and debug the game
  • Publish the game

Career center

Learners who complete The Beginner's Guide to Artificial Intelligence (Unity 2022) will develop knowledge and skills that may be useful to these careers:
AI Programmer
AI Programmers are responsible for writing the code that controls the AI for video games. They work on a wide range of tasks, from developing the AI for the game's enemies to creating the AI for the game's player character. This course is specifically designed for those who want to become AI Programmers.
Gameplay Programmer
Gameplay Programmers are responsible for writing the code that controls the gameplay of video games. They work on a wide range of tasks, from developing the game's physics engine to creating the AI for the game's enemies. This course would help build a foundation for Gameplay Programmers who want to specialize in AI programming.
Game Programmer
Game Programmers are responsible for writing the code that brings video games to life. They work on a wide range of tasks, from developing the game's physics engine to creating the AI for the game's enemies. This course would help build a foundation for Game Programmers who want to specialize in AI programming.
AI Engineer
AI Engineers design and develop artificial intelligence systems. They work on a wide range of projects, from developing self-driving cars to creating chatbots. This course may be useful for AI Engineers who want to learn more about the specific techniques used to create AI-controlled characters in video games.
Robotics Engineer
Robotics Engineers design, build, and maintain robots. They work on a wide range of projects, from developing self-driving cars to creating surgical robots. This course may be useful for Robotics Engineers who want to learn more about the specific techniques used to create AI-controlled characters in video games.
Technical Artist
Technical Artists are responsible for creating the 3D models, textures, and animations for video games. They work closely with Game Designers and Game Programmers to bring the game's world to life. This course may be useful for Technical Artists who want to learn more about the specific techniques used to create AI-controlled characters in video games.
Computer Vision Engineer
Computer Vision Engineers develop algorithms and systems that allow computers to see and understand the world around them. They work on a wide range of projects, from developing self-driving cars to creating medical imaging systems. This course may be useful for Computer Vision Engineers who want to learn more about the specific techniques used to create AI-controlled characters in video games.
Level Designer
Level Designers are responsible for creating the levels for video games. They work closely with Game Designers and Game Programmers to create levels that are fun, challenging, and visually appealing. This course may be useful for Level Designers who want to learn more about the specific techniques used to create AI-controlled characters in video games.
Game Animator
Game Animators are responsible for creating the animations for video games. They work closely with Game Designers and Game Programmers to bring the game's characters and objects to life. This course may be useful for Game Animators who want to learn more about the specific techniques used to create AI-controlled characters in video games.
Simulation Engineer
Simulation Engineers design and develop simulations to model and predict the behavior of complex systems. They work on a wide range of projects, from developing flight simulators to creating models of the human body. This course may be useful for Simulation Engineers who want to learn more about the specific techniques used to create AI-controlled characters in video games.
Machine Learning Engineer
Machine Learning Engineers develop algorithms and systems that allow computers to learn from data. They work on a wide range of projects, from developing self-driving cars to creating fraud detection systems. This course may be useful for Machine Learning Engineers who want to learn more about the specific techniques used to create AI-controlled characters in video games.
Software Engineer
Software Engineers design, develop, and maintain software systems. They work on a wide range of projects, from developing web applications to creating operating systems. This course may be useful for Software Engineers who want to learn more about the specific techniques used to create AI-controlled characters in video games.
Game Producer
Game Producers are responsible for overseeing the development of video games. They work with Game Designers, Game Programmers, and other team members to ensure that the game is completed on time and within budget. This course may be useful for Game Producers who want to learn more about the specific techniques used to create AI-controlled characters in video games.
Data Scientist
Data Scientists use data to solve problems and make predictions. They work on a wide range of projects, from developing fraud detection systems to creating personalized recommendations. This course may be useful for Data Scientists who want to learn more about the specific techniques used to create AI-controlled characters in video games.
Game Designer
Game Designers are responsible for the overall conceptualization and design of video games. They create the game's story, setting, characters, and gameplay mechanics. This course may be useful for Game Designers who want to learn more about the programming and AI techniques used to create compelling game experiences.

Reading list

We've selected 13 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 The Beginner's Guide to Artificial Intelligence (Unity 2022).
Is the second edition of Ian Millington's classic textbook on AI for games. It has been updated to include the latest developments in the field.
Collection of articles from leading game AI professionals. It covers a wide range of topics, including AI design, implementation, and evaluation.
Provides a comprehensive overview of AI for games. It covers a wide range of topics, including game theory, machine learning, and natural language processing.
Collection of articles from experts in the field of game AI. It covers a wide range of topics, from basic concepts to advanced techniques. It would be a valuable resource for students who want to learn from the best in the field.
Provides a hands-on approach to learning AI for games. It includes a number of code examples that can be used to implement AI techniques in your own games.
Collection of articles from experts in the field of game AI. It covers a wide range of topics, from basic concepts to advanced techniques. It would be a valuable resource for students who want to learn from the best in the field.
Collection of articles from experts in the field of game AI. It covers a wide range of topics, from basic concepts to advanced techniques. It would be a valuable resource for students who want to learn from the best in the field.
Provides a comprehensive overview of crowd simulation. It covers the basics of crowd simulation, as well as advanced techniques such as crowd pathfinding and crowd control. It would be a valuable resource for students who want to learn how to create realistic and believable crowds for their games.
Provides a unique perspective on AI for games. It focuses on the design of AI systems, rather than the implementation.
Provides a concise overview of the basics of AI for games. It covers a wide range of topics, including pathfinding, steering behaviors, and decision making.
Provides a comprehensive overview of AI. It is written in a clear and engaging style, making it accessible to readers with no prior knowledge of AI.

Share

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

Similar courses

Here are nine courses similar to The Beginner's Guide to Artificial Intelligence (Unity 2022).
NPC Programming
Most relevant
Planning, HUDs, and Spawners in GameMaker
Most relevant
Writing Video Game Characters
Most relevant
The Ultimate Guide to Game Development with Unity...
Unity & 100+ Asset Store Kits - The Complete Game...
Introduction to C# Programming and Unity
Intermediate Object-Oriented Programming for Unity Games
The Beginners Guide to 3D Web Game Development with...
Make Your First 2D Game with Unity & C# - Beginner Course
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 - 2024 OpenCourser