Skip to content

Behavior Engine

SomeRandomGameDev edited this page Oct 14, 2012 · 1 revision

The aim of the behaviour engine is to provide a language for describing the villagers (passive) behaviour and a mean to execute it.

Common properties

Each villager maintains a rather simple inventory.

List of behaviours

By now, the villagers behaviours are the following:

  • Block Scanning: A zone around the villager is scanned, column by column, from bottom to top. Each column get a context depending on encountered block types. Depending on the currently scanned block, the context and the inventory, the villager changes the currently scanned block type and/or data.
  • Container Block Scanning: A zone around the villager is scanned in order to determine the set of container blocks. Once the scanning is done, the villager is aware of the complete list of available chests/furnaces/brewing stands/etc. Depending on the container blocks state and/or inventory, and on its own inventory, the villager transfers items from/to blocks.
  • Workbench/Crafting: A simple scan is performed in order to determine if a workbench is available or not. If a workbench is available and depending on its inventory, the villager performs crafts (stored in its inventory).
  • Library Processing: Another simple scan that determine the number of surrounding libraries. Depending on an assigned item type, rewarded experience is computed. This experience will be given back to the player who gave the item to the villager.
  • Entity Scanning: The list of surrounding entities is computed. For each entity in the list, given its type and the villager inventory, a property modification is performed. These modifications are very specific by now and shall be loosened/generalised or, at least, be part of a large set of possible villager/entity interactions.
  • Environment Scanning: It is the golem special case. The level of light is inspected at entity position, and an action is performed (placing a torch in that special case).
Clone this wiki locally