|
||||||||||
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<UDKBot> cz.cuni.amis.pogamut.udk.agent.module.sensor.AgentInfo
public class AgentInfo
Memory module specialized on general info about the agent whereabouts.
It is designed to be initialized inside IUDKBotController.prepareBot(UDKBot)
method call
and may be used since first Self
message is received, i.e, since the first IUDKBotController.botSpawned(cz.cuni.amis.pogamut.udk.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 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(UDKBot bot)
Constructor. |
|
AgentInfo(UDKBot bot,
Game game)
Constructor. |
|
AgentInfo(UDKBot bot,
Game game,
Logger log)
Constructor. |
Method Summary | |
---|---|
Double |
_getCurrentVolumeTerminalVelocity()
FIXME[js]: What the hell is this good for? |
boolean |
atLocation(Location location)
|
boolean |
atLocation(Location location,
double epsilon)
|
Double |
getAccelerationRate()
Retreives acceleration rate of the agent. |
Double |
getAirControl()
Retreives agent's control of movement while in the air. |
Double |
getAirSpeed()
Retreives maximum speed of the agent while moving in the air. |
Integer |
getArmor()
Tells, how much of combined armor the agent is wearing. |
Double |
getBaseSpeed()
Retreives maximum base speed of the agent. |
ConfigChange |
getConfig()
Retrieves the configuration of the bot inside UT2004. |
Integer |
getCurrentAmmo()
Tells, how much ammunition the agent has left for the current weapon in its primary firing mode. |
Integer |
getCurrentSecondaryAmmo()
Tells, how much ammunition the agent has left for the current weapon in its alternate (secondary) firing mode. |
Double |
getCurrentVolumeDamagePerSec()
Amount of damage taken for spending time in the current volume. |
String |
getCurrentVolumeDamageType()
Retreives type of damage the current volume inflicts to the agent while he spends time in this volume. |
Double |
getCurrentVolumeFluidFriction()
Friction of the fluid in this map volume. |
Double |
getCurrentVolumeGroundFriction()
Friction of the floor in this map volume. |
UnrealId |
getCurrentWeapon()
Retreives UnrealId of the weapon the agent is currently holding. |
Velocity |
getCurrentZoneGravity()
Gravity in this map zone. |
Velocity |
getCurrentZoneVelocity()
Pulling velocity in this map zone. |
Double |
getDamageScaling()
Retreives scaling factor for damage dealt by the agent. |
int |
getDeaths()
Retreives number of deaths the agent took. |
Double |
getDistance(Location location)
Computes crow-fly distance of the agent from given location. |
Double |
getDodgeSpeedFactor()
Retreives maximum speed of the agent while using dodge. |
Double |
getDodgeZBoost()
Retreives boost of the agent in the Z axis while using dodge. |
Double |
getFallSpeed()
Retreives maximum speed of the agent while falling. |
Location |
getFloorLocation()
Retreives location of the nearest map geometry directly beneath the agent. |
Integer |
getHealth()
Tells, how much health the agent has. |
Integer |
getHighArmor()
Tells, how much of high armor the agent is wearing. |
UnrealId |
getId()
Retreives a unique ID of the agent in the game. |
Double |
getJumpZBoost()
Retreives boost of the agent in the Z axis while jumping. |
int |
getKills()
Retreives number of kills the agent scored. |
Double |
getLadderSpeed()
Retreives maximum speed of the agent while moving on a ladder. |
Location |
getLocation()
Retreives absolute location of the agent within the map. |
Integer |
getLowArmor()
Tells, how much of low armor the agent is wearing. |
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. |
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. |
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. |
Double |
getWaterSpeed()
Retreives maximum speed of the agent while moving in water. |
Boolean |
hasArmor()
Tells, whether the agent is armored to the maximum extent. |
Boolean |
hasHighArmor()
Tells, whether the agent is armored to the maximum of high-armor extent. |
Boolean |
hasLowArmor()
Tells, whether the agent is armored to the maximum of low-armor extent. |
Boolean |
hasUDamage()
Tells whether the agent has the damage multiplier (UDamage) bonus boost activated. |
Boolean |
hasWeapon()
Tells whether the bot is holding some weapon or not. |
Boolean |
isCrouched()
Tells, whether the agent is crouched. |
Boolean |
isCurrentVolumeAffectingProjectiles()
Tells, whether the current volume imparts its velocity to projectiles. |
Boolean |
isCurrentVolumeBanningInventory()
Tells, whether the current volume (the one the agent is within) forbids usage of the inventory. |
Boolean |
isCurrentVolumeDestructive()
Tells, whether the current volume kills the actors (almost) instantly. |
Boolean |
isCurrentVolumePainCausing()
Tells, whether the current volume is causing damage. |
Boolean |
isCurrentVolumeWater()
Tells, whether the current volume is water. |
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. |
Boolean |
isFacing(ILocated location)
Tells if the agent is currently facing input location. |
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. |
Boolean |
isHealthy()
Tells, whether the agent is healthy, i.e. |
Boolean |
isMoving()
Tells, whether the agent is moving. |
Boolean |
isPrimaryShooting()
Tells, whether the agent is shooting with primary fire mode. |
Boolean |
isSecondaryShooting()
Tells, whether the agent is shooting with alternate (secondary) fire mode. |
Boolean |
isShooting()
Tells, whether the agent is shooting or not. |
Boolean |
isSuperHealthy()
Tells, whether the agent is healthy to the maximum boostable extent. |
Boolean |
isTouchingGround()
Tells, whether the agent is currently touching the groud with his feets. |
Boolean |
isWalking()
Tells, whether the agent is walking. |
protected void |
start(boolean startPaused)
Provides initialization of the module (clearing internal data structures). |
Methods inherited from class cz.cuni.amis.pogamut.base.agent.module.AgentModule |
---|
cleanUp, getComponentId, getLog, getState, initComponentId, isRunning, kill, pause, reset, resume, stop, toString |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static final 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(UDKBot bot)
game
- game info modulepublic AgentInfo(UDKBot bot, Game game)
bot
- owner of the modulegame
- game info modulepublic AgentInfo(UDKBot bot, Game game, 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 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 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(Location location)
public boolean atLocation(Location location, double epsilon)
public Double getDistance(Location location)
location
- Location within the map.
getLocation()
public Rotation getRotation()
public Velocity getVelocity()
isMoving()
public Boolean isMoving()
getVelocity()
public Boolean isCrouched()
public Boolean isWalking()
public Boolean isFacing(ILocated location)
location
- input location.
public 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 Boolean isTouchingGround()
public 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 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 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 Boolean isHealthy()
getHealth()
,
isSuperHealthy()
public Boolean isSuperHealthy()
getHealth()
,
isHealthy()
public 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 Boolean hasArmor()
getArmor()
,
hasLowArmor()
,
hasHighArmor()
public 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 Boolean hasLowArmor()
getLowArmor()
,
hasArmor()
,
hasHighArmor()
public 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 Boolean hasHighArmor()
getHighArmor()
,
hasArmor()
,
hasLowArmor()
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()
,
Inventory#getCurrentWeapon()
,
Inventory#getWeapon(UnrealId)
public Boolean hasWeapon()
Note that getCurrentWeapon()
always returns some id. But there is a special id that marks 'no weapon'
public Integer getCurrentAmmo()
getCurrentSecondaryAmmo()
,
Inventory#getCurrentPrimaryAmmo()
public Integer getCurrentSecondaryAmmo()
getCurrentAmmo()
,
Inventory#getCurrentSecondaryAmmo()
public 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 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 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.
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.
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 Double getCurrentVolumeGroundFriction()
public Double getCurrentVolumeFluidFriction()
public Double _getCurrentVolumeTerminalVelocity()
public 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 Boolean isCurrentVolumePainCausing()
getCurrentVolumeDamagePerSec()
. When the volume damages the
agent to the death, the death is counted as a suicide.
isCurrentVolumeDestructive()
,
getCurrentVolumeDamagePerSec()
public Double getCurrentVolumeDamagePerSec()
isCurrentVolumePainCausing()
public Boolean isCurrentVolumeDestructive()
isCurrentVolumePainCausing()
public String getCurrentVolumeDamageType()
FIXME[js]: Is is possible to provide an enum here?
public Boolean isCurrentVolumeBanningInventory()
public Boolean isCurrentVolumeAffectingProjectiles()
public Boolean isCurrentZoneNeutral()
public Double getDamageScaling()
public Double getBaseSpeed()
public Double getAirSpeed()
public Double getLadderSpeed()
public Double getWaterSpeed()
public Double getFallSpeed()
public Double getDodgeSpeedFactor()
FIXME[js]: Check about the name depending on the meaning/value.
public Double getAccelerationRate()
public Double getAirControl()
public Double getJumpZBoost()
public 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 start(boolean startPaused)
start
in class AgentModule<UDKBot>
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |