Conditions and actions

From Gladiabots Wiki
Revision as of 21:51, 19 November 2017 by LuBeNo (Talk | contribs) (Target selectors)

Jump to: navigation, search

Basics

A target can be shared between action and condition nodes.
The invert checkbox only inverts the condition and not the result of the entire node. There is no selected enemy (Step 2) therefore "is carrying a resource" and "is not carrying a resource" makes no difference.
The invert checkbox only inverts the condition and not the result of the entire node. Both enemies are selected by the any selector in step 3. Therefore both conditions "is carrying a resource" and "is not carrying a resource" are evaluated valid.

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 except for counting conditions that check the target count.
3. Select the best remaining 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 can only be used for moving, fleeing, tagging and untagging.
4. Check the condition on the selected entity. The invert checkbox only inverts this condition and not the result of the entire node. Execute the action on the selected entity.
Any selector: Check if the condition is valid for at least one of the remaining entities. When moving or fleeing the any and all selectors result in moving to or fleeing from the average position[1] of all remaining entities. There is no difference between the any and all selector.
All selector: Check if the condition is valid for all of the remaining entities. When tagging or untagging the any and all selectors result in tagging or untagging all remaining entities. There is no difference between the any and all selector.
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 remaining 3 entities is measured. Only the closest enemy of them 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.

Target filters

Multiple filters from the same filter category are connected either with OR or with AND between them.

  • If there are separate dots on the left of each filter from the same filter category, the filters are joined with OR within that filter category.
    • Example: In the filter category bot class filters are connected with OR. If the enemy is Assault class OR Machine gun class.
  • If there is a line and a single dot on the left of all filters from the same filter category, the filters are joined with AND within that filter category.
    • Example: In the filter category tag filters are connected with AND. If the enemy is tagged 1 AND not tagged 2.

The different filter categories are always connected with AND between them.

  • Example: The enemy satisfies the bot class filters AND the tag filters.
Yellow: In the filter category bot class filters are connected with OR (indicated by separate dots).
Orange: In the filter category tag filters are connected with AND (indicated by a line and a single dot).
Blue: The different filter categories are always connected with AND between them.

Target selectors

The following target selectors are valid for the different target types. As there is only one entity of the myself target type there is no need of a target selector in this case.

Selector category Selector Targets Self.png Myself Targets Ally.png Ally Targets Enemy.png Enemy Targets Allybase.png Ally base Targets Enemybase.png Enemy base Targets Resource.png Resource
Distance from me Selectors ClosestToMe.png Selectors FurthestFromMe.png
Distance from arena borders Selectors ClosestToArenaBorders.png Selectors FurthestFromArenaBorders.png
Health Selectors WeakestHealth.png Selectors WeakestHealthRatio.png Selectors StrongestHealth.png Selectors StrongestHealthRatio.png
Shield Selectors WeakestShield.png Selectors WeakestShieldRatio.png Selectors StrongestShield.png Selectors StrongestShieldRatio.png
Health plus shield Selectors WeakestHealthPlusShield.png Selectors StrongestHealthPlusShield.png
Misc Selectors Any.png Selectors All.png

Weakest/strongest and weakest/strongest ratio

If a Sniper has 2700 of 3000 shield remaining (90%) and a Machine gun has 3900 of 5000 shield remaining (78%) weakest shield would select the Sniper (2700 < 3900), weakest shield ratio would select the Machine gun (78% < 90%).

Entity selection process in case of identical attributes

The entity selection process sorts the remaining entities using the following comparison rules and keeps the first one.

Closest Furthest
Closest to me
  1. Closest to self first
  2. In case of equality: Lowest instantiation order first.
Furthest from me
  1. Furthest from self first
  2. In case of equality: Lowest instantiation order first.
Closest to arena borders
  1. Closest to arena borders first
  2. In case of equality: Lowest instantiation order first.
Furthest from arena borders
  1. Furthest from arena borders first
  2. In case of equality: Lowest instantiation order first.
Weakest Strongest
Weakest health
  1. Weakest health first
  2. In case of equality: Weakest health ratio first
  3. In case of equality: Compare like closest to me
Strongest health
  1. Strongest health first
  2. In case of equality: Strongest health ratio first
  3. In case of equality: Compare like closest to me
Weakest health ratio
  1. Weakest health ratio first
  2. In case of equality: Weakest health first
  3. In case of equality: Compare like closest to me
Strongest health ratio
  1. Strongest health ratio first
  2. In case of equality: Strongest health first
  3. In case of equality: Compare like closest to me
Weakest shield
  1. Weakest shield first
  2. In case of equality: Weakest shield ratio first
  3. In case of equality: Compare like closest to me
Strongest shield
  1. Strongest shield first
  2. In case of equality: Strongest shield ratio first
  3. In case of equality: Compare like closest to me
Weakest shield ratio
  1. Weakest shield ratio first
  2. In case of equality: Weakest shield first
  3. In case of equality: Compare like closest to me
Strongest shield ratio
  1. Strongest shield ratio first
  2. In case of equality: Strongest shield first
  3. In case of equality: Compare like closest to me
Weakest health plus shield
  1. Weakest health plus shield first
  2. In case of equality: Compare like closest to me
Strongest health plus shield
  1. Strongest health plus shield first
  2. In case of equality: Compare like closest to me

Actions

The following target types are valid for the different actions.

Targets Self.png Myself Targets Ally.png Ally Targets Enemy.png Enemy Targets Allybase.png Ally base Targets Enemybase.png Enemy base Targets Resource.png Resource
Move Actions move.png Actions flee.png
Actions Idle.png
Attack Actions attack.png
Resource Actions grab.png
Actions score.png
Actions DropResource.png
Tag Actions ExclusiveBotTag1.png Actions ExclusiveBotTag2.png Actions ExclusiveBotTag3.png Actions ExclusiveBotTag4.png Actions ExclusiveBotTag5.png
Actions BotTag1.png Actions BotTag2.png Actions BotTag3.png Actions BotTag4.png Actions BotTag5.png
Actions BotUntag1.png Actions BotUntag2.png Actions BotUntag3.png Actions BotUntag4.png Actions BotUntag5.png
Team tag Actions ExclusiveTeamTagA.png Actions ExclusiveTeamTagB.png Actions ExclusiveTeamTagC.png Actions ExclusiveTeamTagD.png Actions ExclusiveTeamTagE.png
Actions TeamTagA.png Actions TeamTagB.png Actions TeamTagC.png Actions TeamTagD.png Actions TeamTagE.png
Actions TeamUntagA.png Actions TeamUntagB.png Actions TeamUntagC.png Actions TeamUntagD.png Actions TeamUntagE.png

Conditions and filters

The following filters are valid for the different target types. They are used for both: Conditions and filters.

Targets Self.png Myself Targets Ally.png Ally Targets Enemy.png Enemy Targets Allybase.png Ally base Targets Enemybase.png Enemy base Targets Resource.png Resource
Counting File:Conditions Exists.png
Conditions Counting X1.png Conditions Counting X2.png Conditions Counting X3.png Conditions Counting X4.png Conditions Counting X5.png
Conditions Counting X6.png Conditions Counting X7.png Conditions Counting X8.png Conditions Counting X9.png Conditions Counting X10.png
Conditions Counting GE1.png Conditions Counting GE2.png Conditions Counting GE3.png Conditions Counting GE4.png Conditions Counting GE5.png
Conditions Counting GE6.png Conditions Counting GE7.png Conditions Counting GE8.png Conditions Counting GE9.png Conditions Counting GE10.png
Conditions Counting LE1.png Conditions Counting LE2.png Conditions Counting LE3.png Conditions Counting LE4.png Conditions Counting LE5.png
Conditions Counting LE6.png Conditions Counting LE7.png Conditions Counting LE8.png Conditions Counting LE9.png Conditions Counting LE10.png
Distance from me Conditions DistanceFromMe ShortRange.png Conditions DistanceFromMe MediumRange.png Conditions DistanceFromMe LongRange.png Conditions DistanceFromMe OutOfRange.png
Distance from arena borders Conditions DistanceFromArenaBorders ShortRange.png Conditions DistanceFromArenaBorders MediumRange.png Conditions DistanceFromArenaBorders LongRange.png Conditions DistanceFromArenaBorders OutOfRange.png
Resource Conditions Resource CarriesResource.png
Health Conditions Health health0to25pct.png Conditions Health health25to50pct.png Conditions Health health50to75pct.png Conditions Health health75to100pct.png
Target health compared to mine Conditions Health LowerHealth.png Conditions Health SameHealth.png Conditions Health HigherHealth.png
Shield Conditions Shield armor0to25pct.png Conditions Shield armor25to50pct.png Conditions Shield armor50to75pct.png Conditions Shield armor75to100pct.png
Target shield compared to mine Conditions Shield LowerShield.png Conditions Shield SameShield.png Conditions Shield HigherShield.png
Target health plus shield compared to mine Conditions Health+Shield LowerHealthPlusShield.png Conditions Health+Shield SameHealthPlusShield.png Conditions Health+Shield HigherHealthPlusShield.png
My current action Conditions Attack SelfAttacking.png
Conditions Move SelfFleeingFrom.png Conditions Move SelfMovingTo.png
Target current action Conditions Attack AttackingSelf.png Conditions Attack AttackingAlly.png
Conditions Attack AttackingEnemy.png
Conditions Move Fleeing.png
Conditions Move FleeingFromSelf.png
Conditions Move FleeingFromAlly.png Conditions Move FleeingFromEnemy.png Conditions Move FleeingFromResource.png Conditions Move FleeingFromAllyBase.png Conditions Move FleeingFromEnemyBase.png
Conditions Move Moving.png
Conditions Move MovingToSelf.png
Conditions Move MovingToAlly.png Conditions Move MovingToEnemy.png Conditions Move MovingToResource.png Conditions Move MovingToAllyBase.png Conditions Move MovingToEnemyBase.png
Actions Idle.png
Ally current action on target Conditions Attack AllyAttacking.png
Conditions Move AllyFleeingFrom.png Conditions Move AllyMovingTo.png
Enemy current action on target Conditions Attack EnemyAttacking.png
Conditions Move EnemyFleeingFrom.png Conditions Move EnemyMovingTo.png
Bot class Conditions BotClass AssaultClass.png Conditions BotClass ShotgunClass.png Conditions BotClass MachineGunClass.png Conditions BotClass SniperClass.png
Tag Actions ExclusiveBotTag1.png Actions ExclusiveBotTag2.png Actions ExclusiveBotTag3.png Actions ExclusiveBotTag4.png Actions ExclusiveBotTag1.png
Team tag Actions ExclusiveTeamTagA.png Actions ExclusiveTeamTagB.png Actions ExclusiveTeamTagC.png Actions ExclusiveTeamTagD.png Actions ExclusiveTeamTagE.png