You are browsing as a guest. Sign up (or log in) to start making projects!

OggyW0ppy

@OggyW0ppy

Joined July 7th, 2026

  • 5Devlogs
  • 7Projects
  • 2Ships
  • 30Votes
Ship

Flappy Bird Neuroevolution

Flappy Bird clone where 100 birds controlled by a neural network learn to play the game over many generations of training. Each bird has 4 inputs leading to a hidden layer with 6 nodes and ending with a one node jump/wait output all starting with random weights. The more “fit” a bird is based on several factors, the more likely they will produce offspring with similar weights.

Used Python + pygame-ce (no ML library) for the game
Used pygbag to compile to WebAssembly to get it working live in the browser

Play here
Source Code

  • 1 devlog
  • 7h
  • 1.72x multiplier
  • 11 Stardust
Try project → See source code →
Open comments for this post

6h 37m 54s logged

Flappy Bird AI

I started by creating a playable game with human input to play flappy bird. After that basic testing, I planned on
training a population of computer-controlled birds too learn to play using evolution. I did this without using ML libraries because I felt like it :P (and I’ve never used python ML libs before).

To start, I created a simple neural network for each birds “brain”, each with 4 input nodes (y position, y position offset from next pipe, y velocity, and distance to next pipe), 6 hidden nodes, and one output node that determines whether the bird should jump that frame (>0.5 jump, <=0.5 do nothing). They each have their own weights that determine

A bird has a fitness score that is affected by time survived, distance from center of next pipe gap, and a bonus for passing through a pipe (this score is how birds are sorted for parent selection). I used a population of 100 birds and a simple genetic algorithm for each generation where the top few birds create offspring based on their brain’s weights, plus a little mutation for randomness & minor improvement. This allows for future generations’ weights to improve over time.

One of the hardest parts to figure out was the fitness calculation. Initially, the birds had a relatively small reward for passing a pipe, so compared to the amount they got for just surviving, they didn’t actually learn to pass through the pipes and would instead just hover around the gap height without learning to thread the gap. I then made the bonus much larger which actually helped train better birds.

Finally, when I was trying to get this working in the browser using pygbag to compile it to WebAssembly, I got a blank gray screen with NO errors O_O. I spent over an hour trying any fix I could find, and finally came to the conclusion that numpy was crashing the web assembly, and so I had to rewrite the neural network into base python. ToT

Anyways, the results are pretty great! While I was training it once, I got a top score of ~9400 after 700 generations, but I forgot to screenshot it :(.

Try the project here (no download necessary!) Press left/right to speed up/slow down
Github Repo

0
0
6
Ship

I made a collision demo with a ball bouncing around your window with walls that you can place. One of the most challenging parts of this was not actually the collision physics, but getting the right libraries to make a screen and draw stuff on that screen the way I wanted to. I am actually pretty impressed with the graphics I managed to make because I normally leave projects with their bad, simple graphics until the end. If you want to play it check out my github repo and download the jar file.

  • 4 devlogs
  • 9h
  • 2.33x multiplier
  • 22 Stardust
Try project → See source code →
Open comments for this post

1h 6m 46s logged

DEVLOG 3.5

I didn’t really add much just cleared up some code and made the pause system better (I tried to add a blur effect and failed so its just a text box now :P). However I plan to try some new things rather than working forever on this test project, as it is incredibly cumbersome to work in Java. I want to learn python, which I have minimal experience in (even though its the most popular language, I know). End.

0
0
3
Open comments for this post

3h 23m 18s logged

DEVLOG 3 - Project Repo

Additions

  • greatly improved graphics
    • ball has shading
    • boxes have a design and shading
  • changed wall placement style (ROTATION!)
    • created new class for the selection
    • selection box is always visible
    • change width/height with scroll wheel and holding alt/shift
    • change rotation by scrolling normally
    • checks if colliding with ball to prevent illegal placements
    • left click to place wall
  • game updates 5 steps per frame
    • this helps prevent glitches through thin walls
  • added some comments in the code to make it clearer

Plans

  • Try to improve lighting / shadows
    • currently colors and shadow positions are preset
    • also means more vector math!!!
  • add an objective
    • currently planning to make a puzzle to guide a ball into an endzone with minimal walls/bounces
0
0
4
Open comments for this post

3h 17m 16s logged

DEVLOG 2

Additions

  • added the ability to place your own walls
  • can speed up/slow down ball with left/right
  • added github repo
  • added compatibility to rotate walls, collision not updated yet
  • added anti aliasing

Plans

  • change wall placing mechanism to allow rotation
  • allow new balls to be added
  • some main goal of the game?
0
0
5
Open comments for this post

1h 39m 8s logged

DEVLOG 1
using java to make a game (flame me all you want)
-started with making a ball bounce along the screen
-added separate collision shape object to allow rectangular walls to be put anywhere
-added ball class to allow multiple balls at once
-added pause functionality (no visual indication yet however, only movement stops)

-plan to add dynamic wall placement as the game is running using the mouse

0
0
10

Followers

Loading…