Dedicated server problem. Jerky client.
by Scott Coursey · in Torque Game Engine · 02/26/2007 (7:40 pm) · 8 replies
My current setup is as follows:
Server:
PowerMac G5 DP 2.0 GHz, 2 GB RAM
OS X 10.4.8 Server
Client:
PowerBook G4 1.25 GHz, 2 GB RAM
OS X 10.4.8
The server is not loaded. Right now, without TGE running, it's about 98% idle. With TGE running, it moans down to 0% idle (TGE running as dedicated takes up 100% of the processor).
I'm running the AFX Combo code, which is not very different than the stock TGE as far as server/client code goes (some tweaks, but nothing important).
I can run the client, scan the LAN and connect to the server. Cool.
Now comes the fun, nasty part. As I simply move around, the client is VERY jerky. Since this is running across a LAN connection, it's using my GBit connection (passing through a GBit switch, avoiding the cable modem completely).
I did some research on this and found a suggestion, from eons ago, to adjust the values for the sleep in the process() code. From the source, I found an entry, $pref::timeManagerProcessInterval, that alters the usleep() inside the engine. Currently, it's set to 0. I bumped it around to various values, and could not get any improvement. Everything got much worse. I even changed the sleep() code to refer to the values as microseconds instead of milliseconds. Nothing got better.
Pretty pathetic.
Now, I know it's possible to get a dedicated server running. I had it running on my wife's Windows laptop. It was very smooth. It seems we didn't get the same amount of server love.
Does anyone have a suggestion? Has anyone tested the dedicated servers on another Mac? Does this happen on Linux boxes as well? I've been thinking of adding a Linux box, but would love to work with my PMac server, if possible.
Thanks,
ScottC
Server:
PowerMac G5 DP 2.0 GHz, 2 GB RAM
OS X 10.4.8 Server
Client:
PowerBook G4 1.25 GHz, 2 GB RAM
OS X 10.4.8
The server is not loaded. Right now, without TGE running, it's about 98% idle. With TGE running, it moans down to 0% idle (TGE running as dedicated takes up 100% of the processor).
I'm running the AFX Combo code, which is not very different than the stock TGE as far as server/client code goes (some tweaks, but nothing important).
I can run the client, scan the LAN and connect to the server. Cool.
Now comes the fun, nasty part. As I simply move around, the client is VERY jerky. Since this is running across a LAN connection, it's using my GBit connection (passing through a GBit switch, avoiding the cable modem completely).
I did some research on this and found a suggestion, from eons ago, to adjust the values for the sleep in the process() code. From the source, I found an entry, $pref::timeManagerProcessInterval, that alters the usleep() inside the engine. Currently, it's set to 0. I bumped it around to various values, and could not get any improvement. Everything got much worse. I even changed the sleep() code to refer to the values as microseconds instead of milliseconds. Nothing got better.
Pretty pathetic.
Now, I know it's possible to get a dedicated server running. I had it running on my wife's Windows laptop. It was very smooth. It seems we didn't get the same amount of server love.
Does anyone have a suggestion? Has anyone tested the dedicated servers on another Mac? Does this happen on Linux boxes as well? I've been thinking of adding a Linux box, but would love to work with my PMac server, if possible.
Thanks,
ScottC
#2
What's the GPU chipset and memory on that Powerbook G4?
02/26/2007 (8:14 pm)
It's a little confusing reading this. What's the GPU chipset and memory on that Powerbook G4?
#3
GPU chip set on my PBook is ATI Mobility Radeon 9600. As for the memory, I have 2 GB (2 x 1GB PC2700).
02/26/2007 (8:40 pm)
Confusing? Sorry. I thought I was clear. Essentially, I'm having severe lag problems when connecting to my PMac from my PBook.GPU chip set on my PBook is ATI Mobility Radeon 9600. As for the memory, I have 2 GB (2 x 1GB PC2700).
#4
because the dedicated server shouldn't be anywhere near 100%.
something more like 10 or 20 tops would be appropriate.
we run dedicated server on linux boxes which are slightly but not enourmously faster
and the load with 100 clients connected barely breaks 40%.
scott,
is that 0% idle with no client connected ?
if so you're in sort of good shape for debugging
because you can totally write the client out of the equation.
i would try running an absolutely stock TGE as the dedicated server.
like, not even recompiling it, just using the .exe right out of the demo download.
that will provide a nice baseline and give you apples which you can compare with other people's apples.
02/26/2007 (9:24 pm)
The GPU is not the issue,because the dedicated server shouldn't be anywhere near 100%.
something more like 10 or 20 tops would be appropriate.
we run dedicated server on linux boxes which are slightly but not enourmously faster
and the load with 100 clients connected barely breaks 40%.
scott,
is that 0% idle with no client connected ?
if so you're in sort of good shape for debugging
because you can totally write the client out of the equation.
i would try running an absolutely stock TGE as the dedicated server.
like, not even recompiling it, just using the .exe right out of the demo download.
that will provide a nice baseline and give you apples which you can compare with other people's apples.
#5
Part of the problem is that the networking loop has a usleep built into it. The value for the usleep is, unfortunately, 0. This is done in the prefs. I've tried different values, but it only gets worse.
I wonder if it has anything to do with the server being based on Carbon (old OS X method) and not Cocoa (new OS X methods).
I just tried the stock TGE 1.5 client and server (same files, just copied over to the server and run there). There's no difference from the AFX version I had just tried (I'm going to stick with the AFX code base. I like many of the features that have been added).
Actually, since the TGE 1.5 starter.fps comes with so many audio emitters, it's actually worse. I had to move Kork over a mountain to get away from them just to be able to control him (that happens all the time on the G4s).
02/26/2007 (10:01 pm)
@Orion: Yes, top shows %CPU at 100%. It bounces around because of normal processes coming alive, but it says there. There's no difference in having the client connected or not.Part of the problem is that the networking loop has a usleep built into it. The value for the usleep is, unfortunately, 0. This is done in the prefs. I've tried different values, but it only gets worse.
I wonder if it has anything to do with the server being based on Carbon (old OS X method) and not Cocoa (new OS X methods).
I just tried the stock TGE 1.5 client and server (same files, just copied over to the server and run there). There's no difference from the AFX version I had just tried (I'm going to stick with the AFX code base. I like many of the features that have been added).
Actually, since the TGE 1.5 starter.fps comes with so many audio emitters, it's actually worse. I had to move Kork over a mountain to get away from them just to be able to control him (that happens all the time on the G4s).
#6
From the thread titled "Fix for jerky camera orbitmode"
http://www.garagegames.com/mg/forums/result.thread.php?qt=4396
See the very last post by Helda:
engine/game/camera.cc
Go to line 281 where it says:
validateEyePoint(1.0f, &mRenderObjToWorld);
Change it to read:
validateEyePoint(1.0f, &mObjToWorld);
HTH,
Jack
02/27/2007 (8:36 am)
I had this same problem and this fixed it:From the thread titled "Fix for jerky camera orbitmode"
http://www.garagegames.com/mg/forums/result.thread.php?qt=4396
See the very last post by Helda:
engine/game/camera.cc
Go to line 281 where it says:
validateEyePoint(1.0f, &mRenderObjToWorld);
Change it to read:
validateEyePoint(1.0f, &mObjToWorld);
HTH,
Jack
#7
When I run dedicated server on a G5 PowerPC Mac, and connect a client from any other machine (or even the same machine), the level loads incredibly slowly. When I start running the game, I see the netowrk icon pop up at regular intervals (every few second), and the game oscillates between running and hanging.
I can run the exact same code (recompiled of course) on windowsXP, and the dedicated server runs fine.
Also, I can run an ordinary server (non-dedicated, with a client) on the PowerPC Mac, and it runs fine, as do the clients that connect to it.
I was not having any of these problems with v1.4, only since updating to v1.5. With v1.4, I could run multiple dedicated servers on PowerPC Mac witout any problem. I upgraded to get support for Intel Macs.
Anyone have any thoughts on what the issue could be?
05/18/2007 (1:52 pm)
I am experiencing what sounds like the same problem as Scotts. Jack's fix (above) will not solve my problems, because the issues start before the world is even rendering.When I run dedicated server on a G5 PowerPC Mac, and connect a client from any other machine (or even the same machine), the level loads incredibly slowly. When I start running the game, I see the netowrk icon pop up at regular intervals (every few second), and the game oscillates between running and hanging.
I can run the exact same code (recompiled of course) on windowsXP, and the dedicated server runs fine.
Also, I can run an ordinary server (non-dedicated, with a client) on the PowerPC Mac, and it runs fine, as do the clients that connect to it.
I was not having any of these problems with v1.4, only since updating to v1.5. With v1.4, I could run multiple dedicated servers on PowerPC Mac witout any problem. I upgraded to get support for Intel Macs.
Anyone have any thoughts on what the issue could be?
#8
The implementation of TimeManager::process() changed between v1.4 and v1.5. Reverting to the version from v1.4 fixes issues I was seeing where the mac dedicated server runs extremely choppy.
I suggest reverting to this version from v1.4:
Instead of the v1.5 version:
05/21/2007 (1:41 pm)
I found the solution to my problem, and probably Scott's too.The implementation of TimeManager::process() changed between v1.4 and v1.5. Reverting to the version from v1.4 fixes issues I was seeing where the mac dedicated server runs extremely choppy.
I suggest reverting to this version from v1.4:
void TimeManager::process()
{
U32 curTime = Platform::getRealMilliseconds(); // GTC returns Milliseconds, FYI.
TimeEvent event;
event.elapsedTime = curTime - platState.lastTimeTick;
if(event.elapsedTime > sgTimeManagerProcessInterval)
{
platState.lastTimeTick = curTime;
Game->postEvent(event);
}
}Instead of the v1.5 version:
void TimeManager::process()
{
_MacCarbUpdateSleepTicks();
U32 curTime = Platform::getRealMilliseconds(); // GTC returns Milliseconds, FYI.
S32 elapsedTime = curTime - platState.lastTimeTick;
if(elapsedTime <= platState.sleepTicks)
{
Platform::sleep(platState.sleepTicks - elapsedTime);
}
platState.lastTimeTick = Platform::getRealMilliseconds();
TimeEvent event;
event.elapsedTime = elapsedTime;
Game->postEvent(event);
}
Torque Owner Scott Coursey
Yellow Duck Software