update analyzer faster Posted by bulent on Thu 28 of Oct, 2010 19:18 CEST 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
Posted by michal.bida on Thu 28 of Oct, 2010 21:12 CEST 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
Posted by bulent on Thu 28 of Oct, 2010 22:26 CEST 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
Posted by jakub.gemrot on Fri 29 of Oct, 2010 07:26 CEST 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
Posted by jakub.gemrot on Fri 29 of Oct, 2010 07:36 CEST 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
Posted by jakub.gemrot on Fri 29 of Oct, 2010 07:43 CEST 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 ;-)
Posted by bulent on Sat 30 of Oct, 2010 03:35 CEST 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
Posted by michal.bida on Sat 30 of Oct, 2010 10:13 CEST 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
Posted by jakub.gemrot on Sat 30 of Oct, 2010 14:16 CEST 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
Posted by bulent on Thu 04 of Nov, 2010 19:13 CET 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); }
Posted by michal.bida on Fri 05 of Nov, 2010 09:07 CET 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