NPC - IsaacMulcahy/RPG-AI-SYSTEM-WIKI GitHub Wiki

Overview

NPC's are the agents that move around the world. NPC standing for Non Playable Character.

Setup

A NPC when being created needs to have an Animator, AI Controller, AI Databoard and Nav Mesh Agent. This can simply be setup by selecting the option 'Setup object as NPC' in Manager and the GameObject you wish to setup and all components will be added. Then save as a 'prefab' and add to the character pool in Region

Required Components

Animator

The animator is required for animations. The main part this system is interested in is the 'animator controller' as it requires a 'Moving' and 'Dynamic' boolean to be present as well as a 'Motion' called 'Dynamic' to be present and played when the 'Dynamic' parameter is true. A basic 'animator controller' can be found within the 'Animation' folder

AI Controller

The AI controller is the low level control of the NPC. From within here the 'animator controller' settings are set, destinations and pointing out is also controlled. It also handles the interface between the Mount interface.

AI Databoard

This section provides the core data of the NPC and provide a common interface between all systems, this includes states, timers, specific information for this NPC (Where is home, current goal, mounted, if at work etc.) along with access to the inventory.

Nav Mesh Agent

This is the built in Unity feature which provides pathfinding and is used by default with this project. For quick setup see Getting Started

Work Controller (Added via Civil Manager)

The work controller is an optional component which is added at run time if this NPC has a Job. This interfaces with the Civil Job System to provide the character with Job information (What they do, where it is) and holds the logic on how the system progresses as well as updating work states (e.g. setting when they are 'at work')

Need Controller (Added via Civil Manager)

The need controller is an optional component which is added at run time. This interfaces with the Civil Need System to provide the character with information on what they need and holds the logic on how to fulfill them.