One of the biggest challenges when making game AI is not in making the small scripts we've been making so far, but in how you can manage hundreds of these small behaviors to make your NPCs reactive and interesting for the player to deal with.
In this video we reorganize our scripts into tasks, then we make NPCs think of the utility of each of these tasks and pick the best one for them in each situation.
We also build the foundation of a behavior tree system that we're going to use later to make more complex AI behaviors.
Watch the Game AI Mastery Course playlist here:
• AI Groups And Formations in Unity C# - Gam...
Download project files and playable build here:
https://zeusgameassets.itch.io/ai-mas...
Support my work by buying me a coffee: https://ko-fi.com/zeusgameassets
Timestamps:
00:00 Introduction
00:42 Overview of game AI techniques
02:13 Refactoring the AIController script
05:53 Refactoring NPC specific behaviors
07:02 Better script organization with tasks and utility (pseudo-code)
12:59 Implementing tasks and utility
26:42 Creating a Utility Selector (selecting tasks based on utility)
29:10 Refactoring the task system and expanding it
30:56 Expanding the task system: the Wait task
31:57 Expanding the task system: the Sequence and Log tasks
34:33 Expanding the task system: the Repeater task
35:26 Testing and fixing the task system
38:27 Tasks ability to draw gizmos and compute their utility
41:44 Testing gizmos and recap