]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
document item respawntime scaling
authorMartin Taibr <taibr.martin@gmail.com>
Fri, 25 Aug 2017 14:42:11 +0000 (16:42 +0200)
committerMartin Taibr <taibr.martin@gmail.com>
Fri, 25 Aug 2017 14:42:11 +0000 (16:42 +0200)
defaultServer.cfg
qcsrc/common/t_items.qc

index 52b3b0692752f97746c207758777efd21a4044ac..596576a097fb93c6841a9e76ba1927a5909a1e13 100644 (file)
@@ -185,9 +185,9 @@ set g_weapon_throwable 1 "if set to 1, weapons can be dropped"
 set g_powerups -1 "if set to 0 the strength and shield (invincibility) will not spawn on the map, if 1 they will spawn in all game modes, -1 is game mode default"
 set g_use_ammunition 1 "if set to 0 all weapons have unlimited ammunition"
 set g_pickup_items -1 "if set to 0 all items (health, armor, ammo, weapons...) are removed from the map, if 1 they are forced to spawn"
-set g_pickup_respawntime_scaling_a 0 "Multiply respawn time by `a / (p+b) + c` where `p` is the current number of players, takes effect with 2 or more players present"
-set g_pickup_respawntime_scaling_b 0 "Multiply respawn time by `a / (p+b) + c` where `p` is the current number of players, takes effect with 2 or more players present"
-set g_pickup_respawntime_scaling_c 1 "Multiply respawn time by `a / (p+b) + c` where `p` is the current number of players, takes effect with 2 or more players present"
+set g_pickup_respawntime_scaling_reciprocal 0 "Multiply respawn time by `reciprocal / (p + offset) + linear` where `p` is the current number of players, takes effect with 2 or more players present, `reciprocal` (with `offset` and `linear` set to 0) can be used to achieve a constant number of items spawned *per player*"
+set g_pickup_respawntime_scaling_offset 0 "Multiply respawn time by `reciprocal / (p + offset) + linear` where `p` is the current number of players, takes effect with 2 or more players present, `offset` offsets the curve left or right - the results are not intuitive and I recommend plotting the respawn time and the number of items per player to see what's happening"
+set g_pickup_respawntime_scaling_linear 1 "Multiply respawn time by `reciprocal / (p + offset) + linear` where `p` is the current number of players, takes effect with 2 or more players present, `linear` can be used to simply scale the respawn time linearly"
 set g_weaponarena "0"  "put in a list of weapons to enable a weapon arena mode, or try \"all\" or \"most\""
 set g_weaponarena_random "0"   "if set to a number, only that weapon count is given on every spawn (randomly)"
 set g_weaponarena_random_with_blaster "1"      "additionally, always provide the blaster in random weapon arena games"
index 3b264479acd3c5d4afbcfddf26e0dbe05121a040..2c42e472847794b4440be0d2675886ebd0014bca 100644 (file)
@@ -631,9 +631,9 @@ void Item_ScheduleRespawnIn(entity e, float t)
        }
 }
 
-AUTOCVAR(g_pickup_respawntime_scaling_a, float, 0.0, "Multiply respawn time by `a / (p+b) + c` where `p` is the current number of players, takes effect with 2 or more players present");
-AUTOCVAR(g_pickup_respawntime_scaling_b, float, 0.0, "Multiply respawn time by `a / (p+b) + c` where `p` is the current number of players, takes effect with 2 or more players present");
-AUTOCVAR(g_pickup_respawntime_scaling_c, float, 1.0, "Multiply respawn time by `a / (p+b) + c` where `p` is the current number of players, takes effect with 2 or more players present");
+AUTOCVAR(g_pickup_respawntime_scaling_reciprocal, float, 0.0, "Multiply respawn time by `reciprocal / (p + offset) + linear` where `p` is the current number of players, takes effect with 2 or more players present, `reciprocal` (with `offset` and `linear` set to 0) can be used to achieve a constant number of items spawned *per player*");
+AUTOCVAR(g_pickup_respawntime_scaling_offset, float, 0.0, "Multiply respawn time by `reciprocal / (p + offset) + linear` where `p` is the current number of players, takes effect with 2 or more players present, `offset` offsets the curve left or right - the results are not intuitive and I recommend plotting the respawn time and the number of items per player to see what's happening");
+AUTOCVAR(g_pickup_respawntime_scaling_linear, float, 1.0, "Multiply respawn time by `reciprocal / (p + offset) + linear` where `p` is the current number of players, takes effect with 2 or more players present, `linear` can be used to simply scale the respawn time linearly");
 void Item_ScheduleRespawn(entity e)
 {
        if(e.respawntime > 0)
@@ -649,9 +649,9 @@ void Item_ScheduleRespawn(entity e)
                if (c4 != -1) players += c4;
                float adjusted_respawntime;
                if (players >= 2) {
-                       float a = autocvar_g_pickup_respawntime_scaling_a;
-                       float b = autocvar_g_pickup_respawntime_scaling_b;
-                       float c = autocvar_g_pickup_respawntime_scaling_c;
+                       float a = autocvar_g_pickup_respawntime_scaling_reciprocal;
+                       float b = autocvar_g_pickup_respawntime_scaling_offset;
+                       float c = autocvar_g_pickup_respawntime_scaling_linear;
                        adjusted_respawntime = e.respawntime * (a / (players + b) + c);
                } else {
                        adjusted_respawntime = e.respawntime;