As requested, I've released a modded 1.08 to tide us over until 1.09 gets out (see below). Get it here.
This is directed mostly towards the developers, but it might be of more general interest if it works out.
In my idleness today, I thought back to a time when a441 used to run a dedicated server for competition judging, but would have to take it down when he 'needed his CPU'. This struck me as slightly incongruous, since I can run DooM on my 486. I wondered whether there wasn't an opportunity in the main loop somewhere to yield some CPU time. So I looked at the code.
Somebody, it seems, had beaten me to it. This is from D_main.c:
However, it's flagged as 'experimental', and is disabled in the current build. Anyone know why? I re-enabled it and didn't notice any problems, as I'll detail in a moment. Anyway, I defined the appropriate preprocessor symbol, updated things slightly for Win32, and recompiled.
Things went swimmingly. Processor usage was down from a constant 100% before to 50% in small rooms and 80%-100% in the larger ones. Useful, but still not great for multitasking. I then ran SRB2 again, this time in dedicated server mode, i.e. without the renderer, and also with -nomusic and -nosound. CPU usage 4%! The slight caveat is that I haven't tested it with anyone actually connected to the server yet, so i don't know if (a) there are problems with the 'experimental' code in netgames; or if (b) CPU usage will shoot back up when someone connects. I'll try it over my LAN when I can.
The upshot, for latecomers in the audience, is that someone who doesn't mind their bandwidth being used up (and I don't know how bad SRB2 is for that) could run a dedicated server as a background process without having their processor monopolised.
If all this has already been considered for 1.09/1.1, I apologise for wasting everyone's time.
Edit: In my habitual scatterbrainèdness, I forgot to emphasise the main point of this post: Has anyone tried enabling this before, and if so, what were the results?
This is directed mostly towards the developers, but it might be of more general interest if it works out.
In my idleness today, I thought back to a time when a441 used to run a dedicated server for competition judging, but would have to take it down when he 'needed his CPU'. This struck me as slightly incongruous, since I can run DooM on my 486. I wondered whether there wasn't an opportunity in the main loop somewhere to yield some CPU time. So I looked at the code.
Somebody, it seems, had beaten me to it. This is from D_main.c:
Code:
#ifdef SAVECPU_EXPERIMENTAL
if(realtics == 0)
{
usleep(10000);
continue;
}
#endif
However, it's flagged as 'experimental', and is disabled in the current build. Anyone know why? I re-enabled it and didn't notice any problems, as I'll detail in a moment. Anyway, I defined the appropriate preprocessor symbol, updated things slightly for Win32, and recompiled.
Code:
#ifdef SAVECPU_EXPERIMENTAL
if(realtics == 0)
{
#ifndef __WIN32__
usleep(10000);
#else
Sleep(10);
#endif
continue;
}
#endif
Things went swimmingly. Processor usage was down from a constant 100% before to 50% in small rooms and 80%-100% in the larger ones. Useful, but still not great for multitasking. I then ran SRB2 again, this time in dedicated server mode, i.e. without the renderer, and also with -nomusic and -nosound. CPU usage 4%! The slight caveat is that I haven't tested it with anyone actually connected to the server yet, so i don't know if (a) there are problems with the 'experimental' code in netgames; or if (b) CPU usage will shoot back up when someone connects. I'll try it over my LAN when I can.
The upshot, for latecomers in the audience, is that someone who doesn't mind their bandwidth being used up (and I don't know how bad SRB2 is for that) could run a dedicated server as a background process without having their processor monopolised.
If all this has already been considered for 1.09/1.1, I apologise for wasting everyone's time.
Edit: In my habitual scatterbrainèdness, I forgot to emphasise the main point of this post: Has anyone tried enabling this before, and if so, what were the results?