What is a GOAP Agent?

Designing the Agent

When creating an agent, you need to first have a design. So let's choose a design. For simplicity sake, in this tutorial, we will assume the Agent already has a target and will omit it from the preconditions.

Agent: Soldier 
Goals: 
	- `HurtTarget`
Actions:
	- Shoot
		- Preconditions: `InShootingRange`
		- Effects: `HurtPlayer` 
	- GoTo
		- Preconditions: `Not InShootingRange`
		- Effects: `InShootingRange`

Preview of What will be making

We will make a simple agent that follows a target and shoot it when it is within range.

https://s3-us-west-2.amazonaws.com/secure.notion-static.com/511f70a8-cb1a-4ae2-9e55-e7d9915c9bd5/ezgif.com-video-to-gif_(2).gif

In a new scene, add a new GameObject, name it Agent Soldier and add a cube as a child.

https://i.imgur.com/D8AarK9.png

Add a BasicAgent component and then add a HurtTarget goal.

https://i.imgur.com/Vq4CvSq.png

Under the AgentSoldier GameObject

  1. Create an empty GameObject and call it Actions