Summary of the Project
Open_Ai_Gym_Autobahn_Auffahren is a project that makes it possible for a python-agent to play a godot game.
This project shows an example for that with a car trying to enter a highway.
It has a complete Godot-Enviroment with an example bot in python.\
Installation Tutorial
Godot
First you need to install Godot on your Computer.
You can find the Link here.
Python
Here is one way to install Python on your PC.
You also need the following packages: websockets, Pillow.
Please notice that the websockets package is not supportet in Spyder Enviroment.
Repository
Download all the files to convinient folder.
Setup
There are a few variables you can change in Godot You can open the script by clicking the script-button as shown in the screenshot:
World
The variables are found in lines 39-41.
- human_player: If set to true, you can drive with wasd and brake with space. Otherwise the Godot-server waits for a client to connect.
- learn_with_images: In addition to the other information Godot also returns a 60x80 screenshot of the game in every step, if set to true.
- show_game: If set to false, it won't render the game, but still sends all the information to the client.
Car
The variables are found in lines 5-8.
- brake_str: Can be used to reduce the brake-strength of the car.
- NUMBER_OF_SENSORS: Determines the number of sensors around the car (Always start at the front and goes clockwise).
- max_range_sensor: Range of the sensors in pixels (by default ~31 m (1 m = 32 pixels))
- range_per_step_sensor: Accuracy of the sensors in pixels (by default ~0.31 m (1 m = 32 pixels))
Running the Project
Godot
- Start Godot
- Click Scan to add a new project and select the root folder of the downloaded files
- Now doubleclick the project
- Run the Project by pressing F5
Python
- After starting the Project in Godot you can run your own Python programm or the example progamm (main_test) from the files
- Open the command-console
- Type "cd (your rootfolder)/"
- To run the example code type "python main_test.py"
Created by Midras Lappe and Theo Brockmann