- What’s This? Watch pure, unadulterated artificial intelligence (AI) learn to play a famously frustrating game: Flappy Bird. No, really. It’s using something called a Deep Q Network (DQN) to figure out how not to crash. Like magic, but with more math and block spaghetti. - How to Watch Just sit back and let the AI do its thing. You'll see it start incredibly clumsy (it's learning from scratch, literally!), then slowly (or sometimes surprisingly fast) figure out the optimal "flap" strategy. It’s learning by doing, on the fly, and it’s surprisingly addictive to observe. The AI takes three critical pieces of info: where it is (bird.y), where the next pipe gap is (pipe_gap.y), and how far away the pipe is (pipe.x - bird.x). From that, its tiny, block-based brain decides to jump ("up arrow" equivalent), dive faster ("down arrow" equivalent – gravity's always helping), or do absolutely nothing and let gravity take its course.
Built by: @ScratchCat_000 (dev-kas) Powered by: Deep Q Learning (DQN) – because simple Q-Learning felt a bit too basic, and I really needed to cram a neural network into this visual code toy. A single, brave bird with a tiny, yet ambitious, block-based brain. Its brain has 3 inputs (bird.y, pipe_gap.y, pipe.x - bird.x), feeds that through 1 hidden layer with 4 neurons, and then spits out 3 possible actions (up, down, nothing). An unshakeable, possibly unhealthy, belief that Scratch can do anything if you just hit it with enough dedication and digital duct tape. Caffeine. Lots and lots of caffeine. Inspired by: The endless, soul-crushing frustration of Flappy Bird itself. Every single "AI learns to play game X" video on the internet that made me think, "I can do that... but in Scratch." The sheer audacity of implementing complex AI algorithms in a platform primarily designed for interactive stories and games. Acknowledgements: Scratch was most definitely NOT built for this kind of computational nightmare. Still did it. Props to Dong Nguyen for making a game so deceptively simple yet so brutally effective, it became the perfect AI training ground. My current understanding of neuroevolution algorithms (like NEAT, which would be cool for multiple birds) is currently non-existent, which is why there’s only one very determined bird learning here. But hey, learning is learning. Thanks to the Scratch Team for creating such a wonderfully versatile (and endlessly abusable) platform. Trademarks & Stuff: “Flappy Bird” and related assets are trademarks of .Gears / Dong Nguyen. “Scratch” is a trademark of the Lifelong Kindergarten Group at the MIT Media Lab. “Deep Q Network” and “Q-Learning” are concepts, not trademarks, thankfully. This project is not affiliated with or endorsed by anyone except maybe the ghost of a virtual bird and my increasingly confused cat. All copyrights belong to their respective owners. I just copy the vibes, and then make AIs copy the vibes. Fun fact: This entire Deep Q Network, the neural network, the Flappy Bird game mechanics, and the persistent learning process all run on 100% pure visual block spaghetti and the glorious chaos of Scratch variables.