Skip to content

Commit

Permalink
GITBOOK-1: No subject
Browse files Browse the repository at this point in the history
  • Loading branch information
Crash-Konijn authored and gitbook-bot committed Sep 13, 2024
1 parent 0e25697 commit 7aee645
Show file tree
Hide file tree
Showing 10 changed files with 53 additions and 20 deletions.
9 changes: 6 additions & 3 deletions Package/Documentation/Introduction/FAQ.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
# FAQ
# FAQ

{% hint style="warning" %}
V3 is currently stable, but still in beta because the docs are still those of v2.
{% endhint %}

## Why does each action need a target?

Expand All @@ -16,5 +20,4 @@ This does make the graph much smaller. However each action would require logic f

This is the option this project uses. This uses a smaller graph than option 1. This doesn't need to perform movement in an action, keeping them simpler. The graph calculates distance between two actions, adding that cost automatically. Actions don't need to be aware of each other, or their relative position in the graph, making them simpler.

![With move actions](../images/faq_target_with_move_actions.png)
![Without move actions](../images/faq_target_without_move_action.png)
![With move actions](../images/faq\_target\_with\_move\_actions.png) ![Without move actions](../images/faq\_target\_without\_move\_action.png)
27 changes: 19 additions & 8 deletions Package/Documentation/Introduction/GettingStarted.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,20 @@
# Getting Started

##

{% hint style="warning" %}
V3 is currently stable, but still in beta because the docs are still those of v2.
{% endhint %}

## Tutorials
- **[YouTube tutorials](https://www.youtube.com/playlist?list=PLZWmMt_TbeYeatHa9hntDPu4zGEBAFffn)** on how to use the library.
- **[YouTube references](https://www.youtube.com/playlist?list=PLZWmMt_TbeYdBZKvlsRuuOubPTTfPuZot)** discussing GOAP in general.

* [**YouTube tutorials**](https://www.youtube.com/playlist?list=PLZWmMt\_TbeYeatHa9hntDPu4zGEBAFffn) on how to use the library.
* [**YouTube references**](https://www.youtube.com/playlist?list=PLZWmMt\_TbeYdBZKvlsRuuOubPTTfPuZot) discussing GOAP in general.

## Installation

Add the package to your project using the package manager. Add the following URL to the package manager:

```
https://github.com/crashkonijn/GOAP.git?path=/Package#3.0.12-beta
```
Expand All @@ -17,15 +26,16 @@ Alternatively install through [OpenUPM](https://openupm.com/packages/com.crashko
{% endhint %}

## Overview

Below is a quick overview of the different components of classes and how they are connected to an Action.

![Class overview](../images/class_overview.png)
![Class overview](../images/class\_overview.png)

## Setup in Unity

1. Create a class called `WanderGoal` that extends `GoalBase`.

{% code title="WanderGoal.cs" lang="csharp" %}
{% code title="WanderGoal.cs" %}
```csharp
using CrashKonijn.Goap.Behaviours;

Expand All @@ -37,7 +47,7 @@ public class WanderGoal : GoalBase

2. Create a class called `WanderAction` that extends `ActionBase`. The generic value of the class is the type of the data class used in this goal.

{% code title="WanderAction.cs" lang="csharp" %}
{% code title="WanderAction.cs" %}
```csharp
using CrashKonijn.Goap.Behaviours;
using CrashKonijn.Goap.Classes;
Expand Down Expand Up @@ -89,7 +99,7 @@ public class WanderAction : ActionBase<WanderAction.Data>

3. Create a class called `WanderTargetSensor` that extends `LocalTargetSensorBase`. The generic value of the class is the type of the data class used in this goal.

{% code title="WanderTargetSensor.cs" lang="csharp" %}
{% code title="WanderTargetSensor.cs" %}
```csharp
using CrashKonijn.Goap.Classes;
using CrashKonijn.Goap.Interfaces;
Expand Down Expand Up @@ -130,7 +140,7 @@ public class WanderTargetSensor : LocalTargetSensorBase

4. Create a class called `AgentMoveBehaviour`. This class will be called by the `AgentBehaviour` to move the agent to a target.

{% code title="AgentMoveBehaviour.cs" lang="csharp" %}
{% code title="AgentMoveBehaviour.cs" %}
```csharp
using CrashKonijn.Goap.Behaviours;
using CrashKonijn.Goap.Interfaces;
Expand Down Expand Up @@ -193,7 +203,7 @@ public class AgentMoveBehaviour : MonoBehaviour

5. Create a script called `AgentBrain`.

{% code title="AgentBrain.cs" lang="csharp" %}
{% code title="AgentBrain.cs" %}
```csharp
using CrashKonijn.Goap.Behaviours;
using UnityEngine;
Expand All @@ -216,4 +226,5 @@ public class AgentBrain : MonoBehaviour
{% endcode %}

## Choose your config style

Either continue the getting started by using `Code` or `ScriptableObjects`.
8 changes: 6 additions & 2 deletions Package/Documentation/Introduction/Theory.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
# Theory
# What is Goap?

{% hint style="warning" %}
V3 is currently stable, but still in beta because the docs are still those of v2.
{% endhint %}

Goal Oriented Action Planning (GOAP) is a technique commonly used in game AI to create agents that can autonomously determine their actions and achieve specific goals within the game environment. GOAP can be used to create complex and adaptive behavior for non-player characters (NPCs) in a game.

Expand All @@ -10,4 +14,4 @@ Once a plan has been created, the agent executes the first action in the plan. A

GOAP is particularly useful in games with complex environments and multiple goals, as it allows NPCs to adapt to changing situations and make decisions based on their current state and the desired outcome. It can also be used to create NPCs with different personalities or behavior patterns by adjusting the weighting of different actions or goals in their decision-making process.

Overall, GOAP is a powerful technique for creating intelligent and adaptive agents in games that can perform complex tasks and achieve specific goals within the game world.
Overall, GOAP is a powerful technique for creating intelligent and adaptive agents in games that can perform complex tasks and achieve specific goals within the game world.
5 changes: 5 additions & 0 deletions Package/Documentation/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# Introduction

{% hint style="warning" %}
V3 is currently stable, but still in beta because the docs are still those of v2.
{% endhint %}
14 changes: 7 additions & 7 deletions Package/Documentation/SUMMARY.md
Original file line number Diff line number Diff line change
@@ -1,32 +1,32 @@
# Summary
# Table of contents

* [Introduction](Introduction/README.md)
* [Introduction](README.md)
* [What is Goap?](Introduction/Theory.md)
* [Getting Started](Introduction/GettingStarted.md)
* [Code](Introduction/Code.md)
* [ScriptableObjects](Introduction/ScriptableObjects.md)
* [FAQ](Introduction/FAQ.md)
* [Upgrading](upgrade/README.md)
* [Upgrading](upgrading/README.md)
* [V3.0 Changes](upgrade/core-concepts.md)
* [V3.0 Upgrade guide](upgrade/upgrade-guide-2.1-3.0.md)
* [V2.1 Upgrade guide](upgrade/upgrade-guide-2.0-2.1.md)
* [Config](Config/README.md)
* [Config](config/README.md)
* [Through ScriptableObjects](Config/ScriptableObjects.md)
* [Through Code](Config/Code.md)
* [Classes](Classes/README.md)
* [Classes](classes/README.md)
* [Goals](Classes/Goals.md)
* [Actions](Classes/Actions.md)
* [AgentBehaviour](Classes/AgentBehaviour.md)
* [GoapSet](Classes/GoapSet.md)
* [Sensors](Classes/Sensors.md)
* [TargetKeys](Classes/TargetKeys.md)
* [WorldKeys](Classes/WorldKeys.md)
* [General](General/README.md)
* [General](general/README.md)
* [WorldState](General/WorldState.md)
* [Conditions & Effects](General/ConditionsAndEffects.md)
* [Data Injection](General/Injection.md)
* [Life Cycles](General/LifeCycle.md)
* [NodeViewer](General/NodeViewer.md)
* [Examples](Examples/README.md)
* [Examples](examples/README.md)
* [Simple](Examples/Simple.md)
* [Complex](Examples/Complex.md)
2 changes: 2 additions & 0 deletions Package/Documentation/classes/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# Classes

2 changes: 2 additions & 0 deletions Package/Documentation/config/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# Config

2 changes: 2 additions & 0 deletions Package/Documentation/examples/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# Examples

2 changes: 2 additions & 0 deletions Package/Documentation/general/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# General

2 changes: 2 additions & 0 deletions Package/Documentation/upgrading/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# Upgrading

0 comments on commit 7aee645

Please sign in to comment.