Brains

Brains are the least used element because they are the most complicated and most entities generally don’t need this level of complexity. Their purpose is for AI and decision-making so only the complicated creatures need them.

Brains use a system called a “behaviour tree” to make decisions. Every now and then it goes to the first item in the tree and checks, “can I do this?” and if not, it goes to the next one, and then next one, and it’s children, and their children, until it finds something it can do. Then it does that! So this means things higher in the list have more priority, which lets you do things like make pigs prefer fighting to eating, but to panic when they are on fire even if they were fighting.

Brains heavily rely on behaviour trees and nodes.

To get an idea of how brain files work, study the LureplantBrain. To better understand behaviourtrees, study the PigBrain.