I wrote a BA playing AI for my thesis. I need to run a few hundred games to collect data. What can I do to speed up game execution? Can running spring-headless speed things up? In game I can press +/- to speed-up/slow-down the game. Is there a way to do this from my agent? I didn't see anything in the AI Interface (I'm using the plain C interface).
(you may need a linux box, can't recall if it works 100% on windows) download: https://github.com/gajop/springgrid and https://github.com/gajop/botrunner and set it up you can then schedule as many games as you want, at the speed you want, etc. if that's too complex for you, you can check how i'm using scripts for my own AI: https://github.com/gajop/MyAI/tree/master/scripts, check run.sh and go.sh, and any of the other concrete scripts (they will need to be modified for your AI) you can start a game from springlobby for your map/mod and modify the important parts such as map/mod name & hash in one of the existing scripts those shell scripts can easily be converted to a batch script
// same as pressing + once SSendTextMessageCommand msg = {"/speedup", 0}; // or whatever the Actual_F_uglyName of this callback is cb->HandleCommand(COMMAND_SEND_TEXT_MESSAGE, &msg);
Will setting the minspeed too high cause any errors in the game simulation? Will the game slow down to complete all the calculations needed per frame if I set minspeed too high?
Is there a limit to how high I can set the minspeed?
While I wish to test the game at max speed, I also want to be able to watch replays at normal speed. I can set minspeed=1, maxspeed=100. Then set the in game speed to 100 during the test. When I want to review the demo, I can just reduce the speed to 1x. What's the best way to set the game speed? Is there a mod option for this as well? Or is the only option SSendTextMessageCommand from the AI as kloot explained above?
Joined: 22 Feb 2006, 01:02 Location: cheap kitchen
you can type commands into console to change gamespeed: /setmaxspeed 10 /setminspeed 10 /setspeed 10 (not sure about this..if it does not work just use setminspeed)
with a widget (lua script) you can automate that: Spring.SendCommands ("setminspeed 10") etc
Will setting the minspeed too high cause any errors in the game simulation? Will the game slow down to complete all the calculations needed per frame if I set minspeed too high?
never had problems..at some points it simply does not go faster.
just "install" as a normal widget. (copy to ~/.spring/LuaUI/Widgets)
just an idea: (not sure if its worth to do that)
you could speed up re-runs of the ai by slightly modifiyingthe game and "reset" the game after each run (add a gadget that removes all features/units, kills ai / reinitializes the ais) . but i'm not sure if its worth the trouble/time because you only save the start-up time of spring (usally ~10 seconds or so, thats not much if the game itself runs for 10 minutes...). also you need to create your own .sdd...
but i'm not sure if its worth the trouble/time because you only save the start-up time of spring (usally ~10 seconds or so, thats not much if the game itself runs for 10 minutes...). also you need to create your own .sdd...
it may well be worth it, since the game usually doesn't last long if you have speed set high, f.e 100 or so but your AI (and the opposing one, which you may not have knowledge of) may need to be changed, to support reinitialization without "Game Start" event being triggered
Joined: 22 Feb 2006, 01:02 Location: cheap kitchen
gajop wrote:
abma wrote:
but i'm not sure if its worth the trouble/time because you only save the start-up time of spring (usally ~10 seconds or so, thats not much if the game itself runs for 10 minutes...). also you need to create your own .sdd...
it may well be worth it, since the game usually doesn't last long if you have speed set high, f.e 100 or so but your AI (and the opposing one, which you may not have knowledge of) may need to be changed, to support reinitialization without "Game Start" event being triggered
Would probally require quite some changes to games as some parts will depend on GameFrame or passed game seconds and all that. Also you would end up with a replay that is multiple hours long which will make it hard to watch a specific match: imo not a good idea.
Users browsing this forum: No registered users and 0 guests
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot post attachments in this forum