diff --git a/rlbot/managers/match.py b/rlbot/managers/match.py index ffca8a4..dd7d62b 100644 --- a/rlbot/managers/match.py +++ b/rlbot/managers/match.py @@ -122,7 +122,7 @@ def start_match( if wait_for_start: self.wait_for_first_packet() - self.logger.info("Match has started.") + self.logger.debug("First packet received") def disconnect(self): """ diff --git a/tests/atba/atba.py b/tests/atba/atba.py index e239699..333e24f 100644 --- a/tests/atba/atba.py +++ b/tests/atba/atba.py @@ -57,6 +57,7 @@ class Atba(Bot): last_demoed = False needs_render = True + next_teleport = 10 last_send = 0 controller = flat.ControllerState() @@ -125,30 +126,30 @@ def get_output(self, packet: flat.GamePacket) -> flat.ControllerState: steer_correction_radians = car_direction.correction_to(car_to_ball) self.controller.steer = -steer_correction_radians - self.controller.throttle = 1 + self.controller.throttle = 1.0 return self.controller def test_state_setting(self, packet: flat.GamePacket): - self.set_game_state( - { - 0: flat.DesiredBallState( - flat.DesiredPhysics( - velocity=flat.Vector3Partial( - z=packet.balls[0].physics.velocity.z + 10 + if packet.match_info.seconds_elapsed > self.next_teleport: + self.next_teleport = packet.match_info.seconds_elapsed + 10 + self.set_game_state( + { + 0: flat.DesiredBallState( + flat.DesiredPhysics( + location=flat.Vector3Partial(0, 0, 100), ) ) - ) - }, - { - i: flat.DesiredCarState( - flat.DesiredPhysics( - velocity=flat.Vector3Partial(z=car.physics.velocity.z + 1) + }, + { + i: flat.DesiredCarState( + flat.DesiredPhysics( + rotation=flat.RotatorPartial(yaw=0) + ) ) - ) - for i, car in enumerate(packet.players) - }, - ) + for i, car in enumerate(packet.players) + }, + ) def test_rendering(self, packet: flat.GamePacket): if not self.needs_render: @@ -163,6 +164,11 @@ def test_rendering(self, packet: flat.GamePacket): self.renderer.begin_rendering() text = ["Hello world!", "I hope I'm centered!"] + self.renderer.draw_line_3d( + flat.CarAnchor(self.index), + flat.RenderAnchor(flat.Vector3(0, 0, 150), flat.CarAnchor(self.index)), + self.renderer.lime, + ) self.renderer.draw_string_3d( "\n".join(text), flat.CarAnchor(self.index), diff --git a/tests/human_vs_atba.toml b/tests/human_vs_atba.toml index 9bf423b..fcc3fb5 100644 --- a/tests/human_vs_atba.toml +++ b/tests/human_vs_atba.toml @@ -5,6 +5,7 @@ auto_start_bots = true [match] game_mode = "Soccer" game_map_upk = "Stadium_P" +enable_rendering = true [mutators] match_length = "Unlimited" diff --git a/tests/render_test/render.py b/tests/render_test/render.py index 6128e2c..c1a3e07 100644 --- a/tests/render_test/render.py +++ b/tests/render_test/render.py @@ -95,4 +95,4 @@ def do_render(self, radius: float): if __name__ == "__main__": - RenderFun().run(wants_match_communications=False, wants_ball_predictions=False) + RenderFun("testing/render_test").run(wants_match_communications=False, wants_ball_predictions=False) diff --git a/tests/run_match.py b/tests/run_match.py index 085d6b6..3843133 100644 --- a/tests/run_match.py +++ b/tests/run_match.py @@ -6,7 +6,7 @@ DIR = Path(__file__).parent -MATCH_CONFIG_PATH = DIR / "render_test.toml" +MATCH_CONFIG_PATH = DIR / "human_vs_atba.toml" RLBOT_SERVER_FOLDER = DIR / "../../core/RLBotCS/bin/Release/" if __name__ == "__main__":