}
}
-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)
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;