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.
Advertisement
mod'ed server
#5
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;
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;
Advertisement
#7
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...
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...
#10
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.
1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users
Advertisement