Class Constants
Constants.
Inherited Members
Namespace: Robocode.TankRoyale.BotApi
Assembly: api.dll
Syntax
[PublicAPI]
public static class Constants
Fields
| Edit this page View SourceAcceleration
Acceleration is the increase in speed per turn, which adds 1 unit to the speed per turn when the bot is increasing its speed moving forward.
Declaration
public const double Acceleration = 1
Field Value
| Type | Description |
|---|---|
| double | The acceleration is 1 additional unit per turn. |
BoundingCircleRadius
The radius of the bounding circle of the bot, which is a constant of 18 units.
The bounding circle of a bot is a circle going from the center of the bot with a radius so that the circle covers most of the bot. The bounding circle is used for determining when a bot is hit by a bullet.
A bot gets hit by a bullet when the bullet gets inside the bounding circle, i.e. the distance between the bullet and the center of the bounding circle is less than the radius of the bounding circle.
Declaration
public const int BoundingCircleRadius = 18
Field Value
| Type | Description |
|---|---|
| int | The radius of the bounding circle of the bot, which is a constant of 18 units. |
Deceleration
Deceleration is the decrease in speed per turn, which subtracts 2 units to the speed per turn when the bot is decreasing its speed moving backward. This means that a bot is faster at braking than accelerating forward.
Declaration
public const double Deceleration = -2
Field Value
| Type | Description |
|---|---|
| double | The deceleration is 2 units less per turn. |
InactivityZap
The amount of damage a bot receives per turn when the game's inactivity time limit is
exceeded. A bot that has not fired or been hit by a bullet for maxInactivityTurns
consecutive turns will lose this much energy every turn until it acts again.
Declaration
public const double InactivityZap = 0.1
Field Value
| Type | Description |
|---|---|
| double | The inactivity zap damage per turn, which is 0.1 energy points. |
MaxBackwardSpeed
The maximum backward speed, which is -8 units per turn.
Declaration
public const double MaxBackwardSpeed = -8
Field Value
| Type | Description |
|---|---|
| double |
MaxBulletSpeed
The maximum bullet speed is the fastest possible speed that a bullet can travel and is defined by the minimum firepower. Max. bullet speed = 20 - 3 x min. firepower, i.e. 20 - 3 x 0.1 = 19.7. The lesser power, the faster the bullet speed will be.
Declaration
public const double MaxBulletSpeed = 19.7
Field Value
| Type | Description |
|---|---|
| double | The maximum bullet speed is 19.7 units per turn. |
MaxFirepower
The gun will fire up to this power only if the firepower is set to a higher value.
Declaration
public const double MaxFirepower = 3
Field Value
| Type | Description |
|---|---|
| double | The maximum firepower, which is 3. |
MaxForwardSpeed
The maximum forward speed, which is 8 units per turn.
Declaration
public const double MaxForwardSpeed = 8
Field Value
| Type | Description |
|---|---|
| double |
MaxGunTurnRate
The maximum gun turn rate, which is a constant of 20 degrees per turn.
Declaration
public const double MaxGunTurnRate = 20
Field Value
| Type | Description |
|---|---|
| double |
MaxLogicalTeamMessagesPerTurn
The maximum logical payloads across ordinary messages and batch entries per turn, which is 128.
Declaration
public const int MaxLogicalTeamMessagesPerTurn = 128
Field Value
| Type | Description |
|---|---|
| int |
MaxNumberOfTeamMessagesPerTurn
The maximum number of team-message packets that can be sent per turn, which is 64.
Declaration
public const int MaxNumberOfTeamMessagesPerTurn = 64
Field Value
| Type | Description |
|---|---|
| int | The maximum number of team-message packets per turn, which is 64. |
MaxRadarTurnRate
The maximum radar turn rate, which is a constant of 45 degrees per turn.
Declaration
public const double MaxRadarTurnRate = 45
Field Value
| Type | Description |
|---|---|
| double |
MaxSpeed
The maximum absolute speed, which is 8 units per turn.
Declaration
public const double MaxSpeed = 8
Field Value
| Type | Description |
|---|---|
| double |
MaxTurnRate
The maximum possible driving turn rate, which is max. 10 degrees per turn.
This is the max. possible turn rate of the bot.
note
The speed of the bot has a direct impact on the turn rate. The faster the speed the less turn rate.
The formula for the max. possible turn rate at a given speed is: MaxTurnRate - 0.75 x abs(speed). Hence, the turn rate is at max. 10 degrees/turn when the speed is zero, and down to only 4 degrees per turn when the bot is at max speed (which is 8 units per turn).
Declaration
public const double MaxTurnRate = 10
Field Value
| Type | Description |
|---|---|
| double | The maximum possible driving turn rate, which is max. 10 degrees per turn. |
MinBulletSpeed
The minimum bullet speed is the slowest possible speed that a bullet can travel and is defined by the maximum firepower. Min. bullet speed = 20 - 3 x max. firepower, i.e. 20 - 3 x 3 = 11. The more power, the slower the bullet speed will be.
Declaration
public const double MinBulletSpeed = 11
Field Value
| Type | Description |
|---|---|
| double | The minimum bullet speed is 11 units per turn. |
MinFirepower
The gun will not fire with a power that is less than the minimum firepower, which is 0.1.
Declaration
public const double MinFirepower = 0.1
Field Value
| Type | Description |
|---|---|
| double | The minimum firepower, which is 0.1. |
RamDamage
The amount of damage dealt to each bot involved in a collision when two bots ram into each other, which is 0.6 energy points per collision.
Declaration
public const double RamDamage = 0.6
Field Value
| Type | Description |
|---|---|
| double | The ram damage per collision, which is 0.6 energy points. |
ScanRadius
The radius of the radar's scan beam, which is a constant of 1200 units.
The radar is used for scanning the battlefield for opponent bots. The shape of the scan beam of the radar is a circle arc ("pizza slice") starting from the center of the bot. Opponent bots that get inside the scan arc will be detected by the radar.
The radius of the arc is a constant of 1200 units. This means that that the radar will not be able to detect bots that are more than 1200 units away from the bot.
The radar needs to be turned (left or right) to scan opponent bots. So make sure the radar is always turned. The more the radar is turned, the larger the area of the scan arc becomes, and the bigger the chance is that the radar detects an opponent. If the radar is not turning, the scan arc becomes a thin line, unable to scan and detect anything.
Declaration
public const int ScanRadius = 1200
Field Value
| Type | Description |
|---|---|
| int | The radius of the radar's scan beam, which is a constant of 1200 units. |
StartingGunHeat
The gun heat at the start of a round, which is 3.0. The gun cannot fire until its heat drops to zero, cooling at the rate defined by the game setup's gun cooling rate.
Declaration
public const double StartingGunHeat = 3
Field Value
| Type | Description |
|---|---|
| double | The starting gun heat, which is 3.0. |
TeamMessageMaxSize
The maximum size of one team-message packet in UTF-8 bytes (48 KiB), measured on its compact JSON payload. Messages exceeding this size are rejected.
Declaration
public const int TeamMessageMaxSize = 49152
Field Value
| Type | Description |
|---|---|
| int | The maximum team message size in UTF-8 bytes, which is 49152. |
TeamMessagesMaxBytesPerTurn
Maximum UTF-8 bytes of the compact encoded teamMessages array per turn (256 KiB).
Declaration
public const int TeamMessagesMaxBytesPerTurn = 262144
Field Value
| Type | Description |
|---|---|
| int |