itch.io is community of indie game creators and players

Devlogs

NPC AI - Breakdown

Magisteros
A downloadable portfolio project for Windows

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
Download Magisteros
Leave a comment