lookisourcing.blogg.se

Stonehearth mods unit frame activity
Stonehearth mods unit frame activity








stonehearth mods unit frame activity
  1. Stonehearth mods unit frame activity how to#
  2. Stonehearth mods unit frame activity code#

Systems outside the AI control which of these tasks are active at a given time, and task groups allow these systems to ask multiple characters to perform some action.

  • Task group action - An action that runs one of a list of declared tasks (activities).
  • heal_self_action consists of (1) getting a healing item (a stonehearth:goto_item_made_of activity with a material argument set to "healing_item"), (2) reserving that item so other characters don't grab it (a stonehearth:reserve_entity activity with the item selected in the previous step passed as an argument), and finally (3) self-healing with that item (a stonehearth:heal_entity_adjacent activity with the entity itself as the target and the item reserved in the previous step as the item to apply). Executing a compound action involves finding a valid action that performs each step's activity and executing all these actions in order.
  • Compound action - An action that is composed of a list of steps, each of which is an activity with optional argument bindings.
  • A Lua file that has a run() method that executes the action's logic.
  • Leaf action - The simplest type of action.
  • Stonehearth mods unit frame activity how to#

    Ready to be executed and what relevant state it expects to change if executed, (3) and how to "run" it, i.e. how good it is, (2) how to "think" it, i.e. An action is responsible for telling the AI system (1) its "utility", i.e.

    Stonehearth mods unit frame activity code#

    In the code we express this by saying that the action "does" the given activity string. At its core, all the AI component does is to continuously try to perform the stonehearth:top activity.Īction - A specific implementation of an activity. the stonehearth:find_path_to_entity activity takes the entity to path to as an argument. A not-necessarily-up-to-date list of activities can be found in stonehearth/ai/a. Activities are represented as strings, conventionally in the form mod_name:verb, e.g. For example, if "get food" is an activity, "get food from stockpile", "get food from backpack", and "hunt wild animal" may all be implementations of the "get food" activity. Intelligent entities include hearthlings, enemy mobs, pets, critters, and even turrets, although the rest of this page uses "character" to refer to any of these entities.Īctivity - A behavior that can have multiple implementations. This component runs a Lua thread (a coroutine managed by the thread class), which continuously evaluates a tree of plans and executes a branch of it. Intelligent entity - An entity that has a stonehearth:ai component. Let's unpack that formal definition and map it to the terms used in the implementation: Many potential plans are typically being considered at a time, most of which are not ready to execute, or are suboptimal, and the AI constantly selects the one best plan to execute at any given time. Intelligent entities in Stonehearth run a hierarchical task network to perform activities by making, comparing, and executing plans made up of actions. They're still mostly valid, and might help you understand how the AI works with a practical/visual example. There's also the old notes about AI in this other PDF. You can find all the information from this page in this PDF.










    Stonehearth mods unit frame activity