Loading...
 

PogamutUT2004


update analyzer faster

I'm using Analyzer class to get tracking info for player. Like the logic function, the analyzer object updates itself 4 times in a second. Is there a way to increase this number to make it update more often so the tracking path can be more precise
There is a way. In GameBots2004.ini file (found in UT2004/System/) add these lines:

[GameBots2004.ObservingConnection]
updateTime=0.5


The updateTime number defines how many seconds the connection will wait before sending next synchronous update (0.5 = half a second).

Tell me if it works.

Best,
Michal
That didn't help. I even tried to change other parameters in GameBots2004.ini file like:

[GameBots2004.BotConnection]
;delay between two synchronous batches
visionTime=0.1000


still nothing changed. The logic update is still 4 times in a second. I thought rest

> There is a way. In GameBots2004.ini file (found in UT2004/System/) add these lines:
>
>
> [GameBots2004.ObservingConnection]
> updateTime=0.5
>

>
> The updateTime number defines how many seconds the connection will wait before sending next synchronous update (0.5 = half a second).
>
> Tell me if it works.
>
> Best,
> Michal
Hi bulnet!

Thanks for posting your issue here, nothing is happening as the LogicModule is probably not catching up.
Give me a sec I'm going to look into this issue, I think we should implement a feature that would pick up the
update time automatically... I think that the problem is, that LogicModule is preprogrammed to run 4x per second.

I'll be back soon!

Best,
Jimmy
Ok,

so the LogicModule that is being used to run the agent is configured with

protected double logicFrequency = 5;


Hmm, but I'm currently confused as there is no LogicModule in Analyzer or Observer class ...
... this means that the GameBots config should suffice to obtain info more often.

Jimmy
Ha, probably got it :-)

Are you using unmodified Analyzer class? If so than it is using UT2004AnalyzerObsStats to produce
outputs inside .csv file about the bot positions.

Well this class was not completed (== polished) so there is a strange static field of the UT2004AnalyzerObsStats:


public class UT2004AnalyzerObsStats {
...
/**
* How often to write logs into .csv files.
*/
public static double LOG_FREQUENCY = 0.5;
...
}


Which means that entries inside the .csv file will be logged with 0.5s (so it is not "frequency" but "period").
Just set this variable UT2004AnalyzerObsStats.LOG_FREQUENCY = 0.1; anywhere in your code and you should
get more frequent logging.

Does it help you to solve your problem?

Best,
Jimmy

P.S.: If you would fancy some changes in the analyzer / analyzer observers, just ask, we will see what we can do for you ;-)
The .scv file is definitely updated faster but I don't think the player data is updated enough. I think what stops it updating enough is that the player update logic can never be called below 0.25 sec. I tried to play with
visionTime
 variable, and I got success when I tried to increase it. For example I made it 2 seconds and logic did called only once in 2 seconds. However when I tried below 0.25 sec, it never went below. There must be another code that blocks it. The only place I know that blocks it is

AgentConfig.java


/**
* Between 0.1 to 2 seconds, it sets the delay between two
* synchronous batches.
*/
public void setVisionTime(double value) {
if (value < 0.1) value = 0.1;
else if (value > 2) value = 2;
bot.getAct().act(new Configuration().setVisionTime(value));
}

Every value between 0.25 and 2 sec works pretty well, but you can never set it below 0.25.
I don't know why
That's weird. Even when you try to send

bot.getAct().act(new Configuration().setVisionTime(0.1d));


it does not work? The lowest limit is 0.1 - that means 10 synchronous batches per second - so maximum update frequency is 10 times per second.

I tested bots with vision time 0.1 and it worked. Which version of Pogamut are you using? How big is the map you are testing it on? For bigger maps with lots of navpoints and items the unreal server could lag a little resulting in slightly higher update times.

michal
Hmm, now I'm totally confused!

Are you using Bot or Analyzer?

I'm asking because first time you've asked it was about Analyzer, but the code you posted was from the class we're using with UT2004 bots.

Best,
Jimmy
Here's the code to test the vision time. The counter only goes upto 4.

int counter = 1;
long prevTime = System.currentTimeMillis();

public void prepareBot(UT2004Bot bot) {
   getAct().act(new Configuration().setVisionTime(0.1d));
}

public void logic() throws PogamutException {
   long currentTime = System.currentTimeMillis();
   if(currentTime - prevTime > 1000){
      prevTime+=1000;
      counter = 1;
   }
   else counter++;
   System.out.println(counter);
}


Send this in botInitilialized method. In prepraperBot the bot is not yet created in the environment, so the setting has no effect.

getAct().act(new Configuration().setVisionTime(0.1d));


Michal
 

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.