NPC AI - Breakdown


NPC AI

The Non-Player-Character Artificial Intelligence (NPC AI) is the system that controls the behaviour of NPCs in this project. I utilised Finite-State Machines (FSMs) and Unity’s NavMesh system to achieve this.

(StateMachine.cs)

(BaseState.cs)

(AI-FSM.png)

By creating new state classes that inherit from the BaseState class, I can create different actions and transitions to create new behaviours that link to other states.

(S_Search.cs)

NPCs can cache references to chosen custom states and variables using the Scriptable Object, C_Attributes. This makes it easier for designers to easily create new NPC types using only the editor.

(SO_C_Attributes.cs)

Files

Magisteros MVP (v1.0) 30 MB
Jun 17, 2023

Get Magisteros

Leave a comment

Log in with itch.io to leave a comment.