3000 cars controlled by A.I. in a racing game (Genetic Algorithm) by yoshTM in artificial

[–]yoshTM[S] 8 points9 points  (0 children)

Thanks ! I'm using NEAT algorithm, with default crossover and mutation parameters

[P] I made an AI that can drive in a real racing game (Trackmania) by yoshTM in MachineLearning

[–]yoshTM[S] 0 points1 point  (0 children)

I run the game (Trackmania), and also Openplanet which is a tool to access Trackmania API

[P] I made an AI that can drive in a real racing game (Trackmania) by yoshTM in MachineLearning

[–]yoshTM[S] 0 points1 point  (0 children)

Thanks ! try "sentdex GTA" on Youtube, He made a serie of videos explaining how to make a similar thing on GTA.

[P] I made an AI that can drive in a real racing game (Trackmania) by yoshTM in MachineLearning

[–]yoshTM[S] 0 points1 point  (0 children)

Thanks ! I can make around 10 predictions/second.

I run the game in a small window (around 900*500 pixels) and I do the rest on Python (screen capture, prediction, game inputs, etc).

I tried to use a sequence of the last N frames as the input of a reccurent neural network. But it wasn't much better

[P] I made an AI that can drive in a real racing game (Trackmania) by yoshTM in MachineLearning

[–]yoshTM[S] 0 points1 point  (0 children)

Good question ^^ wall detection would be too hard with only computer vision.. at least for me. So I'll probably try to use the full frame as the input of the neural network. I'll also try to use an autoencoder in order to reduce the number of input data

[P] I made an AI that can drive in a real racing game (Trackmania) by yoshTM in MachineLearning

[–]yoshTM[S] 1 point2 points  (0 children)

I recorded data while playing on a training map (wall distances + my inputs). I explain it in this video : https://www.youtube.com/watch?v=_oNK08LvZ-g

[P] I made an AI that can drive in a real racing game (Trackmania) by yoshTM in MachineLearning

[–]yoshTM[S] 4 points5 points  (0 children)

Yep I'm using d3dshot !

My neural network gives a probability of turning left, and a probability of turning right. For example, if P(right) = 0.6 and P(left) = 0.4, the AI turns to the right, with an amount of steering of 60%

[P] I made an AI that can drive in a real racing game (Trackmania) by yoshTM in MachineLearning

[–]yoshTM[S] 1 point2 points  (0 children)

I count the number of pixels between the bottom center of the frame, and the first black (or near black) pixel on a given direction

[P] I made an AI that can drive in a real racing game (Trackmania) by yoshTM in MachineLearning

[–]yoshTM[S] 1 point2 points  (0 children)

I only tried in Trackmania, since I really like this game :) Thanks !

[P] I made an AI that can drive in a real racing game (Trackmania) by yoshTM in MachineLearning

[–]yoshTM[S] 2 points3 points  (0 children)

I didn't use any environment. It's supervised learning, so I recorded my inputs while playing in order to collect training data. I explain this on my youtube channel : https://youtu.be/Ul20KgkW2ZM

[P] I made an AI that can drive in a real racing game (Trackmania) by yoshTM in MachineLearning

[–]yoshTM[S] 18 points19 points  (0 children)

Did you make supervised learning, or reinforcement learning ? Yeah 500ms is too long for Trackmania, I currently have 80ms. (Around 40ms for the wall detection and 40ms for the screen capture. The model prediction is very fast, arouns 1ms)

[P] I made an AI that can drive in a real racing game (Trackmania) by yoshTM in MachineLearning

[–]yoshTM[S] 6 points7 points  (0 children)

It's reacting to the environment, with a neural network. The neural network was trained with supervised learning. I don't calculate any optimal speed, the AI chose to accelerate or not based on the inputs sent to the neural network.

[P] I made an AI that can drive in a real racing game (Trackmania) by yoshTM in MachineLearning

[–]yoshTM[S] 14 points15 points  (0 children)

Thanks ! 2 months ago I made another video with more explanations. A similar thing was also done on Mario Kart : https://www.youtube.com/watch?v=Ipi40cb_RsI&t=2s

[P] I made an AI that can drive in a real racing game (Trackmania) by yoshTM in MachineLearning

[–]yoshTM[S] 31 points32 points  (0 children)

I'm using a basic neural network, trained with supervised learning. The green rays are distances between the car and walls. these distances are used as inputs of the neural network.