Hi everyone, I just started developing some simple skirmish ai's for a project of mine and I want to be able to run them repeatedly against one another (as part of their training). So where I am at right now is I have a shortcut that starts the game passing it script.txt so that everything starts automatically. My main questions are can I crank up the game speed or even run without graphics easily on startup? Secondly can I make it so that after the game is done it exits out on its own, so I don't have to hit 'exit' after one bot wins the game.
My secondary question is what would people recomend I do to run games over and over? I assume some kind of script to run the shortcut but I am not that familiar with such things so any input would be great. Hope to hear from you guys and I will post more about my AI project as I get further along.
AI vs AI testing
Moderators: hoijui, Moderators
Re: AI vs AI testing
A little update on running the game faster. Now when I up the speed manually in game it runs great and super fast. The problem occurs when I try to start the game at a faster speed. I put minspeed=5; for example in my script.txt but the game does not really start faster and it runs all jumpy and weird. So, does anyone know what causes this problem or if there is some command for the script file like startspeed=5; or something cause all I could find were min and max speed. Any help greatly apreciated, thanks.
Re: AI vs AI testing
Well, I can answer most of my questions now, though my solutions are very ugly.
1. Running faster on startup: to acomplish this I hacked the speedFactor variable in GlobalStuff.cpp, of course this only works with my build of spring then. I still dont know why setting minspeed in the script.txt made everyhting all jumpy.
2.Exiting automatically: for this one I did another hack to the spring code this time in EndGameBox.cpp so that when the endgame box is created it sets globalQuit to true without any clicking. Before this I was letting the AI simply exit() when it was out of units but this seemed really ugly to me and the game should be the one that determines when the game is over imo.
3.To run the game over and over I set up a .bat batch file that simply runs spring.exe waits for it to exit and then starts from the top.
I hope maybe someone else will find this helpful, now I am off to work on my actual AI and start testing it.
1. Running faster on startup: to acomplish this I hacked the speedFactor variable in GlobalStuff.cpp, of course this only works with my build of spring then. I still dont know why setting minspeed in the script.txt made everyhting all jumpy.
2.Exiting automatically: for this one I did another hack to the spring code this time in EndGameBox.cpp so that when the endgame box is created it sets globalQuit to true without any clicking. Before this I was letting the AI simply exit() when it was out of units but this seemed really ugly to me and the game should be the one that determines when the game is over imo.
3.To run the game over and over I set up a .bat batch file that simply runs spring.exe waits for it to exit and then starts from the top.
I hope maybe someone else will find this helpful, now I am off to work on my actual AI and start testing it.
Re: AI vs AI testing
i do not know if this works with the script, but if you want to set the speed ingame to 5 eg, you have to first use the command .setmaxspeed 5, and then set the speed to 5 (with .setspeed 5 ? / usually done by keyboard)
so maxspeed alone surely wont change anything
so maxspeed alone surely wont change anything
Re: AI vs AI testing
Yeah max speed alone doesnt do anything but neither does setting minspeed=5; for example in the script.txt, because the game still starts with speed 1 and aparently the game doesnt like this. The problem is I dont know of any .setspeed type command that works in the script.txt