top of page
  • Writer's pictureJesse Toyota

NPC Systems

Updated: Jan 22, 2019

This week I had focused on continuing with the dialogue system, pathfinding, and role behaviours. The systems on their own are working well, but issues arose while trying to combine them.



Pathfinding

Continuing with pathfinding, I was able to implement a PathGeneration class that was used to optimize the path generation. This class allowed for NPCs to perform their A* search over several frames instead of all within the same frame. This was necessary, as NPCs will be traveling larger distances when leaving the village to gather and hunt.







Dialogue System

The dialogue system now allows for NPCs to communicate with each other, as well as performing "barks" in which they will say a short line of dialogue, but not to any specific person. However, it has been found that using Unity's Animator to handle transitions is causing issues. For example, when interrupting an NPC conversation, the animator has trouble ending and starting a new conversation within the same frame, but it has to process the conditions. To solve this, I will most likely attempt to keep the state machine, but handle transitions and flow in a separate class. Unfortunately, this will mean redesigning and implementing the majority of the system.



Role Behaviour

Currently the AI perform actions based on their current role, which includes anything from hunting to wandering. At the moment, the player can only assign NPCs to hunt or build, but when their assigned roles are complete or unavailable, they will decide what roles to do based on various factors. These unassigned roles currently include wandering and socializing. While the system does work most of the time, there are occasional issues caused by the path finding and dialogue system that will have to be refined to sort out the kinks.


For the time being I will be sorting out the existing issues then plan from there.

bottom of page