seeker: make accel/decel consistent with rocket launcher and ticrate independent
authorRudolf Polzer <divverent@alientrap.org>
Sat, 4 Dec 2010 11:13:47 +0000 (12:13 +0100)
committerRudolf Polzer <divverent@alientrap.org>
Sat, 4 Dec 2010 11:13:47 +0000 (12:13 +0100)
balance25.cfg
balanceLeeStricklin.cfg
balanceSamual.cfg
balanceXonotic.cfg
balancetZork.cfg
qcsrc/server/w_seeker.qc

index a5d3b68..d316ce8 100644 (file)
@@ -696,13 +696,13 @@ set g_balance_seeker_flac_speed 3000
 set g_balance_seeker_flac_speed_up 1000
 set g_balance_seeker_flac_speed_z 0
 set g_balance_seeker_flac_spread 0.4
-set g_balance_seeker_missile_accel 1.05
+set g_balance_seeker_missile_accel 3000
 set g_balance_seeker_missile_ammo 2
 set g_balance_seeker_missile_animtime 0.3
 set g_balance_seeker_missile_count 4
 set g_balance_seeker_missile_damage 40
 set g_balance_seeker_missile_damageforcescale 4
-set g_balance_seeker_missile_decel 0.9
+set g_balance_seeker_missile_decel 6000
 set g_balance_seeker_missile_delay 0.25
 set g_balance_seeker_missile_edgedamage 10
 set g_balance_seeker_missile_force 250
@@ -718,7 +718,6 @@ set g_balance_seeker_missile_smart_mindist 800
 set g_balance_seeker_missile_smart_trace_max 2500
 set g_balance_seeker_missile_smart_trace_min 1000
 set g_balance_seeker_missile_speed 700
-set g_balance_seeker_missile_speed_accel 0
 set g_balance_seeker_missile_speed_up 300
 set g_balance_seeker_missile_speed_z 0
 set g_balance_seeker_missile_speed_max 1250
index baca6f9..064b72c 100644 (file)
@@ -696,13 +696,13 @@ set g_balance_seeker_flac_speed 3000
 set g_balance_seeker_flac_speed_up 1000
 set g_balance_seeker_flac_speed_z 0
 set g_balance_seeker_flac_spread 0.4
-set g_balance_seeker_missile_accel 1.05
+set g_balance_seeker_missile_accel 3000
 set g_balance_seeker_missile_ammo 2
 set g_balance_seeker_missile_animtime 0.3
 set g_balance_seeker_missile_count 8
 set g_balance_seeker_missile_damage 25
 set g_balance_seeker_missile_damageforcescale 4
-set g_balance_seeker_missile_decel 0.9
+set g_balance_seeker_missile_decel 6000
 set g_balance_seeker_missile_delay 0.25
 set g_balance_seeker_missile_edgedamage 10
 set g_balance_seeker_missile_force 250
@@ -718,7 +718,6 @@ set g_balance_seeker_missile_smart_mindist 800
 set g_balance_seeker_missile_smart_trace_max 2500
 set g_balance_seeker_missile_smart_trace_min 1000
 set g_balance_seeker_missile_speed 700
-set g_balance_seeker_missile_speed_accel 0
 set g_balance_seeker_missile_speed_up 300
 set g_balance_seeker_missile_speed_z 0
 set g_balance_seeker_missile_speed_max 1250
index 2935a2c..c39a9c6 100644 (file)
@@ -696,13 +696,13 @@ set g_balance_seeker_flac_speed 3000
 set g_balance_seeker_flac_speed_up 1000
 set g_balance_seeker_flac_speed_z 0
 set g_balance_seeker_flac_spread 0.4
-set g_balance_seeker_missile_accel 1.05
+set g_balance_seeker_missile_accel 3000
 set g_balance_seeker_missile_ammo 2
 set g_balance_seeker_missile_animtime 0.3
 set g_balance_seeker_missile_count 4
 set g_balance_seeker_missile_damage 40
 set g_balance_seeker_missile_damageforcescale 4
-set g_balance_seeker_missile_decel 0.9
+set g_balance_seeker_missile_decel 6000
 set g_balance_seeker_missile_delay 0.25
 set g_balance_seeker_missile_edgedamage 10
 set g_balance_seeker_missile_force 250
@@ -718,7 +718,6 @@ set g_balance_seeker_missile_smart_mindist 800
 set g_balance_seeker_missile_smart_trace_max 2500
 set g_balance_seeker_missile_smart_trace_min 1000
 set g_balance_seeker_missile_speed 700
-set g_balance_seeker_missile_speed_accel 0
 set g_balance_seeker_missile_speed_up 300
 set g_balance_seeker_missile_speed_z 0
 set g_balance_seeker_missile_speed_max 1250
index 563318a..1edf010 100644 (file)
@@ -700,13 +700,13 @@ set g_balance_seeker_flac_speed 3000
 set g_balance_seeker_flac_speed_up 1000
 set g_balance_seeker_flac_speed_z 0
 set g_balance_seeker_flac_spread 0.4
-set g_balance_seeker_missile_accel 1.05
+set g_balance_seeker_missile_accel 1400
 set g_balance_seeker_missile_ammo 2
 set g_balance_seeker_missile_animtime 0.3
 set g_balance_seeker_missile_count 8
 set g_balance_seeker_missile_damage 15
 set g_balance_seeker_missile_damageforcescale 4
-set g_balance_seeker_missile_decel 0.9
+set g_balance_seeker_missile_decel 1400
 set g_balance_seeker_missile_delay 0.25
 set g_balance_seeker_missile_edgedamage 10
 set g_balance_seeker_missile_force 250
@@ -722,10 +722,9 @@ set g_balance_seeker_missile_smart_mindist 800
 set g_balance_seeker_missile_smart_trace_max 2500
 set g_balance_seeker_missile_smart_trace_min 1000
 set g_balance_seeker_missile_speed 700
-set g_balance_seeker_missile_speed_accel 0
 set g_balance_seeker_missile_speed_up 300
 set g_balance_seeker_missile_speed_z 0
-set g_balance_seeker_missile_speed_max 1250
+set g_balance_seeker_missile_speed_max 1400
 set g_balance_seeker_missile_spread 0
 set g_balance_seeker_missile_turnrate 0.65
 set g_balance_seeker_tag_ammo 1
@@ -734,6 +733,6 @@ set g_balance_seeker_tag_damageforcescale 4
 set g_balance_seeker_tag_health 5
 set g_balance_seeker_tag_lifetime 15
 set g_balance_seeker_tag_refire 0.7
-set g_balance_seeker_tag_speed 9000
+set g_balance_seeker_tag_speed 5000
 set g_balance_seeker_tag_spread 0
 // End new seeker
index 58b3e3c..2da45b6 100644 (file)
@@ -717,13 +717,13 @@ set g_balance_seeker_flac_speed_up 500
 set g_balance_seeker_flac_speed_z 0
 set g_balance_seeker_flac_spread 0.25
 
-set g_balance_seeker_missile_accel 1.05
+set g_balance_seeker_missile_accel 3000
 set g_balance_seeker_missile_ammo 2
 set g_balance_seeker_missile_animtime 0.3
 set g_balance_seeker_missile_count 4
 set g_balance_seeker_missile_damage 50
 set g_balance_seeker_missile_damageforcescale 2
-set g_balance_seeker_missile_decel 0.9
+set g_balance_seeker_missile_decel 6000
 set g_balance_seeker_missile_delay 0.25
 set g_balance_seeker_missile_edgedamage 10
 set g_balance_seeker_missile_force 250
@@ -739,7 +739,6 @@ set g_balance_seeker_missile_smart_mindist 800
 set g_balance_seeker_missile_smart_trace_max 2500
 set g_balance_seeker_missile_smart_trace_min 1000
 set g_balance_seeker_missile_speed 700
-set g_balance_seeker_missile_speed_accel 0
 set g_balance_seeker_missile_speed_up 300
 set g_balance_seeker_missile_speed_z 0
 set g_balance_seeker_missile_speed_max 1250
index 09c7ec8..6ee8ff0 100644 (file)
@@ -2,7 +2,6 @@
 REGISTER_WEAPON(SEEKER, w_seeker, IT_ROCKETS, 9, WEP_FLAG_NORMAL | WEP_TYPE_SPLASH, BOT_PICKUP_RATING_MID, "seeker", "seeker", "T.A.G. Seeker");
 #else
 #ifdef SVQC
-//.float speed; = switchweapon
 //.float proxytime; = autoswitch
 //.float tl; = wait
 
@@ -27,6 +26,7 @@ void Seeker_Missile_Think()
        vector desireddir, olddir, newdir, eorg;
        float turnrate;
        float dist;
+       float spd;
 
        if (time > self.cnt)
        {
@@ -34,14 +34,12 @@ void Seeker_Missile_Think()
                Seeker_Missile_Explode();
        }
 
-       if (!self.switchweapon)
-               self.switchweapon = cvar("g_balance_seeker_missile_speed");
-
-       if ((self.switchweapon < cvar("g_balance_seeker_missile_speed_max")) && cvar("g_balance_seeker_missile_speed_accel"))
-               self.switchweapon = self.switchweapon * cvar("g_balance_seeker_missile_accel");
-
-       if (self.switchweapon > cvar("g_balance_seeker_missile_speed_max"))
-               self.switchweapon = self.switchweapon * cvar("g_balance_seeker_missile_decel");
+       spd = vlen(self.velocity);
+       spd = bound(
+               spd - cvar("g_balance_seeker_missile_decel") * frametime,
+               cvar("g_balance_seeker_missile_speed_max"),
+               spd + cvar("g_balance_seeker_missile_accel") * frametime
+       );
 
        if (self.enemy != world)
                if (self.enemy.takedamage != DAMAGE_AIM || self.enemy.deadflag != DEAD_NO)
@@ -73,7 +71,7 @@ void Seeker_Missile_Think()
                }
                
                newdir = normalize(olddir + desireddir * turnrate); // take the average of the 2 directions; not the best method but simple & easy
-               self.velocity = newdir * self.switchweapon; // make me fly in the new direction at my flight speed
+               self.velocity = newdir * spd; // make me fly in the new direction at my flight speed
        }
 
        // Proxy
@@ -197,7 +195,6 @@ void Seeker_Fire_Missile(vector f_diff)
        missile.flags       = FL_PROJECTILE;
        W_SETUPPROJECTILEVELOCITY_UP(missile, g_balance_seeker_missile);
 
-       missile.switchweapon = vlen(missile.velocity);
        missile.angles = vectoangles (missile.velocity);
 
        CSQCProjectile(missile, FALSE, PROJECTILE_SEEKER, TRUE);