[Pogamut-list] Determining which team to spawn a bot into during initialization
simon.jakobsen
pogamut-forum at diana.ms.mff.cuni.cz
Tue Apr 20 03:32:17 CEST 2010
Determining which team to spawn a bot into during initialization
Author: simon.jakobsen
In Pogamut2, this was easy. In postPrepareAgent(), I could get the number of players on each team through the memory field and initialize the starting team before the bot spawned.
I've searched for something similar in Pogamut3. I've probably overlooked something but I can't seem to find anything that is helpful, at least in the early stages of the bot's life.
I've tried e.g. getWorldView().getAll(Player.class) in varoius phases of initialization only to finally realize it only returns visible players from the bot's perspective...
I'm assuming this also goes for all the sensor modules and wrappers.
I looked into the Observer classes after remembering one of my earlier questions. I tried doing something like:
observer = factory.newAgent(new SocketConnectionAddress("127.0.0.1", 3002));
observer.getWorldView().addEventListener(PlayerListObtained.class, new IWorldEventListener(){...});
observer.getAct().act(new GetPlayers());
to no avail (Listener was supposed to write to both log and stderr). I don't see the game server reporting any connections from the Observer either.
Is there any way to communicate directly with the server and get a complete list of players during initialization? I would prefer the programmatic control of team selection instead of letting UT team balancing do the work.
Cheers,
Simon
(Sorry for the convoluted post)
--
Reply Link: <http://diana.ms.mff.cuni.cz/main/tiki-view_forum_thread.php?forumId=4&comments_parentId=79#form>
More information about the Pogamut-list
mailing list