Behaviour Trees

Common Tasks

This tasks are common in all behaviour trees:
    Is day condition Returns true if it's day, false if it's night.
    Go despawn action Move the entity to his respawn. When Entity collides despawn, despawns.
    Go to point action Move to a specific point from blackboard.
    Go to random point action From a game object, take all his child and choose one randomly. Move the entity to this point. Returns true when arrive.
    Wait action This is a node canvas action. Waits a certain time and returns true.

Citizen Behaviour Tree

Specific tasks
    Find Free stand action From a gameobject parent with all the free stands, choose one.
    If no one is free returns false. If some stand is free, returns true when arrived and set all changes in become devout and visit other stands probabilities. Also set the selected stand to stand_going variable in Blackboard.
    Become a devout condition Based on the become devout probability returns true or false.
    Go to point action Move to a specific point from blackboard.
    Become a devout action Create a devouts in the citizen position, activate the sound, particles and UI message noticing a new devouts is created and deletes the citizen.

Priest Behaviour Tree

Specific tasks
    If want masses && number of masses < X condition X is the number of masses per day each priest can give. If the number is not approached, randomly decide if give a mas or not. If mass is don't given, the probability to give a mass next time is increased. Returns true if mass is given and false if not.
    Wait action priest action Activate all things needed to mass (audio and UI) and wait for 10 seconds. Then, returns true.
    Finish mass action Add money for the masss and set do_masses variable to false. After that, returns true.

Devouts Behaviour Tree

Specific tasks
    Go to Sit action Search in avaliable pews one and go to. When arrives return true. If thre's no pew avaliable returns false.