It has been an absolutely hectic weekend with work, study and other commitments, this dev diary ended up coming out extremely late. However, I was able to get quite a lot done throughout the week for contribution to the Creature Feature project. This week we will focus a lot on the technical aspects of the Sight sensory system and Goal Oriented Action Planning.
Sensory System – Sight
An important aspect for AI is being able to create a knowledge base for the AI and this is done through the way that the AI processes the world information. There are multiple ways that we can implement this process as well as different senses that we can build for such as smell, touch (proximity sensor), hearing as well as establishing your own senses for your AI creature. For this project, I chose to mainly focus on the most common sight sense, I implemented this by creating a static function that took, view direction, view distance, field of vision, eye position and an optional tag as parameters. The function then retrieves all gameobjects with the tag and adds them to a list of gameobjects if they are within viewing distance and within the view cone (Angle is not outside the field of vision). Finally, a raycast is created to see if line of sight can be established between each object and the list of gameobjects that can be seen is returned.

Goal Oriented Action Planning
I recently discussed the GOAP AI system a few weeks ago in my blog, the basic premise of the system is to have a list of actions that can be executed to complete certain goals set by the AI. This week I went to implement the system into the creature feature project this required many moving parts which include:
- Actions – These action scripts are added as components onto the agent and determine what action needs to be completed, what preconditions are required to perform the action and what effects the action causes.
- Finite State Machine – This state machine determines the current state and therefore the activity that the agent will perform.
- Idle State – No actions are performed in this state, rather an action plan is determined in this state.
- Move State – If the agent is not within range to perform the appropriate an action then this state is called to move to the action.
- Perform Action State – used to perform the action stated in the queued actions.
- Goal – This goal class has a single purpose and that is to return a queue of planned actions depending on the current goals, available action, and current world state.
- IGOAP – This is a GOAP interface that is used by the main behavior script to ensure that the script implements the correct functions necessary to run the GOAP scripts.
These scripts combined together give a simple AI that determines actions based on the goals that are determined by the main behavior script.

Leave a reply to Studio 2 Presentation – Me, My Blog and I Cancel reply