Code Monkey home page Code Monkey logo

rlbotgui'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

rlbotgui's People

Contributors

arik avatar azeemba avatar darxeal avatar ddthj avatar domnomnom avatar enterprisey avatar iameld3st avatar impossibum avatar joshydevrl avatar l0laapk3 avatar niceastvillage avatar rivques avatar rlmarvin avatar robbai avatar savagesnowgoose avatar swz-git avatar tangilj avatar tarehart avatar viliamvadocz avatar virxec 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

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

rlbotgui's Issues

The created python bot isn't set up properly for testing

When clicking the 'start a new bot', it downloads some files, and does some filename-mangling, but one is missed.

When generating bot 'test', the file test/training/hello_world_training.py in make_match_config_with_my_bot should not use 'python_example' / 'python_example.cfg' as path, but 'generated_name' / 'generated_name.cfg'

Consistent python style

As mentioned in comments of #26

There are a few things that might be good to have consistent code style for. This issue is for discussing which code style we should have and how we best achieve this.

[Dumb Question] Does RLBotGui auto updates itself ? Also, does it fetch bots new version ?

Hello,

This may seem like a dumb question, but I haven't found the answer anywhere. I don't see a version number on RLBOTGui, and don't see a version number for a specific bot (let's say Nexto).

So my question is : if I installed RLBOTGUI 6 month ago, am I playing the version of Nexto from 6 month ago ? Does it auto update ?

Thank you in advance for clarifying this. ☮️

Latest RLBotGUI does not work on fresh install

I downloaded RLBot from the "Download RLBot for Windows" link on rlbot.org, and installed it with the default settings. It's the first time I've ever installed it on this machine.

Upon launching it, I get an error message saying "It looks like a recent change to RLBotGUI broke things for you, sorry! Very old versions are not able to auto-upgrade anymore, please check out our upgrade instructions to fix this."

The upgrade instructions page says that users need to download RLBotGUI from rlbot.org, and that the new RLBotGUI uses a launcher, and not an installer, but the latest release offered here and on the website, the .msi file, is an installer. I uninstalled and re-installed. Didn't fix anything.

The .exe file fails in the same way if RLBotGUI is installed.

If RLBotGUI is not installed, running the .exe file fails with an error message saying there's "No Python in %AppData%\Local\RLBotGUIX\Python37\python.exe"

I'm running Windows 10.

Is there something I'm missing? Is there supposed to be a launcher somewhere?

Fix ping command in installer

We use the ping command in a batch script to check if the user has an internet connection before installing/upgrading RLBot. Some users do not have ping installed on their machines, so RLBot fails to run for them.

Replace the ping command in the batch script with a Python script or tiny executable to check for an internet connection and install/upgrade RLBot.

ping -n 1 google.com > nul

ModuleNotFoundError: No module named 'rlbot_gui'

Checking for conenction to pypi.org...

It looks like either you or PyPi is offline, skipping package upgrades.
If this is your first time running RLBotGUI, an internet connection is required to properly install!

Launching RLBotGUIX!
Traceback (most recent call last):
File "", line 1, in
ModuleNotFoundError: No module named 'rlbot_gui'
Press any key to continue . . .

Why does this happen?

ConnectionAbortedError on linux

Hi,
I'm having trouble getting it to work on linux. I constantly get the following error:

Traceback (most recent call last):
  File "src/gevent/greenlet.py", line 906, in gevent._gevent_cgreenlet.Greenlet.run
  File "/home/username/.RLBotGUI/env/lib/python3.7/site-packages/rlbot_gui/match_runner/match_runner.py", line 222, in start_match_helper
    setup_match(sm , match_config, launcher_prefs)
  File "/home/username/.RLBotGUI/env/lib/python3.7/site-packages/rlbot_gui/match_runner/match_runner.py", line 180, in setup_match
    do_setup()
  File "/home/username/.RLBotGUI/env/lib/python3.7/site-packages/rlbot_gui/match_runner/match_runner.py", line 158, in do_setup
    setup_manager.start_match()
  File "/home/username/.RLBotGUI/env/lib/python3.7/site-packages/rlbot/setup_manager.py", line 557, in start_match
    self.game_interface.start_match()
  File "/home/username/.RLBotGUI/env/lib/python3.7/site-packages/rlbot/utils/structures/game_interface.py", line 201, in start_match
    socket_relay.connect_and_run(False, False, False)
  File "/home/username/.RLBotGUI/env/lib/python3.7/site-packages/rlbot/socket/socket_manager.py", line 116, in connect_and_run
    self.socket.connect(('127.0.0.1', 23234))
ConnectionAbortedError: [Errno 103] Software caused connection abort
2021-06-18T21:20:54Z <Greenlet at 0x7f1cfdc12830: start_match_helper([{'name': 'Psyonix Allstar', 'team': 0, 'type': 'p, {'map': 'DFHStadium', 'game_mode': 'Soccer', 'skip, RocketLeagueLauncherPreference(preferred_launcher=)> failed with ConnectionAbortedError

I have tried both on a desktop and a laptop, with similar specifications, i.e.: Ubuntu 20.04.2, kernel 5.4.0-74-generic and 5.8.0-55-generic, nvidia 460.80.

Steam and rocket league work great.

I have tried the following:

  • Reinstalling both steam and rocket league
  • Reinstalling RLBotGUI
  • With steam play compatibility on & off (mainly off, since as I read in discord the linux native version must be running)
  • I have also tried on a VM with Windows 10, but I couldn't make it play there either because it couldn't find the game. But I prefer to make it play on linux, since in the VM the graphics card cannot be utilized and it is laggy.

Pleasy any help would be appreciated.

Virus?

I use RLBot for a month already i think and now when i tried to open it Windows Defender said that this is a virus. I don't remember what was it (it already got deleted) but i think it was some type of a "Trojan.(something that starts with a v)". Now im scared to download it again. Did someone hack RLBot and made a virus update? Or how did this happen? Does anyone else have this issue?

installer doesn't open -Search for app in the store?

whenever I run the rlbotgui installer (.exe or .msi), it tells me to search for an app in the store and doesn't let me run it no matter what I try to do, I've tried to run other installers (example: Hamachi VPN) and they have worked fine
image
any ideas or recommendations on what I should do?

Redesign of Player Types card

After few conversations on Discord, me and @Darxeal came up with an update that fixes the cluttered Player Type card. I will try to explain what is the plan.

  • Move scripts to a separate modal
  • Add gamemode filtering
  • Add gamemode subfilters
  • Change behaviour of Human tile
  • Rename card to Bots

Here is some examples of how the card could look with the changes:
image
image

We also discussed specifics on how should some of these changes work.


Card content changes:

All should work the same way as the card worked, except not include scripts.
Standard should include only bots that indicate they support standard in their config files.
Extra Modes should only show bots made for specific gamemode based on what subfilter is selected.
Other should show other bots, like memebots or script specific bots.

The Bots for scripts subfilter should show bots compatible with one or more of the currently selected scripts. The card should switch to Bots for scripts subfilter automatically if user exits the Scripts modal and atleast one script is enabled. If there is no script enabled and user switches to this subfilter, it should show info/warning message in place where the bot tiles would normally be.

All bots that dont have any category flags in their config will be shown in All gamemode only, as we don't know what that bot supports.


Human tile behaviour changes:

There should only exist one Human tile. It could on first run of gui be automatically put in Blue team. If Human tile is removed from a team it should be put back into the bot list. It should also be shown in all gamemodes and subfilters.


Optional quality of life changes:

Remove Recommendations button as it adds clutter and it looks like nobody is using it. Gamemodes/Subfilters should give a similar benefit.
Add scrolling feature as mentioned in #84.

Enabled scripts are hidden when user does not have that tab open

Now that we have tabs/tags, the currently enabled scripts should be always be shown. In this screenshot, SideSwipe is enabled, but I have no idea unless I go to the correct tab:

billede

I suggest we add a box above/below the teams with the names of enaled scripts. Each script should also have a button with a cross icon which disables the script, without needed to go to right tab.

"QSettings has been deleted" error when loading new bot folder

Any operation that tries to persist new folder settings seems to result in this:

RuntimeError: wrapped C/C++ object of type QSettings has been deleted
2019-12-30T19:27:44Z <Greenlet at 0x2923b380d08: _process_message({'call': 8.128005035388185, 'name': 'pick_bot_fold, <geventwebsocket.websocket.WebSocket object at 0x0)> failed with RuntimeError

The folder settings fail to persist, and also the appropriate bots tend not to load into the GUI. Workaround is to go to the folder settings window after you get this error and click the "Apply" button without changing anything. That should at least load the bots, but you still can't persist the change for next time you open the GUI unfortunately.

QSettings is part of PyQt5, and this functionality may have broken due to an auto-upgrade of that dependency.

RLBot with Cracked RocketLeague ?

RLBotGUI.exe is designed to run RocketLeague via Steam. Is there a way to make it run the actual RocketLeague.exe so that people having cracked version can make use of this software too ?

I have tried to make a shortcut of RocketLeague.exe with Target:

"D:\Games\Rocket League\Binaries\Win64\RocketLeague.exe" {'RLBot_ControllerURL=127.0.0.1:[0-9]+','-rlbot'}
"D:\Games\Rocket League\Binaries\Win64\RocketLeague.exe" -RLBot_ControllerURL=127.0.0.1:[0-9]+ -rlbot
"D:\Games\Rocket League\Binaries\Win64\RocketLeague.exe" RLBot_ControllerURL=127.0.0.1:[0-9]+ -rlbot

But every time I try to start a match, it gives error:

RLBot.exe trying to connect to Rocket League on port 23233...
Traceback (most recent call last):
  File "C:\Users\*****\AppData\Local\RLBotGUIX\venv\lib\site-packages\rlbot\setup_manager.py", line 138, in is_rocket_league_running
    ROCKET_LEAGUE_PROCESS_INFO.REQUIRED_ARGS)
  File "C:\Users\*****\AppData\Local\RLBotGUIX\venv\lib\site-packages\rlbot\utils\process_configuration.py", line 117, in is_process_running
    raise WrongProcessArgs(f"{program} is not running with required arguments: {required_args}!")
rlbot.utils.process_configuration.WrongProcessArgs: RocketLeague.exe is not running with required arguments: {'RLBot_ControllerURL=127.0.0.1:[0-9]+', '-rlbot'}!
 
During handling of the above exception, another exception occurred:
 
Traceback (most recent call last):
  File "src\\gevent\\greenlet.py", line 854, in gevent._gevent_cgreenlet.Greenlet.run
  File "C:\Users\*****\AppData\Local\RLBotGUIX\venv\lib\site-packages\rlbot_gui\match_runner\match_runner.py", line 172, in start_match_helper
    sm.connect_to_game()
  File "C:\Users\*****\AppData\Local\RLBotGUIX\venv\lib\site-packages\rlbot\setup_manager.py", line 170, in connect_to_game
    elif not self.is_rocket_league_running(port):
  File "C:\Users\*****\AppData\Local\RLBotGUIX\venv\lib\site-packages\rlbot\setup_manager.py", line 147, in is_rocket_league_running
    raise Exception(f"Rocket League is not running with {ROCKET_LEAGUE_PROCESS_INFO.REQUIRED_ARGS}!\n"
Exception: Rocket League is not running with {'RLBot_ControllerURL=127.0.0.1:[0-9]+', '-rlbot'}!
Please close Rocket League and let us start it for you instead!
2020-08-08T13:39:09Z <Greenlet at 0x20860316e18: start_match_helper([{'name': 'Human', 'team': 0, 'type': 'human', 'sk, {'map': 'DFHStadium', 'game_mode': 'Soccer', 'skip)> failed with Exception

Full Logs: https://pastebin.com/KchJunB9

Is there a way to make it run RocketLeague.exe directly ?

Dom's first experience with this GUI

First of all, great job! GUI looks slick and I was able to setup a match with Python bots from the RLBotPack quickly.

Here's a list of things that could be improved, in the order of importance (to me):

The RLBotPack disappears between launches. (note: I've used a custom install directory)
I need to redownload every time even though the RLBotPack folder is within the RLBotGUI folder.

Problems relating to Java. As a first time user, I expect that I can follow the installation instructions of RLBotGUI and run every bot in RLBotPack. I can not run AirBud. I get 'java' is not recognized as an internal or external command, operable program or batch file. in the console window that's launched alongside the GUI when I launch.
I'm no java expert but there's different versions of Java and different bots might require different ones?
If we detect that java is missing, the GUI should give a pointer to where to install it. Maybe only do this once a user tries to use a Java bot by adding it into a team. Maybe the provider of the bot should set a special_instalation_instructions as part of the details which we show on first import?
Also, does Java need/have an equivalent of virtualenv?

Currently I need to close both the cmd window and the GUI window.
I want to only close one window, the other window should close with it.
This PR should help: tarehart#1

I can't pin RLBotGUI to the windows taskbar. I think using a shortcut like this would work:
Target: %windir%\system32\cmd.exe /C start /B "" "%CD%\install-and-run.bat"
Start In: C:\Users\RLBot\Documents\RLBotGUI <-- RLBotGUI install folder
This also gives the command prompt window a different task bar icon to the default shell which is nice when I want to also have a shell open to develop my bot.

Note: I can't seem to create issues on tareharts fork. Not sure why not

Left-clicking on a bot puts it on the blue team. Right-clicking on it should put it on the orange team. (note: you can still do you electron inspect devtools on it by using ctrl-shift-c)

The introduction video does not cover that it'll take 1-2 minutes to download dependencies.
Note: you can ship the dependencies you want as wheel files and then install them in your virtualenv
https://medium.com/@amimahloof/how-to-package-a-python-project-with-all-of-its-dependencies-for-offline-install-7eb240b27418

The introduction video does not sufficiently explain what the console window is for. Something short like this would suffice I think "You can see what it is doing behind the scenes here. If a bot has problems, it'll show up here."
Optional, or as a separate video: Teach the viewer basic bug triage: where/how to report errors. How to copy in cmd is not obvious.

Btw, big thanks for using virtualenv, keeps things clean! :D

Pin gevent version

Users see a gevent related issue if they do not have a C++ redistributable installed. We need to pin gevent to less than v22 so that users do not have to deal with this issue.

See #216, #218, and RLBot/gui-installer#2.

"Show Files" button in GUI doesn't work on Linux

in gui.py line 493, the line

subprocess.Popen(f'explorer "{directory}"')

gave me this error:

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/usr/lib/python3.8/subprocess.py", line 854, in __init__
    self._execute_child(args, executable, preexec_fn, close_fds,
  File "/usr/lib/python3.8/subprocess.py", line 1702, in _execute_child
    raise child_exception_type(errno_num, err_msg, err_filename)
FileNotFoundError: [Errno 2] No such file or directory: 'explorer ~/.RLBotGUI/MyBots/tombot/src/"'

I changed it to this line on my machine:

subprocess.Popen(['nautilus', directory], stdout=subprocess.PIPE)

and that worked.

Add functionality to set logo in the appearance editor

Show a preview of the bot's current logo and an edit button next to it. When the edit button is clicked, just open a file chooser and copy the selected png to the bot's folder and name it logo.png. There should be a some text saying 400x300 is the recommended size.

Bootstrap GUI suggestions

These are originally from my notes in #85

  • Highlight stays after removing a bot if another one moves to fill the space
    image

  • Similar highlight bug when you decline to install the missing packages on a bot or script
    image

  • Strange colouring on the orange radio button when selected
    image

  • Highlighting field when clicking on label in the appearance editor (this is apparently intended?)
    image

New solution to get item ids for the appearance editor

Our current solution relies on fetching a json file from the AlphaConsole github: https://github.com/RLBot/RLBotGUI/blob/master/rlbot_gui/gui/appearance-editor.vue#L162

https://raw.githubusercontent.com/AlphaConsole/AlphaConsoleElectron/public/items.json

Unfortunately this file is not getting updated anymore since AlphaConsole is deprecated.

We need an alternative. Bakkes has helpfully pointed out that the BakkesMod console command dumpitems will create a csv file with all the items. Suggested solution:

  • Make a script to convert the csv file into a json file with the same format that AlphaConsole used
  • Do the dump, run the script, and add the json file inside RLBotGUI
  • Somebody would need to redo the dump every season

No permission

Every time I try to download Rlbot GUI it gives me an error. Windows cannot access the specified path, device or file. You may not have the appropriate permissions. That is what the error says. Can someone please help?

Folder Settings behaviour and scaling problems

A scrollbar should be added to the Folder Settings popup. The X buttons can also go off screen if the paths are very long. When the window is rescaled up the buttons appear, but when there are many paths, this won't suffice.

billede

Another problem I noticed with the Folder Settings is, that I can toggle some paths and close it - and it will remember that those, but not apply them. I think it would be better if a popup said "Apply changes?" when closed with unapplied changes, and then it should apply or undo based on the users choice.

Can't set installation directory

I am using epic games to play rocket league. I changed my drive's letter a few months back and RLBotGui is trying to launch RL by the old drive letter, epic games uses the correct drive letter but RLBotGui won't detect the correct installation. I can't find any option to manually set the install directory and didn't find any help in the RLBot discord or this github.

An option to set the directory would be helpful to resolve this issue. If it already exists could someone let me know how to access it?

File "<string>", line 1, <module> ModuleNotFoundError: No module named ' rlbot_gui '

Please help this is what it says
Checking for connection to pypi.org. . .
Connected - Installing / upgrading RLBot components . . .
C : \Users\tyler\ AppData\Local\RLBotGUIX\Python37\python.exe : no module named pip
The system cannot find the path specified.
The system cannot find the path specified.
The system cannot find the path specified.
Launching RLBotGUIX!
Traceback (most recent call last) :
File "", line 1, ModuleNotFoundError: No module named ' rlbot_gui '

Can't create new bots to a different drive than $tmp

Log by @badplayz in discord:

Traceback (most recent call last):
  File "src\gevent\greenlet.py", line 766, in gevent._greenlet.Greenlet.run
  File "D:\Games\RlBot\pkgs\eel__init__.py", line 199, in _process_message
    return_val = _exposed_functions[message['name']](*message['args'])
  File "D:\Games\RlBot\Python\lib\site-packages\rlbot_gui\gui.py", line 233, in begin_python_bot
    config_file = bootstrap_python_bot(bot_name, bot_directory)
  File "D:\Games\RlBot\Python\lib\site-packages\rlbot_gui\bot_management\bot_creation.py", line 36, in bootstrap_python_bot
    os.rename(f"{tmpdirname}/RLBotPythonExample-master", f"{bot_directory}/{sanitized_name}")
OSError: [WinError 17] Das System kann die Datei nicht auf ein anderes Laufwerk verschieben: 'C:\Users\Main\AppData\Local\Temp\tmpkrlsijfz/RLBotPythonExample-master' -> './TestBot'
2019-03-02T21:35:53Z <Greenlet at 0x22a49961e18: _process_message({'call': 5.162969103343832, 'name': 'beginpython, <geventwebsocket.websocket.WebSocket object at 0x0)> failed with OSError

bot_creation.py os.rename() seems to be the culprit and we should use shutil.move() instead. See: https://stackoverflow.com/questions/21116510

While you're at it, I'd suggest moving to pathlib.Path rather than string-formatting paths.

Switch out CPython for PyPy

How fast is PyPy?

image

Plot 1: The above plot represents PyPy trunk (with JIT) benchmark times normalized to CPython. Smaller is better.

It depends greatly on the type of task being performed. The geometric average of all benchmarks is 0.13 or 7.6 times faster than CPython

How has PyPy performance evolved over time?

image
Plot 2: Speedup compared to CPython, using the inverse of the geometric average of normalized times, out of 25 benchmarks (see paper on why the geometric mean is better for normalized results).

(source: speed.pypy.org)


Although these sources are for Python 2.7, these improvements continue even today, as shown in this repository: tonybaloney/performance_testing (smaller is better)

As shown, all the tasks RLBot needs have a better score than CPython, as File I/O seems to be the only issue we get, which should barely happen during an RLBot match (only reading configs on launch could be about a second slower with 50+ bots)

The only con is that so far pypy only supports up to 3.6, so bots using the annotations future import or using code compiled solely for cpython (which can easily be recompiled) will not work.

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.