From cd31fc22c1023a21232c5e20e2165d1e2b1e9217 Mon Sep 17 00:00:00 2001 From: BobTheBob <32057864+BobTheBob9@users.noreply.github.com> Date: Sat, 30 Apr 2022 01:02:38 +0000 Subject: change weighting and add debug draws for weighting --- .../mod/scripts/vscripts/gamemodes/_gamemode_ctf.nut | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'Northstar.CustomServers/mod/scripts/vscripts/gamemodes') diff --git a/Northstar.CustomServers/mod/scripts/vscripts/gamemodes/_gamemode_ctf.nut b/Northstar.CustomServers/mod/scripts/vscripts/gamemodes/_gamemode_ctf.nut index 9d2631f3..d6f7f474 100644 --- a/Northstar.CustomServers/mod/scripts/vscripts/gamemodes/_gamemode_ctf.nut +++ b/Northstar.CustomServers/mod/scripts/vscripts/gamemodes/_gamemode_ctf.nut @@ -79,18 +79,23 @@ void function RateSpawnpoints_CTF( int checkClass, array spawnpoints, in // this is mainly done to avoid issues with frontline position being way too aggressive when people push enemy bases and that, making it pretty unfair for defending team vector weightedFrontline = frontline.origin { - const float FRONTLINE_WEIGHT_THRESHOLD = 0.35 + const float FRONTLINE_WEIGHT_THRESHOLD = 0.325 float frontlineAngle = atan2( frontline.origin.y - ourFlag.GetOrigin().y, frontline.origin.x - ourFlag.GetOrigin().x ) * ( 180 / PI ) float frontlineDistFrac = Distance2D( ourFlag.GetOrigin(), frontline.origin ) / flagDist if ( frontlineDistFrac > FRONTLINE_WEIGHT_THRESHOLD ) { float fracAboveThreshold = frontlineDistFrac - FRONTLINE_WEIGHT_THRESHOLD - fracAboveThreshold *= ( fracAboveThreshold / 0.05 ) * 0.01 + fracAboveThreshold *= fracAboveThreshold * 0.45 frontlineDistFrac = FRONTLINE_WEIGHT_THRESHOLD + fracAboveThreshold } weightedFrontline = ourFlag.GetOrigin() + AnglesToForward( < 0, frontlineAngle, 0 > ) * ( frontlineDistFrac * flagDist ) + + #if CTF_SPAWN_DEBUG + DebugDrawSphere( frontline.origin, 100, 0, 0, 255, false, 30.0, 16 ) + DebugDrawSphere( weightedFrontline, 100, 0, 255, 0, false, 30.0, 16 ) + #endif } float frontlineDist = Distance2D( ourFlag.GetOrigin(), weightedFrontline ) -- cgit v1.2.3