Git Product home page Git Product logo

rlbot's Introduction

YOU PROBABLY SHOULDN'T PULL THIS REPO

Bot Makers Read This!

If you just want to make a bot, you don't need to be here. Instead, start with one of these:

If you just want to play with some bots, you can go to RLBotGUI to easily start matches with bots

Framework Contributors

This repository is currently incomplete to meet the legal needs of the Psyonix API. It is missing the source code behind RLBot.exe, and a few other files. If you want to make a code change that involves RLBot.exe (or the interface dll since it's closely related), you'll need some help from someone with access to the closed repo.

We expect we'll be able to open-source everything eventually, and then this repo will be back in business.

NOTICE: We intend to cherry-pick any commits you make here into the closed repo. At a later date, when we have permission to open-source everything, we will force push the closed repo to this master branch. Your commits will still be there with proper attribution, but if you have any work in progress, it will need to be rebased at that time.

RLBot

Framework Info

The RLBot framework helps people create bots for use in Rocket League's offline modes, just for fun. It provides values from the game like car and ball position, and carries back button presses. RLBot works for up to 10 bots reliably; it can be used up to 64, but can result in issues (bots disappearing after goals, spawning inside one another, etc).

Requirements

Rocket League, Python 3.6+

Quick Start

  1. Run setup.bat (or equivalent if you're on Linux or Mac)
  2. Open a terminal and execute python runner.py

Development Workflow

The first thing you'll want to do is run setup.bat. This does a lot of important things:

  • Sets up your rlbot installation in pip to link to your local files in this folder. Once you've done this, running rlbot from anywhere on your computer will reference these local files, including the dlls, etc.
  • Generates important code based on the .fbs message spec. Therefore it's a prerequisite for running anything.
  • Installs python package dependencies.

If you're doing work that affects our .dll or .exe files, you should also be aware of:

  • copy-dlls.bat - This copies the debug versions any built dlls from visual studio into the correct subdirectory in the python source folder.
  • copy-dlls-release.bat - This copies the release versions any built dlls from visual studio into the correct subdirectory in the python source folder.

For deploying changes, please see https://github.com/RLBot/RLBot/wiki/Deploying-Changes

When you're done with development and want to get back to the official rlbot version vended from https://pypi.org/project/rlbot/, the easiest way to do that is simply pip uninstall rlbot. Then the next time you execute a bat file from one of the RLBot*Example repos, a fresh copy will be installed from pip.

Wikis

There's tons of good information at https://github.com/RLBot/RLBot/wiki

Extras

Community Info

Video Example

Video

Tournament History

Tournament results are recorded in our braacket league.

Videos:

The best part

Psyonix Cone gave us a thumbs up! Thumbs up

rlbot's People

Contributors

adwhalen01 avatar alion02 avatar azeemba avatar christopherhb avatar darxeal avatar ddthj avatar domnomnom avatar drssoccer55 avatar dtracers avatar edwin-kanis avatar ericmburgess avatar gyfis avatar ima9rd avatar jeroen11dijk avatar kipje13 avatar l0laapk3 avatar niceastvillage avatar noodleguitar avatar rlmarvin avatar robbai avatar savagesnowgoose avatar sciguymjm avatar skyborgff avatar tangilj avatar tarehart avatar trunerd avatar twobackfromtheend avatar viliamvadocz avatar virxec avatar whatisaphone avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

rlbot's Issues

Add an easy way to turn screen drawing on and off in V4

Having a bool in the rlbot.cfg file for allowing and disallowing screen drawing would be very helpful.

For instance, a bot maker would use screen drawings for debugging and development purposes. However, this is undesirable when watching a match (e.g. a tournament). Therefore, having an easy way to turn them on and off would be useful.

Quickest way to play against the best bots?

I'm here after checking out the trailer for the upcoming bot tournament.

I gave RLbot a shot last year and back then I remember there weren't a lot of human level bots, now I'm seeing aerials in the trailers.

First of all, fantastic work! Second of all, how do I play against some of these amazing bots?

Java Bot duplication

Java bots can sometimes become duplicated when rejoining the runner. #148 should have fixed this.

This issue is to ensure #148 worked.

RLBot_Core.dll source code?

AFAICT this is where the "magic" happens, but I can't find the source code. Did I just miss it, or is it deliberately omitted?

RLBot breaks if human players are not defined first in the cfg

In rlbot.cfg, you can define some players as 'human' (as opposed to rlbot, etc). Currently, all human players (and probably party_member_bots) MUST come before any other player types in the list. Otherwise, the indices will be messed up and all kinds of chaos happens.

This is probably because the game has a concept of a human index, and we do not keep it properly distinct from our own player indices.

Setting up the development environment

See https://github.com/drssoccer55/RLBot/wiki/Setup-Instructions

Install python 3.x (tested in 3.5.2 and 3.5.3) 64 bit
Download this repository
Download pyvjoy, put the repo file in your Python/Lib/site-packages
[Download and install the latest version of VJoy ]
(https://sourceforge.net/projects/vjoystick/files/latest/download)
Copy "vJoyInterface.dll" from your vjoy install folder into the pyvjoy folder
Install x360ce, 32bit
Run "configreVjoy" and make sure 2 devices are green, if not, switch to tab 2 and add it as a new device
Run vJoyList if you want to check the previous step, 2 rows should be active and by running p2join (or any of the p2 button presses) you should see a row 2 turn red on the vJoyList
Run x360 as administrator from the rocketleague binary directory, make sure 2 controllers are active
Run Rocket League (window mode is useful if you want to switch to that)
Create an exhibition match
On the team select screen, run p2join.py (or p2start + p2 press a) and tab back into the game to get into split screen/have a car join in
join the opposite team as yourself, but pause during the countdown to match start
Run runner.py and tab back into the game
Unpause

Why even bother with Cheat Engine and manual updating of addresses?

I know that this isn't really an issue but I don't know where else I should write this.
I just randomly found this project yesterday and after looking at this project I noticed that it seems to be using hardcoded addresses and offsets to read information from the game client.
However, doing this is absolutely not necessary!
Since Rocket League was made using the Unreal Engine 3, all the information about classes/structures of the game are available in the game client.
There is a very informative tutorial & source code about how to reverse the core structures of the game and then use that information to generate an SDK for the game here: https://www.unknowncheats.me/forum/unreal-engine-3-a/71911-thefeckless-ue3-sdk-generator.html

Since I already have those engine structures, I'm willed to share that information so this framework can be improved.

Check for locked files before attempting pip upgrade of rlbot

If somebody has rocket league open and the dll injected, upgrading the rlbot python package will fail because the dll is locked. It would probably also fail if the interface dll was in use.

The batch files which attempt to upgrade rlbot should check first to see if the files are locked, and if so, skip the update. There are multiple examples of such batch files, one is here: https://github.com/RLBot/RLBotPythonExample/blob/master/run.bat#L5

Possible way to check for locked files: https://www.dostips.com/forum/viewtopic.php?t=5542

To locate the rlbot install location, consider using get_python_root() from here: https://github.com/RLBot/RLBot/blob/v4/src/main/python/rlbot/utils/class_importer.py#L86

Addresses probably off (mega issue thread)

Since rocket league has updated several times I'm pretty sure the addresses for most variables have changed.

When attempting to train I would the error:
"OverflowError Python int too large for c Long"
when trying to read the z axis height of the ball and another variable

I verified in cheatengine that the current address for the ball z height no longer existed, or maybe I mistyped the offset.

Would love if you kept this updated, I wrote a mod for xbox.py so that I can take regular keyboard inputs again for training since I play on a keyboard.

Any plans for smarter bots?

This interesting reddit thread led me here and this repo looks very exciting!

I was just wondering what future direction you're thinking of for this project... Any plans for smarter (harder) bots?

Delay between input and output

Hi guys,

First of all, great work with this - I'm having great fun playing around with it.

I'm having one major problem at the moment though, which is the feedback loop of input from cheat engine and sending the controls back to the game takes too long to process. At first I thought this might be because of the processing I'm doing in between, but actually the AlwaysTowardsTheBall agent demonstrates this by the way it snakes quite a lot to correct itself from this delay.

My suspicion is that the delay is on receiving the input values from cheat engine, rather than sending the control inputs back. When I've debugged the code, the input parameters are saying I'm facing the ball, whereas what I'm seeing is that the car has already turned passed it.

Do you guys experience this? And if so, do you have any tips for trying to solve this?

Thanks,

Rick

Add a way to have extensions.

This will probably be a path in the config to a file that is run in the runner.py process.
Hooks:
End Game
Goal scored
Save occurred

Add flexibility to agent loading so agents can be stored outside RLBot folder / so bot makers can use gradle dependency on framework

Currently agent py files need to be placed somewhere inside the RLBot folder, otherwise # Path to module from runner in the agent's cfg file won't work

I don't like that situation because I want to put my bot in its own repository outside the RLBot folder, and not need to copy files over

I think @DomNomNom achieved that flexibility once, then it was broken, now I want to bring it back again. Dom's commit: 10e1e06

One of my constraints will be that v1 and v2 of a python bot should be easy to fight against each other without part of their imports conflicting

From Marvin:
About the pathing issue not sure if you're aware but it's not necessary to add the folder to sys path, you could use importlib spec to import from a path
You can check this commit for reference
RLMarvin@2ad7230
I was using two paths one for the agent and one for the cfg but if you assume they are in the same directory you can simply use one
This will make it possible to have the agent outside runner.py folder and fix imports with multiple agents having the same name

Provide the bot with full information about the game state.

There are a few minor things missing in the game_tick_packet which prevents bots from taking in a packet and determining the best play from just that packet. Currently it's impossible to predict whether setting bJump to true will cause the car to take action.

  • To be able to double-jump as late as possible, PlayerInfo should track how long the car has been in the air, for the purpose of determining whether we are close to the magic 1.5s timer.
  • To be able to double-jump as quickly as possible, PlayerInfo should track whether the jump input is currently being pressed. ie. we should not jump the frame after we jump as otherwise it'll look like the button is being held down to the game engine.

Counter argument to "This is giving the bot an advantage over humans":
Yes, but the current architecture already does give extra information which is not available to humans. eg. info about things that are not in the field of view and current velocities (not just positions).

I think this change should be done soon after this tournament round is over to provide the community with a stable API for most of a season.

Updates breaking this?

Hi,

First of all really neat idea ๐Ÿ˜„

I'm one of the devs behind alphaconsole and I saw that your currently using mem pointers for editing. Alphaconsole used to do that as well and every semi-large update changes all the pointers and would screw us up (Even some pointers for most people wouldn't work for a few select people). So do you have a special way of handling this or do you have to re-find all of the pointers for RLbot?

Reset shared memory agent input to 0 values on exit.

When RLBot crashes the agent will continue to use whatever inputs were last used before the crash because they are still filled in shared memory. This causes the agent to usually drive forward in circles and can be unclear that a crash has occurred. If we rest to 0, all agents will stop on crash / termination.

Having issues getting p2PressStart.py working.

Hi,

I am a very very novice coder (2 semesters of matlab) but i am trying to learn more and i thought this would be a perfect way to do so. But when i run p2PressStart.py in Thonny I get back an error stating

%cd 'C:\RLbot\Python'
%Run p2PressStart.py
Traceback (most recent call last):
File "C:\RLbot\Python\p2PressStart.py", line 1, in
import pyvjoy
ModuleNotFoundError: No module named 'pyvjoy'

But I dont know what I have done wrong. I have a pyvjoy folder with the address: C:\RLbot\Python\Python36-32\Lib\site-packages\pyvjoy

Any ideas on what could be causing this error?

Add a gradle build

This will download the protos from bintray (as a maven repo)
download the latest dll from bintray (idk what this will be)
install all required python libraries

an option to run runner.py
an option to run runner_GUI.py

Rendering methods should take in ctypes and FlatBuffers

The built-in rendering methods such as self.renderer.draw_line_3d should take in the ctypes Vector3 and the FlatBuffers type in addition to tuples/lists for the 3D location arguments.
This would make bot code much cleaner.

Externalize Event-detection API to benefit other projects

Hey guys,

this is an enhancement request. From what I can see, you have a powerful injector that can detect events inside Rocket League and make the game state available to outside programs. This state is, according to your wiki: https://github.com/RLBot/RLBot/wiki/Input-and-Output-Data-(current)#values-from-game. I assume this data is kept current.

Over at https://github.com/d-karl/Rocket-League-Chroma-Control, I have dormant code that was used to display Razer Chroma (RGB lighting) effects based on events happening within the game, such as goal scored, countdown etc. Example video of when it worked is here: https://www.youtube.com/watch?v=fZzJ_VMt-6U (countdown "go" effect is not final and was change later).

Long story short: event detection was broken when Psyonix adjusted the Unreal Engine logging output I was using to detect events. The data available via your framework would be stupifyingly useful for me, in that I could even detect boosting, which side scored a goal and much more.

Is there any way you guys could externalize this and make it available to me, or would I be allowed to use your injector (or code relating to it) for my purposes? What's the best way to do this? It would be neat if the injector could be built as a library, with an API for retrieving the current game state. I don't currently know if that is possible? Thanks guys.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.