[nexuiz-commits] r8050 - in trunk/data: . qcsrc/server

DONOTREPLY at icculus.org DONOTREPLY at icculus.org
Sun Oct 4 07:24:17 EDT 2009


Author: div0
Date: 2009-10-04 07:24:11 -0400 (Sun, 04 Oct 2009)
New Revision: 8050

Modified:
   trunk/data/balance.cfg
   trunk/data/balance25.cfg
   trunk/data/balanceHavoc.cfg
   trunk/data/balanceSamual.cfg
   trunk/data/defaultNexuiz.cfg
   trunk/data/qcsrc/server/cl_weaponsystem.qc
   trunk/data/qcsrc/server/constants.qh
   trunk/data/qcsrc/server/defs.qh
   trunk/data/qcsrc/server/g_subs.qc
   trunk/data/qcsrc/server/miscfunctions.qc
   trunk/data/qcsrc/server/w_campingrifle.qc
   trunk/data/qcsrc/server/w_common.qc
Log:
cl_noantilag
g_balance_campingrifle_tracer


Modified: trunk/data/balance.cfg
===================================================================
--- trunk/data/balance.cfg	2009-10-04 11:17:00 UTC (rev 8049)
+++ trunk/data/balance.cfg	2009-10-04 11:24:11 UTC (rev 8050)
@@ -3,7 +3,7 @@
 //
 // And... don't forget to edit the other balance*.cfg too.
 
-set cvar_check_balance 9b590c8f7c3065d917ac8e2e5e842a88
+set cvar_check_balance 78188ae599396a346b72738a042880c5
 
 // {{{ weapon replacement
 // NOTE: this only replaces weapons on the map
@@ -487,6 +487,7 @@
 set g_balance_campingrifle_reloadtime 2 // matches reload anim
 set g_balance_campingrifle_auto_reload_after_changing_weapons 0
 set g_balance_campingrifle_bursttime 0.85 // 0.35 - 0.1 + 0.35 - 0.1 + 0.35 = three secondaries
+set g_balance_campingrifle_tracer 1
 set g_balance_campingrifle_primary_damage 50
 set g_balance_campingrifle_primary_headshotaddeddamage 50
 set g_balance_campingrifle_primary_spread 0

Modified: trunk/data/balance25.cfg
===================================================================
--- trunk/data/balance25.cfg	2009-10-04 11:17:00 UTC (rev 8049)
+++ trunk/data/balance25.cfg	2009-10-04 11:24:11 UTC (rev 8050)
@@ -3,7 +3,7 @@
 //
 // And... don't forget to edit the other balance*.cfg too.
 
-set cvar_check_balance 9b590c8f7c3065d917ac8e2e5e842a88
+set cvar_check_balance 78188ae599396a346b72738a042880c5
 
 // {{{ weapon replacement
 // NOTE: this only replaces weapons on the map
@@ -487,6 +487,7 @@
 set g_balance_campingrifle_reloadtime 2 // matches reload anim
 set g_balance_campingrifle_auto_reload_after_changing_weapons 0
 set g_balance_campingrifle_bursttime 0
+set g_balance_campingrifle_tracer 0
 set g_balance_campingrifle_primary_damage 60
 set g_balance_campingrifle_primary_headshotaddeddamage 100
 set g_balance_campingrifle_primary_spread 0

Modified: trunk/data/balanceHavoc.cfg
===================================================================
--- trunk/data/balanceHavoc.cfg	2009-10-04 11:17:00 UTC (rev 8049)
+++ trunk/data/balanceHavoc.cfg	2009-10-04 11:24:11 UTC (rev 8050)
@@ -3,7 +3,7 @@
 //
 // And... don't forget to edit the other balance*.cfg too.
 
-set cvar_check_balance 9b590c8f7c3065d917ac8e2e5e842a88
+set cvar_check_balance 78188ae599396a346b72738a042880c5
 
 // {{{ weapon replacement
 // NOTE: this only replaces weapons on the map
@@ -487,6 +487,7 @@
 set g_balance_campingrifle_reloadtime 2 // matches reload anim
 set g_balance_campingrifle_auto_reload_after_changing_weapons 0
 set g_balance_campingrifle_bursttime 0.85 // 0.35 - 0.1 + 0.35 - 0.1 + 0.35 = three secondaries
+set g_balance_campingrifle_tracer 1
 set g_balance_campingrifle_primary_damage 50
 set g_balance_campingrifle_primary_headshotaddeddamage 50
 set g_balance_campingrifle_primary_spread 0

Modified: trunk/data/balanceSamual.cfg
===================================================================
--- trunk/data/balanceSamual.cfg	2009-10-04 11:17:00 UTC (rev 8049)
+++ trunk/data/balanceSamual.cfg	2009-10-04 11:24:11 UTC (rev 8050)
@@ -3,7 +3,7 @@
 //
 // And... don't forget to edit the other balance*.cfg too.
 
-set cvar_check_balance 9b590c8f7c3065d917ac8e2e5e842a88
+set cvar_check_balance 78188ae599396a346b72738a042880c5
 
 // {{{ weapon replacement
 // NOTE: this only replaces weapons on the map
@@ -487,6 +487,7 @@
 set g_balance_campingrifle_reloadtime 2 // matches reload anim
 set g_balance_campingrifle_auto_reload_after_changing_weapons 0
 set g_balance_campingrifle_bursttime 0.85 // 0.35 - 0.1 + 0.35 - 0.1 + 0.35 = three secondaries
+set g_balance_campingrifle_tracer 1
 set g_balance_campingrifle_primary_damage 50
 set g_balance_campingrifle_primary_headshotaddeddamage 50
 set g_balance_campingrifle_primary_spread 0

Modified: trunk/data/defaultNexuiz.cfg
===================================================================
--- trunk/data/defaultNexuiz.cfg	2009-10-04 11:17:00 UTC (rev 8049)
+++ trunk/data/defaultNexuiz.cfg	2009-10-04 11:24:11 UTC (rev 8050)
@@ -1646,3 +1646,5 @@
 
 set sv_weaponstats_damagefile "" "when set to a file name, per-weapon damage stats get written to that file"
 set sv_weaponstats_killfile "" "when set to a file name, per-weapon kill stats get written to that file"
+
+seta cl_noantilag 0 "turn this on if you believe antilag is bad"

Modified: trunk/data/qcsrc/server/cl_weaponsystem.qc
===================================================================
--- trunk/data/qcsrc/server/cl_weaponsystem.qc	2009-10-04 11:17:00 UTC (rev 8049)
+++ trunk/data/qcsrc/server/cl_weaponsystem.qc	2009-10-04 11:24:11 UTC (rev 8050)
@@ -184,78 +184,9 @@
 	// calculate the shotdir from the chosen shotorg
 	w_shotdir = normalize(trueaimpoint - w_shotorg);
 
-#if 0
-	// explanation of g_antilag:
-	// if client reports it was aiming at a player, and the serverside trace
-	// says it would miss, change the aim point to the player's new origin,
-	// but only if the shot at the player's new origin would hit of course
-	//
-	// FIXME: a much better method for bullet weapons would be to leave a
-	// trail of lagged 'ghosts' behind players, and see if the bullet hits the
-	// ghost corresponding to this player's ping time, and if so it would do
-	// damage to the real player
 	if (antilag)
-	if (ent.cursor_trace_ent)                 // client was aiming at someone
-	if (ent.cursor_trace_ent != ent)         // just to make sure
-	if (ent.cursor_trace_ent.takedamage)      // and that person is killable
-	if (ent.cursor_trace_ent.classname == "player") // and actually a player
-	if (cvar("g_antilag") == 1)
+	if (!ent.cvar_cl_noantilag)
 	{
-		// verify that the shot would miss without antilag
-		// (avoids an issue where guns would always shoot at their origin)
-		traceline(w_shotorg, w_shotorg + w_shotdir * MAX_SHOT_DISTANCE, MOVE_NORMAL, ent);
-		if (!trace_ent.takedamage)
-		{
-			// verify that the shot would hit if altered
-			traceline(w_shotorg, ent.cursor_trace_ent.origin, MOVE_NORMAL, ent);
-			if (trace_ent == ent.cursor_trace_ent)
-			{
-				// verify that the shot would hit in the past
-				if(ent.antilag_debug)
-					antilag_takeback(ent.cursor_trace_ent, time - ent.antilag_debug);
-				else
-					antilag_takeback(ent.cursor_trace_ent, time - ANTILAG_LATENCY(ent));
-
-				traceline(ent.origin + ent.view_ofs, ent.origin + ent.view_ofs + v_forward * MAX_SHOT_DISTANCE, MOVE_NORMAL, ent);
-				antilag_restore(ent.cursor_trace_ent);
-
-				if(trace_ent == ent.cursor_trace_ent)
-				{
-					// HIT!
-					w_shotdir = normalize(ent.cursor_trace_ent.origin - w_shotorg);
-					dprint("ANTILAG HIT for ", ent.netname, "\n");
-				}
-				else
-				{
-					// prydon cursor aimbot or odd network conditions
-					dprint("WARNING: antilag ghost trace for ", ent.netname, " failed!\n");
-				}
-
-				if(cvar("developer") >= 2)
-				{
-					vector v, vplus, vel;
-					float X;
-					v     = antilag_takebackorigin(ent.cursor_trace_ent, time - (ANTILAG_LATENCY(ent)       ));
-					vplus = antilag_takebackorigin(ent.cursor_trace_ent, time - (ANTILAG_LATENCY(ent) + 0.01));
-					vel = (vplus - v) * (1 / 0.01);
-					// solve: v + X * vel = closest to ent.origin + ent.view_ofs, v_forward axis
-					v     -= (ent.origin + ent.view_ofs);
-					// solve: v + X * vel = closest to v_forward axis
-					// project into 2D by subtracting v_forward components:
-					v   -= (v   * v_forward) * v_forward;
-					vel -= (vel * v_forward) * v_forward;
-					// solve: v + X * vel = closest to origin
-					// (v + X * vel)^2 closest to 0
-					// v^2 + 2 * X * (v * vel) + X^2 * vel^2 closest to 0
-					X = -(v * vel) / (vel * vel);
-					dprint("dead center needs adjustment of ", ftos(X), " (that is, ", ftos(ANTILAG_LATENCY(ent) + X), " instead of ", ftos(ANTILAG_LATENCY(ent)), "\n");
-				}
-			}
-		}
-	}
-#else
-	if (antilag)
-	{
 		if (cvar("g_antilag") == 1) // switch to "ghost" if not hitting original
 		{
 			traceline(w_shotorg, w_shotorg + w_shotdir * MAX_SHOT_DISTANCE, MOVE_NORMAL, ent);
@@ -294,7 +225,6 @@
 			}
 		}
 	}
-#endif
 
 	ent.dphitcontentsmask = oldsolid; // restore solid type (generally SOLID_SLIDEBOX)
 

Modified: trunk/data/qcsrc/server/constants.qh
===================================================================
--- trunk/data/qcsrc/server/constants.qh	2009-10-04 11:17:00 UTC (rev 8049)
+++ trunk/data/qcsrc/server/constants.qh	2009-10-04 11:24:11 UTC (rev 8050)
@@ -1,5 +1,5 @@
 string CVAR_CHECK_DEFAULT = "091f36c4fb0d7b22bbd2d2fdff8b1447";
-string CVAR_CHECK_BALANCE = "9b590c8f7c3065d917ac8e2e5e842a88";
+string CVAR_CHECK_BALANCE = "78188ae599396a346b72738a042880c5";
 
 float	FALSE					= 0;
 float	TRUE					= 1;

Modified: trunk/data/qcsrc/server/defs.qh
===================================================================
--- trunk/data/qcsrc/server/defs.qh	2009-10-04 11:17:00 UTC (rev 8049)
+++ trunk/data/qcsrc/server/defs.qh	2009-10-04 11:24:11 UTC (rev 8050)
@@ -338,6 +338,7 @@
 float sv_loddistance1;
 float sv_loddistance2;
 .float cvar_cl_gunalign;
+.float cvar_cl_noantilag;
 
 .float version_nagtime;
 

Modified: trunk/data/qcsrc/server/g_subs.qc
===================================================================
--- trunk/data/qcsrc/server/g_subs.qc	2009-10-04 11:17:00 UTC (rev 8049)
+++ trunk/data/qcsrc/server/g_subs.qc	2009-10-04 11:24:11 UTC (rev 8050)
@@ -360,13 +360,13 @@
 }
 void traceline_antilag (entity source, vector v1, vector v2, float nomonst, entity forent, float lag)
 {
-	if (cvar("g_antilag") != 2)
+	if (cvar("g_antilag") != 2 || source.cvar_cl_noantilag)
 		lag = 0;
 	traceline_antilag_force(source, v1, v2, nomonst, forent, lag);
 }
 void tracebox_antilag (entity source, vector v1, vector mi, vector ma, vector v2, float nomonst, entity forent, float lag)
 {
-	if (cvar("g_antilag") != 2)
+	if (cvar("g_antilag") != 2 || source.cvar_cl_noantilag)
 		lag = 0;
 	tracebox_antilag_force(source, v1, mi, ma, v2, nomonst, forent, lag);
 }

Modified: trunk/data/qcsrc/server/miscfunctions.qc
===================================================================
--- trunk/data/qcsrc/server/miscfunctions.qc	2009-10-04 11:17:00 UTC (rev 8049)
+++ trunk/data/qcsrc/server/miscfunctions.qc	2009-10-04 11:24:11 UTC (rev 8050)
@@ -560,6 +560,7 @@
 	GetCvars_handleFloat(s, f, cvar_cl_forceplayermodelsfromnexuiz, "cl_forceplayermodelsfromnexuiz");
 #endif
 	GetCvars_handleFloatOnce(s, f, cvar_cl_gunalign, "cl_gunalign");
+	GetCvars_handleFloatOnce(s, f, cvar_cl_noantilag, "cl_noantilag");
 
 
 	// fixup of switchweapon (needed for LMS or when spectating is disabled, as PutClientInServer comes too early)

Modified: trunk/data/qcsrc/server/w_campingrifle.qc
===================================================================
--- trunk/data/qcsrc/server/w_campingrifle.qc	2009-10-04 11:17:00 UTC (rev 8049)
+++ trunk/data/qcsrc/server/w_campingrifle.qc	2009-10-04 11:24:11 UTC (rev 8050)
@@ -88,7 +88,7 @@
 		w_shotorg = self.origin + self.view_ofs + ((w_shotorg - self.origin - self.view_ofs) * v_forward) * v_forward;
 	}
 
-	fireBallisticBullet(w_shotorg, w_shotdir, pSpread, pSpeed, pLifetime, pDamage, pHeadshotAddedDamage / pDamage, pForce, deathtype, EF_RED, 1, pBulletConstant);
+	fireBallisticBullet(w_shotorg, w_shotdir, pSpread, pSpeed, pLifetime, pDamage, pHeadshotAddedDamage / pDamage, pForce, deathtype, (cvar("g_balance_campingrifle_tracer") ? EF_RED : 0), 1, pBulletConstant);
 	endFireBallisticBullet();
 
 	if (cvar("g_casings") >= 2)

Modified: trunk/data/qcsrc/server/w_common.qc
===================================================================
--- trunk/data/qcsrc/server/w_common.qc	2009-10-04 11:17:00 UTC (rev 8049)
+++ trunk/data/qcsrc/server/w_common.qc	2009-10-04 11:24:11 UTC (rev 8050)
@@ -411,7 +411,7 @@
 			lag = 0;
 		if(clienttype(self) != CLIENTTYPE_REAL)
 			lag = 0;
-		if(cvar("g_antilag") == 0)
+		if(cvar("g_antilag") == 0 || self.cvar_cl_noantilag)
 			lag = 0; // only do hitscan, but no antilag
 
 		if(lag)



More information about the nexuiz-commits mailing list