[Pogamut-list] Launching Multiple Bots of Different Types
jakub.gemrot
pogamut-forum at diana.ms.mff.cuni.cz
Mon Nov 29 11:29:24 CET 2010
Re: Launching Multiple Bots of Different Types
Author: jakub.gemrot
Hi! Excellent!
So I'm going to explain how to work with MultipleUT2004BotRunner inside Pogamut 3.1 (I'm afraid you're on your own with 3.0.11 which I would suggest not to use).
To be able to talk about MultipleUT2004BotRunner I will need to explain how objects of UT2004Bot class are constructed and initialized and what roles objects implementing IUT2004BotController (namely UT2004BotModuleController which you are extending) plays.
First of all you have to notice that what we call JAVA BOT PROJECT in the NetBeans plugin is in fact UT2004 BOT CONTROLLER PROJECT, i.e., you're just creating something that control the bot. That is because UT2004Bot is wrapping all the low-level communication stuff with GameBots2004 (i.e., Unreal Tournament 2004) you do not want to care about. All you (usually) want is to code a behavior for your bot.
(This is our stance when coding Pogamut).
In fact, we did not spot any place where a user might want to extends the UT2004 except the IUT2004BotController methods. That is to instantiate 2 (or more) different bots means to instantiate 2 (or more) UT2004Bot objects each having a different IUT2004BotController implementation.
As I said before, UT2004Bot handles communication with GB2004 which involves great deal of objects that interacts with each others having their own threads, states, behaviors, etc... Thus to construct UT2004Bot means to instantiate a lot of (correct) objects in concrete sequence embedding one into another until you finally instantiates an UT2004Bot. Pretty hard to do if you are not one of the authors... but the whole thing is handled gracefully with Google Guice IoC container. I recommand you to see UT2004BotModule class which is a descendent of some other classes which are defining dependencies between interfaces and their implementations providing Guice an information how you want to instantiate the UT2004Bot (or IAgent which is a base interface for any Pogamut's agent).
Guice module, i.e., UT2004BotModule is a place where you:
1) saying which IUT2004BotController implementation you want to use (that's why it has a constructor with Class
--
Reply Link: <http://diana.ms.mff.cuni.cz/main/tiki-view_forum_thread.php?forumId=4&comments_reply_threadId=4&comments_parentId=221&post_reply=1#form>
More information about the Pogamut-list
mailing list