120 likes | 275 Views
GameBots messages + async listeners Navigation HealthForager bot. Faculty of mathematics and physics Charles University at Prague 2 nd April 2008. Pogamut 2 Platform for fast development of cognitive agents inside 3D environment. http://artemis.ms.mff.cuni.cz/pogamut.
E N D
GameBots messages + async listeners Navigation HealthForager bot Faculty of mathematics and physics Charles University at Prague 2nd April 2008 Pogamut 2Platform for fast development of cognitive agents inside 3D environment http://artemis.ms.mff.cuni.cz/pogamut
Let’s talk a bit about GameBots… Exports information Translating text messages to java objects Simulates the world Model of the agent http://artemis.ms.mff.cuni.cz/pogamut
GameBots2004 1/2 • programmed in UnrealScript, UT2004 extension • text message protocol • more / less a direct translations of UT’s events WAL {Id wall} {Normal x,y,z} {Location x,y,z} Telnet… …can be used to check whether the GB is working. http://artemis.ms.mff.cuni.cz/pogamut
GameBots2004 2/2 • 2 types of messages • synchronous (sent in batches) • list of visible navpoints / items / etc… • once upon a time … 5 Hz usually • asynchronous • messages like WAL, FAL, DIE, KIL, … • you may define listeners for messages Doc: webpage … menu Documentation, GameBots API List http://artemis.ms.mff.cuni.cz/pogamut
Message listeners 1/2 http://artemis.ms.mff.cuni.cz/pogamut
Message listeners 2/2 Consider using synchronized statement inside listeners (listeners are called from within the communication thread). http://artemis.ms.mff.cuni.cz/pogamut
Navigation 1/5 Bunch of memory methods • getKnownAmmos(), Armors(), Weapons(), etc. • list of all XYZ available in map • getSeeAmmos(), Healths(), Weapons(), etc. • list of XYZ the bot currently sees • getSeeAnyAmmo(), … • return first XYZ GB gave us last batch • getSeeAmmo(UnrealID) • check whether the bot sees the specified object http://artemis.ms.mff.cuni.cz/pogamut
Navigation 2/5 Crucial object … gameMap • safeRunToLocation(Triple) • be brave and try to reimplement this even better! • returns boolean • true all is OK, false run-to failed http://artemis.ms.mff.cuni.cz/pogamut
Navigation 3/5 AStar – has modular implementation AStarGoal – defining the goal, may forbid nodes - implementation GameMapAStarGoal AStarMap - defines the graph - specifies the costs - implementation GameMapAStarMap http://artemis.ms.mff.cuni.cz/pogamut
Navigation 4/5 AStar – example implementation http://artemis.ms.mff.cuni.cz/pogamut
Navigation 5/5 You should try to implement Floyd-Warshal algorithm inside postPrepareAgent(). You will have to check a lot of paths and it’s lengths often. Remember – computer bot programming is all about running around points. Navigation graph is map dependent, you may find out that some maps are more suitable for your bots then others. http://artemis.ms.mff.cuni.cz/pogamut
HealthForager bot Let’s create a bot that is running around the medkits like mad… … some snippet http://artemis.ms.mff.cuni.cz/pogamut