r5829 - in trunk/data: . qcsrc/server
DONOTREPLY at icculus.org
DONOTREPLY at icculus.org
Wed Feb 11 00:45:43 EST 2009
Author: div0
Date: 2009-02-11 00:45:39 -0500 (Wed, 11 Feb 2009)
New Revision: 5829
Modified:
trunk/data/defaultNexuiz.cfg
trunk/data/qcsrc/server/w_common.qc
trunk/data/weapons.cfg
Log:
g_antilag_bullets:
Bullets AntiLag (0 = no AntiLag, 1 = server side hit scan in the past) - USE WITH EXTREME CARE (severely changes weapon balance), also disables bullet tracer effects
Stays 0 by default, for weapon balance.
Also, improved Uzi (less damage, less force, faster refire, higher DPS in the end) to work better without bullets antilag.
Modified: trunk/data/defaultNexuiz.cfg
===================================================================
--- trunk/data/defaultNexuiz.cfg 2009-02-10 20:56:46 UTC (rev 5828)
+++ trunk/data/defaultNexuiz.cfg 2009-02-11 05:45:39 UTC (rev 5829)
@@ -386,6 +386,7 @@
locs_enable 0
pausable 0
set g_antilag 2 "AntiLag (0 = no AntiLag, 1 = verified client side hit scan, 2 = server side hit scan in the past, 3 = unverified client side hit scan)"
+set g_antilag_bullets 0 "Bullets AntiLag (0 = no AntiLag, 1 = server side hit scan in the past) - USE WITH EXTREME CARE (severely changes weapon balance), also disables bullet tracer effects"
set g_shootfromeye 0
set g_shootfromcenter 0
set g_pinata 0
Modified: trunk/data/qcsrc/server/w_common.qc
===================================================================
--- trunk/data/qcsrc/server/w_common.qc 2009-02-10 20:56:46 UTC (rev 5828)
+++ trunk/data/qcsrc/server/w_common.qc 2009-02-11 05:45:39 UTC (rev 5829)
@@ -128,8 +128,9 @@
headshot = 0;
yoda = 0;
damage_headshotbonus = self.dmg_edge;
- railgun_start = self.origin - 2 * frametime * self.oldvelocity;
- railgun_end = self.origin + 2 * frametime * self.oldvelocity;
+ railgun_start = self.origin - 2 * frametime * self.velocity;
+ railgun_end = self.origin + 2 * frametime * self.velocity;
+
Damage(other, self, self.owner, self.dmg * f, self.projectiledeathtype, self.origin, self.dmg_force * normalize(self.velocity) * f);
damage_headshotbonus = 0;
@@ -259,6 +260,9 @@
void fireBallisticBullet(vector start, vector dir, float spread, float pSpeed, float lifetime, float damage, float headshotbonus, float force, float dtype, float tracereffects, float gravityfactor, float bulletconstant)
{
+ float lag, dt, savetime;
+ entity pl, oldself;
+
entity proj;
proj = spawn();
proj.classname = "bullet";
@@ -289,6 +293,61 @@
proj.oldvelocity = proj.velocity;
+ if(cvar("g_antilag_bullets"))
+ if(pSpeed >= cvar("g_antilag_bullets"))
+ {
+ // NOTE: this may severely throw off weapon balance
+ lag = ANTILAG_LATENCY(self);
+ if(lag < 0.001)
+ lag = 0;
+ if(clienttype(self) != CLIENTTYPE_REAL)
+ lag = 0;
+
+ if(lag)
+ FOR_EACH_PLAYER(pl)
+ antilag_takeback(pl, time - lag);
+
+ oldself = self;
+ self = proj;
+
+ savetime = frametime;
+ frametime = 0.05;
+
+ for(;;)
+ {
+ tracetoss(self, oldself);
+ other = trace_ent;
+ dt = vlen(trace_endpos - self.origin) / vlen(self.velocity); // this is only approximate!
+ setorigin(self, trace_endpos);
+ self.velocity_z -= sv_gravity * dt;
+
+ if(!SUB_OwnerCheck())
+ {
+ if(SUB_NoImpactCheck())
+ break;
+
+ // hit the player
+ W_BallisticBullet_Hit ();
+ }
+
+ // go through solid!
+ if(!W_BallisticBullet_LeaveSolid(self, self.velocity, self.dmg_radius))
+ break;
+
+ W_BallisticBullet_LeaveSolid_think();
+ }
+ frametime = savetime;
+ self = oldself;
+
+ if(lag)
+ FOR_EACH_PLAYER(pl)
+ antilag_restore(pl);
+
+ remove(proj);
+
+ return;
+ }
+
if(tracereffects & EF_RED)
CSQCProjectile(proj, TRUE, PROJECTILE_BULLET_GLOWING, TRUE);
else
Modified: trunk/data/weapons.cfg
===================================================================
--- trunk/data/weapons.cfg 2009-02-10 20:56:46 UTC (rev 5828)
+++ trunk/data/weapons.cfg 2009-02-11 05:45:39 UTC (rev 5829)
@@ -91,14 +91,14 @@
set g_balance_shotgun_secondary_bulletconstant 75 // 3.8qu
set g_balance_uzi_first_damage 30
-set g_balance_uzi_first_force 50
-set g_balance_uzi_first_spread 0.008
-set g_balance_uzi_first_refire 0.2
+set g_balance_uzi_first_force 40
+set g_balance_uzi_first_spread 0.01
+set g_balance_uzi_first_refire 0.15
set g_balance_uzi_first_ammo 1
-set g_balance_uzi_sustained_damage 15
-set g_balance_uzi_sustained_force 27
+set g_balance_uzi_sustained_damage 13
+set g_balance_uzi_sustained_force 15
set g_balance_uzi_sustained_spread 0.05
-set g_balance_uzi_sustained_refire 0.1
+set g_balance_uzi_sustained_refire 0.05
set g_balance_uzi_sustained_ammo 1
set g_balance_uzi_speed 18000
set g_balance_uzi_bulletconstant 115 // 13.1qu
More information about the nexuiz-commits
mailing list