Difference between revisions of "Conditions and actions"

From Gladiabots Wiki
Jump to: navigation, search
Line 53: Line 53:
  
 
=== Thoughts to include into this page ===
 
=== Thoughts to include into this page ===
 +
 +
* explain INVERT
 +
* Target filters
 +
** OR and AND between filters
 +
** Connecting different filters bot class and target action
 +
** inverting a filter
 +
** Lists of Filters per Target Type
 +
* Target selector
 +
** What a selector selects if there are several possibilities of equal value.
 +
** Lists of Selectors per Target Type
 +
* Actions
 +
** Lists of Actions per Target Type
 +
* Conditions
 +
** List of Conditions per Target Type (same as filters?)
  
 
* [https://forum.gladiabots.com/viewtopic.php?f=22&t=126&p=1087#p1087 explanation of conditions and, similarly, actions]
 
* [https://forum.gladiabots.com/viewtopic.php?f=22&t=126&p=1087#p1087 explanation of conditions and, similarly, actions]
Line 63: Line 77:
 
<!--
 
<!--
  
What a selector selects if there are several possibilities of equal value.
 
OR and AND between filters
 
Lists of Actions per Target Type
 
Lists of Selectors per Target Type
 
Lists of Filters per Target Type
 
the [Invert] check box makes the Condition evaluate True if the filtered Target is <i>not</i> executing the action mentioned in the Condition.
 
  
 
-->
 
-->

Revision as of 12:00, 28 October 2017

Information.png This page needs improvement, you are welcome to contribute.

Basics

A target can be shared between action and condition nodes.

Both condition nodes and action nodes are mainly defined by a target and share almost the same evaluation process:

Step Condition node Action node
1. Get all the entities of the target type.
2. Remove all entities not matching the target filters. If there is not a single entity left the node is considered invalid.
3. Select the best entity according to the target selector.
The any and all selectors are special cases where all remaining entities are selected instead. The any and all selectors are not allowed for action targeting.
4. Check the condition on the remaining entity. Execute the action upon the remaining entity.
Any selector: Check if the condition is valid for at least one of the entities.
All selector: Check if the condition is valid for all of the entities.
Information.png Condition nodes: Checking the condition is the very last step after filtering and selecting took place.

Example

Consider the following condition node:

  1. Target type: Enemy
  2. Target filters: Not carrying resource
  3. Target selector: Closest to me
  4. Condition: Shield is 0 to 25%

The following situation is evaluated like this:

  1. There are 4 entities of target type enemy. Allies, resources and bases are discarded.
  2. There are 3 entities not carrying a resource. The enemy moving to his base is removed from the list.
  3. The distance between the Shotgun and the entities is measured. Only the closest enemy is selected.
  4. The condition is only checked for the remaining entity. As this enemy has full shield, the condition is evaluated invalid.
The condition node is evaluated invalid in this situation.
Warning.png The rest of the page is a work in progress.

Thoughts to include into this page

  • explain INVERT
  • Target filters
    • OR and AND between filters
    • Connecting different filters bot class and target action
    • inverting a filter
    • Lists of Filters per Target Type
  • Target selector
    • What a selector selects if there are several possibilities of equal value.
    • Lists of Selectors per Target Type
  • Actions
    • Lists of Actions per Target Type
  • Conditions
    • List of Conditions per Target Type (same as filters?)