Differences
This shows you the differences between two versions of the page.
Both sides previous revision Previous revision Next revision | Previous revision | ||
pogamut_bot_svn_guide [2011/01/10 17:04] michal_bida |
pogamut_bot_svn_guide [2011/11/04 16:14] michal.bida removed |
||
---|---|---|---|
Line 1: | Line 1: | ||
- | {maketoc} | + | ====== Intro ====== |
- | Don't want to wait for a new installer when we fix some bugs in Pogamut? Or do you want to edit Pogamut code yourself? | + | Don't want to wait for a new installer when we fix some bugs in Pogamut? Or do you want to edit Pogamut code yourself? |
====== Pogamut UT2004 ====== | ====== Pogamut UT2004 ====== | ||
- | You need to checkout | + | To develop your own version of Pogamut UT2004 project, that is responsible for controlling bots in UT2004. |
- | * PogamutCore located in [[svn://amis.mff.cuni.cz/ | + | * PogamutCore located in [[svn://artemis.ms.mff.cuni.cz/ |
- | * PogamutUnreal located in [[svn:// | + | |
- | * PogamutUT2004 located in [[svn:// | + | |
- | Add these projects | + | However, since we moved to Maven, you now need to set your Maven bot project |
- | + | ||
- | Moreover, add all .jars from [[svn:// | + | |
- | + | ||
- | In your project | + | |
- | + | ||
- | < | + | |
- | package pogamutjavabot; | + | |
- | + | ||
- | import cz.cuni.amis.pogamut.base.agent.IAgent; | + | |
- | import cz.cuni.amis.pogamut.base.agent.state.WaitForAgentStateChange; | + | |
- | import cz.cuni.amis.pogamut.base.agent.state.level2.IAgentStateStopped; | + | |
- | import cz.cuni.amis.pogamut.base.utils.Pogamut; | + | |
- | import cz.cuni.amis.pogamut.ut2004.bot.impl.UT2004Bot; | + | |
- | import cz.cuni.amis.pogamut.ut2004.bot.impl.UT2004BotModuleController; | + | |
- | + | ||
- | import cz.cuni.amis.pogamut.ut2004.communication.messages.gbcommands.Initialize; | + | |
- | import cz.cuni.amis.pogamut.ut2004.communication.messages.gbinfomessages.BotKilled; | + | |
- | import cz.cuni.amis.pogamut.ut2004.communication.messages.gbinfomessages.ConfigChange; | + | |
- | import cz.cuni.amis.pogamut.ut2004.communication.messages.gbinfomessages.GameInfo; | + | |
- | import cz.cuni.amis.pogamut.ut2004.communication.messages.gbinfomessages.InitedMessage; | + | |
- | import cz.cuni.amis.pogamut.ut2004.communication.messages.gbinfomessages.Self; | + | |
- | import cz.cuni.amis.pogamut.ut2004.factory.guice.remoteagent.UT2004BotFactory; | + | |
- | import cz.cuni.amis.pogamut.ut2004.factory.guice.remoteagent.UT2004BotModule; | + | |
- | import cz.cuni.amis.pogamut.ut2004.utils.UT2004BotRunner; | + | |
- | import cz.cuni.amis.utils.exception.PogamutException; | + | |
- | import cz.cuni.amis.pogamut.ut2004.utils.UT2004BotRunner; | + | |
- | + | ||
- | /** | + | |
- | * Java Bot template. | + | |
- | */ | + | |
- | public class PogamutJavaBot extends UT2004BotModuleController { | + | |
- | + | ||
- | @Override | + | |
- | public void prepareBot(UT2004Bot bot) { | + | |
- | // TODO used for initialization, | + | |
- | } | + | |
- | + | ||
- | @Override | + | |
- | public Initialize getInitializeCommand() { | + | |
- | // TODO init bot's params there | + | |
- | return new Initialize(); | + | |
- | } | + | |
- | + | ||
- | @Override | + | |
- | public void botInitialized(GameInfo info, ConfigChange config, InitedMessage init) { | + | |
- | // TODO called after the bot was initialized | + | |
- | // since this method, you may use your agent modules | + | |
- | } | + | |
- | + | ||
- | @Override | + | |
- | public void botSpawned(GameInfo gameInfo, ConfigChange config, InitedMessage init, Self self) { | + | |
- | // bot is spawned for the first time in the environment | + | |
- | // examine ' | + | |
- | } | + | |
- | + | ||
- | @Override | + | |
- | public void logic() throws PogamutException { | + | |
- | // TODO code bots logic there | + | |
- | + | ||
- | // The parent | + | |
- | // you with querying | + | |
- | // | + | |
- | // this.game | + | |
- | // | + | |
- | // this.info // Memory module specialized on general info about the agent whereabouts: | + | |
- | // | + | |
- | // this.players | + | |
- | // | + | |
- | // this.descriptors | + | |
- | // providing an easy way to obtain item descriptors for various items in UT2004. | + | |
- | // this.items | + | |
- | // this.senses | + | |
- | // whether the bot has been recently killed, collide with level' | + | |
- | // this.weaponry | + | |
- | // | + | |
- | // this.config | + | |
- | // | + | |
- | // this.raycasting | + | |
- | // this.body | + | |
- | // this.shoot | + | |
- | // this.move | + | |
- | // | + | |
- | // this.pathPlanner | + | |
- | // this.pathExecutor // Executor is used for following a path in the environment. | + | |
- | // | + | |
- | // | + | |
- | } | + | |
- | + | ||
- | @Override | + | |
- | public void botKilled(BotKilled event) { | + | |
- | // TODO handle what will happen whent the bot was killed | + | |
- | } | + | |
- | + | ||
- | /** | + | |
- | * This method is called when the bot is started either from IDE or from command line. | + | |
- | * It connects the bot to the game server. | + | |
- | * @param args | + | |
- | */ | + | |
- | public static void main(String args[]) throws PogamutException { | + | |
- | new UT2004BotRunner(PogamutJavaBot.class, | + | |
- | } | + | |
- | } | + | |
- | </ | + | |
- | + | ||
- | + | ||
- | And you are ready to go. To make changes to PogamutUT2004 or Core simply open them in NetBeans, make change and then Clean and Build your bot project. | + | |
====== Pogamut UDK ====== | ====== Pogamut UDK ====== | ||
Line 126: | Line 18: | ||
checkout and add to your project | checkout and add to your project | ||
- | * PogamutUDK located in [[svn://amis.mff.cuni.cz/ | + | * PogamutUDK located in [[svn://artemis.ms.mff.cuni.cz/ |
- | To get PogamutUDK base bot class use the class created when creating new Pogamut UDK project in NetBeans. After the project is created, in project properties in Libraries, remove the default library (should be PogamutUDK) and add projects and jars as in PogamutUT2004 above (except that instead PogamutUT2004 add PogamutUDK). | + |