Skip to main content
grasp.study
About
Explore
Pricing
Log in
Try it for free
Back to course
👋
Welcome to a Grasp lesson
Create a free account
to keep studying and create your own study path.
FSMs in Game Development
·
Module 4
Applying FSMs to NPC AI
1
Designing a Basic NPC FSM: States and Transitions
Design an FSM for a basic NPC by identifying states (e.g., Idle, Patrol, Chase, Attack, Flee) and transitions.
2
Implementing Idle and Timed Patrol Transitions
Implement the 'Idle' state and a timed transition to the 'Patrol' state.
3
Implementing a Patrol State with PathfindingService
Implement the 'Patrol' state, using PathfindingService to move the NPC between a series of waypoints.
4
Player Proximity: Patrol to Chase Transition
Implement player proximity detection to trigger a transition from 'Patrol' to 'Chase'.
5
Implementing Player-Tracking AI with Pathfinding
Implement the 'Chase' state, using PathfindingService to follow a player, with a transition back to 'Patrol' if the player is lost.
6
Implementing an Attack State
Add an 'Attack' state, triggered when the NPC is within attack range during the 'Chase' state.
7
Implementing Flee Behavior with Pathfinding
Implement a 'Flee' state triggered by a low health condition, using PathfindingService to move to a safe point.
Previous module
Building a Reusable FSM Module
Next module
Applying FSMs to UI Flow