aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBobTheBob <32057864+BobTheBob9@users.noreply.github.com>2022-04-30 01:31:34 +0000
committerBobTheBob <32057864+BobTheBob9@users.noreply.github.com>2022-04-30 01:31:34 +0000
commit3160d798c2d583add7120f370cb63e52a8ec8068 (patch)
treef84d50a8ee4e5ca4bcfa7f425d9b607b71e659ac
parentcd31fc22c1023a21232c5e20e2165d1e2b1e9217 (diff)
downloadNorthstarMods-3160d798c2d583add7120f370cb63e52a8ec8068.tar.gz
NorthstarMods-3160d798c2d583add7120f370cb63e52a8ec8068.zip
measure small angle for spawn rating using the non-weighted frontline
-rw-r--r--Northstar.CustomServers/mod/scripts/vscripts/gamemodes/_gamemode_ctf.nut7
1 files changed, 5 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 d6f7f474..eaf47918 100644
--- a/Northstar.CustomServers/mod/scripts/vscripts/gamemodes/_gamemode_ctf.nut
+++ b/Northstar.CustomServers/mod/scripts/vscripts/gamemodes/_gamemode_ctf.nut
@@ -86,7 +86,7 @@ void function RateSpawnpoints_CTF( int checkClass, array<entity> spawnpoints, in
if ( frontlineDistFrac > FRONTLINE_WEIGHT_THRESHOLD )
{
float fracAboveThreshold = frontlineDistFrac - FRONTLINE_WEIGHT_THRESHOLD
- fracAboveThreshold *= fracAboveThreshold * 0.45
+ fracAboveThreshold *= fracAboveThreshold * 0.4
frontlineDistFrac = FRONTLINE_WEIGHT_THRESHOLD + fracAboveThreshold
}
@@ -98,7 +98,9 @@ void function RateSpawnpoints_CTF( int checkClass, array<entity> spawnpoints, in
#endif
}
+ float frontlineDistReal = Distance2D( ourFlag.GetOrigin(), frontline.origin )
float frontlineDist = Distance2D( ourFlag.GetOrigin(), weightedFrontline )
+ float frontlineAngleReal = atan2( frontline.origin.y - ourFlag.GetOrigin().y, frontline.origin.x - ourFlag.GetOrigin().x ) * ( 180 / PI )
float frontlineAngle = atan2( weightedFrontline.y - ourFlag.GetOrigin().y, weightedFrontline.x - ourFlag.GetOrigin().x ) * ( 180 / PI )
// dividing dist between flags by 3ish gives a good radius for the initial circle
@@ -121,13 +123,14 @@ void function RateSpawnpoints_CTF( int checkClass, array<entity> spawnpoints, in
else
{
// calc angle between our spawnpoint and frontline
+ float angleReal = ( atan2( frontline.origin.y - spawnpoint.GetOrigin().y, frontline.origin.x - spawnpoint.GetOrigin().x ) * ( 180 / PI ) ) - frontlineAngleReal
float angle = ( atan2( weightedFrontline.y - spawnpoint.GetOrigin().y, weightedFrontline.x - spawnpoint.GetOrigin().x ) * ( 180 / PI ) ) - frontlineAngle
// if it's <=1/3 of the distance between frontline and spawn, ensure it's within 65deg
// otherwise, just make sure its on the same side of the map
float frontlineSpawnDist = Distance2D( spawnpoint.GetOrigin(), weightedFrontline )
- if ( ( angle <= 45 && angle >= -45 ) || ( angle <= 110 && angle >= -110 && frontlineSpawnDist <= frontlineDist / 3 ) && frontlineSpawnDist < frontlineDist )
+ if ( ( angleReal <= 50 && angleReal >= -50 ) || ( angle <= 110 && angle >= -110 && frontlineSpawnDist <= frontlineDistReal / 3 ) && frontlineSpawnDist < frontlineDist )
{
// max out at flagDist, rate better as we get closer
rating = ( ( 1 - ( Distance2D( spawnpoint.GetOrigin(), weightedFrontline ) / frontlineDist ) ) * 50 )