From 1286c93afdaeda08931cbca8b91afc8ee59f4d18 Mon Sep 17 00:00:00 2001 From: StrawWagen <64710817+StrawWagen@users.noreply.github.com> Date: Sat, 3 Feb 2024 13:29:03 -0700 Subject: [PATCH] Tweak vars based off playtesting Old changes from coddle-newly-spawned. + make minSpawns calculation give more spawns. --- lua/cfc_random_spawn/module/sv_player_spawning.lua | 12 ++++++------ lua/cfc_random_spawn/sv_config.lua | 2 +- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/lua/cfc_random_spawn/module/sv_player_spawning.lua b/lua/cfc_random_spawn/module/sv_player_spawning.lua index 40bd5eb..f4d5175 100755 --- a/lua/cfc_random_spawn/module/sv_player_spawning.lua +++ b/lua/cfc_random_spawn/module/sv_player_spawning.lua @@ -13,10 +13,10 @@ local CLOSENESS_LIMIT = CFCRandomSpawn.Config.CLOSENESS_LIMIT ^ 2 local CENTER_UPDATE_INTERVAL = customSpawnConfigForMap.centerUpdateInterval or CFCRandomSpawn.Config.CENTER_UPDATE_INTERVAL local IGNORE_BUILDERS = CFCRandomSpawn.Config.IGNORE_BUILDERS -local DYNAMIC_CENTER_MINSIZE = 1750 -- getDynamicPvpCenter starts at this radius -local DYNAMIC_CENTER_MAXSIZE = 3750 -- no bigger than this radius +local DYNAMIC_CENTER_MINSIZE = 2000 -- getDynamicPvpCenter starts at this radius +local DYNAMIC_CENTER_MAXSIZE = 4000 -- no bigger than this radius local DYNAMIC_CENTER_MINSPAWNS = 10 -- getDynamicPvpCenter needs at least this many spawns inside the radius -local DYNAMIC_CENTER_MAXSPAWNS = 30 -- max possible spawns +local DYNAMIC_CENTER_MAXSPAWNS = 35 -- max possible spawns local DYNAMIC_CENTER_SPAWNCOUNTMATCHPVPERS = true -- pvp center gets bigger when more people are pvping local DYNAMIC_CENTER_IMPERFECT = true -- throw a bit of randomness in, makes pvp less stiff. @@ -190,7 +190,7 @@ local function findFreeSpawnPoint( spawns, plys ) end end - return customSpawnsForMap[math.random( 1, #customSpawnsForMap )] -- If all spawnpoints are full, just return a random spawn anywhere in the map. Super rare case. + return customSpawnsForMap[math.random( 1, #customSpawnsForMap )] -- If all spawnpoints are full, just return a random spawn anywhere in the map. Rare case. end local function getPlyAvg( plys, centerPos ) @@ -228,7 +228,7 @@ local function getDynamicPvpCenter( measurablePlayers ) -- add some randomness if DYNAMIC_CENTER_IMPERFECT then - local offset = VectorRand() * 800 + local offset = VectorRand() * 1000 offset.z = 0 playersAveragePos = playersAveragePos + offset end @@ -245,7 +245,7 @@ local function getDynamicPvpCenter( measurablePlayers ) -- allow this to adapt to pvper count local minSpawns = DYNAMIC_CENTER_MINSPAWNS if DYNAMIC_CENTER_SPAWNCOUNTMATCHPVPERS then - minSpawns = math.Clamp( measurablePlysCount, DYNAMIC_CENTER_MINSPAWNS, DYNAMIC_CENTER_MAXSPAWNS ) + minSpawns = math.Clamp( DYNAMIC_CENTER_MINSPAWNS + measurablePlysCount, DYNAMIC_CENTER_MINSPAWNS, DYNAMIC_CENTER_MAXSPAWNS ) end -- now determine the center's size diff --git a/lua/cfc_random_spawn/sv_config.lua b/lua/cfc_random_spawn/sv_config.lua index c669436..b4cdb92 100755 --- a/lua/cfc_random_spawn/sv_config.lua +++ b/lua/cfc_random_spawn/sv_config.lua @@ -1,5 +1,5 @@ CFCRandomSpawn.Config.DEFAULT_CENTER_CUTOFF = 3000 -- Default cutoff range from the most popular pvp center, where players further away from this will be ignored. The system tries to place you closest to everyone else. -CFCRandomSpawn.Config.CLOSENESS_LIMIT = 100 -- Will not choose spawnpoints that are within this many units of a valid player (i.e. a living pvper). +CFCRandomSpawn.Config.CLOSENESS_LIMIT = 400 -- Will not choose spawnpoints that are within this many units of a valid player (i.e. a living pvper). CFCRandomSpawn.Config.SELECTION_SIZE = 16 -- Max number of 'ideal' spawnpoints to select from randomly. CFCRandomSpawn.Config.CENTER_UPDATE_INTERVAL = 120 -- The gap (in seconds) between each center popularity update. If set to 0, will update on every respawn. CFCRandomSpawn.Config.IGNORE_BUILDERS = true -- Should 'center popularity' and player position average not care about builders? Requires a PvP addon which uses a function of the form PLAYER:IsInPvp()