There are a number of special purpose system variables that provide information about a robot's performance. These variables are called "statistics variables". All statistics variables follow one of the three formats described below. Almost all of the statistics variables use arrays to store information. Before learning about statistics variables it is important that you understand how arrays work. For a description of arrays see the user variables help topic.

When learning about statistics variables it is useful to examine their structures in the game. To view the statistics variables while a match is running, click the Statistics tab on the Inspector window.

One Dimensional (1D) Variables

One dimensional statistics variables contain information in an array with one dimension. Each variable has a one dimensional array with just two elements. The first element (which is index 0) contains information about the entire match. The second element (which is index 1) contains information about the current game. The root values of one dimensional statistics variable are not needed. Since all variables have root values, however, the root values of one dimensional statistics variables are set to the same value as the first element (index 0).

An example of a one dimensional statistics variable is _points. The total number of points scored over the entire match is held in the first array element. The number of points scored in just the current game is held in the second array element.

Variable Description
_points[0] Points earned over entire match
_points[1] Points earned in current game

All one dimensional statistics variables follow the format above. This is a list of all 1D statistics variables:

_bonusfromcookies
_dmgfrommines
_dmgfromjar
_dmgfromwalls
_hitstocookies
_hitstomines
_hitstrtorobots
_killsfromerrors
_killsfrommines
_killsfrommisc
_killsfromtimeout
_killsfromwalls
_points
_shotsfired

Two Dimensional (2D) Variables

Two dimensional statistics variables contain information in an array with two dimensions. Like the one dimensional variables, the first dimension has just two elements. The first element (which is index 0) contains information about the entire match. The second element (which is index 1) contains information about the current game.

The second dimension is an array contained in each of the two elements of the first dimension. Elements in the second dimension contain information specific to individual robots and are indexed using robot ids. The number of elements in the second dimension is the number of robots in a match.

The root values of two dimensional statistics variable are not needed. Since all variables have root values, however, the root values of two dimensional statistics variables are set to the same value as the first element (index 0) of the first dimension.

An example of a two dimensional statistics variable is _dmgfromrobots. The first array index is used to specify either the entire match or the current game. The second index is used to specifying a particular robot. The total damage for all robots is also summed per game and per match.

Variable Description
_dmgfromrobots[0] Damage done by all robots over entire match
_dmgfromrobots[0][n] Damage done by robot with id n over entire match
_dmgfromrobots[1] Damage done by all robots in current game
_dmgfromrobots[1][n] Damage done by robot with id n in current game

Where n is a robot id. Valid values for n range from 0 to (_robotstotal-1). All two dimensional statistics variables follow the format above. This is a list of all 2D statistics variables:

_cldwithrobots
_dmgfromrobots
_dmgtorobots
_hitsfromrobots
_hitstorobots
_killsfromrobots
_killstorobots
 

No Array Variables

Statistics variables without array components contain information in their root values. These variables have one value that contains information about the entire match. There is only one no array statistics variable:

 _place

 

See Also

user variables