Loading...
 

PogamutUT2004


Tracking Player Position

Hi, I'm interested in having a constant knowledge of the player's position. Unfortunately this isn't possible when the bot listens for the Player object to update, because this only works when the player is in sight of the bot. See below:

IWorldObjectEventListener playerUpdatedHandler =
new IWorldObjectEventListener() {
public void notify(WorldObjectUpdatedEvent event) {
Player player = event.getObject();
user.info("PLAYER UPDATE: " + player.getId().getStringId() + " LOCATION: " + player.getLocation() );
}

So I tried exploring this using the ObserverAgent like Simon did in this post:

http://diana.ms.mff.cuni.cz/main/tiki-view_forum_thread.php?topics_offset=1&forumId=4&comments_parentId=79

But came to the same conclusion that the observer doesn't actually see these events.

So if somebody could point me in the right direction on this matter I would very much appreciate it. :-)

Thanks!
Juliet
Hi Juliet! Welcome to the forum :-)

If you are interested only in player's position, I advise you to use UT2004Server.

Are you running against Pogamut 3.0.11 or SVN version?

If it is Pogamut 3.0.11 than there is a UT2004ServerFactory in the ...ut2004...factory.direct package that can be used to easily construct the desired object, start it using start(), and hook your playerUpdatedHandler to its worldview.

If it is SVN version then there is a UT2004ServerRunner ... new UT2004ServerRunner(new UT2004ServerFactory( new UT2004ServerModule() ) ).startAgent() to obtain the started instance and hook your listener there as usual.

It is a bit hasty response, just ask if something is unclear or wrong (I'm typing the code out of the blue, hopefully I'm not bluffing too much :-)).

Cheers!
Jimmy
Hello Jimmy, thanks for the warm welcome. :-)

My over all goal is to get a sense for how the player performs against my bot versus another player.

I'm actually interested in more than just the Player's position, but also what weapon they're carrying, who they're targeting, and so on. I just thought asking about the position would be a good place to start.

It turns out that PlayerObjectUpdate event has much of the information I needed, but as you know it is only accessible when the player is in the bot's "sight".

I'm running Pogamut 3.0.11. I'll try out what you suggest and post any further questions I have.

Thanks for the quick response :-)

Juliet


> Hi, I'm interested in having a constant knowledge of the player's position. Unfortunately this isn't possible when the bot listens for the Player object to update, because this only works when the player is in sight of the bot. See below:
>
> IWorldObjectEventListener playerUpdatedHandler =
> new IWorldObjectEventListener() {
> public void notify(WorldObjectUpdatedEvent event) {
> Player player = event.getObject();
> user.info("PLAYER UPDATE: " + player.getId().getStringId() + " LOCATION: " + player.getLocation() );
> }
>
> So I tried exploring this using the ObserverAgent like Simon did in this post:
>
> http://diana.ms.mff.cuni.cz/main/tiki-view_forum_thread.php?topics_offset=1&forumId=4&comments_parentId=79
>
> But came to the same conclusion that the observer doesn't actually see these events.
>
> So if somebody could point me in the right direction on this matter I would very much appreciate it. :-)
>
> Thanks!
> Juliet
That worked perfectly. Thank you for your help!
Great!

Anyway, if you really need all information (currently the Health as well as bot's inventory are unavailable through UT2004Server) you will really need to use UT2004Observer. In this case, you will need to use SVN version (but Pogamut 3.0.12 is around the corner so may be you can wait for that :-).

Tomorrow (Monday) I should clarify how to use UT2004Observer and create a sample project for both UT2004Server and UT2004Observer that will help you to collect all information available.

Also my colleague, Michal Danilak is putting UT2004Analyzer extends UT2004Server that observes all players in the game collecting trivial stuff such as their positions, health, score, etc. exporting such information into CSV (so it is easy to use R or MatLab on results). This should be incorporated into PogamutUT2004 as well so it will be soon pretty easy to devise some metrics/fitness functions for bots. I will also refactor UT2004Analyzer to be easily extensible (i.e., user will be able to make easy hooks to observations of players collecting additional stuff).

Cheers!
Jimmy
 

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.