Loading...
 

PogamutUT2004


Determining whether opponents are crouching/jumping

Hi

I'm trying to do online imitation learning and would like to be able to gather as much info on the bot's teammates and opponents as possible.

Ideally, I'd like to know as much about them as I know about myself (only for training, not for "active use") but realize that is probably not possible/not allowed.

Anyway, one thing I'd like to be able to tell is whether the other bots are jumping or crouching, which is necessary for me to allow for learning of more complex behavior.

This informations doesn't seem available (at least not in the Player information messages) but I notice that UnrealUtils have some constants for bot height when standing and crouched. Any way to use this to calculate the info, if it's not available elsewhere?

Cheers,
Simon
Hi,
there is (already undocumented) feature internally called "player observing" that allows you to get this type of information for other bots and even human players. I will contact Jozef who has implemented this feature, hopefully he will be able to give you some support.
R
Well actually there is some support. First read: GameBots documentation. Then to create an observing connection from Java, stick to the example below (when you run this class you should successfully connect to GameBots server as an observer):

package cz.cuni.amis.pogamut.ut2004.examples;

import cz.cuni.amis.pogamut.base.agent.IAgentId;
import cz.cuni.amis.pogamut.base.communication.command.IAct;
import cz.cuni.amis.pogamut.base.component.bus.IComponentBus;
import cz.cuni.amis.pogamut.base.utils.guice.AgentScoped;
import cz.cuni.amis.pogamut.base.utils.logging.IAgentLogger;
import cz.cuni.amis.pogamut.ut2004.communication.messages.gbcommands.GetPlayers;

import cz.cuni.amis.pogamut.ut2004.communication.messages.gbinfomessages.*;
import cz.cuni.amis.pogamut.ut2004.communication.worldview.UT2004WorldView;

import cz.cuni.amis.pogamut.ut2004.factory.direct.remoteagent.UT2004ObserverFactory;
import cz.cuni.amis.pogamut.ut2004.observer.IUT2004Observer;
import cz.cuni.amis.pogamut.ut2004.observer.impl.UT2004Observer;
import cz.cuni.amis.pogamut.ut2004.utils.UT2004ObserverRunner;
import cz.cuni.amis.utils.exception.PogamutException;
import java.util.logging.Level;

/**
 */
@AgentScoped
public class ObserverServer extends UT2004Observer implements IUT2004Observer {

    /**
     * This method is called when the bot is started either from IDE or from command line.
     *
     * @param args
     */
    public static void main(String args[]) throws PogamutException {
        UT2004ObserverFactory factory = new UT2004ObserverFactory();
        UT2004ObserverRunner serverRunner = new UT2004ObserverRunner(factory, "ObservingServer", "localhost", 3002);
        serverRunner.startAgent();

    }

    public ObserverServer(IAgentId agentId, IComponentBus bus, IAgentLogger agentLogger, UT2004WorldView worldView, IAct act) {
        super(agentId, bus, agentLogger, worldView, act);        
    }
}


Best,
Michal
Hi! There is an UT2004Observer class and UT2004ObserverFactory that can create an observer instance for you.
Then - you would need to send "getplrs" command (GetPlayers Java object) that returns a list of players (not directly inside Java code,
you would have to set up listener to PlayerListObtained event). Then you may send InitializeObserver command with a certail id of a player
you want to observer... set up listeners as you are used to for regular bot.

Note that UT2004Observer is still in experiment phase and it will be extended to be comfrotable (like provide hooks for auto-init of observer
to a certain player...)

Cheers!

Jakub
BTW: Jumping could be guessed also from other player/bot velocity. But you would have to see him all the time to compute it correctly. Each time .z velocity attribute extends certain value (50 could do), the bot or player jumped.

For all the information the Observer server discussed above is a way to go.

Michal
Thanks a lot guys :-)

I had to get the newest build from the SVN repository to get the observer-classes. But I notice there's quite a bit of activity on the SVN, so I suppose keeping the pogamut libraries updated is a good idea in any case.

I'm guessing that the absolute z velocity is only high when the player is either jumping or landing from the jump. So I guess the update rate should be pretty high. Anyway, I'm assuming the z velocity is varying a lot when the bot is being shot at with rockets or falls off edges, etc. But thanks for the idea, should keep me working for some time yet :-)

Btw. I found the Pogamut3 interface to be a bit convoluted in the beginning but I'm really starting to appreciate the cool product you're putting out!

Cheers,
Simon
Sorry to open this thread back up, but I needed to use the Observer Connection too. I'm confused by what the GameBots documentation says though:

To start observing a player command INIT {Name PlayerName} or INIT {Id PlayerUnrealId} needs to be sent. After that the server starts to send synchronous batch messages (enveloped by BEG and END messages) with information about what observed player or bot can see in the environement (messages PLR, INV, NAV...).

Can anybody show me an example of what this means? Where do these commands go? It says the server starts to send synchronous batch messages, where does the server send this to? I'd like to print what the players and bots are doing to a file.

Thank you,

Juliet
You need to connect to the server with observing connection. Then you can register listeners for the messages you want to listen to (Players, Items, etc...). However support for this in Pogamut is now limited. Jakub is now finishing the implementation of classes: UT2004Observer, UT2004Analyzer and UT2004AnalyzerObsrever. Download latest svn version and check them out.

best,
m
 

News

News RSS RSS feed for News link



Pogamut

Quarterly RSS RSS feed for quarterly reports

Acknowledgement

This work is supported by GA UK 1053/2007/A-INF/MFF (2007-8), GA UK 351/2006/A-INF/MFF (2006-8), the Ministry of Education of the Czech Republic (grant MSM0021620838) (2008-9), by the Program "Information Society" under project 1ET100300517 (2006-9), and the project Integration of IT Tools into Education of Humanities (2006-8) and by the project CZ.2.17/3.1.00/31162, which are financed by the European Social Fund, the state budget of the Czech Republic, and by the budget of Municipal House Prague.