cz.cuni.amis.pogamut.ut2004.bot.impl
Class UT2004BotModuleController<BOT extends UT2004Bot>

java.lang.Object
  extended by cz.cuni.amis.pogamut.ut2004.bot.impl.UT2004BotController<BOT>
      extended by cz.cuni.amis.pogamut.ut2004.bot.impl.UT2004BotLogicController<BOT>
          extended by cz.cuni.amis.pogamut.ut2004.bot.impl.UT2004BotModuleController<BOT>
Type Parameters:
BOT -
All Implemented Interfaces:
IAgentLogic<LogicModule>, IUT2004BotController<BOT>, IUT2004BotLogicController<BOT,LogicModule>

public class UT2004BotModuleController<BOT extends UT2004Bot>
extends UT2004BotLogicController<BOT>

The most advanced controller that is available. This controller contains all useful modules instantiated.

Modules currently available:


Field Summary
protected  IAct act
          Shortcut for the getAct().
protected  CompleteBotCommandsWrapper body
          Wraps all available commands that can be issued to the virtual body of the bot inside UT2004.
protected  AgentConfig config
          Memory module specialized on the agent's configuration inside UT2004 - name, vision time, manual spawn, cheats (if enabled at GB2004).
protected  ItemDescriptors descriptors
          Sensory module that provides mapping between ItemType and ItemDescriptor providing an easy way to obtain item descriptors for various items in UT2004.
protected  FloydWarshallMap fwMap
          Path-planner (IPathPlanner using NavPoints), you may use it to find paths inside the environment wihtout waiting for round-trip of GetPath command and PathLists response from UT2004.
protected  Game game
          Memory module specialized on general info about the game - game type, time limit, frag limit, etc.
protected  AgentInfo info
          Memory module specialized on general info about the agent whereabouts - location, rotation, health, current weapon, who is enemy/friend, etc.
protected  Items items
          Memory module specialized on items on the map - which are visible and which are probably spawned.
protected  AnnotationListenerRegistrator listenerRegistrator
          Listener registrator that probes declared methods for the presence of EventListener, ObjectClassEventListener, ObjectClassListener, ObjectEventListener and ObjectListener annotations and automatically registers them as listeners on a specific events.
protected  AdvancedLocomotion move
          Shortcut for body.getAdvancedLocomotion() that allows you to manually steer the movement through the environment.
protected  NavigationGraphBuilder navBuilder
          Navigation graph builder that may be used to manually extend the navigation graph of the UT2004.
protected  IUnrealPathExecutor<ILocated> pathExecutor
          Executor is used for following a path in the environment.
protected  IPathPlanner<ILocated> pathPlanner
          Planner used to compute the path (consisting of navigation points) inside the map.
protected  Players players
          Memory module specialized on whereabouts of other players - who is visible, enemy / friend, whether bot can see anybody, etc.
protected  java.util.Random random
          Random number generator that is usually useful to have during decision making.
protected  Raycasting raycasting
          Support for creating rays used for raycasting (see AutoTraceRay that is being utilized).
protected  Senses senses
          Memory module specialized on agent's senses - whether the bot has been recently killed, collide with level's geometry, etc.
protected  ImprovedShooting shoot
          Shortcut for body.getAdvancedShooting() that allows you to shoot at opponent.
protected  AgentStats stats
          Module that is providing various statistics about the bot.
protected  WeaponPrefs weaponPrefs
          Weapon preferences for your bot.
protected  Weaponry weaponry
          Memory module specialized on info about the bot's weapon and ammo inventory - it can tell you which weapons are loaded, melee/ranged, etc.
protected  IVisionWorldView world
          Shortcut for the UT2004BotController.getWorldView().
 
Fields inherited from class cz.cuni.amis.pogamut.ut2004.bot.impl.UT2004BotLogicController
logicModule
 
Fields inherited from class cz.cuni.amis.pogamut.ut2004.bot.impl.UT2004BotController
bot, log, user, USER_LOG_CATEGORY_ID
 
Constructor Summary
UT2004BotModuleController()
           
 
Method Summary
 void finishControllerInitialization()
          Called after IUT2004BotController.botSpawned(GameInfo, ConfigChange, InitedMessage, Self) as a hook for Pogamut's core developers to finalize initialization of various modules.
 IAct getAct()
           
 CompleteBotCommandsWrapper getBody()
           
 AgentConfig getConfig()
           
 ItemDescriptors getDescriptors()
           
 FloydWarshallMap getFwMap()
           
 Game getGame()
           
 AgentInfo getInfo()
           
 Items getItems()
           
 AdvancedLocomotion getMove()
           
 NavigationGraphBuilder getNavBuilder()
           
 IUnrealPathExecutor<ILocated> getPathExecutor()
           
 IPathPlanner<ILocated> getPathPlanner()
           
 Players getPlayers()
           
 java.util.Random getRandom()
           
 Raycasting getRaycasting()
           
 Senses getSenses()
           
 ImprovedShooting getShoot()
           
 AgentStats getStats()
           
 WeaponPrefs getWeaponPrefs()
           
 Weaponry getWeaponry()
           
 IVisionWorldView getWorld()
           
 void initializeController(BOT bot)
          Called during the construction of the UT2004Bot before the GameBots2004 greets the bot even before IUT2004BotController.prepareBot(UT2004Bot) method.
protected  void initializeListeners(BOT bot)
          Initializes UT2004BotModuleControllerNew#listenerRegistrator and calls AnnotationListenerRegistrator.addListeners() method to probe all declared methods for event-annotation presence.
protected  void initializeModules(BOT bot)
          Initializes memory/command modules of the bot.
protected  void initializePathFinding(BOT bot)
          Initializes path-finding modules: UT2004BotModuleControllerNew#pathPlanner, fwMap and UT2004BotModuleControllerNew#pathExecutor.
 
Methods inherited from class cz.cuni.amis.pogamut.ut2004.bot.impl.UT2004BotLogicController
getLogicInitializeTime, getLogicShutdownTime, logic, logicInitialize, logicShutdown
 
Methods inherited from class cz.cuni.amis.pogamut.ut2004.bot.impl.UT2004BotController
botInitialized, botKilled, botShutdown, botSpawned, getInitializeCommand, getLog, getPassword, getWorldView, prepareBot
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface cz.cuni.amis.pogamut.ut2004.bot.IUT2004BotController
botInitialized, botKilled, botShutdown, botSpawned, getInitializeCommand, getLog, getPassword, prepareBot
 

Field Detail

random

protected java.util.Random random
Random number generator that is usually useful to have during decision making.


game

protected Game game
Memory module specialized on general info about the game - game type, time limit, frag limit, etc.

May be used since IUT2004BotController.botInitialized(cz.cuni.amis.pogamut.ut2004.communication.messages.gbinfomessages.GameInfo, cz.cuni.amis.pogamut.ut2004.communication.messages.gbinfomessages.ConfigChange, cz.cuni.amis.pogamut.ut2004.communication.messages.gbinfomessages.InitedMessage) is called.

Initialized inside initializeModules(UT2004Bot).


info

protected AgentInfo info
Memory module specialized on general info about the agent whereabouts - location, rotation, health, current weapon, who is enemy/friend, etc.

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.

Initialized inside initializeModules(UT2004Bot).


players

protected Players players
Memory module specialized on whereabouts of other players - who is visible, enemy / friend, whether bot can see anybody, etc.

May be used since IUT2004BotController.botInitialized(cz.cuni.amis.pogamut.ut2004.communication.messages.gbinfomessages.GameInfo, cz.cuni.amis.pogamut.ut2004.communication.messages.gbinfomessages.ConfigChange, cz.cuni.amis.pogamut.ut2004.communication.messages.gbinfomessages.InitedMessage) is called.

Initialized inside initializeModules(UT2004Bot).


descriptors

protected ItemDescriptors descriptors
Sensory module that provides mapping between ItemType and ItemDescriptor providing an easy way to obtain item descriptors for various items in UT2004.

May be used since IUT2004BotController.botInitialized(cz.cuni.amis.pogamut.ut2004.communication.messages.gbinfomessages.GameInfo, cz.cuni.amis.pogamut.ut2004.communication.messages.gbinfomessages.ConfigChange, cz.cuni.amis.pogamut.ut2004.communication.messages.gbinfomessages.InitedMessage) is called.

Initialized inside initializeModules(UT2004Bot).


items

protected Items items
Memory module specialized on items on the map - which are visible and which are probably spawned.

May be used since IUT2004BotController.botInitialized(cz.cuni.amis.pogamut.ut2004.communication.messages.gbinfomessages.GameInfo, cz.cuni.amis.pogamut.ut2004.communication.messages.gbinfomessages.ConfigChange, cz.cuni.amis.pogamut.ut2004.communication.messages.gbinfomessages.InitedMessage) is called.

Initialized inside initializeModules(UT2004Bot).


senses

protected Senses senses
Memory module specialized on agent's senses - whether the bot has been recently killed, collide with level's geometry, etc.

May be used since IUT2004BotController.botInitialized(cz.cuni.amis.pogamut.ut2004.communication.messages.gbinfomessages.GameInfo, cz.cuni.amis.pogamut.ut2004.communication.messages.gbinfomessages.ConfigChange, cz.cuni.amis.pogamut.ut2004.communication.messages.gbinfomessages.InitedMessage) is called.

Initialized inside initializeModules(UT2004Bot).


weaponry

protected Weaponry weaponry
Memory module specialized on info about the bot's weapon and ammo inventory - it can tell you which weapons are loaded, melee/ranged, etc.

May be used since IUT2004BotController.botInitialized(cz.cuni.amis.pogamut.ut2004.communication.messages.gbinfomessages.GameInfo, cz.cuni.amis.pogamut.ut2004.communication.messages.gbinfomessages.ConfigChange, cz.cuni.amis.pogamut.ut2004.communication.messages.gbinfomessages.InitedMessage) is called.

Initialized inside initializeModules(UT2004Bot).


config

protected AgentConfig config
Memory module specialized on the agent's configuration inside UT2004 - name, vision time, manual spawn, cheats (if enabled at GB2004).

May be used since IUT2004BotController.botInitialized(cz.cuni.amis.pogamut.ut2004.communication.messages.gbinfomessages.GameInfo, ConfigChange, cz.cuni.amis.pogamut.ut2004.communication.messages.gbinfomessages.InitedMessage) is called.

Initialized inside initializeModules(UT2004Bot).


raycasting

protected Raycasting raycasting
Support for creating rays used for raycasting (see AutoTraceRay that is being utilized).

May be used since IUT2004BotController.botInitialized(cz.cuni.amis.pogamut.ut2004.communication.messages.gbinfomessages.GameInfo, cz.cuni.amis.pogamut.ut2004.communication.messages.gbinfomessages.ConfigChange, cz.cuni.amis.pogamut.ut2004.communication.messages.gbinfomessages.InitedMessage) is called.

Initialized inside initializeModules(UT2004Bot).


body

protected CompleteBotCommandsWrapper body
Wraps all available commands that can be issued to the virtual body of the bot inside UT2004.

May be used since since the first IUT2004BotController.botSpawned(cz.cuni.amis.pogamut.ut2004.communication.messages.gbinfomessages.GameInfo, ConfigChange, InitedMessage, Self) is called.

Initialized inside initializeModules(UT2004Bot).


shoot

protected ImprovedShooting shoot
Shortcut for body.getAdvancedShooting() that allows you to shoot at opponent.

Note: more weapon-handling methods are available through UT2004BotModuleControllerNew#weaponry.

May be used since since the first IUT2004BotController.botSpawned(cz.cuni.amis.pogamut.ut2004.communication.messages.gbinfomessages.GameInfo, ConfigChange, InitedMessage, Self) is called.

Initialized inside initializeModules(UT2004Bot).


move

protected AdvancedLocomotion move
Shortcut for body.getAdvancedLocomotion() that allows you to manually steer the movement through the environment.

Note: navigation is done via UT2004BotModuleControllerNew#pathExecutor that needs PathHandle from the UT2004BotModuleControllerNew#pathPlanner.

May be used since since the first IUT2004BotController.botSpawned(cz.cuni.amis.pogamut.ut2004.communication.messages.gbinfomessages.GameInfo, ConfigChange, InitedMessage, Self) is called.

Initialized inside initializeModules(UT2004Bot).


pathExecutor

protected IUnrealPathExecutor<ILocated> pathExecutor
Executor is used for following a path in the environment.

May be used since since the first IUT2004BotController.botSpawned(cz.cuni.amis.pogamut.ut2004.communication.messages.gbinfomessages.GameInfo, ConfigChange, InitedMessage, Self) is called.

Initialized inside initializePathFinding(UT2004Bot).


pathPlanner

protected IPathPlanner<ILocated> pathPlanner
Planner used to compute the path (consisting of navigation points) inside the map.

May be used since since the first IUT2004BotController.botSpawned(cz.cuni.amis.pogamut.ut2004.communication.messages.gbinfomessages.GameInfo, ConfigChange, InitedMessage, Self) is called.

Initialized inside initializePathFinding(UT2004Bot).


navBuilder

protected NavigationGraphBuilder navBuilder
Navigation graph builder that may be used to manually extend the navigation graph of the UT2004.

May be used since IUT2004BotController.botInitialized(cz.cuni.amis.pogamut.ut2004.communication.messages.gbinfomessages.GameInfo, ConfigChange, InitedMessage) is called.

Initialized inside initializeModules(UT2004Bot).


listenerRegistrator

protected AnnotationListenerRegistrator listenerRegistrator
Listener registrator that probes declared methods for the presence of EventListener, ObjectClassEventListener, ObjectClassListener, ObjectEventListener and ObjectListener annotations and automatically registers them as listeners on a specific events.

Note that this registrator is usable for 'this' object only! It will work only for 'this' object.


weaponPrefs

protected WeaponPrefs weaponPrefs
Weapon preferences for your bot. See WeaponPrefs class javadoc. It allows you to define preferences for weapons to be used at given distance (together with their firing mode).


world

protected IVisionWorldView world
Shortcut for the UT2004BotController.getWorldView().


act

protected IAct act
Shortcut for the getAct().


stats

protected AgentStats stats
Module that is providing various statistics about the bot. You may also used it to output these stats (in CSV format) into some file using AgentStats.startOutput(String) or AgentStats.startOutput(String, boolean).


fwMap

protected FloydWarshallMap fwMap
Path-planner (IPathPlanner using NavPoints), you may use it to find paths inside the environment wihtout waiting for round-trip of GetPath command and PathLists response from UT2004. It is much faster than pathPlanner but you need to pass NavPoint instances to planner instead of ILocated ... to find the nearest NavPoint instance, DistanceUtils is a handy, check especially DistanceUtils.getNearest(java.util.Collection, ILocated).

Constructor Detail

UT2004BotModuleController

public UT2004BotModuleController()
Method Detail

initializeController

public void initializeController(BOT bot)
Description copied from interface: IUT2004BotController
Called during the construction of the UT2004Bot before the GameBots2004 greets the bot even before IUT2004BotController.prepareBot(UT2004Bot) method.

NOTE: This is Pogamut's developers reserved method - do not override it and if you do, always use 'super' to call parent's initializeController.

Specified by:
initializeController in interface IUT2004BotController<BOT extends UT2004Bot>
Overrides:
initializeController in class UT2004BotLogicController<BOT extends UT2004Bot>

initializeListeners

protected void initializeListeners(BOT bot)
Initializes UT2004BotModuleControllerNew#listenerRegistrator and calls AnnotationListenerRegistrator.addListeners() method to probe all declared methods for event-annotation presence.

Parameters:
bot -

initializePathFinding

protected void initializePathFinding(BOT bot)
Initializes path-finding modules: UT2004BotModuleControllerNew#pathPlanner, fwMap and UT2004BotModuleControllerNew#pathExecutor. If you need different path planner / path executor - override this method and initialize your own modules.

Parameters:
bot -

initializeModules

protected void initializeModules(BOT bot)
Initializes memory/command modules of the bot.

Parameters:
bot -

finishControllerInitialization

public void finishControllerInitialization()
Description copied from interface: IUT2004BotController
Called after IUT2004BotController.botSpawned(GameInfo, ConfigChange, InitedMessage, Self) as a hook for Pogamut's core developers to finalize initialization of various modules.

NOTE: This is Pogamut's developers reserved method - do not override it and if you do, always use 'super' to call parent's finishControllerInitialization.

Specified by:
finishControllerInitialization in interface IUT2004BotController<BOT extends UT2004Bot>
Overrides:
finishControllerInitialization in class UT2004BotController<BOT extends UT2004Bot>

getRandom

public java.util.Random getRandom()

getGame

public Game getGame()

getInfo

public AgentInfo getInfo()

getPlayers

public Players getPlayers()

getDescriptors

public ItemDescriptors getDescriptors()

getItems

public Items getItems()

getSenses

public Senses getSenses()

getWeaponry

public Weaponry getWeaponry()

getConfig

public AgentConfig getConfig()

getRaycasting

public Raycasting getRaycasting()

getBody

public CompleteBotCommandsWrapper getBody()

getShoot

public ImprovedShooting getShoot()

getMove

public AdvancedLocomotion getMove()

getPathExecutor

public IUnrealPathExecutor<ILocated> getPathExecutor()

getPathPlanner

public IPathPlanner<ILocated> getPathPlanner()

getNavBuilder

public NavigationGraphBuilder getNavBuilder()

getWeaponPrefs

public WeaponPrefs getWeaponPrefs()

getWorld

public IVisionWorldView getWorld()

getAct

public IAct getAct()
Overrides:
getAct in class UT2004BotController<BOT extends UT2004Bot>

getStats

public AgentStats getStats()

getFwMap

public FloydWarshallMap getFwMap()