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?
NeuroEvolution – Flappy Bird
71–80 of 103 posts
Re: NeuroEvolution – Flappy Bird
#72Re: NeuroEvolution – Flappy Bird
#73Earlier 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.
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
#74Re: NeuroEvolution – Flappy Bird
#75Re: NeuroEvolution – Flappy Bird
#76(Naturally I came to the comments because I thought this was BS)
Re: NeuroEvolution – Flappy Bird
#77At 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
Re: NeuroEvolution – Flappy Bird
#78Interestingly, 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.
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
#79Can 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)
Re: NeuroEvolution – Flappy Bird
#80Interestingly, 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…
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();