Skip to content

Commit 71a35b9

Browse files
committed
Tweaks
Goalie false if shooting true. Removed airborne and distance_ball_foe_goal < 3500 as conditions to keep shooting if offside. Hopefully stopped bot driving in circles in goal. Only get boost when should be doing something else if len(agent.friends) > 1
1 parent fba5c4e commit 71a35b9

2 files changed

Lines changed: 5 additions & 4 deletions

File tree

FormularBot.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ def run(agent):
7979
else:
8080
shooting = False
8181

82-
if not(me_onside and closest_to_ball) and closest_to_friendly_goal and len(agent.friends) > 0 and not(close and not me_onside):
82+
if not(shooting) and closest_to_friendly_goal and not(close and not me_onside) and len(agent.friends) > 0:
8383
goalie = True
8484
else:
8585
goalie = False
@@ -133,7 +133,7 @@ def run(agent):
133133
stack = 'getting boost'
134134
agent.push(get_nearest_big_boost)
135135

136-
if not stack == kickoff and not(stack == 'shooting' and (close and (agent.me.airborne or me_onside or distance_ball_foe_goal < 3500))) and not(stack == 'getting boost' and agent.me.boost < 20):
136+
if not stack == kickoff and not(stack == 'shooting' and (close and me_onside)) and not(stack == 'getting boost' and agent.me.boost < 20 and len(agent.friends) > 1):
137137

138138
if agent.kickoff_flag and closest_to_ball:
139139
if stack != 'kickoff':

routines.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,11 +36,12 @@ def run(agent):
3636
class goto_friendly_goal():
3737
#Drives towards friendly goal. If touching or over goal line stops moving and faces enemy goal
3838
def run(agent):
39-
if abs(agent.me.location.y) < 5000:
39+
if abs(agent.me.location.y) < 5000:
4040
relative = Vector3(0,5120*side(agent.team),0) - agent.me.location
4141
defaultPD(agent,agent.me.local(relative))
4242
angles = defaultPD(agent, agent.me.local(relative))
43-
defaultThrottle(agent,2300)
43+
if abs(agent.me.location.y) < 4900:
44+
defaultThrottle(agent,2300)
4445
else:
4546
relative = agent.foe_goal.location - agent.me.location
4647
defaultPD(agent,agent.me.local(relative))

0 commit comments

Comments
 (0)