From: Martin Taibr Date: Fri, 25 Aug 2017 14:42:11 +0000 (+0200) Subject: document item respawntime scaling X-Git-Tag: xonotic-v0.8.5~2497^2~8 X-Git-Url: https://git.xonotic.org/?a=commitdiff_plain;h=0902306e34fb8e5092a665dcbc1fa69157e0456e;p=xonotic%2Fxonotic-data.pk3dir.git document item respawntime scaling --- diff --git a/defaultServer.cfg b/defaultServer.cfg index 52b3b0692..596576a09 100644 --- a/defaultServer.cfg +++ b/defaultServer.cfg @@ -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" diff --git a/qcsrc/common/t_items.qc b/qcsrc/common/t_items.qc index 3b264479a..2c42e4728 100644 --- a/qcsrc/common/t_items.qc +++ b/qcsrc/common/t_items.qc @@ -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;