|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object cz.cuni.amis.pogamut.base.agent.module.AgentModule<AGENT> cz.cuni.amis.pogamut.base.agent.module.SensorModule<UT2004Bot> cz.cuni.amis.pogamut.ut2004.agent.module.sensor.AgentInfo
public class AgentInfo
Memory module specialized on general info about the agent whereabouts.
It is designed to be initialized inside IUT2004BotController.prepareBot(UT2004Bot)
method call
and may be used since first Self
message is received, i.e, since the first IUT2004BotController.botSpawned(cz.cuni.amis.pogamut.ut2004.communication.messages.gbinfomessages.GameInfo, ConfigChange, InitedMessage, Self)
is called.
Field Summary | |
---|---|
static double |
AT_LOCATION_EPSILON
Which distance to a location is considered the same as specified location. |
Game |
game
Game memory module. |
static double |
IS_FACING_ANGLE
What angle is considered to be maximum facing angle by default (in degrees). |
static java.lang.String |
NONE_WEAPON_ID
|
static int |
TEAM_BLUE
Blue team number. |
static int |
TEAM_GOLD
Gold team number. |
static int |
TEAM_GREEN
Green team number. |
static int |
TEAM_NONE
No-team number. |
static int |
TEAM_RED
Red team number. |
Fields inherited from class cz.cuni.amis.pogamut.base.agent.module.SensorModule |
---|
worldView |
Fields inherited from class cz.cuni.amis.pogamut.base.agent.module.AgentModule |
---|
agent, controller, eventBus, log |
Constructor Summary | |
---|---|
AgentInfo(UT2004Bot bot)
Constructor. |
|
AgentInfo(UT2004Bot bot,
Game game)
Constructor. |
|
AgentInfo(UT2004Bot bot,
Game game,
java.util.logging.Logger log)
Constructor. |
Method Summary | |
---|---|
java.lang.Double |
_getCurrentVolumeTerminalVelocity()
FIXME[js]: What the hell is this good for? |
boolean |
atLocation(ILocated location)
Returns whether the bot is at 'location', using AT_LOCATION_EPSILON . |
boolean |
atLocation(ILocated location,
double epsilon)
Returns whether the bot is at 'location', using 'epsilon' as a distance tolerance |
boolean |
atLocation(java.lang.String objectId)
Tells whether the bot is at navpoint/item/... |
boolean |
atLocation(java.lang.String objectId,
double epsilon)
Tells whether the bot is at navpoint/item/... |
protected void |
cleanUp()
Hook where to perform clean up of data structures of the module. |
java.lang.Double |
getAccelerationRate()
Retreives acceleration rate of the agent. |
java.lang.Integer |
getAdrenaline()
Tells, how much adrenaline the agent has. |
java.lang.Double |
getAirControl()
Retreives agent's control of movement while in the air. |
java.lang.Double |
getAirSpeed()
Retreives maximum speed of the agent while moving in the air. |
java.lang.Integer |
getArmor()
Tells, how much of combined armor the agent is wearing. |
java.lang.Double |
getBaseSpeed()
Retreives maximum base speed of the agent. |
ConfigChange |
getConfig()
Retrieves the configuration of the bot inside UT2004. |
java.lang.Integer |
getCurrentAmmo()
Tells, how much ammunition the agent has left for the current weapon in its primary firing mode. |
java.lang.Integer |
getCurrentSecondaryAmmo()
Tells, how much ammunition the agent has left for the current weapon in its alternate (secondary) firing mode. |
java.lang.Double |
getCurrentVolumeDamagePerSec()
Amount of damage taken for spending time in the current volume. |
java.lang.String |
getCurrentVolumeDamageType()
Retreives type of damage the current volume inflicts to the agent while he spends time in this volume. |
java.lang.Double |
getCurrentVolumeFluidFriction()
Friction of the fluid in this map volume. |
java.lang.Double |
getCurrentVolumeGroundFriction()
Friction of the floor in this map volume. |
UnrealId |
getCurrentWeapon()
Retreives UnrealId of the weapon the agent is currently holding. |
java.lang.String |
getCurrentWeaponName()
Returns name of the currently wielded weapon (or null if no such weapon exists). |
ItemType |
getCurrentWeaponType()
Returns type of the weapon the agent is currently holding (or null if no such weapon exists). |
Velocity |
getCurrentZoneGravity()
Gravity in this map zone. |
Velocity |
getCurrentZoneVelocity()
Pulling velocity in this map zone. |
java.lang.Double |
getDamageScaling()
Retreives scaling factor for damage dealt by the agent. |
int |
getDeaths()
Retreives number of deaths the agent took. |
java.lang.Double |
getDistance(ILocated location)
Computes crow-fly distance of the agent from given location. |
java.lang.Double |
getDodgeSpeedFactor()
Retreives maximum speed of the agent while using dodge. |
java.lang.Double |
getDodgeZBoost()
Retreives boost of the agent in the Z axis while using dodge. |
java.lang.Double |
getFallSpeed()
Retreives maximum speed of the agent while falling. |
Location |
getFloorLocation()
Retreives location of the nearest map geometry directly beneath the agent. |
java.lang.Integer |
getHealth()
Tells, how much health the agent has. |
java.lang.Integer |
getHighArmor()
Tells, how much of high armor the agent is wearing. |
Rotation |
getHorizontalRotation()
Retreives absolute rotation of the agent within the map. |
UnrealId |
getId()
Retreives a unique ID of the agent in the game. |
java.lang.Double |
getJumpZBoost()
Retreives boost of the agent in the Z axis while jumping. |
int |
getKills()
Retreives number of kills the agent scored. |
java.lang.Double |
getLadderSpeed()
Retreives maximum speed of the agent while moving on a ladder. |
Location |
getLocation()
Retreives absolute location of the agent within the map. |
java.lang.Integer |
getLowArmor()
Tells, how much of low armor the agent is wearing. |
java.lang.String |
getName()
Retreives current name of the agent in the game. |
Item |
getNearestItem()
Retrieves nearest known item to current agent location. |
NavPoint |
getNearestNavPoint()
Retrieves nearest known navpoint to current agent location. |
Player |
getNearestPlayer()
Retrieves nearest known player to current agent location. |
Item |
getNearestVisibleItem()
Retrieves nearest visible item to current agent location. |
NavPoint |
getNearestVisibleNavPoint()
Retrieves nearest visible navpoint to current agent location. |
Player |
getNearestVisiblePlayer()
Retrieves nearest visible player to current agent location. |
java.lang.Double |
getRemainingUDamageTime()
Tells whether the agent has the damage multiplier (UDamage) bonus boost activated and how long will the UDamage boost remain active. |
Rotation |
getRotation()
Retreives absolute rotation of the agent within the map. |
int |
getScore()
Retreives current agent score. |
Self |
getSelf()
|
int |
getSuicides()
Retreives number of suicides the agent commited. |
java.lang.Integer |
getTeam()
Retreives team number the agent is on. |
int |
getTeamScore()
Retreives current agent's team score. |
double |
getTime()
Retreives current game time, since the game started. |
Velocity |
getVelocity()
Retreives current velocity of the agent as a vector of movement. |
java.lang.Double |
getWaterSpeed()
Retreives maximum speed of the agent while moving in water. |
java.lang.Boolean |
hasArmor()
Tells, whether the agent is armored to the maximum extent. |
java.lang.Boolean |
hasFastFire()
Tells, whether the agent has special bonus action activated: the fast firing rate. |
java.lang.Boolean |
hasHighArmor()
Tells, whether the agent is armored to the maximum of high-armor extent. |
java.lang.Boolean |
hasInvisibility()
Tells, whether the agent has special bonus action activated: the invisibility. |
java.lang.Boolean |
hasLowArmor()
Tells, whether the agent is armored to the maximum of low-armor extent. |
java.lang.Boolean |
hasRegeneration()
Tells, whether the agent has special bonus action activated: the regenration, which is also called booster. |
java.lang.Boolean |
hasSpeed()
Tells, whether the agent has special bonus action activated: the speed. |
java.lang.Boolean |
hasUDamage()
Tells whether the agent has the damage multiplier (UDamage) bonus boost activated. |
java.lang.Boolean |
hasWeapon()
Tells whether the bot is holding some weapon or not. |
java.lang.Boolean |
isAdrenalineFull()
Tells, whether the agent has full adrenaline. |
java.lang.Boolean |
isAdrenalineSufficient()
Tells, whether the agent gained enough adrenaline to use it for special adrenaline-based action, e.g. |
boolean |
isAtLocation(ILocated location)
Returns whether the bot is at 'location'. |
java.lang.Boolean |
isCrouched()
Tells, whether the agent is crouched. |
java.lang.Boolean |
isCurrentVolumeAffectingProjectiles()
Tells, whether the current volume imparts its velocity to projectiles. |
java.lang.Boolean |
isCurrentVolumeBanningInventory()
Tells, whether the current volume (the one the agent is within) forbids usage of the inventory. |
java.lang.Boolean |
isCurrentVolumeDestructive()
Tells, whether the current volume kills the actors (almost) instantly. |
java.lang.Boolean |
isCurrentVolumePainCausing()
Tells, whether the current volume is causing damage. |
java.lang.Boolean |
isCurrentVolumeWater()
Tells, whether the current volume is water. |
java.lang.Boolean |
isCurrentZoneNeutral()
Tells, whether the current zone is a neutral zone. |
boolean |
isEnemy(int team)
Tells, whether a given team is an enemy team to the agent. |
boolean |
isEnemy(Player player)
Tells, whether a given player is an enemy to the agent. |
java.lang.Boolean |
isFacing(ILocated location)
Tells if the agent is currently facing input location. |
java.lang.Boolean |
isFacing(ILocated location,
double angle)
Tells if the agent is currently facing input location. |
boolean |
isFriend(int team)
Tells, whether a given team is a friend team to the agent. |
boolean |
isFriend(Player player)
Tells, whether a given player is a friend to the agent. |
java.lang.Boolean |
isHealthy()
Tells, whether the agent is healthy, i.e. |
java.lang.Boolean |
isMoving()
Tells, whether the agent is moving. |
java.lang.Boolean |
isPrimaryShooting()
Tells, whether the agent is shooting with primary fire mode. |
java.lang.Boolean |
isSecondaryShooting()
Tells, whether the agent is shooting with alternate (secondary) fire mode. |
java.lang.Boolean |
isShooting()
Tells, whether the agent is shooting or not. |
java.lang.Boolean |
isSuperHealthy()
Tells, whether the agent is healthy to the maximum boostable extent. |
java.lang.Boolean |
isTouchingGround()
Tells, whether the agent is currently touching the groud with his feets. |
java.lang.Boolean |
isWalking()
Tells, whether the agent is walking. |
Methods inherited from class cz.cuni.amis.pogamut.base.agent.module.AgentModule |
---|
getComponentId, getLog, getState, initComponentId, isRunning, kill, pause, reset, resume, start, stop, toString |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static final java.lang.String NONE_WEAPON_ID
public static final int TEAM_RED
public static final int TEAM_BLUE
public static final int TEAM_GREEN
public static final int TEAM_GOLD
public static final int TEAM_NONE
public static final double AT_LOCATION_EPSILON
public static final double IS_FACING_ANGLE
public Game game
Constructor Detail |
---|
public AgentInfo(UT2004Bot bot)
game
- game info modulepublic AgentInfo(UT2004Bot bot, Game game)
bot
- owner of the modulegame
- game info modulepublic AgentInfo(UT2004Bot bot, Game game, java.util.logging.Logger log)
bot
- owner of the modulegame
- game info modulelog
- Logger to be used for logging runtime/debug info. Note: If null is provided,
this memory module creates it's own logger.Method Detail |
---|
public UnrealId getId()
Note: This ID does not change and can be relied upon during entire match. However, be aware that the ID may change between different matches and/or sessions.
public java.lang.String getName()
Note: The agent may choose and change it's name during a match and it does not need to be unique among players. Even an empty string might be a valid name.
public java.lang.Integer getTeam()
TEAM_RED
,
TEAM_BLUE
,
TEAM_GREEN
,
TEAM_GOLD
,
TEAM_NONE
,
isEnemy(int)
,
isEnemy(Player)
,
isFriend(int)
,
isFriend(Player)
public boolean isEnemy(int team)
team
- Team number to be tested.
getTeam()
,
isFriend(int)
public boolean isEnemy(Player player)
player
- Player to be tested.
getTeam()
,
isFriend(Player)
public boolean isFriend(int team)
team
- Team number to be tested.
getTeam()
,
isEnemy(int)
public boolean isFriend(Player player)
player
- Player to be tested.
getTeam()
,
isEnemy(Player)
public Location getLocation()
getDistance(Location)
,
Location.getDistance(Location)
,
Location.getDistanceL1(Location)
,
Location.getDistanceLinf(Location)
,
Location.getDistancePlane(Location)
,
Location.getDistanceSquare(Location)
public boolean atLocation(java.lang.String objectId)
ILocated
) of id 'objectId'. Note that IDs are case sensitive! UT2004 is usually using camel-case.
objectId
-
public boolean atLocation(java.lang.String objectId, double epsilon)
ILocated
) of id 'objectId'. Note that IDs are case sensitive! UT2004 is usually using camel-case.
objectId
- epsilon
-
public boolean isAtLocation(ILocated location)
Synonym for AgentInfo#atLocation(Location)
.
public boolean atLocation(ILocated location)
AT_LOCATION_EPSILON
.
public boolean atLocation(ILocated location, double epsilon)
location
- epsilon
-
public java.lang.Double getDistance(ILocated location)
location
- Location within the map.
getLocation()
public Rotation getRotation()
public Rotation getHorizontalRotation()
public Velocity getVelocity()
isMoving()
public java.lang.Boolean isMoving()
getVelocity()
public java.lang.Boolean isCrouched()
public java.lang.Boolean isWalking()
public java.lang.Boolean isFacing(ILocated location)
location
- input location.
public java.lang.Boolean isFacing(ILocated location, double angle)
location
- input location.angle
- specifies maximum angle (in degrees) that will be still considered as facing angle.
public Location getFloorLocation()
public java.lang.Boolean isTouchingGround()
public java.lang.Double getRemainingUDamageTime()
When UDamage is activated, the agent is causing double (or tripple, or even more) damage to other players. The multiplying factor depends on game settings and mutators.
hasUDamage()
public java.lang.Boolean hasUDamage()
When UDamage is activated, the agent is causing double (or tripple, or even more) damage to other players. The multiplying factor depends on game settings and mutators.
getRemainingUDamageTime()
public java.lang.Boolean hasInvisibility()
To learn, for how long the bonus action will remain activated, check
the remaining amount of adrenaline. When level of adrenaline reaches
zero, the bonus action is deactivated. See getAdrenaline()
.
getAdrenaline()
public java.lang.Boolean hasFastFire()
To learn, for how long the bonus action will remain activated, check
the remaining amount of adrenaline. When level of adrenaline reaches
zero, the bonus action is deactivated. See getAdrenaline()
.
getAdrenaline()
public java.lang.Boolean hasRegeneration()
To learn, for how long the bonus action will remain activated, check
the remaining amount of adrenaline. When level of adrenaline reaches
zero, the bonus action is deactivated. See getAdrenaline()
.
getAdrenaline()
public java.lang.Boolean hasSpeed()
To learn, for how long the bonus action will remain activated, check
the remaining amount of adrenaline. When level of adrenaline reaches
zero, the bonus action is deactivated. See getAdrenaline()
.
getAdrenaline()
public java.lang.Integer getHealth()
The health usually starts at 100, and ranges from 0 to 199. These values, however, can be changed by various mutators.
isHealthy()
,
isSuperHealthy()
public java.lang.Boolean isHealthy()
getHealth()
,
isSuperHealthy()
public java.lang.Boolean isSuperHealthy()
getHealth()
,
isHealthy()
public java.lang.Integer getArmor()
The combined armor usually starts at 0, and ranges from 0 to 150. These values, however, can be changed by various mutators.
Note: The armor consist of two parts, which are summed together into combined armor value. However, each part is powered-up by different item (low armor by small shield; high armor by super-shield).
hasArmor()
,
getLowArmor()
,
getHighArmor()
public java.lang.Boolean hasArmor()
getArmor()
,
hasLowArmor()
,
hasHighArmor()
public java.lang.Integer getLowArmor()
The low armor usually starts at 0, and ranges from 0 to 50. These values, however, can be changed by various mutators.
Note: The armor consist of two parts, which are summed together into combined armor value. However, each part is powered-up by different item (low armor by small shield; high armor by super-shield).
hasLowArmor()
,
getArmor()
,
getHighArmor()
public java.lang.Boolean hasLowArmor()
getLowArmor()
,
hasArmor()
,
hasHighArmor()
public java.lang.Integer getHighArmor()
The high armor usually starts at 0, and ranges from 0 to 100. These values, however, can be changed by various mutators.
Note: The armor consist of two parts, which are summed together into combined armor value. However, each part is powered-up by different item (low armor by small shield; high armor by super-shield).
hasHighArmor()
,
getArmor()
,
getLowArmor()
public java.lang.Boolean hasHighArmor()
getHighArmor()
,
hasArmor()
,
hasLowArmor()
public java.lang.Integer getAdrenaline()
Adrenaline can be gained through fulfilling various game tasks, such as killing opponents, capturing flags, controlling domination points, picking up adrenaline pills, etc. Note: More adrenaline is gained when the agent fulfill these tasks in combos (e.g. by scoring a double-kill the agent receives significantly more adrenaline than by scoring two single-kills).
Once the adrenaline reaches a designated level, it can be used to
start special bonus actions like booster, invisibility,
speed, etc. The adrenaline is then spent on the action. The more
adrenaline the agent has, the longer the action lasts. Note: The agent
may gain new adrenaline during the bonus action, which prolongs the
action duration. See isAdrenalineFull()
to determine, when the
necessary adrenaline level is reached.
The adrenaline usually starts at 0, and ranges from 0 to 100. These values, however, can be changed by various mutators.
isAdrenalineFull()
public java.lang.Boolean isAdrenalineSufficient()
getAdrenaline()
public java.lang.Boolean isAdrenalineFull()
getAdrenaline()
public UnrealId getCurrentWeapon()
The UnrealId might contains a substring, which identifies the type of the weapon. However, this is not guaranteed by definition. Therefore, you shoud use inventory to retreive the appropriate weapon object, to further retreive correct type of weapon.
getCurrentAmmo()
,
getCurrentSecondaryAmmo()
,
Weaponry#getCurrentWeapon()
,
Weaponry#getWeapon(UnrealId)
public java.lang.String getCurrentWeaponName()
getCurrentWeapon
public ItemType getCurrentWeaponType()
public java.lang.Boolean hasWeapon()
Note that getCurrentWeapon()
always returns some id. But there is a special id that marks 'no weapon'
public java.lang.Integer getCurrentAmmo()
getCurrentSecondaryAmmo()
,
Inventory#getCurrentPrimaryAmmo()
public java.lang.Integer getCurrentSecondaryAmmo()
getCurrentAmmo()
,
Inventory#getCurrentSecondaryAmmo()
public java.lang.Boolean isShooting()
This method reports shooting with either primary or secondary fire
mode. To distinguish between the fire modes, see isPriShooting()
,
isAltShooting()
.
isPrimaryShooting()
,
isSecondaryShooting()
public java.lang.Boolean isPrimaryShooting()
This method reports shooting with primary fire mode only. See
isAltShooting()
method to determine, whether the agent shoots
with alternate firing mode. See isShooting()
to determine,
whether the agent shoots with either primary or alternate firing mode.
isShooting()
,
isSecondaryShooting()
public java.lang.Boolean isSecondaryShooting()
This method reports shooting with alternate (secondary) fire mode only. See
isPriShooting()
method to determine, whether the agent shoots
with primary firing mode. See isShooting()
to determine,
whether the agent shoots with either primary or alternate (secondary) firing mode.
isShooting()
,
isPrimaryShooting()
public int getKills()
A kill is counted, whenever the agent kills an opponent.
public int getDeaths()
A death is counted, whenever the agent dies.
Note that if Integer.MIN_VALUE
is returned, than the number of deaths is unknown. This happens only
if you call this method before the first logic iteration of the agent (i.e., before first PlayerScore
messages
are exported by GameBots).
public int getSuicides()
A suicide is counted, whenever the agent dies by his own weapon, or by damaging himself by falling into pits, lava, acid, etc.
It can also be said that suicide is every agent's death, which could not be credited to any other player in the map.
Each suicide is also counted as death. See getDeaths()
.
public int getScore()
Agent score is usually rising by achieving some goals, e.g. killing opponents, capturing flags, controlling domination points, etc. Note: Agent score might decrease upon suicides, based on map, game type and game settings.
Note that if Integer.MIN_VALUE
is returned, than the score is unknown. This happens only
if you call this method before the first logic iteration of the agent (i.e., before first PlayerScore
messages
are exported by GameBots).
public int getTeamScore()
Agent's team score is usually rising by achieving team goals, e.g. killing opponents, capturing flags, controlling domination points, etc. Note: Agent's team score might decrease, when oposing teams score points themselves, based on map, game type and game settings.
public Velocity getCurrentZoneVelocity()
public Velocity getCurrentZoneGravity()
getFallSpeed()
.
public java.lang.Double getCurrentVolumeGroundFriction()
public java.lang.Double getCurrentVolumeFluidFriction()
public java.lang.Double _getCurrentVolumeTerminalVelocity()
public java.lang.Boolean isCurrentVolumeWater()
getCurrentVolumeFluidFriction()
and getWaterSpeed()
can
help to determine changes to movement and speed of the agent. Also note
that getCurrentZoneVelocity()
, getCurrentZoneGravity()
,
and others may change (and usually does) in water.
public java.lang.Boolean isCurrentVolumePainCausing()
getCurrentVolumeDamagePerSec()
. When the volume damages the
agent to the death, the death is counted as a suicide.
isCurrentVolumeDestructive()
,
getCurrentVolumeDamagePerSec()
public java.lang.Double getCurrentVolumeDamagePerSec()
isCurrentVolumePainCausing()
public java.lang.Boolean isCurrentVolumeDestructive()
isCurrentVolumePainCausing()
public java.lang.String getCurrentVolumeDamageType()
FIXME[js]: Is is possible to provide an enum here?
public java.lang.Boolean isCurrentVolumeBanningInventory()
public java.lang.Boolean isCurrentVolumeAffectingProjectiles()
public java.lang.Boolean isCurrentZoneNeutral()
public java.lang.Double getDamageScaling()
public java.lang.Double getBaseSpeed()
public java.lang.Double getAirSpeed()
public java.lang.Double getLadderSpeed()
public java.lang.Double getWaterSpeed()
public java.lang.Double getFallSpeed()
public java.lang.Double getDodgeSpeedFactor()
FIXME[js]: Check about the name depending on the meaning/value.
public java.lang.Double getAccelerationRate()
public java.lang.Double getAirControl()
public java.lang.Double getJumpZBoost()
public java.lang.Double getDodgeZBoost()
public double getTime()
public ConfigChange getConfig()
public NavPoint getNearestNavPoint()
WARNING: O(n) complexity.
public NavPoint getNearestVisibleNavPoint()
WARNING: O(n) complexity.
public Item getNearestItem()
WARNING: O(n) complexity.
public Item getNearestVisibleItem()
WARNING: O(n) complexity.
public Player getNearestPlayer()
WARNING: O(n) complexity.
public Player getNearestVisiblePlayer()
WARNING: O(n) complexity.
public Self getSelf()
protected void cleanUp()
AgentModule
Called from AgentModule.stop()
, AgentModule.kill()
, AgentModule.reset()
.
cleanUp
in class AgentModule<UT2004Bot>
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |