> For the complete documentation index, see [llms.txt](https://goap.crashkonijn.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://goap.crashkonijn.com/goap-v2/examples/complex.md).

# Complex

The complex example uses code as the configuration method. The demo scene can be found in `Demos/Complex/Scenes/ComplexDemoScene.unity`.

There are 4 type of agents:

* Cleaner (Orange). They grab items laying on the floor and bring them to boxes.
* Smith (Blue). When there are enough materials he will craft an `Axe` or `Pickaxe`. He needs `Wood` and `Iron` to craft the tools.
* WoodCutter (Green). When there isn't enough `Wood` in the world, they will chop wood from trees.
* Miner (Pink). When there isn't enough `Iron` in the world, they will mine iron from rocks.

Each agent has 2 base goals: `WanderGoal` and `FixHungerGoal`. The `WanderGoal` will make the agent wander around the scene. The `FixHungerGoal` will make the agent eat apples. The agent will only eat apples if it is hungry. The agent will only wander if it is not hungry.

## Cleaner

The goap set builder can be found in `Demos/Complex/Factories/CleanerGoapSetConfigFactory.cs`.

![Clenaer graph](https://1800565653-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FZpAsOUBq8CwXUNyR25c4%2Fuploads%2Fgit-blob-5d7e13c6601563d281503bd2ba5756a174e6f73a%2Fdemo_complex_cleaner_graph.png?alt=media\&token=4a49878d-723e-41b0-a965-993987a75238)

## Smith

The goap set builder can be found in `Demos/Complex/Factories/SmithGoapSetConfigFactory.cs`.

![Smith graph](https://1800565653-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FZpAsOUBq8CwXUNyR25c4%2Fuploads%2Fgit-blob-953bca5376c6d197c4d1c7d8f52e5483a2f42a25%2Fdemo_complex_smith_graph.png?alt=media\&token=9050bccf-2513-4df1-acc6-ed78de1903a8)

## Wood Cutter

The goap set builder can be found in `Demos/Complex/Factories/WoodCutterGoapSetConfigFactory.cs`.

![Wood Cutter graph](https://1800565653-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FZpAsOUBq8CwXUNyR25c4%2Fuploads%2Fgit-blob-e1ae7b4948477317544f82858ab6372074a22d05%2Fdemo_complex_woodcutter_graph.png?alt=media\&token=b2df0757-20a6-493e-9a5d-ac3373dd7658)

## Miner

The goap set builder can be found in `Demos/Complex/Factories/MinerGoapSetConfigFactory.cs`.

![Wood Cutter graph](https://1800565653-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FZpAsOUBq8CwXUNyR25c4%2Fuploads%2Fgit-blob-b4996bd5c4f0f0ca307d45b76196819d791cf263%2Fdemo_complex_miner_graph.png?alt=media\&token=6c15546a-d7e9-46c2-90b5-227e3d1ab478)
