public class UT2004Behaviour<BOT extends cz.cuni.amis.pogamut.ut2004.bot.impl.UT2004Bot> extends JavaBehaviour<BOT>
Modifier and Type | Field and Description |
---|---|
protected cz.cuni.amis.pogamut.base.communication.command.IAct |
act
Shortcut for the
UT2004BotController.getAct() . |
protected cz.cuni.amis.pogamut.ut2004.bot.command.CompleteBotCommandsWrapper |
body
Creates and wraps all available commands that can be issued to the virtual body of the bot inside UT2004.
|
protected cz.cuni.amis.pogamut.ut2004.agent.module.sensomotoric.AgentConfig |
config
Memory module specialized on the agent's configuration inside UT2004 - name, vision time, manual spawn, cheats (if enabled at GB2004).
|
protected cz.cuni.amis.pogamut.ut2004.agent.module.sensor.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 cz.cuni.amis.pogamut.ut2004.agent.navigation.floydwarshall.FloydWarshallMap |
fwMap
Path-planner (
IPathPlanner using NavPoint s), you may use it to find paths inside the environment wihtout
waiting for round-trip of GetPath command and PathList s response from UT2004. |
protected cz.cuni.amis.pogamut.ut2004.agent.module.sensor.Game |
game
Memory module specialized on general info about the game - game type, time limit, frag limit, etc.
|
protected cz.cuni.amis.pogamut.ut2004.agent.navigation.UT2004GetBackToNavGraph |
getBackToNavGraph
Navigation helper that is able to get your bot back to the nearest navigation graph so you can use
UT2004BotModuleController.navigation
without fear of catastrophe. |
protected cz.cuni.amis.pogamut.ut2004.agent.module.sensor.AgentInfo |
info
Memory module specialized on general info about the agent whereabouts - location, rotation, health, current weapon, who is enemy/friend, etc.
|
protected cz.cuni.amis.pogamut.ut2004.agent.module.sensor.Items |
items
Memory module specialized on items on the map - which are visible and which are probably spawned.
|
protected cz.cuni.amis.pogamut.base.communication.worldview.listener.annotation.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 cz.cuni.amis.pogamut.base.utils.logging.LogCategory |
log
Alias for user's log.
|
protected cz.cuni.amis.pogamut.ut2004.bot.command.AdvancedLocomotion |
move
Shortcut for body.getAdvancedLocomotion() that allows you to manually steer the movement through the environment.
|
protected cz.cuni.amis.pogamut.ut2004.agent.module.sensor.NavigationGraphBuilder |
navBuilder
Navigation graph builder that may be used to manually extend the navigation graph of the UT2004.
|
protected cz.cuni.amis.pogamut.ut2004.agent.navigation.UT2004Navigation |
navigation
Command module that is internally using
UT2004PathExecutor for path-following and FloydWarshallMap
for path planning resulting in unified class that can solely handle navigation of the bot within the environment. |
protected cz.cuni.amis.pogamut.ut2004.agent.navigation.UT2004PathExecutor<cz.cuni.amis.pogamut.base3d.worldview.object.ILocated> |
pathExecutor
Executor is used for following a path in the environment.
|
protected cz.cuni.amis.pogamut.base.agent.navigation.IPathPlanner<cz.cuni.amis.pogamut.base3d.worldview.object.ILocated> |
pathPlanner
Planner used to compute the path (consisting of navigation points) inside the map.
|
protected cz.cuni.amis.pogamut.ut2004.agent.module.sensor.Players |
players
Memory module specialized on whereabouts of other players - who is visible, enemy / friend, whether bot can see anybody, etc.
|
protected Random |
random
Random number generator that is usually useful to have during decision making.
|
protected cz.cuni.amis.pogamut.ut2004.agent.module.sensomotoric.Raycasting |
raycasting
Support for creating rays used for raycasting (see
AutoTraceRay that is being utilized). |
protected cz.cuni.amis.pogamut.ut2004.agent.navigation.UT2004RunStraight |
runStraight
Navigation helper that can run-straight to some point with stuck detectors.
|
protected cz.cuni.amis.pogamut.ut2004.agent.module.sensor.Senses |
senses
Memory module specialized on agent's senses - whether the bot has been recently killed, collide with level's geometry, etc.
|
protected cz.cuni.amis.pogamut.ut2004.bot.command.ImprovedShooting |
shoot
Shortcut for body.getImprovedShooting() that allows you to shoot at opponent.
|
protected cz.cuni.amis.pogamut.ut2004.agent.module.sensor.AgentStats |
stats
Module that is providing various statistics about the bot.
|
protected cz.cuni.amis.pogamut.base.utils.logging.LogCategory |
user
Deprecated.
use
UT2004BotController.log instead |
protected cz.cuni.amis.pogamut.ut2004.agent.module.sensor.visibility.Visibility |
visibility
Module that provides visibility/cover information for the map.
|
protected cz.cuni.amis.pogamut.ut2004.agent.module.sensor.WeaponPrefs |
weaponPrefs
Weapon preferences for your bot.
|
protected cz.cuni.amis.pogamut.ut2004.agent.module.sensomotoric.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 cz.cuni.amis.pogamut.base3d.worldview.IVisionWorldView |
world
Shortcut for the
UT2004BotController.getWorldView() . |
bot
Constructor and Description |
---|
UT2004Behaviour(String name,
BOT bot) |
Modifier and Type | Method and Description |
---|---|
void |
botInitialized(cz.cuni.amis.pogamut.ut2004.communication.messages.gbinfomessages.GameInfo info,
cz.cuni.amis.pogamut.ut2004.communication.messages.gbinfomessages.ConfigChange config,
cz.cuni.amis.pogamut.ut2004.communication.messages.gbinfomessages.InitedMessage init)
This method is called whenever
InitedMessage is received. |
void |
botKilled(cz.cuni.amis.pogamut.ut2004.communication.messages.gbinfomessages.BotKilled event)
Called whenever the bot gets killed inside the game.
|
void |
botSpawned(cz.cuni.amis.pogamut.ut2004.communication.messages.gbinfomessages.GameInfo gameInfo,
cz.cuni.amis.pogamut.ut2004.communication.messages.gbinfomessages.ConfigChange config,
cz.cuni.amis.pogamut.ut2004.communication.messages.gbinfomessages.InitedMessage init,
cz.cuni.amis.pogamut.ut2004.communication.messages.gbinfomessages.Self self)
This method is called only once whenever first batch of information what the bot can see is received.
|
void |
finishBehaviourInitialization()
Called after
botSpawned(GameInfo, ConfigChange, InitedMessage, Self) as a hook for Pogamut's core developers
to finalize initialization of various modules. |
cz.cuni.amis.pogamut.base.communication.command.IAct |
getAct() |
cz.cuni.amis.pogamut.ut2004.agent.navigation.UT2004GetBackToNavGraph |
getGetBackToNavGraph() |
cz.cuni.amis.pogamut.ut2004.agent.module.sensor.visibility.Visibility |
getVisibility() |
cz.cuni.amis.pogamut.base3d.worldview.IVisionWorldView |
getWorldView() |
protected void |
initializeBehaviour(BOT bot)
Called after the construction of the
UT2004Behaviour before the GameBots2004 greets the bot even before
prepareBehaviour(UT2004Bot) method. |
protected void |
initializeListeners(BOT bot)
Initializes
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 and UT2004BotModuleControllerNew#pathExecutor . |
protected void |
prepareBehaviour(BOT bot)
Called after the behaviour construction to initialize user's data structures.
|
doNothing, fail, getActions, getBot, getName, getSenses, logicAfterPlan, logicBeforePlan, succeed
protected Random random
protected cz.cuni.amis.pogamut.base.utils.logging.LogCategory user
UT2004BotController.log
insteadLevel.ALL
.protected cz.cuni.amis.pogamut.base.utils.logging.LogCategory log
protected cz.cuni.amis.pogamut.ut2004.agent.module.sensor.Game game
May be used since SposhBotLogic#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)
.
protected cz.cuni.amis.pogamut.ut2004.agent.module.sensor.AgentInfo info
May be used since first Self
message is received, i.e, since the first SposhBotLogic#botFirstSpawn(cz.cuni.amis.pogamut.ut2004.communication.messages.gbinfomessages.GameInfo, ConfigChange, InitedMessage, Self)
is called.
Initialized inside initializeModules(UT2004Bot)
.
protected cz.cuni.amis.pogamut.ut2004.agent.module.sensor.Players players
May be used since SposhBotLogic#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)
.
protected cz.cuni.amis.pogamut.ut2004.agent.module.sensor.ItemDescriptors descriptors
ItemType
and ItemDescriptor
providing
an easy way to obtain item descriptors for various items in UT2004.
May be used since SposhBotLogic#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)
.
protected cz.cuni.amis.pogamut.ut2004.agent.module.sensor.Items items
May be used since SposhBotLogic#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)
.
protected cz.cuni.amis.pogamut.ut2004.agent.module.sensor.Senses senses
May be used since SposhBotLogic#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)
.
protected cz.cuni.amis.pogamut.ut2004.agent.module.sensomotoric.Weaponry weaponry
May be used since SposhBotLogic#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)
.
protected cz.cuni.amis.pogamut.ut2004.agent.module.sensomotoric.AgentConfig config
May be used since SposhBotLogic#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)
.
protected cz.cuni.amis.pogamut.ut2004.agent.module.sensomotoric.Raycasting raycasting
AutoTraceRay
that is being utilized).
May be used since SposhBotLogic#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.
protected cz.cuni.amis.pogamut.ut2004.bot.command.CompleteBotCommandsWrapper body
May be used since since the first SposhBotLogic#botFirstSpawn(cz.cuni.amis.pogamut.ut2004.communication.messages.gbinfomessages.GameInfo, ConfigChange, InitedMessage, Self)
is called.
Initialized inside initializeModules(UT2004Bot)
.
protected cz.cuni.amis.pogamut.ut2004.bot.command.ImprovedShooting shoot
Note: more weapon-handling methods are available through weaponry
.
May be used since since the first SposhBotLogic#botFirstSpawn(cz.cuni.amis.pogamut.ut2004.communication.messages.gbinfomessages.GameInfo, ConfigChange, InitedMessage, Self)
is called.
Initialized inside initializeModules(UT2004Bot)
.
protected cz.cuni.amis.pogamut.ut2004.bot.command.AdvancedLocomotion move
Note: navigation is done via pathExecutor
that needs PathHandle
from the pathPlanner
.
May be used since since the first SposhBotLogic#botFirstSpawn(cz.cuni.amis.pogamut.ut2004.communication.messages.gbinfomessages.GameInfo, ConfigChange, InitedMessage, Self)
is called.
Initialized inside initializeModules(UT2004Bot)
.
protected cz.cuni.amis.pogamut.ut2004.agent.navigation.UT2004PathExecutor<cz.cuni.amis.pogamut.base3d.worldview.object.ILocated> pathExecutor
May be used since since the first IUT2004BotController.botFirstSpawn(cz.cuni.amis.pogamut.ut2004.communication.messages.gbinfomessages.GameInfo, ConfigChange, InitedMessage, Self)
is called.
Initialized inside UT2004BotModuleControllerNew#initializePathFinding(UT2004Bot)
.
protected cz.cuni.amis.pogamut.base.agent.navigation.IPathPlanner<cz.cuni.amis.pogamut.base3d.worldview.object.ILocated> pathPlanner
May be used since since the first IUT2004BotController.botFirstSpawn(cz.cuni.amis.pogamut.ut2004.communication.messages.gbinfomessages.GameInfo, ConfigChange, InitedMessage, Self)
is called.
Initialized inside UT2004BotModuleControllerNew#initializePathFinding(UT2004Bot)
.
protected cz.cuni.amis.pogamut.ut2004.agent.module.sensor.WeaponPrefs weaponPrefs
WeaponPrefs
class javadoc. It allows you to define preferences for
weapons to be used at given distance (together with their firing mode).protected cz.cuni.amis.pogamut.ut2004.agent.module.sensor.NavigationGraphBuilder navBuilder
May be used since IUT2004BotController.botInitialized(cz.cuni.amis.pogamut.ut2004.communication.messages.gbinfomessages.GameInfo, ConfigChange, InitedMessage)
is called.
Initialized inside UT2004BotModuleController.initializeModules(UT2004Bot)
.
protected cz.cuni.amis.pogamut.ut2004.agent.module.sensor.AgentStats stats
AgentStats.startOutput(String)
or AgentStats.startOutput(String, boolean)
.protected cz.cuni.amis.pogamut.ut2004.agent.navigation.floydwarshall.FloydWarshallMap fwMap
IPathPlanner
using NavPoint
s), you may use it to find paths inside the environment wihtout
waiting for round-trip of GetPath
command and PathList
s response from UT2004. It is much faster than
UT2004BotModuleController.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)
.protected cz.cuni.amis.pogamut.ut2004.agent.navigation.UT2004GetBackToNavGraph getBackToNavGraph
UT2004BotModuleController.navigation
without fear of catastrophe.
May be used since IUT2004BotController.botInitialized(cz.cuni.amis.pogamut.ut2004.communication.messages.gbinfomessages.GameInfo, ConfigChange, InitedMessage)
is called.
Initialized inside UT2004BotModuleController.initializePathFinding(UT2004Bot)
.
protected cz.cuni.amis.pogamut.ut2004.agent.navigation.UT2004RunStraight runStraight
May be used since IUT2004BotController.botInitialized(cz.cuni.amis.pogamut.ut2004.communication.messages.gbinfomessages.GameInfo, ConfigChange, InitedMessage)
is called.
Initialized inside UT2004BotModuleController.initializePathFinding(UT2004Bot)
.
protected cz.cuni.amis.pogamut.ut2004.agent.navigation.UT2004Navigation navigation
UT2004PathExecutor
for path-following and FloydWarshallMap
for path planning resulting in unified class that can solely handle navigation of the bot within the environment.
In contrast to UT2004PathExecutor
methods
of this module may be recalled every UT2004BotLogicController.logic()
iteration even with
the same argument (which is not true for BasePathExecutor.followPath(cz.cuni.amis.pogamut.base.agent.navigation.IPathFuture)
.
Note that this class is actually initialized with instances of UT2004BotModuleController.pathExecutor
and UT2004BotModuleController.fwMap
so you must take care if using add/remove stuck detectors or reinitilize this property to your liking (you can do that in UT2004BotController.botInitialized(cz.cuni.amis.pogamut.ut2004.communication.messages.gbinfomessages.GameInfo, ConfigChange, InitedMessage)
method.
May be used since first UT2004BotLogicController.logic()
is called.
Initialized inside UT2004BotModuleController.initializePathFinding(UT2004Bot)
.
protected cz.cuni.amis.pogamut.ut2004.agent.module.sensor.visibility.Visibility visibility
May be used since IUT2004BotController.botInitialized(cz.cuni.amis.pogamut.ut2004.communication.messages.gbinfomessages.GameInfo, ConfigChange, InitedMessage)
is called.
Initialized inside UT2004BotModuleController.initializeModules(UT2004Bot)
.
protected cz.cuni.amis.pogamut.base.communication.worldview.listener.annotation.AnnotationListenerRegistrator listenerRegistrator
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.
protected cz.cuni.amis.pogamut.base3d.worldview.IVisionWorldView world
UT2004BotController.getWorldView()
.protected cz.cuni.amis.pogamut.base.communication.command.IAct act
UT2004BotController.getAct()
.protected void initializeBehaviour(BOT bot)
UT2004Behaviour
before the GameBots2004 greets the bot even before
prepareBehaviour(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 initializeBehaviour.
protected void initializeListeners(BOT bot)
listenerRegistrator
and calls AnnotationListenerRegistrator.addListeners()
method
to probe all declared methods for event-annotation presence.bot
- protected void initializePathFinding(BOT bot)
UT2004BotModuleControllerNew#pathPlanner
and UT2004BotModuleControllerNew#pathExecutor
.
If you need different path planner / path executor - override this method and initialize your own modules.bot
- protected void initializeModules(BOT bot)
bot
- protected void prepareBehaviour(BOT bot)
bot
- public void botInitialized(cz.cuni.amis.pogamut.ut2004.communication.messages.gbinfomessages.GameInfo info, cz.cuni.amis.pogamut.ut2004.communication.messages.gbinfomessages.ConfigChange config, cz.cuni.amis.pogamut.ut2004.communication.messages.gbinfomessages.InitedMessage init)
InitedMessage
is received. Various agent modules are usable since this
method is called.gameInfo
- config
- init
- self
- public void botSpawned(cz.cuni.amis.pogamut.ut2004.communication.messages.gbinfomessages.GameInfo gameInfo, cz.cuni.amis.pogamut.ut2004.communication.messages.gbinfomessages.ConfigChange config, cz.cuni.amis.pogamut.ut2004.communication.messages.gbinfomessages.InitedMessage init, cz.cuni.amis.pogamut.ut2004.communication.messages.gbinfomessages.Self self)
Note that this method has advantage over the IUT2004BotController.botInitialized(GameInfo, ConfigChange, InitedMessage)
that you already have Self
object.
gameInfo
- config
- init
- self
- public void finishBehaviourInitialization()
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.
public void botKilled(cz.cuni.amis.pogamut.ut2004.communication.messages.gbinfomessages.BotKilled event)
event
- public cz.cuni.amis.pogamut.base3d.worldview.IVisionWorldView getWorldView()
public cz.cuni.amis.pogamut.base.communication.command.IAct getAct()
public cz.cuni.amis.pogamut.ut2004.agent.navigation.UT2004GetBackToNavGraph getGetBackToNavGraph()
public cz.cuni.amis.pogamut.ut2004.agent.module.sensor.visibility.Visibility getVisibility()
Copyright © 2012 AMIS research group, Faculty of Mathematics and Physics, Charles University in Prague, Czech Republic. All Rights Reserved.