Self Learning 3d Cars

Machine Learning / Artificial Intelligence / Genetic Algorithm (Source Code: GitHub link)

Loading

You can also scroll down (if curious).


Change the total amount of cpu cores:

(This will reload the page)


Source Code:

GitHub link


Camera controls?


Computer Keyboard

they arrows keys
they WASD keys (UK/US)
they ZQSD keys (FR)

Computer Mouse

click + drag

Touch Screen

touch + drag

Details


What are the white strips
on the circuit?


The checkpoints used to reward the cars.

All cars lose "health" value over time.

Any car with low "health" is discarded.

Any car being rewarded become "healthy".

This is visible as cars color will change.
from white/green colored to red colored.

What are the colored lines
on the leading car?


The car's sensors, it's "eye".

The sensors can hit the ground and the "walls".
it's the only inputs the cars uses.

it will affect the decisions:
to accelerate/decelerate.
to turn left/right.

What is the white line
below the leading car?


The car's "ground sensor".
It detect the checkpoints (for the rewards).

What are the white/grey lines
alongside the circuit?


The "skeleton" used to generate the circuit.

The circuit is made by interpolating the "skeleton".
it uses the BSpline method (degree: 3).

Technologies


this project was written in C++.

the web version was compiled to WebAssembly.
the source code of the native build is reused.
it relies on emscripten (clang based compiler).

it uses "Bullet Physics"
(bullet3) for the physic.

it uses a homemade
rendering engine.

native build:
rely on OpenGL-ES3.

WebAssembly build:
is translated to WebGL2.

it uses a homemade
machine learning library.
very basic fixed
topology genetic algorithm.

it is composed of 3 builds:

build 1:
native build.

multithreading for parallel computing (pthread).

build 2A:
WebAssembly build (#1).

multithreading for parallel computing (pthread).
only when the server and browser allows it.

build 2B:
WebAssembly build (#2).

web-workers for parallel computing.
as a fallback when build 2A is unavailable.

it was built on a Linux OS.


Note

The 'success' of this simulation is quite random,
which means that sometime
you might want to reload this page
and hope for a better result.


Thank you for watching!