Difference between revisions of "BotProgramming Basics"

From Gladiabots Wiki
Jump to: navigation, search
Line 12: Line 12:
 
!Element!!Description
 
!Element!!Description
 
|-
 
|-
|Root node    ||Each AI contains exactly one root node that defines the starting point of the AI check. Nodes linked from the starting point below are evaluated counterclockwise. The root node contains the name of the AI.  
+
|Root node    ||Each AI contains exactly one root node that defines the starting point of the AI check. Nodes linked from the bottom of the root node are evaluated counterclockwise. The root node indicates the name of the AI.
 
|-
 
|-
 
|Action node  ||If a rectangular-shaped action node is evaluated valid during AI check, the described action is executed for the current tick. An action node is considered invalid if the bot {{Tooltip|cannot perform it|Example: Attacking an enemy in close range is considered invalid if there are only enemies in mid and long range.}}.
 
|Action node  ||If a rectangular-shaped action node is evaluated valid during AI check, the described action is executed for the current tick. An action node is considered invalid if the bot {{Tooltip|cannot perform it|Example: Attacking an enemy in close range is considered invalid if there are only enemies in mid and long range.}}.
 
|-
 
|-
|Condition node||If an oval-shaped condition node is evaluated valid during AI check, the elements connected from the output below are evaluated counterclockwise. A condition node is considered invalid if the current situation {{Tooltip|doesn't fit it|Example: Checking if an enemy is shooting myself from long range is considered invalid if there is only one enemy shooting myself from mid range.}}.
+
|Condition node||If an oval-shaped condition node is evaluated valid during AI check, the nodes linked from the bottom of the condition node are evaluated counterclockwise. A condition node is considered invalid if the current situation {{Tooltip|doesn't fit it|Example: Checking if an enemy is shooting myself from long range is considered invalid if there is only one enemy shooting myself from mid range.}}.
 
|-
 
|-
|Connector node||The diamond-shaped connector node is always evaluated valid during AI check. It connects every element linked to the input above with every element linked from the output below the connector node. A connector node can be used to simplify the layout of the AI.
+
|Connector node||The diamond-shaped connector node is always evaluated valid during AI check. It connects every node linked to the top of the connector node with every node linked from the bottom of the connector node. A connector node can be used to simplify the layout of the AI.
 
|-
 
|-
 
|Sub-AI node  ||One can reuse an AI inside another one, by using a Sub-AI node. When evaluating this node the whole sub-AI is checked for a valid action. A sub-AI can again contain its own sub-AIs.
 
|Sub-AI node  ||One can reuse an AI inside another one, by using a Sub-AI node. When evaluating this node the whole sub-AI is checked for a valid action. A sub-AI can again contain its own sub-AIs.
 
|-
 
|-
|Link          ||A link connects the starting point or output below {{Tooltip|a node|Could be a root node, condition node or connector node.}} with the input above {{Tooltip|another node|Could be a action node, condition node, connector node or sub-AI node.}}.
+
|Link          ||A link is a directed connection from the bottom of {{Tooltip|one node|Could be a root node, a condition node or a connector node.}} to the top of {{Tooltip|another node|Could be an action node, a condition node, a connector node or a sub-AI node.}}.
 
|}
 
|}
  

Revision as of 22:12, 19 October 2017

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

Basics

The robots in Gladiabots are autonomous and obey their Artificial Intelligence (AI). Bots can only execute one of the possible actions at a time. The AIs task is to determine what action to use in the current situation. Each bot checks its AI counterclockwise, searching for the first valid branch leading to an action.

Example AI.png

The AI of a bot is shaped like an upside down tree. It can be composed of the following elements:

Element Description
Root node Each AI contains exactly one root node that defines the starting point of the AI check. Nodes linked from the bottom of the root node are evaluated counterclockwise. The root node indicates the name of the AI.
Action node If a rectangular-shaped action node is evaluated valid during AI check, the described action is executed for the current tick. An action node is considered invalid if the bot cannot perform it.
Condition node If an oval-shaped condition node is evaluated valid during AI check, the nodes linked from the bottom of the condition node are evaluated counterclockwise. A condition node is considered invalid if the current situation doesn't fit it.
Connector node The diamond-shaped connector node is always evaluated valid during AI check. It connects every node linked to the top of the connector node with every node linked from the bottom of the connector node. A connector node can be used to simplify the layout of the AI.
Sub-AI node One can reuse an AI inside another one, by using a Sub-AI node. When evaluating this node the whole sub-AI is checked for a valid action. A sub-AI can again contain its own sub-AIs.
Link A link is a directed connection from the bottom of one node to the top of another node.
Warning.png Rest of the page is a work in progress.