Register a SA Forums Account here!
JOINING THE SA FORUMS WILL REMOVE THIS BIG AD, THE ANNOYING UNDERLINED ADS, AND STUPID INTERSTITIAL ADS!!!

You can: log in, read the tech support FAQ, or request your lost password. This dumb message (and those ads) will appear on every screen until you register! Get rid of this crap by registering your own SA Forums Account and joining roughly 150,000 Goons, for the one-time price of $9.95! We charge money because it costs us money per month for bills, and since we don't believe in showing ads to our users, we try to make the money back through forum registrations.
 
  • Post
  • Reply
tarehart
May 9, 2002
Programming custom Rocket League bots has been my thing for a while now, and it's fuckin cool. So cool that Psyonix made us an official API.



We made it so you can code a bot in:
  • Python
  • Java
  • C#
  • Rust
  • Scratch (yes, really)

It's a really nice blend of math, physics, code, and competition. I'm running a tournament, and it's only two weeks before the deadline, you poor bastards:

https://www.youtube.com/watch?v=pl0neodLCwk

Too chicken? Just try it out then.

https://www.youtube.com/watch?v=YJ69QZ-EX7k

It's pretty much as simple as this:
code:
    def get_output(self, packet: GameTickPacket) -> SimpleControllerState:
        ball_location = Vec3(packet.game_ball.physics.location)

        my_car = packet.game_cars[self.index]
        car_location = Vec3(my_car.physics.location)

        car_to_ball = ball_location - car_location

        car_orientation = Orientation(my_car.physics.rotation)
        car_direction = car_orientation.forward

        steer_correction_radians = find_correction(car_direction, car_to_ball)

        if steer_correction_radians > 0:
            turn = -1.0
        else:
            turn = 1.0

        self.controller_state.throttle = 1.0
        self.controller_state.steer = turn

        return self.controller_state
Just get in.

tarehart fucked around with this message at 04:49 on Jul 23, 2019

Adbot
ADBOT LOVES YOU

tarehart
May 9, 2002
P.S. You can make actually-good bots:

https://www.youtube.com/watch?v=ibYH3J8D3ko

JawnV6
Jul 4, 2004

So hot ...
What's the tick rate? The full physics 120Hz or something downsampled from that?

edit: the tick looks pretty close to the 8.3ms i'd expect? with some massive gaps when reloading, 150ms+. I need to figure out how to dump out data rather than pulling from labels, but this is nifty

JawnV6 fucked around with this message at 20:01 on Sep 20, 2019

duck monster
Dec 15, 2004

This'd make a pretty great target for AI research

  • 1
  • 2
  • 3
  • 4
  • 5
  • Post
  • Reply