Difference between revisions of "Tags and team tags"

From Gladiabots Wiki
Jump to: navigation, search
(2 intermediate revisions by 2 users not shown)
Line 22: Line 22:
 
=== Bot action: Tag ===
 
=== Bot action: Tag ===
  
The bot action tag (also known as exclusive tagging) is an action that removes all other instances of the same tag, and tags the new target, all in one tick. If there is currently a resource, a base and a bot team tagged "A" and a bot is (exclusive) team tagging itself "A" all the other "A" marks get removed.
+
The bot action tag (also known as exclusive tagging) is an action that removes all other instances of the same tag, and tags one or more new targets. If there is currently a resource, a base and an allied bot team tagged "A" and a bot is (exclusive) team tagging all attacking enemy bots "A" all the other "A" marks get removed.
  
 
=== Bot action: Add tag ===
 
=== Bot action: Add tag ===
  
The bot action add tag is an action that tags the new target and keeps other instances of the same tag like they were before. If there is currently a resource, a base and a bot team tagged "A" and a bot uses add team tag "A" to itself all the other "A" marks are still there.
+
The bot action add tag is an action that tags one or more new target and keeps other instances of the same tag like they were before. If there is currently a resource, a base and an allied bot team tagged "A" and a bot uses add team tag "A" to all attacking enemy bots all the other "A" marks are still there.
  
 
== Programming tags ==
 
== Programming tags ==
  
Tags take 1 tick to place or to remove. Other bots detect the bot doing the tagging or untagging as idle in the next tick.
+
As of Alpha 12, placing or removing a tag does not cost a tick. Thus, one can add/remove many tags, and use those tags to perform an action, all within the same tick. All tagging actions happen from left to right (in the order that they are checked). Once a tagging action is evaluated, this change is visible to all later nodes. This means that the tags a particular node sees aren't necessarily the tags which you can see.
 +
 
 +
Group tags are evaluated left to right, also, but each bot is evaluated in [[Maps#Instantiation_order|instantiation order]]. This means that if you have a leader, it's important that the leader be the highest priority bot (the first in instantiation order). This way, any tags the leader places will be seen in the same tick. If the leader were the lowest priority bot, then the other bots would not see the tag until the next tick.
  
 
Remarks:
 
Remarks:
 
* It is possible to place multiple tags on the same target, the order does not matter.
 
* It is possible to place multiple tags on the same target, the order does not matter.
* Tags cost ticks, so it is advisable to try to minimize tag usage. For example to continuously attack one bot it is preferred to use action filters.
 
 
* Tags can be used for {{Tooltip|focus fire|Team tag an enemy bot that should be attacked by several bots.}}, {{Tooltip|determining a leader|Team tag an allied bot that should give commands like focus fire.}}, {{Tooltip|mark resources|Tag resources and react differently if an enemy tries to pick them up or know what resources to score first.}} and timing actions. They can also be used for more complex choreography.
 
* Tags can be used for {{Tooltip|focus fire|Team tag an enemy bot that should be attacked by several bots.}}, {{Tooltip|determining a leader|Team tag an allied bot that should give commands like focus fire.}}, {{Tooltip|mark resources|Tag resources and react differently if an enemy tries to pick them up or know what resources to score first.}} and timing actions. They can also be used for more complex choreography.
* 2 bots of the same team trying to exclusive tag 2 different targets can start off an endless loop.
+
* Note that later tagging actions can override earlier tagging actions. This makes rightmost tagging actions appear to have highest priority.
* If several bots try to team tag or team untag in a contradictory way they tag in the order specified in the [[Maps#Instantiation_order|instantiation order]].
+
  
 
== Examples using tags ==
 
== Examples using tags ==
 +
'''''Note: Examples are obsolete, since they don't use instant tagging.'''''
  
 
=== Map: Set your priorities ===
 
=== Map: Set your priorities ===

Revision as of 11:48, 27 February 2018

Basics

Tags are single-character marks placed on objects on the Gladiabots arena, such as:

  • Myself
  • Allies
  • Enemies
  • Allied bases
  • Enemy bases
  • Resources

Tags

From left to right: (exclusive) team tag "A", add team tag "A", (exclusive) tag "1" and add tag "1"

Tags (previously known as bot tags) exist as numerals, the numbers "1" through "5". They can be detected only by the bot which placed the tag.

Team tags

Team tags exist as alphabets, the letters "A" through "E". They can be detected by all bots which are in the same team as the bot which placed the team tag.

Bot action: Tag

The bot action tag (also known as exclusive tagging) is an action that removes all other instances of the same tag, and tags one or more new targets. If there is currently a resource, a base and an allied bot team tagged "A" and a bot is (exclusive) team tagging all attacking enemy bots "A" all the other "A" marks get removed.

Bot action: Add tag

The bot action add tag is an action that tags one or more new target and keeps other instances of the same tag like they were before. If there is currently a resource, a base and an allied bot team tagged "A" and a bot uses add team tag "A" to all attacking enemy bots all the other "A" marks are still there.

Programming tags

As of Alpha 12, placing or removing a tag does not cost a tick. Thus, one can add/remove many tags, and use those tags to perform an action, all within the same tick. All tagging actions happen from left to right (in the order that they are checked). Once a tagging action is evaluated, this change is visible to all later nodes. This means that the tags a particular node sees aren't necessarily the tags which you can see.

Group tags are evaluated left to right, also, but each bot is evaluated in instantiation order. This means that if you have a leader, it's important that the leader be the highest priority bot (the first in instantiation order). This way, any tags the leader places will be seen in the same tick. If the leader were the lowest priority bot, then the other bots would not see the tag until the next tick.

Remarks:

  • It is possible to place multiple tags on the same target, the order does not matter.
  • Tags can be used for focus fire, determining a leader, mark resources and timing actions. They can also be used for more complex choreography.
  • Note that later tagging actions can override earlier tagging actions. This makes rightmost tagging actions appear to have highest priority.

Examples using tags

Note: Examples are obsolete, since they don't use instant tagging.

Map: Set your priorities

Tagging the resource in the center can help secure a 3-2 score.

Dance choreography

AI of bot "A" in the dance choreography

They can also be used for more complex choreography, such as:

The bots are moving to the allied bot that's tagged with the next letter in series, i.e., A > B > C > D > E > A and they are fleeing from the bot that's tagged with the previous letter in series. They are also fleeing from the allied base to prevent clumping up.