robocode.naval
Class NavalRules

java.lang.Object
  extended by robocode.naval.NavalRules

public class NavalRules
extends Object

Class that discribes the rules of Naval Robocode. Also contains a few variables regarding the Ships.

Author:
Thales B.V. / Thomas Hakkers

Field Summary
static double ACCELERATION
          The acceleration of a Ship, i.e. the increase of velocity when the Ship moves forward, which is 1 pixel/turn.
static double BACK_WEAPON_OFFSET
          The offsets from the Pivot point(PROW_OFFSET), for the different components.
static double CENTRAL_RADAR_OFFSET
          The offsets from the Pivot point(PROW_OFFSET), for the different components.
static double DECELERATION
          The deceleration of a Ship, i.e. the decrease of velocity when the Ship moves backwards (or brakes), which is 2 pixels/turn.
static double FRONT_WEAPON_OFFSET
          The offsets from the Pivot point(PROW_OFFSET), for the different components.
static double GUN_TURN_RATE
          The turning rate of the gun measured in degrees, which is 8 degrees/turn.
static double GUN_TURN_RATE_RADIANS
          The turning rate of the gun measured in radians instead of degrees.
static int HALF_HEIGHT_OFFSET
          The width and height of a regular ship.
static int HALF_WIDTH_OFFSET
          The width and height of a regular ship.
static int HEIGHT
          The width and height of a regular ship.
static int IDX_CENTRAL_RADAR
          The indices of the different components as used by the AdvancedShip class.
static int IDX_MINE_PLACER
          The indices of the different components as used by the AdvancedShip class.
static int IDX_WEAPON_BACK
          The indices of the different components as used by the AdvancedShip class.
static int IDX_WEAPON_FRONT
          The indices of the different components as used by the AdvancedShip class.
static double MAX_BULLET_POWER
          The maximum bullet power, i.e. the maximum amount of energy that can be transferred to a bullet when it is fired, which is 3 energy points.
static double MAX_MINE_POWER
          The maximum mine power.
static double MAX_TURN_RATE
          The maximum turning rate of the Ship, in degrees, which is 1 degrees/turn.
static double MAX_TURN_RATE_RADIANS
          The maximum turning rate of the Ship measured in radians instead of degrees.
static double MAX_VELOCITY
          The maximum velocity of a Ship, which is 15.4 pixels/turn.
static double MIN_BULLET_POWER
          The minimum bullet power, i.e the amount of energy required for firing a bullet, which is 0.1 energy points.
static double MIN_MINE_POWER
          The minimum mine power.
static double MINE_COMPONENT_OFFSET
          The offsets from the Pivot point(PROW_OFFSET), for the different components.
static double PROW_OFFSET
          The Pivot Point is this much pixels from the center of the ship into the prow.
static double RADAR_EXTENT_DEGREES
           
static double RADAR_EXTENT_RADIANS
           
static double RADAR_SCAN_RADIUS
          The radar scan radius, which is 1200 pixels.
static double RADAR_TURN_RATE
          The turning rate of the radar measured in degrees, which is 15 degrees/turn.
static double RADAR_TURN_RATE_RADIANS
          The turning rate of the radar measured in radians instead of degrees.
static double SHIP_HIT_BONUS
          The amount of bonus given when a robot moving forward hits an opponent robot (ramming), which is 1.2 energy points.
static double SHIP_HIT_DAMAGE
          The amount of damage taken when a robot hits or is hit by another robot, which is 0.6 energy points.
static int WIDTH
          The width and height of a regular ship.
 
Method Summary
static double getBlastRadius(double minePower)
          Experimental: Blastradius Mine blast radius = mine_Radius + blastRadius
static double getBulletDamage(double bulletPower)
          This value is reduced, since Ships are easier to hit (I mean, bigger hitbox + 2 weapons) Returns the amount of damage of a bullet given a specific bullet power.
static double getBulletHitBonus(double bulletPower)
          Returns the amount of bonus given when a Ship's bullet hits an opponent Ship given a specific bullet power.
static double getBulletSpeed(double bulletPower)
          Returns the speed of a bullet given a specific bullet power measured in pixels/turn.
static double getGunHeat(double bulletPower)
          Returns the heat produced by firing the gun given a specific bullet power.
static double getMineDamage(double minePower)
          Returns the amount of damage of a mine given a specific mine power.
static double getMineHitBonus(double minePower)
          Returns the amount of bonus given when a robot's mine hits an opponent Ship given a specific mine power.
static double getMineRecharge(double minePower)
           
static double getTurnRate(double velocity)
          Returns the turn rate of a Ship given a specific velocity measured in degrees/turn.
static double getTurnRateRadians(double velocity)
          Returns the turn rate of a Ship given a specific velocity measured in radians/turn.
static double getWallHitDamage(double velocity)
          Returns the amount of damage taken when Ship hits a wall with a specific velocity.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

WIDTH

public static final int WIDTH
The width and height of a regular ship.

See Also:
Constant Field Values

HEIGHT

public static final int HEIGHT
The width and height of a regular ship.

See Also:
Constant Field Values

HALF_WIDTH_OFFSET

public static final int HALF_WIDTH_OFFSET
The width and height of a regular ship.

See Also:
Constant Field Values

HALF_HEIGHT_OFFSET

public static final int HALF_HEIGHT_OFFSET
The width and height of a regular ship.

See Also:
Constant Field Values

PROW_OFFSET

public static final double PROW_OFFSET
The Pivot Point is this much pixels from the center of the ship into the prow.

See Also:
Constant Field Values

CENTRAL_RADAR_OFFSET

public static final double CENTRAL_RADAR_OFFSET
The offsets from the Pivot point(PROW_OFFSET), for the different components.

See Also:
Constant Field Values

FRONT_WEAPON_OFFSET

public static final double FRONT_WEAPON_OFFSET
The offsets from the Pivot point(PROW_OFFSET), for the different components.

See Also:
Constant Field Values

BACK_WEAPON_OFFSET

public static final double BACK_WEAPON_OFFSET
The offsets from the Pivot point(PROW_OFFSET), for the different components.

See Also:
Constant Field Values

MINE_COMPONENT_OFFSET

public static final double MINE_COMPONENT_OFFSET
The offsets from the Pivot point(PROW_OFFSET), for the different components.

See Also:
Constant Field Values

IDX_CENTRAL_RADAR

public static final int IDX_CENTRAL_RADAR
The indices of the different components as used by the AdvancedShip class.

See Also:
Constant Field Values

IDX_WEAPON_FRONT

public static final int IDX_WEAPON_FRONT
The indices of the different components as used by the AdvancedShip class.

See Also:
Constant Field Values

IDX_WEAPON_BACK

public static final int IDX_WEAPON_BACK
The indices of the different components as used by the AdvancedShip class.

See Also:
Constant Field Values

IDX_MINE_PLACER

public static final int IDX_MINE_PLACER
The indices of the different components as used by the AdvancedShip class.

See Also:
Constant Field Values

ACCELERATION

public static final double ACCELERATION
The acceleration of a Ship, i.e. the increase of velocity when the Ship moves forward, which is 1 pixel/turn.

See Also:
Constant Field Values

DECELERATION

public static final double DECELERATION
The deceleration of a Ship, i.e. the decrease of velocity when the Ship moves backwards (or brakes), which is 2 pixels/turn.

See Also:
Constant Field Values

MAX_VELOCITY

public static final double MAX_VELOCITY
The maximum velocity of a Ship, which is 15.4 pixels/turn.

See Also:
Constant Field Values

RADAR_SCAN_RADIUS

public static final double RADAR_SCAN_RADIUS
The radar scan radius, which is 1200 pixels. Ships that are more than 1200 pixels away cannot be seen on the radar.

See Also:
Constant Field Values

MIN_BULLET_POWER

public static final double MIN_BULLET_POWER
The minimum bullet power, i.e the amount of energy required for firing a bullet, which is 0.1 energy points.

See Also:
Constant Field Values

MAX_BULLET_POWER

public static final double MAX_BULLET_POWER
The maximum bullet power, i.e. the maximum amount of energy that can be transferred to a bullet when it is fired, which is 3 energy points.

See Also:
Constant Field Values

MIN_MINE_POWER

public static final double MIN_MINE_POWER
The minimum mine power. Minepower can't be set lower than this

See Also:
Constant Field Values

MAX_MINE_POWER

public static final double MAX_MINE_POWER
The maximum mine power. Minepower can't be set higher than this.

See Also:
Constant Field Values

MAX_TURN_RATE

public static final double MAX_TURN_RATE
The maximum turning rate of the Ship, in degrees, which is 1 degrees/turn. Note, that the turn rate of the robot depends on it's velocity.

See Also:
MAX_TURN_RATE_RADIANS, getTurnRate(double), getTurnRateRadians(double), Constant Field Values

MAX_TURN_RATE_RADIANS

public static final double MAX_TURN_RATE_RADIANS
The maximum turning rate of the Ship measured in radians instead of degrees.

See Also:
MAX_TURN_RATE, getTurnRate(double), getTurnRateRadians(double)

GUN_TURN_RATE

public static final double GUN_TURN_RATE
The turning rate of the gun measured in degrees, which is 8 degrees/turn. Note, that if setAdjustGunForRobotTurn(true) has been called, the gun turn is independent of the robot turn. In this case the gun moves relatively to the screen. If setAdjustGunForRobotTurn(false) has been called or setAdjustGunForRobotTurn() has not been called at all (this is the default), then the gun turn is dependent on the robot turn, and in this case the gun moves relatively to the robot body.

See Also:
GUN_TURN_RATE_RADIANS, Robot.setAdjustGunForRobotTurn(boolean), Constant Field Values

GUN_TURN_RATE_RADIANS

public static final double GUN_TURN_RATE_RADIANS
The turning rate of the gun measured in radians instead of degrees.

See Also:
GUN_TURN_RATE

RADAR_TURN_RATE

public static final double RADAR_TURN_RATE
The turning rate of the radar measured in degrees, which is 15 degrees/turn. Note, that if setAdjustRadarForRobotTurn(true) and/or setAdjustRadarForGunTurn(true) has been called, the radar turn is independent of the robot and/or gun turn. If both methods has been set to true, the radar moves relatively to the screen. If setAdjustRadarForRobotTurn(false) and/or setAdjustRadarForGunTurn(false) has been called or not called at all (this is the default), then the radar turn is dependent on the robot and/or gun turn, and in this case the radar moves relatively to the gun and/or Ship body.

See Also:
RADAR_TURN_RATE_RADIANS, Robot.setAdjustGunForRobotTurn(boolean), Robot.setAdjustRadarForGunTurn(boolean), Constant Field Values

RADAR_TURN_RATE_RADIANS

public static final double RADAR_TURN_RATE_RADIANS
The turning rate of the radar measured in radians instead of degrees.

See Also:
RADAR_TURN_RATE

RADAR_EXTENT_DEGREES

public static final double RADAR_EXTENT_DEGREES
See Also:
Constant Field Values

RADAR_EXTENT_RADIANS

public static final double RADAR_EXTENT_RADIANS

SHIP_HIT_DAMAGE

public static final double SHIP_HIT_DAMAGE
The amount of damage taken when a robot hits or is hit by another robot, which is 0.6 energy points.

See Also:
Constant Field Values

SHIP_HIT_BONUS

public static final double SHIP_HIT_BONUS
The amount of bonus given when a robot moving forward hits an opponent robot (ramming), which is 1.2 energy points.

See Also:
Constant Field Values
Method Detail

getTurnRate

public static double getTurnRate(double velocity)
Returns the turn rate of a Ship given a specific velocity measured in degrees/turn.

Parameters:
velocity - the velocity of the robot.
Returns:
turn rate in degrees/turn.
See Also:
getTurnRateRadians(double)

getTurnRateRadians

public static double getTurnRateRadians(double velocity)
Returns the turn rate of a Ship given a specific velocity measured in radians/turn.

Parameters:
velocity - the velocity of the robot.
Returns:
turn rate in radians/turn.
See Also:
getTurnRate(double)

getWallHitDamage

public static double getWallHitDamage(double velocity)
Returns the amount of damage taken when Ship hits a wall with a specific velocity.

Parameters:
velocity - the velocity of the Ship.
Returns:
wall hit damage in energy points.

getBulletDamage

public static double getBulletDamage(double bulletPower)
This value is reduced, since Ships are easier to hit (I mean, bigger hitbox + 2 weapons) Returns the amount of damage of a bullet given a specific bullet power.

Parameters:
bulletPower - the energy power of the bullet.
Returns:
bullet damage in energy points.

getBulletHitBonus

public static double getBulletHitBonus(double bulletPower)
Returns the amount of bonus given when a Ship's bullet hits an opponent Ship given a specific bullet power.

Parameters:
bulletPower - the energy power of the bullet.
Returns:
bullet hit bonus in energy points.

getBulletSpeed

public static double getBulletSpeed(double bulletPower)
Returns the speed of a bullet given a specific bullet power measured in pixels/turn.

Parameters:
bulletPower - the energy power of the bullet.
Returns:
bullet speed in pixels/turn

getGunHeat

public static double getGunHeat(double bulletPower)
Returns the heat produced by firing the gun given a specific bullet power.

Parameters:
bulletPower - the energy power of the bullet.
Returns:
gun heat

getMineRecharge

public static double getMineRecharge(double minePower)

getMineDamage

public static double getMineDamage(double minePower)
Returns the amount of damage of a mine given a specific mine power.

Parameters:
minePower - the energy power of the bullet.
Returns:
mine damage in energy points.

getMineHitBonus

public static double getMineHitBonus(double minePower)
Returns the amount of bonus given when a robot's mine hits an opponent Ship given a specific mine power.

Parameters:
minePower - the energy power of the mine.
Returns:
mine hit bonus in energy points.

getBlastRadius

public static double getBlastRadius(double minePower)
Experimental: Blastradius Mine blast radius = mine_Radius + blastRadius



Copyright © 2015 Robocode. All Rights Reserved.