Giter VIP home page Giter VIP logo

carbrains's Introduction

Car Brains

Car brains is a toy game where you train cars to drive around a track using neural networks and genetic algorithms. Right now, it only works on Windows. It's not very useful, but can be pretty fun to watch.

Playing

When you first start it, the game creates a configuration file under

C:\Users\{YourName}\Documents\CarBrains\config\default-config.json

Copy that file and edit it to your delight. The config contains settings controlling how the neural networks are constructed and how the genetic algorithm operates. Please do not edit the default config, as any changes will get lost after the game is restarted.

Once you are satisfied with your config, click Refresh and generate a population of cars from it. Next create some track for them to drive around, and then proceed to the training window. There, you can watch your cars fail to finish a simple track for countless hours.

Technology

The neural networks and genetic algorithm are written in Rust and reside in the brains folder. After compiling, move the DLL into game/Assets/Plugins to make it available in Unity. This requires a restart of the engine.

The Rust code interacts with the Unity frontend via a manually written C API. Because I am too lazy to replicate structs from Rust in C#, I use JSON files to pass around information wherever performance is of no concern.

carbrains's People

Contributors

1hporange avatar

Stargazers

 avatar  avatar

Watchers

 avatar

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.