|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object cz.cuni.amis.pogamut.ut2004.bot.impl.UT2004BotController<BOT> cz.cuni.amis.pogamut.ut2004.bot.impl.UT2004BotLogicController<BOT> cz.cuni.amis.pogamut.ut2004.bot.impl.UT2004BotModuleController<UT2004Bot> nl.tudelft.goal.ut2004.agent.UT2004BotBehavior
public class UT2004BotBehavior
Field Summary | |
---|---|
protected long |
actionCount
|
protected nl.tudelft.pogamut.ut2004.agent.module.shooting.util.OrderedFocusProvider |
focus
|
protected long |
logicIteration
|
protected nl.tudelft.pogamut.ut2004.agent.module.shooting.util.FocusProvider |
lookFocus
|
protected List<ContextSelector> |
lookSelector
|
protected nl.tudelft.goal.unreal.messages.BotParameters |
parameters
Settings for the bot. |
protected eis.eis2java.util.AllPerceptsModule |
percepts
|
protected nl.tudelft.pogamut.ut2004.agent.module.sensor.Projectiles |
projectiles
|
protected SharedFloydWarshallMap |
sfwMap
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 List<ContextSelector> |
targetSelector
|
protected nl.tudelft.pogamut.ut2004.agent.module.shooting.WeaponryShooting |
weaponShooting
|
Fields inherited from class cz.cuni.amis.pogamut.ut2004.bot.impl.UT2004BotModuleController |
---|
act, aStar, body, combo, config, ctf, descriptors, fwMap, game, getBackToNavGraph, info, items, listenerRegistrator, move, navBuilder, navigation, navPoints, pathExecutor, pathPlanner, players, random, raycasting, runStraight, senses, shoot, stats, visibility, weaponPrefs, weaponry, world |
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_LOG_CATEGORY_ID |
Constructor Summary | |
---|---|
UT2004BotBehavior()
|
Method Summary | |
---|---|
Percept |
actionCount()
Deprecated. |
void |
addAction(Action action)
Queues up the action to be executed on the first evaluation of the logic cycle. |
Collection<Percept> |
base()
Information about the location of the base. |
void |
beforeFirstLogic()
Called before the evaluation of the first logic. |
Collection<Percept> |
bot()
Percept provided when another bot becomes visible to this bot. |
void |
combo(Combo combo)
When called the bot will use the given combo. |
Percept |
currentWeapon()
Information about weapon the bot is currently holding. |
void |
dropWeapon()
Drops the weapon the bot is currently holding. |
void |
finishControllerInitialization()
Finish controller initialisation. |
Collection<Percept> |
flag()
Description: Percept provided when the flag is visible. |
Collection<Percept> |
flagState()
Description: Percept that provides information about the current state of the flag. |
List<Percept> |
fragged()
This percept is provided when one bot is violently fragmented by another. |
Percept |
game()
Information about the type of game being played, the map and the score required for winning the game. |
Map<Method,Object> |
getAllPercepts()
Returns a previously prepared batch of percepts. |
Initialize |
getInitializeCommand()
Prepares the initialization message for Gamebots using the BotParameters provided to the UT2004BotRunner . |
void |
initializeController(UT2004Bot bot)
|
protected void |
initializeModules(UT2004Bot bot)
Initialize projectiles and weaponshooting modules. |
protected void |
initializePathFinding(UT2004Bot bot)
Initializes path-finding modules: UT2004BotModuleControllerNew#pathPlanner ,
UT2004BotModuleController.fwMap and
UT2004BotModuleControllerNew#pathExecutor . |
protected void |
initializeWeaponShootings()
Adds handlers to deal with different weapons. |
Collection<Percept> |
item()
Description: Provides information items the bot sees in the world. |
void |
logic()
The bot will evaluate its the logic every 100ms. |
Percept |
logicIteration()
Deprecated. |
void |
look(SelectorList targets)
Tells the bot how to prioritize what it looks at. |
void |
msgBotKilled(BotKilled msg)
Event listener for deaths of this bot. |
void |
msgPlayerKilled(PlayerKilled msg)
Event listener for deaths of other bots & players. |
void |
navigate(UnrealIdOrLocation destination)
When called the bot will make a best effort attempt to navigate to requested destination. |
Percept |
navigation()
Information about the state of the navigation. |
Collection<Percept> |
navPoint()
Information about point in the map. |
Percept |
orientation()
Information about the bot's position, rotation and velocity. |
Percept |
path(UnrealIdOrLocation from,
UnrealIdOrLocation to)
The bot computes a path from a to b. |
Collection<Percept> |
pickup()
Information indicating at which navpoint weapons, ammo, and health can be found. |
void |
prefer(WeaponPrefList weaponList)
Tells the bot which weapon it should prefer. |
void |
respawn()
When called the bot will respawn in at a random spawn point of its team. |
Percept |
score()
Information about the number of kills, deaths, and suicides this bot accumulated. |
Percept |
self()
Information about the bot's identity and team. |
void |
shoot(SelectorList targets)
Tells the bot how to prioritize who it shoots. |
void |
skip()
Does nothing. |
Percept |
status()
Information about the bot's current physical state. |
void |
stop()
When called the bot will stop. |
void |
stopShooting()
* |
Percept |
teamScore()
Percept that provides information about the current state of the game. |
Collection<Percept> |
visibleNavPoint()
TODO: Doc this |
Collection<Percept> |
weapon()
Information about weapons the bot has in its inventory. |
Methods inherited from class cz.cuni.amis.pogamut.ut2004.bot.impl.UT2004BotModuleController |
---|
getAStar, getBody, getCombo, getConfig, getDescriptors, getFwMap, getGame, getInfo, getItems, getMove, getNavBuilder, getNavigation, getPathExecutor, getPathPlanner, getPlayers, getRandom, getRaycasting, getSenses, getShoot, getStats, getVisibility, getWeaponPrefs, getWeaponry, getWorld, initializeListeners |
Methods inherited from class cz.cuni.amis.pogamut.ut2004.bot.impl.UT2004BotLogicController |
---|
getLogicInitializeTime, getLogicShutdownTime, initializeLogic, logicInitialize, logicShutdown |
Methods inherited from class cz.cuni.amis.pogamut.ut2004.bot.impl.UT2004BotController |
---|
botFirstSpawn, botInitialized, botKilled, botShutdown, getAct, getBot, getLog, getName, 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 |
---|
botFirstSpawn, botInitialized, botKilled, botShutdown, getAct, getBot, getLog, getPassword, getWorldView, prepareBot |
Field Detail |
---|
protected List<ContextSelector> targetSelector
protected List<ContextSelector> lookSelector
protected nl.tudelft.pogamut.ut2004.agent.module.sensor.Projectiles projectiles
protected nl.tudelft.pogamut.ut2004.agent.module.shooting.WeaponryShooting weaponShooting
protected nl.tudelft.pogamut.ut2004.agent.module.shooting.util.FocusProvider lookFocus
protected nl.tudelft.pogamut.ut2004.agent.module.shooting.util.OrderedFocusProvider focus
protected eis.eis2java.util.AllPerceptsModule percepts
protected nl.tudelft.goal.unreal.messages.BotParameters parameters
protected long logicIteration
protected long actionCount
protected SharedFloydWarshallMap sfwMap
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)
.
Constructor Detail |
---|
public UT2004BotBehavior()
Method Detail |
---|
public void initializeController(UT2004Bot bot)
initializeController
in interface IUT2004BotController<UT2004Bot>
initializeController
in class UT2004BotModuleController<UT2004Bot>
protected void initializeModules(UT2004Bot bot)
initializeModules
in class UT2004BotModuleController<UT2004Bot>
protected void initializeWeaponShootings()
protected void initializePathFinding(UT2004Bot bot)
UT2004BotModuleControllerNew#pathPlanner
,
UT2004BotModuleController.fwMap
and
UT2004BotModuleControllerNew#pathExecutor
. If you need different
path planner / path executor - override this method and initialize your
own modules.
initializePathFinding
in class UT2004BotModuleController<UT2004Bot>
bot
- public Initialize getInitializeCommand()
BotParameters
provided to the UT2004BotRunner
.
getInitializeCommand
in interface IUT2004BotController<UT2004Bot>
getInitializeCommand
in class UT2004BotController<UT2004Bot>
public void finishControllerInitialization()
finishControllerInitialization
in interface IUT2004BotController<UT2004Bot>
finishControllerInitialization
in class UT2004BotModuleController<UT2004Bot>
public void beforeFirstLogic()
beforeFirstLogic
in interface cz.cuni.amis.pogamut.base.agent.module.IAgentLogic<cz.cuni.amis.pogamut.base.agent.module.LogicModule>
beforeFirstLogic
in class UT2004BotLogicController<UT2004Bot>
public void logic()
Selector
in the list set by
UT2004BotBehavior#target(SelectorList)
that returns a valid
target.Selector
in the list set by
look(SelectorList)
that returns a valid target.
logic
in interface cz.cuni.amis.pogamut.base.agent.module.IAgentLogic<cz.cuni.amis.pogamut.base.agent.module.LogicModule>
logic
in class UT2004BotLogicController<UT2004Bot>
public void addAction(Action action) throws InterruptedException
action
-
InterruptedException
public Map<Method,Object> getAllPercepts()
getAllPercepts
in interface eis.eis2java.util.AllPerceptsProvider
public void navigate(UnrealIdOrLocation destination) throws InterruptedException
Location
or
the UnrealId of an ILocated
such as NavPoint
or
Player
. When provided with a player the bot will actively pursue
the player provided the player remains visible.
The destination is considered reached when the bot is within 50 UT units
from the destination. Or 100 UT units when trying to navigate to a
player.
The navigation can fail when there is no path to the destination, when
the bot gets stuck. A bot can be considered stuck by three heuristics.
Either the UT2004DistanceStuckDetector
when the bot has not be
closing in on its target enough, UT2004PositionStuckDetector
when
it has not been moving at all, or the UT2004TimeStuckDetector
when it has not moved enough over time.
When the bot dies or respawns the navigation will reset to waiting.
destination
- where the bot should go.
InterruptedException
public void stop() throws InterruptedException
InterruptedException
public void respawn() throws InterruptedException
InterruptedException
public void combo(Combo combo) throws InterruptedException
When called the bot will use the given combo.
Syntax: combo(Combo)
A combo can only be activated when the bot has 100 or more adrenaline. When active the combo will give the bot a small powerup and consume the bots adrenaline until none remains. When the adrenaline runs out the combo will stop.
For more information about the effects of a combo see: http://liandri.beyondunreal.com/Adrenaline
combo
- to be activated.
InterruptedException
public void dropWeapon() throws InterruptedException
Drops the weapon the bot is currently holding.
Syntax: dropWeapon
The weapon will be dropped a few UT hundred units in the direction the bot is looking. When a weapon is dropped it can be picked up again, either by this bot or other other bots.
Note: The translocator and the shield gun can not be dropped.
InterruptedException
public Percept path(UnrealIdOrLocation from, UnrealIdOrLocation to)
The bot computes a path from a to b.
Syntax: path(From,To)
The action results in a path percept containing the path from a to b.
Syntax: path(Length,[NavPointId])
from
- the navpoint from which the path starts.to
- the navpoint where the path should go to
public void shoot(SelectorList targets) throws InterruptedException
Tells the bot how to prioritize who it shoots.
Syntax: shoot([Selector])
Syntax: shoot(Selector)
Note:
InterruptedException
public void stopShooting() throws InterruptedException
Tells the bot to stop shooting.
Syntax: stopShoot
Note: Executes shoot([])
InterruptedException
public void prefer(WeaponPrefList weaponList) throws InterruptedException
Tells the bot which weapon it should prefer. The bot will select the first weapon from the list it can use. A weapon can be used when the bot has the and the ammo for it.
Syntax: prefer([weapon(WeaponId, FireMode)])
Syntax: prefer(weapon(WeaponId, FireMode))
Note: By Default the bot prefers the weapons in this order:
InterruptedException
public void look(SelectorList targets) throws InterruptedException
Tells the bot how to prioritize what it looks at.
Syntax: look([Selector])
Syntax: look(Selector)
Note:
InterruptedException
public void skip()
Does nothing.
Syntax: skip
TODO: Check DOC
@Deprecated public Percept logicIteration()
Information about iteration of the bots logic.
Type: On Change
Syntax: logic(Iteration)
Notes:
@Deprecated public Percept actionCount()
public Percept self()
Information about the bot's identity and team.
Type: On Change
Syntax: self(UnrealId, NickName, Team)
public Percept orientation()
Information about the bot's position, rotation and velocity.
Type: On Change
Syntax: orientation(location(X,Y,Z), rotation(Pitch,Yaw,Roll), velocity(Vx, Vy,Vz))
public Percept status()
Information about the bot's current physical state.
Type: On Change
Syntax status(Health, Armour, Adrenaline,ActiveCombo)
public Percept score()
Information about the number of kills, deaths, and suicides this bot accumulated.
Type: On Change
Syntax: score(Kills, Deaths, Suicides)
Note: Using the respawn action and being fragged by an opponent both count as a death. Being killed by the your own weapon counts as a suicide.
public Percept currentWeapon()
Information about weapon the bot is currently holding.
Type: On Change
Syntax: currentWeapon(WeaponType,FireMode)
TODO: List available weapons.
public Collection<Percept> weapon()
Information about weapons the bot has in its inventory.
Type: On change
Syntax: weapon(WeaponType, PriAmmo, SecAmmo)
Note: The Shield Gun has infinite primary ammo. Its secondary ammo recharges when not used.
TODO: List available weapons.
public void msgBotKilled(BotKilled msg)
msg
- public void msgPlayerKilled(PlayerKilled msg)
msg
- public List<Percept> fragged()
This percept is provided when one bot is violently fragmented by another.
Type: Always
Syntax: fragged(Time,KillerID,VictemID,Weapon)
Notes:
public Percept navigation()
Information about the state of the navigation. The available states are:
Type: On Change
Syntax: navigation(State,Destination)
public Collection<Percept> navPoint()
Information about point in the map. Together these form a directed graph that spans the entire map.
Type: Once
Syntax: navPoint(UnrealID, location(X,Y,Z), [NeigsUnrealID])
public Collection<Percept> visibleNavPoint()
public Collection<Percept> pickup()
Information indicating at which navpoint weapons, ammo, and health can be found.
Type: Once
Syntax: pickup(UnrealID, Label, ItemType)
Notes:
public Collection<Percept> base()
Information about the location of the base. The opposing team will try to steal the flag from this location. Your team must deliver any capture flags to the base.
Type: Once
Syntax: base(Team, UnrealID)
public Percept game()
Information about the type of game being played, the map and the score required for winning the game.
Type: On Change
Syntax: game(Gametype, Map, TeamScoreLimit, RemainingTime)
public Percept teamScore()
Percept that provides information about the current state of the game.
Type: On change
Syntax: teamScore(TeamScore, OpponentTeamScore)
Notes
public Collection<Percept> flagState()
Description: Percept that provides information about the current state of the flag.
Type: On change with negation.
Syntax: flagState(Team,FlagState)
Notes:
public Collection<Percept> item()
Description: Provides information items the bot sees in the world.
Type: On change with negation.
Syntax: item(UnrealID, Label, ItemType, NavPointId)
Syntax: item(UnrealID, Label, ItemType, location(X,Y,Z)) when dropped.
Notes:
public Collection<Percept> flag()
Description: Percept provided when the flag is visible.
Type: On change with negation.
Syntax: flag(Team, UnrealId, location(X,Y,Z))
Notes:
public Collection<Percept> bot()
Percept provided when another bot becomes visible to this bot.
Type: On change with negation.
Syntax: bot(UnrealId, Team, location(X,Y,Z), Weapon, FireMode)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |