Skip to content

MATHEMA-GmbH/Owl-Racer-AI

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

34 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Logo

Owl Racer

Get Conected



Table of Contents

Introduction

This repository serves as the head repo for the Owl Racer AI project. The goal of this project is to play around and work with an AI using a simple racing game framework. It is intended for students, colleagues and enthusiasts who want to get started with machine learning or try out their own models.

Architecture

The Owl Racer project consists of two major parts: First is the server, whose purpose is to control all the aspects of the racing game without providing an UI. It holds all the required information, about the track, the race cars, in which direction they are driving etc. Further there is a dedicated UI implementation in Monogame. Then there are clients which can be used to control the cars on the server by sending commands like "Please rotate the car now" or querying data like "How far is it to the next wall on my righthand-side?".

The communication between server and clients is realized using (Web-)gRPC which allows fast IPC (Inter-Process-Communication) between process- and machine boundaries. This way, the server can run on a separate and faster machine, serving multiple clients at once. The client on the other hand can virtually be anything (gRPC/protobuf is supported on a good amount of platforms and languages). This repository contains a UI client to enable the user to watch what is actually happening with his car on the client and even control it with the cursor keys.

Usually clients want to be more low-key though, like console-based AI trainers written in Python e.g. Check the MATHEMA GitHub for more supported languages.

To support pre-computed machine learning models the clients maintained by MATHEMA provide ONNX interfaces.

Architecture Overview

Server

The server is the central part of the project, calculating the outcome of the commands sent by the clients, keeping everything synchronized and providing services for controlling the racing game overall. The communication between the Server and Clients is performed using (Web-)gRPC.

For more details on the component, visit its documentation here.

The server itself is ASP.NET Core based, which means it is able to host the Web-Client directly within its process space.

Common Library

The common library contains shared models and classes for easier data exchange between the UI client and the server, as they reside within the same Visual Studio solution. This project is built and used by the other .NET projects directly.

Local UI Client

The UI client is a visual test and sandbox client implemented with the MonoGame Framework. MonoGame is based on Microsofts XNA Framework and enables fast and lightweight 2D rendering perfectly suited for the purpose of showing the user what is going on during machine learning. It also enables the users to drive a car themselves and even compete against AI.

Note however, that the UI client is merely a tool to give developers a visual representation to make analysis easier (ok, and to incorporate some fun into the project ^^). The focus still relies on the machine learning clients doing the actually interesting stuff.

The communication between the UI client and the server is realized using a (Web-)gRPC channel.

For more details on the component, visit its documentation here.

Machine Learning Algorithm

This component represents virtually any client that connects to the server via (Web-)gRPC with the intent to train an AI model to drive the car around the track.

Any language and implementation can be used that supports gRPC and allows nearly any developer interested in machine learning to start implementing their own algorithms.

Currently there are sample algorithms available, written in Python.

Setup for local development

If you want to develop directly on the project, the following requirements must be met.

.NET Projects

The .NET projects include the server, the common library, the UI client and the ML.NET model loader

  • .NET 5 SDK or later (server, UI client, common libraries)
  • .NET 3 Framework (for UI client)
  • Visual Studio 2019 or later
  • A protobuf compiler (can be installed with Visual Studio)
  • Git Bash

The main Visual Studio solution containing the project you need will be build with the setup.sh. This way your project contains the repositories you need

For Windows install with the PowerShell . .\setup.sh

If all requirements above are met, the solution should build without any further setup or problems.

There are currently two standard configurations for the solution, DEBUG and RELEASE. Apart from some more verbose console output and the usual facts about DEBUG and RELEASE builds, the configuration you use will not matter that much at the moment.

When starting the projects, the server should always be started first, for any other client you want to use. It is recommended to setup multiple startup-projecsts in the solution settings, having the server start before the client, to make things easier.

For execution of the different clients you need to edit the file paths in Matlabs.OwlRacer.GameClient\appsettings.json We provide you some examples in Matlabs.OwlRacer.GameClient\appsettings_examples.json

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published