Urban Terror Forums: mod'ed server - Urban Terror Forums

Jump to content

 Login | Register 
Advertisement
  • (3 Pages)
  • +
  • 1
  • 2
  • 3
  • You cannot start a new topic
  • You cannot reply to this topic

mod'ed server Rate Topic: -----

#1 User is offline   Rambetter Icon

  •   community dev   
  • Account: rambetter
  • Joined: 28-February 10
  • Posts: 1,140

Posted 10 March 2008 - 08:31 PM

I'm running a server (wTf - San Diego) with a slightly modified source code.  I thought I'd try a little experiment just for fun, at the same time perhaps making game play smoother and more responsive for players with good network connections.  On the other hand, my modification will impact gameplay in a negative way for those players with poor network connections (because of the extra bandwidth requirements).  My server will probably end up attracting players with good network connections.  In a nutshell, the mod bumps up the server fps, client snaps, and client rates up by 25 percent.  It's hardcoded in the C code.  The rest of this post is from an email to a friend:

So my server is modded now.  I don't want to make this a secret, I just want people's experience to be better.  The modded server is not suitable for competition play because it is non-standard.  The plain vanilla server binary is still there and I can launch it for a match server whenever I want.

Here's the mod.  In standard UrbanTerror, the server performs computations 20 times per second; the rest of the time the server sleeps.  So every 20th of a second the server reads data from the network buffers and computes the new world state.  It then sends network packets describing the world state to every client connected.

The FPS is 25 on my server.  This is a 25 percent increase from the standard server.  In addition to that change, the server increases the max datarate for each client by 25 percent automatically.  So if your client has a /rate of 8000 (the default), the server will interpret that as 10000.  If you have your client's rate set to 20000, the server will send at most 25 KB/sec.

So far my server has been full (20 players) with no problems reported.  If there are problems I will switch back to the plain vanilla version.

#2 User is offline   Oswald (old) Icon

  • Joined: 13-January 04
  • Posts: 6,603
  • LocationWishin' I was in SoCal

Posted 10 March 2008 - 09:09 PM

So our code for our files is being overwritten by a new pak file is what you are saying?

#3 User is offline   Rambetter Icon

  •   community dev   
  • Account: rambetter
  • Joined: 28-February 10
  • Posts: 1,140

Posted 10 March 2008 - 09:35 PM

The pk3 files and what not are not touched at all.  I'm compiling a modified version of ioUrTded.i386.  The binary executable.  The quake 3 engine or whatever it's called.

#4 User is offline   Oswald (old) Icon

  • Joined: 13-January 04
  • Posts: 6,603
  • LocationWishin' I was in SoCal

Posted 10 March 2008 - 11:29 PM

But it is still overwriting settings we have, is it not?

#5 User is offline   Rambetter Icon

  •   community dev   
  • Account: rambetter
  • Joined: 28-February 10
  • Posts: 1,140

Posted 10 March 2008 - 11:42 PM

Yes I am overwriting the settings.  Here is the full diff of the source code.  It's kind of ugly.  But realize that 20 sv_fps and 20 snaps is hardcoded in several places.  Also there are other things that are ugly-hardcoded even before my mod.  If you are really against this mod, I will no longer run this mod'ed server.  This mod'ed server has been up for 24 hours I will take it down at your request (I don't want to get into trouble with anyone).  It was an experimental test I got my jolly's off of.

diff -ur ioUrbanTerrorServerSource_Vanilla/code/game/bg_misc.c ioUrbanTerrorServerSource_25FPS_1.25xRate/code/game/bg_misc.c
--- ioUrbanTerrorServerSource_Vanilla/code/game/bg_misc.c      2008-03-06 11:14:08.000000000 -0800
+++ ioUrbanTerrorServerSource_25FPS_1.25xRate/code/game/bg_misc.c      2008-03-09 17:33:31.000000000 -0700
@@ -1554,7 +1554,7 @@
        // set the time for linear prediction
        s->pos.trTime = time;
        // set maximum extra polation time
-      s->pos.trDuration = 50; // 1000 / sv_fps (default = 20)
+      s->pos.trDuration = 40; // 1000 / sv_fps (default = 20)

        s->apos.trType = TR_INTERPOLATE;
        VectorCopy( ps->viewangles, s->apos.trBase );
diff -ur ioUrbanTerrorServerSource_Vanilla/code/server/sv_client.c ioUrbanTerrorServerSource_25FPS_1.25xRate/code/server/sv_client.c
--- ioUrbanTerrorServerSource_Vanilla/code/server/sv_client.c  2008-03-06 11:14:09.000000000 -0800
+++ ioUrbanTerrorServerSource_25FPS_1.25xRate/code/server/sv_client.c  2008-03-09 17:34:18.000000000 -0700
@@ -1146,6 +1146,8 @@
                        cl->rate = 3000;
                }
        }
+      cl->rate = (cl->rate * 5) / 4;
+      if (cl->rate > 99999) { cl->rate = 99999; }
        val = Info_ValueForKey (cl->userinfo, "handicap");
        if (strlen(val)) {
                i = atoi(val);
@@ -1155,6 +1157,7 @@
        }

        // snaps command
+      /*
        val = Info_ValueForKey (cl->userinfo, "snaps");
        if (strlen(val)) {
                i = atoi(val);
@@ -1167,6 +1170,8 @@
        } else {
                cl->snapshotMsec = 50;
        }
+      */
+      cl->snapshotMsec = 40;

        // TTimo
        // maintain the IP information
diff -ur ioUrbanTerrorServerSource_Vanilla/code/server/sv_init.c ioUrbanTerrorServerSource_25FPS_1.25xRate/code/server/sv_init.c
--- ioUrbanTerrorServerSource_Vanilla/code/server/sv_init.c    2008-03-06 11:14:09.000000000 -0800
+++ ioUrbanTerrorServerSource_25FPS_1.25xRate/code/server/sv_init.c    2008-03-09 17:33:31.000000000 -0700
@@ -660,6 +660,7 @@
        sv_rconPassword = Cvar_Get ("rconPassword", "", CVAR_TEMP );
        sv_privatePassword = Cvar_Get ("sv_privatePassword", "", CVAR_TEMP );
        sv_fps = Cvar_Get ("sv_fps", "20", CVAR_TEMP );
+      sv_fps->integer = 25;
        sv_timeout = Cvar_Get ("sv_timeout", "200", CVAR_TEMP );
        sv_zombietime = Cvar_Get ("sv_zombietime", "2", CVAR_TEMP );
        Cvar_Get ("nextmap", "", CVAR_TEMP );
diff -ur ioUrbanTerrorServerSource_Vanilla/code/server/sv_main.c ioUrbanTerrorServerSource_25FPS_1.25xRate/code/server/sv_main.c
--- ioUrbanTerrorServerSource_Vanilla/code/server/sv_main.c    2008-03-06 11:14:09.000000000 -0800
+++ ioUrbanTerrorServerSource_25FPS_1.25xRate/code/server/sv_main.c    2008-03-09 17:33:31.000000000 -0700
@@ -787,7 +787,7 @@

        // if it isn't time for the next frame, do nothing
        if ( sv_fps->integer < 1 ) {
-              Cvar_Set( "sv_fps", "10" );
+              Cvar_Set( "sv_fps", "1" );
        }

        frameMsec = 1000 / sv_fps->integer * com_timescale->value;

bullet_loaderAdvertisement

#6 User is offline   Oswald (old) Icon

  • Joined: 13-January 04
  • Posts: 6,603
  • LocationWishin' I was in SoCal

Posted 11 March 2008 - 02:32 AM

well why you are ove4rwriting our settings you are not doing anything with the qvms so youa re free to do what you want...

#7 User is offline   TwentySeven Icon

  •   former FS member   
    Lead Engine Developer
  • Account: twentyseven
  • Country:
  • Joined: 24-January 10
  • Posts: 1,318

Posted 11 March 2008 - 02:34 AM

Umm yeah,  Theres alot of stuff in the server qvm code that expects things to be locked to sv_fps 20.  50ms between snapshots is convenient for alot of things.

Stuff will probably break.  For example im sure it'll bugger up antiwarp.

As for what sv_fps does, it sends down more snapshots of player positions per second.  Wether or not that'll have any positive benefit on gameplay is most likely going to be placebo.. 20hz is pretty fast and we interpolate for the remaining frames...

#8 User is offline   Rambetter Icon

  •   community dev   
  • Account: rambetter
  • Joined: 28-February 10
  • Posts: 1,140

Posted 11 March 2008 - 03:50 AM

You're probably right.  I think the antiwarp or something is messing things up.  I tried server FPS at 100 and something was definitely wrong.  So some code is assuming 20 FPS probably.  Anyhow it was worth a try.  I'm chaning it back to vanilla.

#9 User is offline   don Icon

  • Account: don
  • Main tag: GlaD-
  • Joined: 28-February 10
  • Posts: 2,640

Posted 11 March 2008 - 05:02 AM

I was playing on your server tonight, and it was hitting good. But it seems it wasn't modded at the time, so I guess your server is just good. It pinged 120 for me with your old host, and now it pings a proper 50-60.:)

#10 User is offline   Longbeachbean Icon

  •   community admin   

Posted 11 March 2008 - 05:21 AM

Quote

I was playing on your server tonight, and it was hitting good. But it seems it wasn't modded at the time, so I guess your server is just good. It pinged 120 for me with your old host, and now it pings a proper 50-60.:)


Yeah rambetter took it down the old version and put up the stock model. you were most likely playing on stock. Still a pretty damn sweet server.

Thanks for stopping by for a frag.

  • (3 Pages)
  • +
  • 1
  • 2
  • 3
  • You cannot start a new topic
  • You cannot reply to this topic

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users

Advertisement


Copyright © 1999-2024 Frozensand Games Limited  |  All rights reserved  |  Urban Terror™ and FrozenSand™ are trademarks of Frozensand Games Limited

Frozensand Games is a Limited company registered in England and Wales. Company Reg No: 10343942