# 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`.

![Cleaner graph](https://2551805142-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FZWdV1mSTzb2x1Sd7xgdN%2Fuploads%2Fgit-blob-67a6eec3c9833ad89ddd613bbce7203d6270c0b1%2Fdemo_complex_cleaner_graph.png?alt=media)

## Smith

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

![Smith graph](https://2551805142-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FZWdV1mSTzb2x1Sd7xgdN%2Fuploads%2Fgit-blob-92054350ff0df235252250c19905ea3da1fb836c%2Fdemo_complex_smith_graph.png?alt=media)

## Wood Cutter

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

![Wood Cutter graph](https://2551805142-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FZWdV1mSTzb2x1Sd7xgdN%2Fuploads%2Fgit-blob-164c28acf183b5daa6e1be9133c452470ae5ce65%2Fdemo_complex_woodcutter_graph.png?alt=media)

## Miner

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

![Miner graph](https://2551805142-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FZWdV1mSTzb2x1Sd7xgdN%2Fuploads%2Fgit-blob-33bd195e1fb33f1adf5766ff11441bf069df1c84%2Fdemo_complex_miner_graph.png?alt=media)
