Live data from Hacker News

NeuroEvolution – Flappy Bird

xviniette.github.io

71–80 of 103 posts

Re: NeuroEvolution – Flappy Bird

#71
Hmmm.. I made the pipes move up and down and now the neural network isn't doing so well :P

I've added "vertical velocity of next pipe" and "distance until next pipe" as inputs as well as upped the hidden layer neurons to 4 - anyone have any other ideas to improve its performance?

Re: NeuroEvolution – Flappy Bird

#73
post #58

Earlier quoted context omitted.

In a GA approach, you'd have kept that bird AND mutate/breed offspring from it. In a NN, you often get oscillation during training.

This is a GA. I just think it doesn't practice elitism (saving the best solutions found so far.) Or it's nondeterministic.

The problem seems to be the map.

It's always different and you can get to 1000 points if you are lucky with the map. But the one that got to 1000 might not get a gap that didn't show up in the last map.

Re: NeuroEvolution – Flappy Bird

#77

At generation 83, a single bird emerged that successfully navigated through several hundred columns (current score 100000+) and showed no signs of failing. It took a few dozen generations to find versions that would make it through a few columns if those columns had gaps without too much vertical distance between them. Somewhere in generation 60-70, I could see versions figuring out how to transition between heights,…

took 230 generations for me to do anything then it just went from dying within the first 3 pipes to mastering it within 4 generations

Similar experience here. Went from dying within the first 3 pipes to a perfect run at generation 68.

Re: NeuroEvolution – Flappy Bird

#78
post #40
post #25

Interestingly, the updates are done on the basis of only 2 external inputs [1]: the height of the bird in the screen and height of the aperture in the next pipe. Using only these two parameters the neural network decides whether to flap or not. I would had expected at least also the horizontal distance from the next pipe... [1] https://github.com/xviniette/FlappyLearning/blob/gh-pages/ga...

The pipes are evenly spaced so horizontal distance just goes away.

The fact that the pipes are evenly spaced doesn't make horizontal distance go away, their distance is still a variable at each flap decision.

What does make the distance irrelevant is that the holes are high enough to safely flap whilst inside them, so you never have to make a timed leap through, a luxury not afforded to users of the original game if I recall.

Re: NeuroEvolution – Flappy Bird

#79
post #20

Can this be used on, say, Mario Bros?

You mean this script? Or machine learning in general? If the later then it has already been done: https://www.youtube.com/watch?v=qv6UVOQ0F44 (great educational video)

looking at the author's github profile he did a lib to abstract the artificial intelligence and used in some other games.

Re: NeuroEvolution – Flappy Bird

#80
post #25

Interestingly, the updates are done on the basis of only 2 external inputs [1]: the height of the bird in the screen and height of the aperture in the next pipe. Using only these two parameters the neural network decides whether to flap or not. I would had expected at least also the horizontal distance from the next pipe... [1] https://github.com/xviniette/FlappyLearning/blob/gh-pages/ga...

Given the perfect play reported elsewhere, this suggests that the holes are just tall enough to accomodate a single flap, so the network essentially just has to learn the less-than function and then tune the threshold. edit: With sigmoid or hard-threshold activation, this function is really simple to implement. If we want to flap iff bird is lower than pipe, we can do that with no hidden layers and a weight vector of…

> Given the perfect play reported elsewhere, this suggests that the holes are just tall enough to accomodate a single flap, so the network essentially just has to learn the less-than function and then tune the threshold.

Yes, slightly disappointingly the neural network can be replaced by the line:

if((this.birds[i].y - 70) / this.height > nextHoll) this.birds[i].flap();

Post reply on HN