Skip to content

Commit

Permalink
CheeseBot Family bug fixes : ) (#267)
Browse files Browse the repository at this point in the history
* Delete RLBotPack/Cheese directory

* CheeseBot Cheesus Cheezer fixes

minor bug / gameplay fixes

* Delete RLBotPack/CheeseBot Family directory

* Bug fixes for CheeseBot, Cheesus and Cheezer

Minor gameplay and bug fixes + final changes to tags and description.

* Delete RLBotPack/CheeseBot Family/Cheesus/dll directory

* Delete Bot.pdb

* Delete RedUtils.pdb

* Delete RLBotPack/CheeseBot Family/Cheezer/dll directory

* Delete Bot.pdb

* Delete RedUtils.pdb
  • Loading branch information
JoshyDevRL authored Nov 7, 2022
1 parent 298fa4a commit 4f86c56
Show file tree
Hide file tree
Showing 45 changed files with 195 additions and 273 deletions.
31 changes: 0 additions & 31 deletions RLBotPack/Cheese/CheeseBot/ExampleBot.cfg

This file was deleted.

51 changes: 0 additions & 51 deletions RLBotPack/Cheese/Cheesus/Bot.cfg

This file was deleted.

Binary file removed RLBotPack/Cheese/Cheesus/Bot.pdb
Binary file not shown.
18 changes: 0 additions & 18 deletions RLBotPack/Cheese/Cheesus/Loadouts/loadout_generator.py

This file was deleted.

Binary file removed RLBotPack/Cheese/Cheesus/RedUtils.pdb
Binary file not shown.
49 changes: 0 additions & 49 deletions RLBotPack/Cheese/Cheezer/Bot.cfg

This file was deleted.

Binary file removed RLBotPack/Cheese/Cheezer/Bot.pdb
Binary file not shown.
Binary file not shown.
20 changes: 0 additions & 20 deletions RLBotPack/Cheese/Cheezer/Loadouts/loadout_generator.py

This file was deleted.

Binary file removed RLBotPack/Cheese/Cheezer/RedUtils.pdb
Binary file not shown.
Binary file removed RLBotPack/Cheese/Cheezer/logo.png
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
from stat import FILE_ATTRIBUTE_NO_SCRUB_DATA
from turtle import Vec2D
from tools import *
from objects import *
Expand Down Expand Up @@ -155,6 +154,8 @@ def should_go_for_shot(self):


def run(agent):
targets = {"goal": (agent.foe_goal.left_post, agent.foe_goal.right_post), "not_my_net": (agent.friend_goal.right_post, agent.friend_goal.left_post)}
shots = find_hits(agent, targets)
controls = SimpleControllerState()
agent.process()
friends = len(agent.friends)
Expand Down Expand Up @@ -197,14 +198,26 @@ def run(agent):
if agent.current_shot_condition != agent.offense_defense_switch:
if agent.should_go_for_shot():
if len(agent.friends) != 0:
GoForShot = False
for i in range(agent.friends):
if agent.me.location.dist(agent.ball.location) <= agent.friends[i].location.dist(agent.ball.location):
GoForShot = True

if GoForShot == True:
agent.clear()
agent.push(agent.shot)
friends = len(agent.friends)
for i in range(friends):
friends_distance_to_ball = []
friends_distance_to_ball.append(agent.ball.location.dist(agent.friends[i-1].location))
my_distance_to_ball = agent.ball.location.dist(agent.me.location)
if min(friends_distance_to_ball) > my_distance_to_ball or min(friends_distance_to_ball) == my_distance_to_ball:
agent.clear()
agent.push(agent.shot)
agent.current_shot_condition = agent.offense_defense_switch
else:
agent.pop()
agent.push(goto_goal())
if agent.me.location.dist(agent.ball.location) < 2000 or agent.me.location.dist(agent.friend_goal.location) < 1000:
if agent.is_clear():
if len(shots["goal"]) > 0:
agent.push(shots["goal"][0])
elif len(shots["not_my_net"]) > 0:
agent.push(shots["not_my_net"][0])
else:
agent.push(short_shot())

else:
agent.clear()
Expand All @@ -225,20 +238,28 @@ def run(agent):
my_distance_to_ball = agent.ball.location.dist(agent.me.location)
if min(friends_distance_to_ball) >= my_distance_to_ball:
if min(friends_distance_to_ball) == my_distance_to_ball:
if agent.team == 0 and agent.me.location.x < 0:
if agent.team == 0 and agent.me.location.x > 0:
agent.push(cheese_kickoff())
if agent.team == 1 and agent.me.location.x > 0:
if agent.team == 1 and agent.me.location.x < 0:
agent.push(cheese_kickoff())
else:
agent.push(cheese_kickoff())
else:
nearest_boost = agent.get_nearest_boost()
if nearest_boost is not None:
agent.push(goto_boost(nearest_boost))

return


if agent.is_clear():

if agent.me.airborne:
agent.push(recovery())
return

nearest_boost = agent.get_nearest_boost()
if nearest_boost is not None:
if nearest_boost is not None and agent.me.boost < 25:
if agent.me.boost < MAIN_GET_BOOST_MIN_VALUE and not (agent.ball_going_into_our_net or agent.ball_going_into_danger_zone) and (2 > agent.offense_defense_switch >= 0 or (nearest_boost.location - agent.me.location).magnitude() < 900):
agent.push(goto_boost(nearest_boost))
return
Expand Down
19 changes: 19 additions & 0 deletions RLBotPack/CheeseBot Family/CheeseBot/ExampleBot.cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
[Locations]
looks_config = ./appearance.cfg

python_file = ./Cheese.py

name = CheeseBot

maximum_tick_rate_preference = 120

[Details]
developer = JoshyDev

description = CheeseBot is my first bot. (v1)

fun_fact = CheeseBot loves cheese

language = Python

tags = 1v1, teamplay
Loading

0 comments on commit 4f86c56

Please sign in to comment.