Hi all,
I'm using the Spring engine for a research project. For this project I need to run a lot of experiments playing two AI's against one another.
Rather than sitting around and doing each experiment manually, I have set up a small framework that runs spring.exe manually.
I'm using script.txt to set settings and use the /quit and /minimise command line arguments to automate things.
In order to speed up the experiment, I accelerated the game. Using the minSpeed and maxSpeed settings in script.txt doesn't seem to set the speed at game start, so I've compiled the Spring engine myself and played around with the 'userSpeedFactor' and 'internalSpeed' settings in GameServer.cpp. This way I can get Spring to run at basically any speed I wish.
The one problem I have now is that already at speeds of 5x normal, I start seeing 'delayed sync response' messages, and the AI seems to respond sluggishly.
Looking at the windows taskmanager reveals CPU usage is 100%.
I have already reduced the graphical detail and options to an absolute minimum, and spring is set to start minimized.
Is there perhaps a better way to get Spring to run at the speed I want? Is there anything else I can do to reduce CPU requirements?
If nothing else, since I've been thinking of getting a newer machine, what kind of hardware would I need to run spring optimally?
Oh, due to AI's not working in the latest version, and my using previous work done, I'm using an older version of spring: 0.76b1+.
Thanks in advance for any opinions or advice.
Running Spring as fast as possible
Moderator: Moderators
- TheFatController
- Balanced Annihilation Developer
- Posts: 1177
- Joined: 10 Dec 2006, 18:46
Re: Running Spring as fast as possible
Which mod are you using? BA 6.6 is faster than BA 6.5 for example due to a simple reduction in LosMipLevel, you could implement this in your test mod if not already done.
Re: Running Spring as fast as possible
force it to use null sound output in the source (not sure if there's a flag for it)
Re: Running Spring as fast as possible
you could try making the icon distance 0, so al units are icons (don't know if that works)
Re: Running Spring as fast as possible
Most of the stuff that's eating CPU time is actually CPU intensive stuff like dynamic pathing so you could turn off terrain deformation in the map or other features like that.
- LoidThanead
- Posts: 58
- Joined: 27 Feb 2008, 16:16
Re: Running Spring as fast as possible
Thanks for the quick responses.
I've tried setting the icon distance to zero. I had to fiddle with the engine code again, but got it to work fairly easily. It doesn't seem to affect CPU usage noticably. There is no drop in CPU use, nor do I seem to get any less delayed sync response messages. Of course the latter is subjective.
The mod that I'm using is the BA installer version. Upgrading to a newer version would be no problem. However, the Spring version I'm using doesn't have the content downloader, as far as I know, and running the installer again would probably override some of the changes I've made. So I'm going to have to download the 6.6 BA mod using the content downloader of the latest version, and copy it over to the one I'm using. This should work, right?
If it does, I'll get back to you with the results.
As for sound, I tried setting all volumes to zero in the Spring settings. I'm not sure what you mean by 'use null sound output.' I think you mean to find the sound output variable, then assign it a null value? Off the top of my head, I suspect this would lead to a lot of errors when running the code. I haven't tried it yet.
However, I was under the impression that starting Spring minimized is supposed to disable rendering altogether. Wouldn't that mean that any graphical settings simply won't have any effect?
I've tried setting the icon distance to zero. I had to fiddle with the engine code again, but got it to work fairly easily. It doesn't seem to affect CPU usage noticably. There is no drop in CPU use, nor do I seem to get any less delayed sync response messages. Of course the latter is subjective.
The mod that I'm using is the BA installer version. Upgrading to a newer version would be no problem. However, the Spring version I'm using doesn't have the content downloader, as far as I know, and running the installer again would probably override some of the changes I've made. So I'm going to have to download the 6.6 BA mod using the content downloader of the latest version, and copy it over to the one I'm using. This should work, right?
If it does, I'll get back to you with the results.
As for sound, I tried setting all volumes to zero in the Spring settings. I'm not sure what you mean by 'use null sound output.' I think you mean to find the sound output variable, then assign it a null value? Off the top of my head, I suspect this would lead to a lot of errors when running the code. I haven't tried it yet.
However, I was under the impression that starting Spring minimized is supposed to disable rendering altogether. Wouldn't that mean that any graphical settings simply won't have any effect?
Re: Running Spring as fast as possible
You could try the skip command:
It allows you to fast-forward the game.
Code: Select all
/skip <[+|f]seconds> -- requires /cheat if not in a replay
Re: Running Spring as fast as possible
remove these lines from rts/System/Sound.cppLoidThanead wrote:As for sound, I tried setting all volumes to zero in the Spring settings. I'm not sure what you mean by 'use null sound output.' I think you mean to find the sound output variable, then assign it a null value? Off the top of my head, I suspect this would lead to a lot of errors when running the code. I haven't tried it yet.
#ifdef _WIN32
#include "Platform/Win/DxSound.h"
#else
#include "Platform/Linux/OpenALSound.h"
#endif
and it will replace the default sound output with a null one :)
- LoidThanead
- Posts: 58
- Joined: 27 Feb 2008, 16:16
Re: Running Spring as fast as possible
Thanks for the suggestions.
I tried following yours, aegis. Blindly doing as you said earned me a compilation error, since it couldn't find DxSound anymore. However, looking at the code where the error occurred it took me only a minute to figure out how to set sound to use the NullSound. I just had the getSoundSystem() method return NullSound. (I don't have the code in front of me right now, so I might misremember the exact names. You should get the idea though.)
In the end though, it still didn't let me run Spring any faster. I get the impression that it's not so much the engine that is slowing me down. I can get it to run at twenty times normal speed, it's just that the AI then gets desynched. It seems to me that it's the AI that can't keep up, and a quick test with two simple AI's against one another seems to confirm my theory.
So I guess I'll have to look at speeding up the AI without reducing playing strength... or just get a new computer.
The only other thing I can think of is somehow setting up the engine to wait for a response from all players at every frame. This would probably be no use in a multiplayer game, and it would likely be annoying to have lag when playing against the AI by yourself, but for a game with only AI players, it could be interesting.
Though, there is probably no easy way (or even a not so easy one) to set up something this, is there?
I tried following yours, aegis. Blindly doing as you said earned me a compilation error, since it couldn't find DxSound anymore. However, looking at the code where the error occurred it took me only a minute to figure out how to set sound to use the NullSound. I just had the getSoundSystem() method return NullSound. (I don't have the code in front of me right now, so I might misremember the exact names. You should get the idea though.)
In the end though, it still didn't let me run Spring any faster. I get the impression that it's not so much the engine that is slowing me down. I can get it to run at twenty times normal speed, it's just that the AI then gets desynched. It seems to me that it's the AI that can't keep up, and a quick test with two simple AI's against one another seems to confirm my theory.
So I guess I'll have to look at speeding up the AI without reducing playing strength... or just get a new computer.
The only other thing I can think of is somehow setting up the engine to wait for a response from all players at every frame. This would probably be no use in a multiplayer game, and it would likely be annoying to have lag when playing against the AI by yourself, but for a game with only AI players, it could be interesting.
Though, there is probably no easy way (or even a not so easy one) to set up something this, is there?
-
- Posts: 42
- Joined: 28 Dec 2008, 00:42
Re: Running Spring as fast as possible
since the source is available, though this may be an inconvenience, you may be able to set the compilers parameters more thoroughly to fit your computer and that may give you a small speed increase. Works all the time on a basic *NIX operating system and is what makes the Gentoo Linux operating system so popular.