Loading...
 

Tasks

Go back to the Table of Content

Most of the action in Beyond will occur through the completion of tasks. They include building, growing food, sleeping, etc.

The first-dweller (controlled by the player) as well as all other AI-controlled people (friendly dwellers, visitors, enemies) will be assigned tasks based on their priorities. The player can choose to override priorities to work on a specific task, but even this has its limit as the first dweller will need to eat, rest, etc. Technically, someone (or something) who can complete a task is called an Agent.

Tasks can be relevant only in one place, in which case any agent in that place could potentially pick it up. Other tasks are agent-specific (eat, sleep, ...) and normally not carried out by any other agent than the one from which the task originated, and mostly linked to each agent's needs.

Priorities are based on a set of game world features and handled by a priority manager, which takes into account what the player has indicated as being more important, but also skills, motivation, available resources of all sorts, etc. A dweller-specific task's priority aimed at fulfilling a need will increase as the negative effects of the need increase (extreme example: A Dweller would stop what she's doing immediately to go eat if she's starving)

A task is either a meta-task made of a queue of other tasks, or describes an activity that sets the agent into various states until either the task is completed or has failed.

A task also has an optional queue of outcomes, that are applied when the task is completed.

Queues are used to ensure the sequence of events, to give the agent a chance to check pre-requisites in a specific order, or for sub-tasks to flow logically.

Examples:

  • Meta task Build wall is made of:
    • Meta task Build wall frame
    • Meta task Cover wall
    • Meta task Finish Wall
    • Outcomes:
      • Wall is built

  • Meta task Build wall frame is made of:
    • Task Has_Skill(Carpentry level 1)
    • Task Has(Item Wooden board, quantity 4)
    • Task Has(Item Nails, quantity 50)
    • Task Has(Tool Hammer, quantity 1, level 1)
    • Task Has(Tool Saw, quantity 1, level 1)
    • Task Work(1 hour)
    • Outcomes:
      • VisualUpdate(Show frame done)

  • Meta task Cover wall is made of:
    • Task Has_Skill(Carpentry level 1)
    • Task Has(Tool Trowel, quantity 1, level 1)
    • Task Work(1 hour)
    • Outcomes:
      • Add modifier(Wet)
      • VisualUpdate(Wall cover done)

  • Meta task Finish Wall is made of:
    • Task Has_Skill(Carpentry level 1)
    • Task Has_Modifier(Wet, false)
    • Task Has(Item Nails, quantity 50)
    • Task Has(Tool Hammer, quantity 1, level 1)
    • Task Work(30 minutes)


Tasks that describe an activity are:

  • Has(type, quantity, where, level): A material or tool to be used or consumed. "Where" will handle whether the target object must be carried to a destination or kept on the agent.
  • Has_Skill(skill, level): Minimum skill needed by the agent. Having the skill at that level will immediately complete the task. Not having it will immediately make it fail.
  • Has_Modifier(Modifier, bool): Must have (or not have) a certain modifier (e.g. : being not wet)
  • Has_Facility(type, level, modifiers): Have access to a facility of a certain type, level, and optional modifiers
  • Work(time):Amount of time to work on the task to complete it


While some tasks are straightforward to evaluate and complete (e.g. Has_Skill), other can be quite convoluted. The "Has" task, for example, will search for an object, move the agent there, pick up the object and either deliver it to a destination or keep it on the agent based on where it's needed.

In order to get the agent to act, the activity will have a method that checks some conditions and sets the agent in various states. Those states are often translated into a visual animation and akin to a Finite State Machine or FSM. For example, the activity for Has is made of 70 lines of code searching for the items, and showing the agent picking, carrying & delivering them.

Agent's states are:

  • Idling: The agent is waiting for something
  • Going: The agent is going to a specific destination
  • Picking: The agent is picking something up
  • Delivering: The agent is delivering something to a specific target
  • Working: The agent is working


Ideally, a task can be planned to check all pre-requisites, work out the best route to complete it, reserve tools and materials so other agents don't pick them up, etc.

Outcomes


Outcomes describe the result of a task and are also in a queue so they occur in order, in case that's important.

They include (but will probably not be limited to):

  • Build something: This turns the blueprint for an element into the element itself (see Building data model
  • Add or remove a modifier: So a target can become wet, burnt, grown, rotten, painted, etc