[nexuiz-commits] r8436 - in trunk/data/qcsrc/server: . pathlib tturrets/system

DONOTREPLY at icculus.org DONOTREPLY at icculus.org
Sun Dec 20 04:36:18 EST 2009


Author: div0
Date: 2009-12-20 04:36:18 -0500 (Sun, 20 Dec 2009)
New Revision: 8436

Modified:
   trunk/data/qcsrc/server/anticheat.qc
   trunk/data/qcsrc/server/cl_client.qc
   trunk/data/qcsrc/server/cl_weaponsystem.qc
   trunk/data/qcsrc/server/defs.qh
   trunk/data/qcsrc/server/g_hook.qc
   trunk/data/qcsrc/server/miscfunctions.qc
   trunk/data/qcsrc/server/mode_onslaught.qc
   trunk/data/qcsrc/server/pathlib.qc
   trunk/data/qcsrc/server/pathlib/main.qc
   trunk/data/qcsrc/server/sv_main.qc
   trunk/data/qcsrc/server/tturrets/system/system_aimprocs.qc
   trunk/data/qcsrc/server/tturrets/system/system_main.qc
Log:
- rename sys_ticrate global to sys_frametime, and premultiply it with slowmo (fixes lots of bugs)
- make player weapon anims play one frame longer, gets rid of flicker introduced by subframe weaponframes


Modified: trunk/data/qcsrc/server/anticheat.qc
===================================================================
--- trunk/data/qcsrc/server/anticheat.qc	2009-12-20 08:46:29 UTC (rev 8435)
+++ trunk/data/qcsrc/server/anticheat.qc	2009-12-20 09:36:18 UTC (rev 8436)
@@ -58,7 +58,7 @@
 	if(self.anticheat_div0_evade_offset == 0)
 	{
 		f = fabs(anticheat_div0_evade_evasion_delta - floor(anticheat_div0_evade_evasion_delta) - 0.5) * 2; // triangle function
-		self.anticheat_div0_evade_offset = time + sys_ticrate * (3 * f - 1);
+		self.anticheat_div0_evade_offset = time + sys_frametime * (3 * f - 1);
 		self.anticheat_div0_evade_v_angle = self.v_angle;
 		self.anticheat_div0_evade_forward_initial = v_forward;
 		MEAN_ACCUMULATE(anticheat_div0_evade, 0, 1);

Modified: trunk/data/qcsrc/server/cl_client.qc
===================================================================
--- trunk/data/qcsrc/server/cl_client.qc	2009-12-20 08:46:29 UTC (rev 8435)
+++ trunk/data/qcsrc/server/cl_client.qc	2009-12-20 09:36:18 UTC (rev 8436)
@@ -2709,6 +2709,8 @@
 	}
 
 	target_voicescript_next(self);
+
+	print(ftos(self.frame), "\n");
 }
 
 // on dragger:

Modified: trunk/data/qcsrc/server/cl_weaponsystem.qc
===================================================================
--- trunk/data/qcsrc/server/cl_weaponsystem.qc	2009-12-20 08:46:29 UTC (rev 8435)
+++ trunk/data/qcsrc/server/cl_weaponsystem.qc	2009-12-20 09:36:18 UTC (rev 8436)
@@ -1178,7 +1178,7 @@
 	{
 		local vector anim;
 		anim = self.anim_shoot;
-		anim_z = anim_y / t;
+		anim_z = anim_y / (t + sys_frametime);
 		setanim(self, anim, FALSE, TRUE, TRUE);
 	}
 };

Modified: trunk/data/qcsrc/server/defs.qh
===================================================================
--- trunk/data/qcsrc/server/defs.qh	2009-12-20 08:46:29 UTC (rev 8435)
+++ trunk/data/qcsrc/server/defs.qh	2009-12-20 09:36:18 UTC (rev 8436)
@@ -285,7 +285,7 @@
 
 //sv_timeout: pauses the game by setting the gamespeed to a really low value (see TIMEOUT_SLOWMO_VALUE)
 #define TIMEOUT_SLOWMO_VALUE 0.0001
-float sys_ticrate; // gets initialised in worlspawn, saves the value from cvar("sys_ticrate")
+float sys_frametime; // gets initialised in worlspawn, saves the value from cvar("sys_ticrate")
 float remainingTimeoutTime; // contains the time in seconds that the active timeout has left
 float remainingLeadTime; // contains the number of seconds left of the leadtime (before the timeout starts)
 float timeoutStatus; // (values: 0, 1, 2) contains whether a timeout is not active (0), was called but still at leadtime (1) or is active (2)

Modified: trunk/data/qcsrc/server/g_hook.qc
===================================================================
--- trunk/data/qcsrc/server/g_hook.qc	2009-12-20 08:46:29 UTC (rev 8435)
+++ trunk/data/qcsrc/server/g_hook.qc	2009-12-20 09:36:18 UTC (rev 8436)
@@ -270,7 +270,7 @@
 	if(other == world)
 	{
 		vector tic;
-		tic = self.velocity * sys_ticrate;
+		tic = self.velocity * sys_frametime;
 		tic = tic + normalize(tic) * vlen(self.maxs - self.mins);
 		traceline(self.origin - tic, self.origin + tic, MOVE_NORMAL, self);
 		if(trace_fraction >= 1)

Modified: trunk/data/qcsrc/server/miscfunctions.qc
===================================================================
--- trunk/data/qcsrc/server/miscfunctions.qc	2009-12-20 08:46:29 UTC (rev 8435)
+++ trunk/data/qcsrc/server/miscfunctions.qc	2009-12-20 09:36:18 UTC (rev 8436)
@@ -2104,7 +2104,7 @@
     if (other == world && self.size != '0 0 0')
     {
         vector tic;
-        tic = self.velocity * sys_ticrate;
+        tic = self.velocity * sys_frametime;
         tic = tic + normalize(tic) * vlen(self.maxs - self.mins);
         traceline(self.origin - tic, self.origin + tic, MOVE_NORMAL, self);
         if (trace_fraction >= 1)

Modified: trunk/data/qcsrc/server/mode_onslaught.qc
===================================================================
--- trunk/data/qcsrc/server/mode_onslaught.qc	2009-12-20 08:46:29 UTC (rev 8435)
+++ trunk/data/qcsrc/server/mode_onslaught.qc	2009-12-20 09:36:18 UTC (rev 8436)
@@ -967,7 +967,7 @@
 	if(self.owner.iscaptured)
 		WaypointSprite_UpdateHealth(self.owner.sprite, self.health);
 	else
-		WaypointSprite_UpdateBuildFinished(self.owner.sprite, time + (self.max_health - self.health) / (self.count / sys_ticrate));
+		WaypointSprite_UpdateBuildFinished(self.owner.sprite, time + (self.max_health - self.health) / (self.count / sys_frametime));
 	self.pain_finished = time + 1;
 	self.punchangle = (2 * randomvec() - '1 1 1') * 45;
 	self.cp_bob_dmg_z = (2 * random() - 1) * 15;
@@ -1027,7 +1027,7 @@
 void onslaught_controlpoint_icon_think()
 {
 	entity oself;
-	self.nextthink = time + sys_ticrate;
+	self.nextthink = time + sys_frametime;
 	if (time > self.pain_finished + 5)
 	{
 		if(self.health < self.max_health)
@@ -1115,7 +1115,7 @@
 	local entity oself;
 	float a;
 
-	self.nextthink = time + sys_ticrate;
+	self.nextthink = time + sys_frametime;
 
 	// only do this if there is power
 	a = onslaught_controlpoint_can_be_linked(self.owner, self.owner.team);
@@ -1127,7 +1127,7 @@
 	if (self.health >= self.max_health)
 	{
 		self.health = self.max_health;
-		self.count = cvar("g_onslaught_cp_regen") * sys_ticrate; // slow repair rate from now on
+		self.count = cvar("g_onslaught_cp_regen") * sys_frametime; // slow repair rate from now on
 		self.think = onslaught_controlpoint_icon_think;
 		sound(self, CHAN_TRIGGER, "onslaught/controlpoint_built.wav", VOL_BASE, ATTN_NORM);
 		bprint(ColoredTeamName(self.team), " captured ", self.owner.message, " control point\n");
@@ -1190,12 +1190,12 @@
 	e.team = other.team;
 	e.colormap = 1024 + (e.team - 1) * 17;
 	e.think = onslaught_controlpoint_icon_buildthink;
-	e.nextthink = time + sys_ticrate;
-	e.count = (e.max_health - e.health) * sys_ticrate / cvar("g_onslaught_cp_buildtime"); // how long it takes to build
+	e.nextthink = time + sys_frametime;
+	e.count = (e.max_health - e.health) * sys_frametime / cvar("g_onslaught_cp_buildtime"); // how long it takes to build
 	sound(e, CHAN_TRIGGER, "onslaught/controlpoint_build.wav", VOL_BASE, ATTN_NORM);
 	self.team = e.team;
 	self.colormap = e.colormap;
-	WaypointSprite_UpdateBuildFinished(self.sprite, time + (e.max_health - e.health) / (e.count / sys_ticrate));
+	WaypointSprite_UpdateBuildFinished(self.sprite, time + (e.max_health - e.health) / (e.count / sys_frametime));
 	onslaught_updatelinks();
 };
 

Modified: trunk/data/qcsrc/server/pathlib/main.qc
===================================================================
--- trunk/data/qcsrc/server/pathlib/main.qc	2009-12-20 08:46:29 UTC (rev 8435)
+++ trunk/data/qcsrc/server/pathlib/main.qc	2009-12-20 09:36:18 UTC (rev 8436)
@@ -511,7 +511,7 @@
             dprint("Time used - rebuild & filter: ", ftos(ftime),"\n");
             dprint("Time used -          cleanup: ", ftos(ctime),"\n");
             dprint("Time used -            total: ", ftos(ptime + ftime + ctime),"\n");
-            dprint("Time used -         # frames: ", ftos(ceil((ptime + ftime + ctime) / sys_ticrate)),"\n\n");
+            dprint("Time used -         # frames: ", ftos(ceil((ptime + ftime + ctime) / sys_frametime)),"\n\n");
             dprint("Nodes -         created: ", ftos(pathlib_made_cnt),"\n");
             dprint("Nodes -            open: ", ftos(pathlib_open_cnt),"\n");
             dprint("Nodes -          merged: ", ftos(pathlib_merge_cnt),"\n");

Modified: trunk/data/qcsrc/server/pathlib.qc
===================================================================
--- trunk/data/qcsrc/server/pathlib.qc	2009-12-20 08:46:29 UTC (rev 8435)
+++ trunk/data/qcsrc/server/pathlib.qc	2009-12-20 09:36:18 UTC (rev 8436)
@@ -1015,7 +1015,7 @@
             dprint("Time used - rebuild & filter: ", ftos(ftime),"\n");
             dprint("Time used -          cleanup: ", ftos(ctime),"\n");
             dprint("Time used -            total: ", ftos(ptime + ftime + ctime),"\n");
-            dprint("Time used -         # frames: ", ftos(ceil((ptime + ftime + ctime) / sys_ticrate)),"\n\n");
+            dprint("Time used -         # frames: ", ftos(ceil((ptime + ftime + ctime) / sys_frametime)),"\n\n");
             dprint("Nodes -         created: ", ftos(pathlib_made_cnt),"\n");
             dprint("Nodes -            open: ", ftos(pathlib_open_cnt),"\n");
             dprint("Nodes -          merged: ", ftos(pathlib_merge_cnt),"\n");

Modified: trunk/data/qcsrc/server/sv_main.qc
===================================================================
--- trunk/data/qcsrc/server/sv_main.qc	2009-12-20 08:46:29 UTC (rev 8435)
+++ trunk/data/qcsrc/server/sv_main.qc	2009-12-20 09:36:18 UTC (rev 8436)
@@ -197,7 +197,7 @@
 	sv_warsowbunny_turnaccel = cvar("sv_warsowbunny_turnaccel");
 	sv_warsowbunny_backtosideratio = cvar("sv_warsowbunny_backtosideratio");
 	teamplay = cvar ("teamplay");
-	sys_ticrate = cvar("sys_ticrate");
+	sys_frametime = cvar("sys_ticrate") * cvar("slowmo");
 
 	if (timeoutStatus == 1) // just before the timeout (when timeoutStatus will be 2)
 		orig_slowmo = cvar("slowmo"); // slowmo will be restored after the timeout

Modified: trunk/data/qcsrc/server/tturrets/system/system_aimprocs.qc
===================================================================
--- trunk/data/qcsrc/server/tturrets/system/system_aimprocs.qc	2009-12-20 08:46:29 UTC (rev 8435)
+++ trunk/data/qcsrc/server/tturrets/system/system_aimprocs.qc	2009-12-20 09:36:18 UTC (rev 8436)
@@ -26,13 +26,13 @@
 
     // Keep track of when we can shoot the next time and
     // try to predict where the target will be then, so we can put our aimpoint there.
-    // + sys_ticrate, becouse spawned REMOVE THIS IF sv_gameplayfix_delayprojectiles are 0!
+    // + sys_frametime, becouse spawned REMOVE THIS IF sv_gameplayfix_delayprojectiles are 0!
     // projectiles dont move during the first tic of their life.
     //if (self.turrcaps_flags & TFL_TURRCAPS_HITSCAN)
-    //    mintime = max(self.attack_finished_single - time,0) + sys_ticrate;
+    //    mintime = max(self.attack_finished_single - time,0) + sys_frametime;
     //else
 
-    mintime = max(self.attack_finished_single - time,0) + sys_ticrate;
+    mintime = max(self.attack_finished_single - time,0) + sys_frametime;
 
     // Baseline
     pre_pos = real_origin(self.enemy);
@@ -77,10 +77,10 @@
             float vz;
             prep_z = pre_pos_z;
             vz = self.enemy.velocity_z;
-            for(i = 0; i < impact_time; i += sys_ticrate)
+            for(i = 0; i < impact_time; i += sys_frametime)
             {
-                vz = vz - (sv_gravity * sys_ticrate);
-                prep_z = prep_z + vz * sys_ticrate;
+                vz = vz - (sv_gravity * sys_frametime);
+                prep_z = prep_z + vz * sys_frametime;
             }
         }
         pre_pos = prep;

Modified: trunk/data/qcsrc/server/tturrets/system/system_main.qc
===================================================================
--- trunk/data/qcsrc/server/tturrets/system/system_main.qc	2009-12-20 08:46:29 UTC (rev 8435)
+++ trunk/data/qcsrc/server/tturrets/system/system_main.qc	2009-12-20 09:36:18 UTC (rev 8436)
@@ -1004,7 +1004,7 @@
     else
         if (!self.ticrate) self.ticrate = 0.1;     // 10 fps for normal turrets
 
-    self.ticrate = bound(sys_ticrate,self.ticrate,60);  // keep it sane
+    self.ticrate = bound(sys_frametime,self.ticrate,60);  // keep it sane
 
 // General stuff
     if (self.netname == "")
@@ -1295,7 +1295,7 @@
 
     ++turret_count;
     self.nextthink = time + 1;
-    self.nextthink +=  turret_count * sys_ticrate;
+    self.nextthink +=  turret_count * sys_frametime;
 
     self.tur_head.team = self.team;
     self.view_ofs = '0 0 0';



More information about the nexuiz-commits mailing list