Example Tribes and their recipes
Tribe Name: "Eagle Gobble Tribe Oja2" , defined with ID 9 in tribes table , tribal recipe ID 105
tribal recipe 105 "Peaceful Gobble Upkeep Tribe" has this algorithm:
brain(GobbleTribesman); aggressivity(neutral); growth(conservatory); unity(organised); sleepPeriod(nocturnal); loadRecipe(Do Nothing); loadRecipe(Gobble Upkeep); loadRecipe(Warrior Patrol Home); loadRecipe(Peaceful Gobble Tribe Spots);
brain: GobbleTribesman is associated to each member of the tribe, and defines some basic behaviours like: peace_meet, tribesman_attacked, Explore, HuntResource, Breed, GoBuild, ...
aggressivity: neutral
sleepPeriod: nocturnal
Recipes
Initially the engine loads all recipe and the structure looks like this:
Peaceful Gobble Upkeep Tribe Do Nothing Gobble Upkeep Warrior Patrol Home Peaceful Gobble Tribe Spots
Then the engine selects "Peaceful Gobble Tribe Spots" and executes it fully, because it has persistent=0 , it's then removed from the tree.
Peaceful Gobble Upkeep Tribe Do Nothing Gobble Upkeep Warrior Patrol Home
Then the engine selects "Warrior Patrol Home" and executes it, it's persistent=1, so it stays in the list.
Then the engine selects "Gobble Upkeep" and executes it, it's persistent=1, so it stays in the list. it adds one new recipe "Hunter Hunt Resource", which is executed and removed immediately.
Peaceful Gobble Upkeep Tribe Do Nothing Gobble Upkeep Hunter Hunt Resource Warrior Patrol Home
Then the engine selects "Do Nothing" and executes it, it's persistent=1, so it stays in the list.
RECIPE: Gobble Upkeep
select(Hunter,1); locateBuildingSpot(Campfire); goWork(60); alterResource($REPRODUCTION_RESOURCE,0); wait(60.0);
locateBuildingSpot: searches a reserved spot in the tribe home location
goWork: send 'tribe:work' event, which triggers GoToWork behaviour. GoToWork: goes to the location, plays animation work, waits x seconds, returns home.
RECIPE: Peaceful Gobble Evolve Tribe.
RECIPE: Gobble Build Campfire. contains percept(selection,tribe:build), this one calls Behaviour "GoBuild", which executes
<build pickupable="false" />