Inspiration

We really like the idea of self-driving car in a simulation game environment. So we thought, let's make a full stack application with multiplayer and a database to store the score. Essentially a online multiplayer training environment with changeable AI neural network parameters and evironment parameters.

Features

  • Telegraf notification
  • Chat window in multiplayer
  • Tweakable environmental variables like lane count and neural network variables for training
  • Multiplayer with rooms using socket.IO
  • Authentication with JWT
  • Leaderboard with highest score

What it does

It allows users to train their AI then use it to battle in a multiplayer setting. Players can then select rooms to join and then battle their AI and the scores will be broadcasted through telegraf and leaderboard on the home page.

Challenges we ran into

PyTorch integration to node.JS. We have successfully integrated PyTorch neural network into node.JS using standard IO but due to the lack of time, we couldn't train an agent that does anything meaningful. Moreover, the approach of using node.JS to spawn a Python process then pass data to it using standard IO might not be the best approach. There are better approaches out there.

The approach of randomly generating an AI does not actually train the AI to be able to respond to every single case. Because when we mutate an agent, we cannot choose which part of the neural net to keep and which to change since an agent might do well at say dodging cars on the left and right but terrible when there is a car in front of it. For such cases we could use neural net meshing to mesh 2 neural networks together where 1 does really well in one thing and the other does really well in something else. But due to the lack of time, we couldn't figure it out in time. We could technically linked both of their output together or linked it into another hidden layer before outputting.

Accomplishments that we're proud of

We manage to integrate quite a number of features into this app within what little time we had and finished it.

What we learned

Randomization with neural evolution is hard in the sense that we are unable to choose which exact weights and biases to tweak.

What's next for 2D Multiplayer Self Driving Playground

Implement a better AI using PyTorch or TensorJS.

WARNING

Do not check the PyTorch controller unless you set up the environment with PyTorch installed and you also need to uncomment the Python process spawning in the socket index.js. Otherwise it will crash the entire server.

Built With

Share this project:

Updates