]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/common/t_items.qc
document item respawntime scaling
[xonotic/xonotic-data.pk3dir.git] / qcsrc / common / t_items.qc
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;