Discord
Login
Community
DARK THEME

Anyone got some simple games for an AI to play?

I've just finished making a new neural network evolution simulation, this time with a much more advanced algorithm. However, I'm struggling to think of a good game to test it on, since there are some reasonably specific criteria for the AI to be able to learn a game in a reasonable time period (more details in the project description at https://microstudio.dev/i/Apples9/megabigbrainman/). Basically, there have to be simple actions for the AI to take and simple ways that the AI can sense it's environment (distance to blocks, locations of enemies, etc. An easy solution would be to just feed it the pixel data from the entire screen, but that would be thousands of inputs, would take years for the AI to learn, and isn't currently possible in MicroStudio), and the ability to have dozens, if not hundreds of AIs going at the same time without slowing to a crawl. Additionally, it needs to be able to run dozens AIs at once and to be able to track the fitness of AIs (it's survival of the fittest after all).

Here's what the AI's currently set to do. The stuff in the middle of the screen is a visualisation of the highest scoring AI's brain.

:embed https://microstudio.io/Apples9/megabigbrainman/

Leave it running for a while (at least 15 mins) and the majority of them should be going straight for the goal (spike) no matter what position it's in. Compare that to the randomness of the first generation and the difference is quite obvious.

Feel free to adapt this into your own projects if you like, just remember to credit me (a comment at the code will do) If you're looking for something that's a bit simpler and doesn't use 350 lines of code, then I've got basic neural networks (https://microstudio.dev/i/Apples9/bigbrainman/) and a genetic evolution simulator for evolution of simple traits (https://microstudio.dev/i/Apples9/evolutionsim/)

Documentation (eventually) coming for all of them

Maybe Skate Run could be a good test case: https://microstudio.dev/i/gilles/skaterun/

The inputs would be relatively easy, how far are the obstacles in front of the player. The action is just taking the decision to press the jump key (I assume when the output of the neural network goes over a predefined threshold?). You could quite easily start a game with 100 AIs, that would be nice to watch!

Another recent game could be this one: https://microstudio.dev/i/mrpiay/shrinkingtrack/ ; I guess the inputs could be position x and y and velocity x and y and the radius of the track. Outputs are whether to press any of the 4 directional keys. You can compute a score based on the number of laps completed by the AI.

hm, I think maybe we could get it to play a simple game like .... getting over it

Or maybe halo :P

Pathfinding

Go through the maze for example

This earlier iteration of the AI, which is much simpler, is able to solve mazes:

:embed https://microstudio.io/Apples9/evolutionsim/

If you clone the project and edit the obstacle's position they'll find a way around it. Even if more obstacles are added, as long as it's possible the AI will eventually complete it.

Post a reply

Progress

Status

Preview
Cancel
Post
Validate your e-mail address to participate in the community