Goals, Actions and World State

Goals and actions are core of MindCraft. You can set goals like in real life and craft a path for your NPCs to achieve those goals.

Goals

Goals table

The starting point of your NPC's goals should always be an idle state. If there are no other goals NPC should be able to just do nothing.

Goal name - The readable name of your goal.

Priority - 0 to 50 000 basically how important your goal is

Preconditions - World state required for this goal to be chosen. (e.g. bool iAmHungry - True for the goal Eat.) Mindcraft supports any kind of preconditions - boolean values, floats, integers, vectors (the NPC is close to something) and all types of comparisons. (!=, ==, <,>, <=, >=). Do not forget to define the type of Value. There can be as many preconditions of different types as you need for your situation.

Desired World State - Desired state of the world after meeting the goal. For example goal "Eat" might lead to "Not Hungry" or something like "iAmHungry = False" Supports the same value types as Preconditions.

Actions

Actions are route to achieve goals.

Actions Data Table

Action Name - readable name of your action (Find Boxes, Move Boxes etc.)

Preconditions - World state required for this action to be chosen. (e.g. bool iAmHungry - True for the goal Eat.) Mindcraft supports any kind of preconditions - boolean values, floats, integers, vectors (the NPC is close to something) and all types of comparisons. (!=, ==, <,>, <=, >=). Do not forget to define the type of Value. There can be as many preconditions of different types as you need for your situation.

Effects - The state of the world in case action completed successfully. For example Action - Find the Box and Effect - Box found.

Base cost - the cost of your action. Think of it like this: How hard is to complete this action. For example if you are making a shooter game and the goal of NPC is to Attack the player you can plan different set of actions to achieve the same goal. The Action Frontal Assault will be very expensive as it could get NPC killed and the action Flank The Enemy will be cheaper as the risk is lower.

Penalty and Random Factor change not used in v1.0 and are a part of upcoming feature.

Behavior Tree Asset - this is the Behavior tree responsible for your action. If GOAP is the brain of your NPC this one is his muscles. For example the action is "Find Food" and behavior tree is the factual implementation of that process. During execution of that BH the character will get coordinates of the nearest food item.

Action details

World State

BlackBoard

This is the BlackBoard asset which contains the world state for this NPC or Group of NPCs. States could be shared or private. Could be any kind supported by Preconditions, Desired World State and Effects. This blackboard should be assigned to AI Controller mentioned earlier.

Last updated