[Pogamut-list] Experiments / workaround

Jakub Gemrot jakub.gemrot at gmail.com
Thu Jan 19 07:34:52 CET 2012


Hi!

It depends on what type of experiments you want to run, i.e., how
complex you want your experiment to be.

There already exists UT2004Tournament project that can automatically
run series of DeathMatches and CTF matches:
svn://artemis.ms.mff.cuni.cz/pogamut/trunk/project/Addons/UT2004Tournament
UT2004Match and UT2004DeathMatch classes are great places to learn how
to run UT2004 game automatically.

See UT2004Tournament project test classes that contains examples on
how to run the UT2004Tournament.

If you're referring to JPPF implementation we've got, that is not
available currently I'm afraid :-(

You would probably be interested in class UCCWrapper that can
automatically start up ucc.exe
and also check out examle projects 10, 11 that shows you how to setup
UT2004Server class and use it for
adding bots to UT2004.

See archetypes in our artifactory:
<groupId>cz.cuni.amis.pogamut.ut2004.examples</groupId>
<artifactId>10-add-native-bot-archetype</artifactId>
<version>3.2.4</version>

<groupId>cz.cuni.amis.pogamut.ut2004.examples</groupId>
<artifactId>11-kick-all-bots</artifactId>
<version>3.2.4</version>

See manual: http://pogamut.cuni.cz/pogamut_files/doc/Setup-Pogamut3-with-Maven.pdf
How to import our example archetype into NetBeans.

Basicly, what you need to do (if you up to manual setup) is:

1) instantiate UCCWrapper and fire up ucc.exe

2) startup your own bots

3) setup UT2004Server class and populate environment with native bots

4) restart match with ut2004Server.getAct().act(new
GameConfiguration().setRestart(true));

5) wait till some your game-end condition is triggered

6) kill UCCWrapper (along with all your bots)

Note that every UT2004Bot contains AgentStats instance (inside
UT2004BotModuleController) that can be used
to collect huge amount of statistics about the bot, it can be
configured to output the stats into .csv file.

Hope it helps,
Jakub



On Wed, Jan 18, 2012 at 9:59 PM, marcel.golunski
<pogamut-forum at diana.ms.mff.cuni.cz> wrote:
>
> Experiments / workaround
>
> Author: marcel.golunski
>
> Hello.
>
> I've used Pogamut 2 for my MSc thesis some time ago (Pogamut project is really great BTW) and there was an "Experiment" functionality.
>
> I can't find something similar in pogamut 3. I'm mostly involved with bot teams which means that i need to easily start new "experiment" with arbitrary number of different pogamut bots.
>
> I found this:
> [http://diana.ms.mff.cuni.cz/main/tiki-view_forum_thread.php?topics_offset=1&forumId=4&comments_parentId=188]
> Which says that there is no such functionality (but its quite an old post)
>
> I also found that:
> [http://diana.ms.mff.cuni.cz/pogamut_files/latest/doc/tutorials/ch09s03.html]
> Which could be usefull if i could automatically add some pogamut bots.
>
> What i need to achieve is to automatically start a new match with a number of different pogamut bots. Is there any simple way?
>
> In pogamut 2 i used experiments like that below:
>
>
>    public static byte TCB_BOT_COUNT = 4;
>    public static byte NB_BOT_COUNT = 4;
>    public static byte IVCB_BOT_COUNT = 0;
>    public static int TEAM_SKILL_LEVEL = 2;
>    public static int ENEMY_SKILL_LEVEL = 2;
>    public static int FREETIME = 10000;
>    public static int TC_FREE_TIME = 0;
>
>    public static byte DUMMY_BOT_COUNT = 0;
>    public static byte SHOOT_ANY_BOT_COUNT = 0;
>
>    public Main(ExperimentDescriptor descriptor, UTServer server) {
>        super(descriptor, server);
>    }
>
>    @Override
>    protected void stageOneInit() throws Exception {
>        getLogger().info("Experiment initialized.");
>    }
>
>    @Override
>    protected void stageTwoStart() throws Exception {
>        getLogger().info("Experiment started.");
>        Agent teamAgent = new teamcombatbot.TeamController();
>        ((teamcombatbot.TeamController)teamAgent).setSkillLevel(TEAM_SKILL_LEVEL);
>        ((teamcombatbot.TeamController)teamAgent).setExperimentLog(getLogger());
>        getServer().connectBot(teamAgent, "TC");
>        Thread.currentThread().sleep(TC_FREE_TIME);
>        int i = 0;
>        Agent [] agents = new Agent[TCB_BOT_COUNT-1];
>        for (Agent a: agents){
>            //Thread.sleep(1500);
>            getLogger().info("Adding bot: TeamCombatBot" + i);
>            a = new teamcombatbot.TeamBot();
>            ((teamcombatbot.TeamBot)a).setSkillLevel(TEAM_SKILL_LEVEL);
>            ((teamcombatbot.TeamBot)a).setCommuniactionName("TeamCombatBot"+i++);
>            getServer().connectBot(a, "TeamCombatBot");
>        }
>        Thread.currentThread().sleep(FREETIME);
>        for (i = 0; i < NB_BOT_COUNT; i++){
>            getServer().connectOriginalBot("UTBot " +i , Triple.add(SimpleMapInfo.getMapCenter(),new Triple(1000,1000,0)), ENEMY_SKILL_LEVEL, 2);
>        }
>        for (i = 0; i < DUMMY_BOT_COUNT; i++){
>            getServer().connectBot(new teamcombatbot.DummyBot(),"DummyBot");
>        }
>        i = 0;
>        agents = new Agent[IVCB_BOT_COUNT];
>        for (Agent a: agents){
>            //Thread.sleep(1500);
>            getLogger().info("Adding bot: InfluenceVectorsCombatBot" + i);
>            a = new influencevectorscombatbot.TeamBot();
>            ((influencevectorscombatbot.TeamBot)a).setSkillLevel(ENEMY_SKILL_LEVEL);
>            ((influencevectorscombatbot.TeamBot)a).setTeam(2);
>            getServer().connectBot(a, "InfluenceVectorsCombatBot");
>        }
>        agents = new Agent[SHOOT_ANY_BOT_COUNT];
>        for (Agent a: agents){
>            //Thread.sleep(1500);
>            getLogger().info("Adding bot: ShootAnyBot" + i);
>            a = new influencevectorscombatbot.ShootAnyBot();
>            ((influencevectorscombatbot.ShootAnyBot)a).setSkillLevel(ENEMY_SKILL_LEVEL);
>            ((influencevectorscombatbot.ShootAnyBot)a).setTeam(2);
>            getServer().connectBot(a, "ShootAnyBot");
>        }
>        //if (TCB_BOT_COUNT > 0)
>        //    ((simplecirclebot.Main)agents[0]).setExperimentLeader(true);
>        while (true)
>        {
>            //Thread.currentThread().sleep(1000);
>            //if (agents[0] != null){
>                if (((teamcombatbot.TeamController)teamAgent).isExperimentFinish()){
>                    getServer().disconnectAllBots();
>                    for (Player p : getServer().getPlayers()){
>                        getServer().kickBot(p.UnrealID);
>                    }
>                    break;
>                }
>            //}
>        }
>        // Quit the experiment
>        setResultAndTerminate(new ExperimentResult());
>    }
>
>
>
> Thanks!
>
> Marcel
>
> --
> Reply Link: <http://diana.ms.mff.cuni.cz/main/tiki-view_forum_thread.php?forumId=4&comments_parentId=883#form>
>
>
> _______________________________________________
> Pogamut-list mailing list
> Pogamut-list at amis.mff.cuni.cz
> https://artemis.ms.mff.cuni.cz/mailman/listinfo/pogamut-list



More information about the Pogamut-list mailing list