Game Development Community

Dedicated Server Issue on Linux

by Daniel Ko · in Technical Issues · 01/29/2007 (2:29 am) · 14 replies

Hi All,

I have successfully installed the Demo Torgue Game Engine on Linux and after installing when i try to run the torgueDemo Engine i get the following message and the Engine stops.

Sleep latency: 2ms
Sleep latency ok, enabling dsleep for lower cpu utilization
Alert: Fatal-ISV: (console/consoleFunctions.cc @ 765) Copy of Torque is already running; exiting.
Segmentation fault.

From the above message it says "Copy of Torque is already running; exiting." but there is no other Torgue process is running but still i get that message.

Can anyone be kind enough to help me out correcting the problem.?

Thanks in Advance
Dan

#1
01/29/2007 (4:50 am)
Have you checked "ps aux" to make sure there is not a crashed instance in the background. I do most of my work on Linux and have not seen this happen.

Edit: Upon further investigation, the bit of code that throws that error is in the script "common/client/canvas.cs" and it appears to throw that error if Torque fails to create the Canvas ( game window). So it appears that you've got something else going on there.

What Linux are you running, vid card, sys specs, etc.
#2
01/29/2007 (5:54 am)
Thank you so much for the reply ArmedGeek!!

Yes i have checked using "ps aux" and there is no crashed instances in the background.
Also i Edit canvas.cs and it shows this

//-----------------------------------------------------------------------------
// Torque Game Engine
// Copyright (C) GarageGames.com, Inc.
//-----------------------------------------------------------------------------

//-----------------------------------------------------------------------------
// Function to construct and initialize the default canvas window
// used by the games

function initCanvas(%windowName, %effectCanvas)
{
videoSetGammaCorrection($pref::OpenGL::gammaCorrection);

if( %effectCanvas )
%canvasCreate = createEffectCanvas( %windowName );
else
%canvasCreate = createCanvas( %windowName );

if( !%canvasCreate )
{
quitWithErrorMessage("Copy of Torque is already running; exiting.");
return;
}

setOpenGLTextureCompressionHint( $pref::OpenGL::compressionHint );
setOpenGLAnisotropy( $pref::OpenGL::textureAnisotropy );
setOpenGLMipReduction( $pref::OpenGL::mipReduction );
setOpenGLInteriorMipReduction( $pref::OpenGL::interiorMipReduction );
setOpenGLSkyMipReduction( $pref::OpenGL::skyMipReduction );

// Declare default GUI Profiles.
exec("~/ui/defaultProfiles.cs");

// Common GUI's
exec("~/ui/ConsoleDlg.gui");
exec("~/ui/LoadFileDlg.gui");
exec("~/ui/ColorPickerDlg.gui");
exec("~/ui/SaveFileDlg.gui");
exec("~/ui/MessageBoxOkDlg.gui");
exec("~/ui/MessageBoxYesNoDlg.gui");
exec("~/ui/MessageBoxOKCancelDlg.gui");
exec("~/ui/MessagePopupDlg.gui");
exec("~/ui/HelpDlg.gui");
exec("~/ui/RecordingsDlg.gui");
exec("~/ui/NetGraphGui.gui");

// Commonly used helper scripts
exec("./metrics.cs");
exec("./messageBox.cs");
exec("./screenshot.cs");
exec("./cursor.cs");
exec("./help.cs");
exec("./recordings.cs");

// Init the audio system
OpenALInit();
}

function resetCanvas()
{
if (isObject(Canvas))
{
Canvas.repaint();
}
}

Also I am using the following version of Linux

Linux hostname-4 2.6.9-42.0.2.EL #1 Tue Aug 22 23:56:05 CDT 2006 i686 athlon i386 GNU/Linux.

I have a question here regarding the vid card you have asked.. does a server need a vid card too .? since it has to be just a server and will not be used as a client for playing.

Sorry if i am sounding silly here about vid card.

Thanks again for the reply ArmedGeek

Regards
Dan
#3
01/29/2007 (10:39 am)
This problem is actually caused a bit further back up the chain..

in starter.fps/main.cs, there's this function:
function onStart()
{
   Parent::onStart();
   echo("\n--------- Initializing MOD: FPS Starter Kit ---------");

   // Load the scripts that start it all...
   exec("./client/init.cs");
   exec("./server/init.cs");
   exec("./data/init.cs");

   // Server gets loaded for all sessions, since clients
   // can host in-game servers.
   initServer();

   // Start up in either client, or dedicated server mode
   if ($Server::Dedicated)
      initDedicated();
   else
      initClient();
}

I don't remember the actual fix offhand, but the problem is that initClient is being called despite $Server::Dedicated being set, or being meant to be set. Start by checking what the value of it actually is; if it's true, then find out why initClient is being called. If it's false, find out why it's not being set.

"Copy of Torque is already running; exiting." is an incorrect error message, presumably in there to throw you off the scent. :-)

Sorry I can't be more helpful, it's been a while and I don't have my linux stuffs on hand :-/

Gary (-;
#4
01/29/2007 (6:45 pm)
Thanks for your reply Gary but i have checked all those files in the backup chain as you have mentioned but did not find anything wrong so looks like i am definitely missing something else somewhere because of which i am getting this message.

"Sleep latency: 2ms
Sleep latency ok, enabling dsleep for lower cpu utilization
Alert: Fatal-ISV: (console/consoleFunctions.cc @ 765) Copy of Torque is already running; exiting.
Segmentation fault."

NOTE: I am using Centos ( Linux hostname-4 2.6.9-42.0.2.EL #1 Tue Aug 22 23:56:05 CDT 2006 i686 athlon i386 GNU/Linux. )

I would really apprecite if i could get some help with my issue from anyone of the Support Guys.

Thanks to the guys who replied to my post and Thanks again in advance to the Support Team.

Regards
Dan
#5
03/10/2007 (5:03 am)
You should be passing -dedicated as a command line parameter to the executable, otherwise Torque attempts to create client window which probably is failing.

If you want a dedicated server, also make sure you type "make dedicated" to build it.
#6
03/19/2007 (6:05 am)
Hi All,

"Thanks for your reply Tony but i am getting that error when i ran ./torgueDemod.bin -dedicated." So anyways since i could not fix the above problem i had posted earlier and then going thru the other posts i formatted the exists OS installation i had and reinstalled Ubuntu 6.1.XX and everything went on fine with the required repositories required for the Torgue demo i continued to install the Torgue Demo, while make dedicated the installation stops at a point as following:

In file included from ./interior/interiorMapRes.h:9,
from ./collision/convexBrush.h:12,
from collision/convexBrush.cc:1:
./dgl/gTexManager.h:428:26: warning: no newline at end of file
./collision/optimizedPolyList.h:37: error: extra qualification
#7
03/22/2007 (5:14 am)
Hi All,

The compilation worked finally and when i try to run the engine i get the following error.
./torqueDemo.bin -dedicated
Sleep latency: 3ms
Sleep latency ok, enabling dsleep for lower cpu utilization
Alert: Error Could not find a compatible OpenGL display resolution. Please check your driver configuration.
Exiting

Can anyone help me out in this or if somebody else also encountered this same error message and were able to fix it.

Thanks in Advance !!!

Dan
#8
03/22/2007 (7:28 am)
I had a problem running the dedicated server with the 'tutorial.base' game. Pointing to 'starter.fps' worked.
#9
04/18/2008 (10:59 pm)
PROBLEM: in dedicated mode, process goes to sleep and responds very slowly
LINUX DISTRO: ubuntu 7.10
TORQUE: TGE 1.5.2

when running a game as a dedicated server, every thing seems to launch quickly and correctly, but then the process goes to sleep, the console becomes very slow to respond to input, echo("Hello World"); takes about 4 sec to print Hello World. It also doesn't respond to lan querys from clients on the LAN.
If I run the same build and game as a client and host a multiplayer game, everything works fine. clients can find the server and connect.
#10
04/22/2008 (12:19 pm)
For dedicated mode you need to run the torquedemoD.bin.

I mean the special version compiled for dedicated mode

for more information : eviwo.free.fr/torque/compile.html

the command line will be : torqueDemod.bin -dedicated -mission game/data/missions/test.mis

If you need a debugger for torque script on linux , test this one : eviwo.free.fr/torque/Debugger-documentation.html
#11
06/08/2008 (2:51 pm)
It seems that i have the same issue with John Lockwood.

To John - did you fix it?

And yes, i have built special "dedicated" version of engine.
And also yes, i have used "-dedicated" start option.
#12
07/05/2008 (2:44 pm)
I'm seeing the same problem as John Lockwood in my tests here.

Ubuntu 8.04.1
TGE 1.5.2

I've tried running the dedicated server on the same machine as the client and on a separate box with almost nothing else running on it (also Ubuntu 8.04.1). The results are the same either way. The client claims that there are no servers on the LAN. Checking with tcpdump verifies that the broadcast queries are making it to the system running the dedicated server and that it does respond but the response is delayed by 3-4 seconds, by which time the client has moved on.

Here is the output from a tcpdump trace on the dedicated box. As you can see the server does not respond to the broadcast query for several seconds. This is also with the precompiled dedicated server binary provided by GarageGames in the SDK.

19:07:08.020719 IP 192.168.10.146.36474 > 255.255.255.255.28000: UDP, length 6
19:07:13.026004 IP 192.168.10.102.28000 > 192.168.10.146.36474: UDP, length 42

19:07:16.914954 IP 192.168.10.146.36474 > 255.255.255.255.28000: UDP, length 6
19:07:22.046044 IP 192.168.10.102.28000 > 192.168.10.146.36474: UDP, length 42

19:07:25.128654 IP 192.168.10.146.36474 > 255.255.255.255.28000: UDP, length 6
19:07:31.066049 IP 192.168.10.102.28000 > 192.168.10.146.36474: UDP, length 42

Any help on this would be most appreciated.
#13
07/05/2008 (3:28 pm)
I figured this one out. Valerij, sorry, I did not see the notice when you posted.

in platform.cc: set sgBackgroundSleepTime to a low number, like 1.

S32 sgBackgroundSleepTime = 1;

in /server/defaults.cs also set:
$pref::backgroundSleepTime = 1;


make sure to delete your prefs afterward.

also, in the command to start a dedicated server, put " -dsleep" on the end.
#14
07/05/2008 (4:31 pm)
@John Lockwood: thank you... that does indeed appear to correct the problem

I should probably note that I only had to add the:

$pref::backgroundSleepTime = 1;

to where my preferences were set. The other changes were not necessary. However, I suspect the source code change would set the global default.