diff options
author | BobTheBob <32057864+BobTheBob9@users.noreply.github.com> | 2022-04-30 01:02:38 +0000 |
---|---|---|
committer | BobTheBob <32057864+BobTheBob9@users.noreply.github.com> | 2022-04-30 01:02:38 +0000 |
commit | cd31fc22c1023a21232c5e20e2165d1e2b1e9217 (patch) | |
tree | a91b65e610e0d12071312864f0b1c6f0cd3ed5ab | |
parent | 4beeca8d51921996c72af4a8dd8706741e9afebf (diff) | |
download | NorthstarMods-cd31fc22c1023a21232c5e20e2165d1e2b1e9217.tar.gz NorthstarMods-cd31fc22c1023a21232c5e20e2165d1e2b1e9217.zip |
change weighting and add debug draws for weighting
-rw-r--r-- | Northstar.CustomServers/mod/scripts/vscripts/gamemodes/_gamemode_ctf.nut | 9 |
1 files changed, 7 insertions, 2 deletions
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<entity> 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 ) |