Example Tribes and their recipes

From PSwiki
Revision as of 12:03, 1 October 2023 by Talad (talk | contribs)
Jump to navigation Jump to search


Tribe Name: "Eagle Gobble Tribe Oja2" , ID 9 , tribal recipe ID 105 "Peaceful Gobble Upkeep Tribe"

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.


Tribe Name: "Peaceful Gobble Tribe" , ID 3 , tribal recipe ID 103 "Peaceful Gobble Tribe"

3 members: 1 warrior , 2 hunters

location: /teleport me map hydlaa_plaza 164194.14 -437924.8 10323.0


Starting with no assets and no resources, they start to gather fish, until they reach 10 fishes. Then they build a campfire.

RECIPE: "Peaceful Gobble Tribe" has "Peaceful Gobble Evolve Tribe" as algorithm.

RECIPE: "Peaceful Gobble Evolve Tribe" contains "Gobble Build Campfire" as requirement.

RECIPE: Gobble Build Campfire. contains

locateBuildingSpot(Campfire) : searches the campfire location in the current assets, spot must be status=1 (NOT USED). Then set it as INCONSTRUCTION to avoid other members to use the same one.

percept(selection,tribe:build), this one calls Behaviour "GoBuild", which executes

<build pickupable="false" />

build uses the wait time item previously loaded in variables.