This project contains a simulation developed using the GOAP (a.k.a. Goal-Oriented Action Planning) technique in Unity. In this AI technique, multiple agents will make decisions in real-time to satisfy their own goals.
Each individual agent can have a set of goals for different priorities, and a varied range of actions they can perform. A goal can be reached by executing one or more sequences of these actions, and it's the GOAP's behaviour planner which will determine what's the best course of action for each agent based on the current state of the world.
The presented simulation was created for the subject "Artificial Inteligence in Videogames" in the videogame development's degree of the University of La Laguna.
The presented simulation portrays a battle arena, in which the primary focus is for warriors to fight with each other. As part of the staff, we will also encounter assistants and healers. The first group of people will be in charge of carrying the wounded, while the second will effectively tend to their wounds. Last, but not least, we have a fourth group which are the audience, people who pass by to enjoy the show for a while.
There are three main type of shared resources in this simulation, which are the different arena slots, the available seats on them and also the beds to rest. Availability or lack of this resources at a given time will have an impact in how the agents behave, as some actions will require usage of one of them.
The image below illustrates the result of this simulation, where we can see the different agent types interacting with each other and seeking their destinations.
As stated above, there are 4 different types of agents involved in this simulation, each one with their own motives and possible actions.
In this section we'll go over all of them in more detail, listing their goals and the sequence of actions that need to take place in order to fulfil them.
Warriors play a major role in the coliseum, as they'll be the ones to actually engage into fights to entertain the public.
This is the list of their main goals, as well as the sequence of actions that have to transpire to reach them:
-
Pre-conditions:
- Warrior is full of stamina
- There are free arena slots
-
Actions:
- Go to arena (move towards free arena slot)
- Get ready to fight (wait for an opponent to show up)
- Fight (deal damage during a specific time slot, the one who deals a deathly blow will win)
-
Pre-conditions:
- Warrior is full of stamina
-
Actions:
- Train (go to train spot and remain there)
-
Pre-conditions:
- Warrior is exhausted
- There are free beds
-
Actions:
- Rest (go to bed and spend a while there)
-
Pre-conditions:
- Warrior is defeated
- Assistant picked up the warrior
-
Actions:
- Be carried (follow the assistant to assigned bed)
- Get healed (get treated by a healer)
Assistants are part of the staff of the arena, and their aim is to guide the warriors that are defeated to a bed, where they can be taken care of.
This is the list of their goals, as well as the sequence of actions that have to transpire to reach them:
-
Pre-conditions:
- There are free beds
- There are defeated warriors
-
Actions:
- Patrol (wander around until a defeated warrior is on any area)
- Pick up defeated (assign bed to the defeated and go towards him)
- Carry defeated (guide wounded towards their bed)
-
Pre-conditions:
- Assistant is exhausted
- There are free beds
-
Actions:
- Rest (go to bed and spend a while there)
Healers are responsible of healing warriors that have been defeated, so that they can return to battle again.
This is the list of their goals, as well as the sequence of actions that have to transpire to reach them:
-
Pre-conditions:
- There are warriors awaiting to be healed
-
Actions:
- Patrol (wander around until a defeated warrior is awaiting in bed)
- Heal (go towards warrior and restore his health)
-
Pre-conditions:
- Assistant is exhausted
- There are free beds
-
Actions:
- Rest (go to bed and spend a while there)
Audience's only aim is to pass some time of the arena, and then return home.
This is the list of their goals, as well as the sequence of actions that have to transpire to reach them:
-
Pre-conditions:
- There are available seats
-
Actions:
- Get seat (go towards a free seat)
- Watch (remain on the seat for a while looking at the arena)
- Go home (return home after having watched for a while)
- Unity: 2021.3.26f1 Personal
- Operating System: Windows 10, 64 bits