cz.cuni.amis.pogamut.udk.agent.module.sensor
Class Game

Package class diagram package Game
java.lang.Object
  extended by cz.cuni.amis.pogamut.base.agent.module.AgentModule<AGENT>
      extended by cz.cuni.amis.pogamut.base.agent.module.SensorModule<UDKBot>
          extended by cz.cuni.amis.pogamut.udk.agent.module.sensor.Game
All Implemented Interfaces:
IComponent

public class Game
extends SensorModule<UDKBot>

Memory module specialized on general info about the game.

It is designed to be initialized inside IUDKBotController.prepareBot(UDKBot) method call and may be used since IUDKBotController.botInitialized(cz.cuni.amis.pogamut.udk.communication.messages.gbinfomessages.GameInfo, cz.cuni.amis.pogamut.udk.communication.messages.gbinfomessages.ConfigChange, cz.cuni.amis.pogamut.udk.communication.messages.gbinfomessages.InitedMessage) is called.

Author:
Juraj 'Loque' Simlovic, Jimmy

Nested Class Summary
static class Game.GameType
          Enums for game types that shields you from Unreal's string ids of game types.
 
Field Summary
 
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
Game(UDKBot bot)
          Constructor.
Game(UDKBot bot, Logger log)
          Constructor.
 
Method Summary
 Map<Integer,FlagInfo> getAllCTFFlags()
          Returns a map indexed by team numbers, holding all flags in the game.
 Collection<FlagInfo> getAllCTFFlagsCollection()
          Returns a collection of all the flags in the game.
 Integer getFragLimit()
          BotDeathMatch only: Number of points (e.g. kills) needed to win the game.
 Integer getFullHealth()
          Retreives maximum level of non-boosted health.
 Game.GameType getGameType()
          Retreives the type of the game.
 String getMapName()
          Retreives the name of current map.
 Integer getMaxAdrenaline()
          Retreives maximum level of adrenaline that can be gained.
 Integer getMaxArmor()
          Retreives maximum level of combined armor.
 Integer getMaxHealth()
          Retreives maximum level of boosted health.
 int getMaxHighArmor()
          Retreives maximum level of high armor.
 int getMaxLowArmor()
          Retreives maximum level of low armor.
 Integer getMaxMultiJump()
          Retreives the maximum number of multi-jumping combos.
 Integer getMaxTeams()
          BotTeamGame, BotCTFGame, BotDoubleDomination only: Retrieves number of teams in the game.
 Integer getMaxTeamSize()
          BotTeamGame, BotCTFGame, BotDoubleDomination only: Retreives maximum number of players per team.
 List<Mutator> getMutators()
          Returns list of mutators that are active in the current game.
 Double getRemainingTime()
          Retreives time remaining for the game.
 Integer getStartAdrenaline()
          Retreives starting level of adrenaline.
 Integer getStartHealth()
          Retreives starting level of health.
 Integer getTargetAdrenaline()
          Retreives target level of adrenaline that need to be gained to start special bonus actions.
 Integer getTeamScoreLimit()
          BotTeamGame, BotCTFGame, BotBombingRun, BotDoubleDomination only: Number of points a team needs to win the game.
 double getTime()
          Retreives current game time, since the game started.
 Double getTimeLimit()
          Retreives time limit for the game.
 Boolean getWeaponsStay()
          Tells, whether the weapons stay on pick-up points, even when they are picked-up by players.
 Boolean isBotsPaused()
          Tells, whether the bots are paused or running.
 Boolean isPaused()
          Tells, whether the game is paused or running.
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
 

Constructor Detail

Game

public Game(UDKBot bot)
Constructor. Setups the memory module based on bot's world view.

Parameters:
bot - owner of the module that is using it

Game

public Game(UDKBot bot,
            Logger log)
Constructor. Setups the memory module based on bot's world view.

Parameters:
bot - owner of the module that is using it
log - Logger to be used for logging runtime/debug info. If null, the module creates its own logger.
Method Detail

getGameType

public Game.GameType getGameType()
Retreives the type of the game.

Returns:
Type of the game.

getMapName

public String getMapName()
Retreives the name of current map.

Returns:
Name of the current map.

getTime

public double getTime()
Retreives current game time, since the game started.

Returns:
Current game timestamp.

getTimeLimit

public Double getTimeLimit()
Retreives time limit for the game.

Note: Then the time limit is reached and the game is tie, special game modes might be turned on, e.g. sudden death overtime. Depends on the game type and game settings.

Returns:
Time limit of the game.
See Also:
getRemainingTime()

getRemainingTime

public Double getRemainingTime()
Retreives time remaining for the game.

Note: Then the time limit is reached and the game is tie, special game modes might be turned on, e.g. sudden death overtime. Depends on the game type and game settings.

Returns:
Time limit of the game.
See Also:
getTime(), getTimeLimit()

getFragLimit

public Integer getFragLimit()
BotDeathMatch only:

Number of points (e.g. kills) needed to win the game.

Returns:
Frag limit of the game.
See Also:
getTeamScoreLimit()

getTeamScoreLimit

public Integer getTeamScoreLimit()
BotTeamGame, BotCTFGame, BotBombingRun, BotDoubleDomination only:

Number of points a team needs to win the game.

Returns:
Team score limit of the game.
See Also:
getFragLimit()

getMaxTeams

public Integer getMaxTeams()
BotTeamGame, BotCTFGame, BotDoubleDomination only:

Retrieves number of teams in the game.

Team numbers start from 0. Usually, there are just two teams: 0 and 1.

Returns:
Number of teams in the game.

getMaxTeamSize

public Integer getMaxTeamSize()
BotTeamGame, BotCTFGame, BotDoubleDomination only:

Retreives maximum number of players per team.

Returns:
Maximum number of players per team.

getStartHealth

public Integer getStartHealth()
Retreives starting level of health. This is the level of health the players spawn with into the game.

Returns:
Starting level of health.
See Also:
getMaxHealth(), getFullHealth()

getFullHealth

public Integer getFullHealth()
Retreives maximum level of non-boosted health. This is the level achievable by foraging standard health kits.

Returns:
Maximum level of non-boosted health.
See Also:
getStartHealth(), getMaxHealth()

getMaxHealth

public Integer getMaxHealth()
Retreives maximum level of boosted health. This is the total maximum health achievable by any means of health kits, super health, or health vials.

Returns:
Maximum level of boosted health.
See Also:
getStartHealth(), getFullHealth()

getMaxArmor

public Integer getMaxArmor()
Retreives maximum level of combined armor. The armor consist of two parts, which are summed together into combined armor value. However, each part is powered-up by different item (either by small shield or by super-shield).

Returns:
Maximum level of combined armor.
See Also:
getMaxLowArmor(), getMaxHighArmor()

getMaxLowArmor

public int getMaxLowArmor()
Retreives maximum level of low armor. The armor consist of two parts, which are summed together into combined armor value. However, each part is powered-up by different item (either by small shield or by super-shield).

Low armor is powered-up by small shield.

Returns:
Maximum level of low armor.
See Also:
getMaxArmor(), getMaxHighArmor()

getMaxHighArmor

public int getMaxHighArmor()
Retreives maximum level of high armor. The armor consist of two parts, which are summed together into combined armor value. However, each part is powered-up by different item (either by small shield or by super-shield).

High armor is powered-up by super-shield.

Returns:
Maximum level of high armor.
See Also:
getMaxArmor(), getMaxLowArmor()

getStartAdrenaline

public Integer getStartAdrenaline()
Retreives starting level of adrenaline. This is the level of adrenaline the players spawn with into the game.

Returns:
Starting level of adrenaline.

getTargetAdrenaline

public Integer getTargetAdrenaline()
Retreives target level of adrenaline that need to be gained to start special bonus actions.

Once the agent's adrenaline reaches this designated level, it can be used to start special bonus booster-actions like invisibility, speed, booster, etc. The adrenaline is then spent on the invoked action.

Returns:
Maximum level of adrenaline that can be gained.

getMaxAdrenaline

public Integer getMaxAdrenaline()
Retreives maximum level of adrenaline that can be gained.

Returns:
Maximum level of adrenaline that can be gained.

getWeaponsStay

public Boolean getWeaponsStay()
Tells, whether the weapons stay on pick-up points, even when they are picked-up by players.

If so, each weapon type can be picked up from pick-up points only once. If the player already has the weapon the pick-up point offers, he can not pick it up. Also, each weapon pick-up point always contains its associated weapon.

If not, weapons can be picked up from pick-up points repeatedly. If the player already has the weapon the pick-up point offers, the pick-up will simply replenish ammo for that weapon. Also, upon each pick-up by a player, the offered weapon disappears (it is "taken" by that player). Weapons respawn on empty pick-up points after a while.

Returns:
True, if weapons stay on pick-up points.

getMaxMultiJump

public Integer getMaxMultiJump()
Retreives the maximum number of multi-jumping combos.

Note: Multi-jump combos are currently limited to double-jumps for bots.

Returns:
Maximum number of multi-jumping combos.

getMutators

public List<Mutator> getMutators()
Returns list of mutators that are active in the current game.

Returns:
Current game's mutators

isPaused

public Boolean isPaused()
Tells, whether the game is paused or running. When the game is paused, nobody can move or do anything (usually except posting text messages).

Returns:
True, if the game is paused. False otherwise.
See Also:
areBotsPaused()

isBotsPaused

public Boolean isBotsPaused()
Tells, whether the bots are paused or running. When the bots are paused, but the game is not paused as well, human controlled players can move. The bots are standing still and can do nothing (usually except posting text messages).

Returns:
True, if the bots are paused. False otherwise.
See Also:
isPaused()

getAllCTFFlags

public Map<Integer,FlagInfo> getAllCTFFlags()
Returns a map indexed by team numbers, holding all flags in the game. In non-Capture the Flag (CTF) gametypes the result map will be empty.

Returns:
Map containing all the flags in the game indexed by owner team number.

getAllCTFFlagsCollection

public Collection<FlagInfo> getAllCTFFlagsCollection()
Returns a collection of all the flags in the game. In non-Capture the Flag (CTF) gametypes the result collection will be empty.

Returns:
Collection containing all the flags in the game.

start

protected void start(boolean startPaused)
Provides initialization of the module (clearing internal data structures). Called automatically during the agent starting sequence.

Overrides:
start in class AgentModule<UDKBot>


Copyright © 2014 AMIS research group, Faculty of Mathematics and Physics, Charles University in Prague, Czech Republic. All Rights Reserved.