Code Monkey home page Code Monkey logo

acrl's Introduction

ACRL: Assetto Corsa Reinforcement Learning

Description

A Python project that uses the SAC algorithm to learn to drive autonomously in the racing simulator game Assetto Corsa through Reinforcement Learning.

This project is the bachelor assignment of Jurre de Ruiter (s2580160), Technical Computer Science student at the University of Twente.

Project overview

The project consists of two main components:

  1. The Assetto Corsa app (ACRL/), which is a Python script that runs inside Assetto Corsa and communicates real-time data with the Python project outside of Assetto Corsa.
  2. The standalone Python project (standalone/), which is a Python script that runs outside of Assetto Corsa and uses the real-time data from the Assetto Corsa app to train a model using the SAC algorithm. It sends the model's actions back to the Assetto Corsa app through a virtual controller from vgamepad.

Getting started

  1. Purchase and install Assetto Corsa on Steam, and download the free Content Manager extension software.
  2. Clone this repository to your local machine. (See here for instructions on how to clone a repository.
  3. Download and install the Microsoft Visual C++ 2015-2019 Redistributable from here.
  4. Download and install the Microsoft Messaging Passing Interface standard (MS-MPI) v10.1.3 here.
  5. Getting the Assetto Corsa app working:
    • Install the Python 3.3.5 interpreter. This is what Assetto Corsa uses and we need this locally for the socket import to not throw errors in AC.
    • Copy the ACRL folder to the apps/python folder in your Assetto Corsa installation directory. (e.g. C:\Program Files (x86)\Steam\steamapps\common\assettocorsa\apps\python)
    • Run Assetto Corsa and enable the ACRL app in the General tab of the Settings menu. (You can also enable it through the Content Manager settings, or in the Custom Shaders Patch tab if you have CSP installed).
  6. Getting the standalone Python project working:
    • Install a modern Python interpreter (tested on: Python 3.10.11). This is what we use for the part of the project that runs outside of AC. Make sure to add Python to your PATH environment variable.
    • Install the required Python packages by running pip install -r requirements.txt in the root of the /standalone directory.
  7. Set up a new session in Assetto Corsa through Content Manager:
    • Select Practice Mode and choose track "Silverstone 1967" and car "Ferrari 458 GT2"
    • Confirm tires are the default option
    • Set the number of AI opponents to 0
    • Turn on penalties and ideal conditions
    • Limit the framerate to 30 FPS
    • Set controls to Gamepad, with speed sensitivity set to 0, steering speed set to 100%, steering gamma set to 100%, and steering filter set to 0%
  8. Start the session and wait for the car to spawn on the track. Make sure automatic gear switching is enabled (ctrl + G).
  9. Change directory using cd standalone, and run the standalone/main.py file to start listening for an incoming connection from Assetto Corsa.
  10. Start training by clicking the Start Training button in the ACRL app window in Assetto Corsa. The car should start driving around the track and the model should start training. You can monitor the training progress in the console window where you started the main.py script.

acrl's People

Contributors

jurredr avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

Forkers

frakkerman

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.