[Pogamut-list] Logic frequency and game speed

michal.bida pogamut-forum at artemis.ms.mff.cuni.cz
Mon Mar 30 20:12:17 CEST 2009


Re: Logic frequency and game speed

Author: michal.bida

GB sensory batch is bunch of messages enveloped by BEG and END messages. These messages contains information about the bot surroundings - about what the bot can see at the moment (PLR, INV and NAV messages) and about the bot current state (SLF message). These synchronous batches comes 4 times per second by default (every 250 ms). So this means that the doLogic() method is called 4 times per second by default.

You can change the delay between synchronous batches in GameBots ini file. You will find it here: UT2004/System/BotAPI.ini . There you can find [BotAPI.BotConnection] variables and there will be visionTime variable. If you write there visionTime=200 it will mean that the delay between synchronous batches is going to be 200 ms and doLogic method will be called 5 times per sec. I wouldn't set this number to less than 100 ms, cause it may seriously lag the UT server, if more bots with such a low delay will be online - but you are free to experiment with it. You will also need to restart UT server so the changes in the ini file have effect. 

More information about GB ini file can be found here: ((GB INI file|GB INI file)).

There is no gain to set the game speed to higher numbers. Its true that on the higher game speed doLogic method will be called more often, but as the whole game will run faster the relative time of the bot reaction will still be the same. 

Its true that the change we have implemented reduce the frequency of doLogic method. This has the advantage that the objects you work with inside doLogic method that corresponds to the object in game (players, items) won't change their value during execution of doLogic method (in previous versions they could and it was a problem). The bot reactions will be a bit slower in new GB version (average 100 ms - the same as with human beings), but the programing of the logic a bit safer.

Summary:
You can set the doLogic frequency by increasing or decreasing the delay between GB sensory batches by visionTime variable in BotAPI.ini . By default there will be 4 doLogic executions per second (every 250ms) as 250 ms is the default delay between GB sensory batches.

best,
Michal

PS. If you have more questions, don't hesitate do ask.





More information about the Pogamut-list mailing list