150 likes | 262 Views
Creating javabot project / pitfalls Startup/running/shutdown sequence and it’s methods Followbot + logs. Faculty of mathematics and physics Charles University at Prague 26 th March 2008. Pogamut 2 Platform for fast development of cognitive agents inside 3D environment.
E N D
Creating javabot project / pitfalls Startup/running/shutdown sequence and it’s methods Followbot + logs Faculty of mathematics and physics Charles University at Prague 26th March 2008 Pogamut 2Platform for fast development of cognitive agents inside 3D environment http://artemis.ms.mff.cuni.cz/pogamut
Architecture review Exports information Translating text messages to java objects Simulates the world Model of the agent http://artemis.ms.mff.cuni.cz/pogamut
Creating new javabot project 1/3 http://artemis.ms.mff.cuni.cz/pogamut
Creating new javabot project 2/3 • P. name =will become=> package name • P. location – Pogamut 2 platform folder (set via Menu/Tools/Options) • P. folder – guess what ;-) • Checkbox – simple view, can be switched off later on http://artemis.ms.mff.cuni.cz/pogamut
Creating new javabot project 3/3 • Created project… • … notice the imported library PogamutCore.jar http://artemis.ms.mff.cuni.cz/pogamut
Javabot project pitfalls 1/2 Renaming agent base class (Main) • can be done, but you have to change manifest.mf as well • manifest.mf can be found in window Files http://artemis.ms.mff.cuni.cz/pogamut
Javabot project pitfalls 2/2 Main method must be present in agent base class • otherwise NB won’t recognize it as a runnable file http://artemis.ms.mff.cuni.cz/pogamut
Sequences and methods 1/2 Few methods • prePrepareAgent() • before GB communication • postPrepareAgent() • after GB communication • doLogic() • iteratively called • shutdownAgent() • at the end (exception) http://artemis.ms.mff.cuni.cz/pogamut
Sequences andmethods 2/2 prePrepareAgent() postPrepareAgent() doLogic() shutdownAgent() http://artemis.ms.mff.cuni.cz/pogamut
FollowBot 1/6 Player memory.getSeePlayer() • returns a PLR wrapper body.runToTarget(Player player) • sends a RUNTO command body.turnHorizontal(int degrees) • sends a TURN command http://artemis.ms.mff.cuni.cz/pogamut
FollowBot 2/6 NullPointerException is around the corner… … logic and GB message receiver are in different threads. http://artemis.ms.mff.cuni.cz/pogamut
FollowBot 3/6 Better… … but what to do if the bot is facing the wall from the beginning ? http://artemis.ms.mff.cuni.cz/pogamut
FollowBot 4/6 Better… … but shouldn’t the bot seek the player on itself? … what if the bot lose the player? http://artemis.ms.mff.cuni.cz/pogamut
FollowBot 5/6 Introducing user log, levels… object log .finest() / .finer() / .fine() / .info() / .warning() / .severe() http://artemis.ms.mff.cuni.cz/pogamut
FollowBot 6/6 … TODO … but shouldn’t the bot seek the player on itself? memory.getSeeNavPoint() memory.getSeeNavPoints() … what if the bot lose the player? remember last player position, try to run there and turn around http://artemis.ms.mff.cuni.cz/pogamut