Log In  


Cart #yabadopuwo-2 | 2022-01-08 | Code ▽ | Embed ▽ | License: CC4-BY-NC-SA
6

Hello there!

Here's my first PICO-8 project, Flap Evolved. It's a really terrible Flappy Bird clone, but it is playable. It was a great project to start my PICO-8 journey out on.

Player Mode (X):
Take control of a really ugly bird and try not to fly into pipes. That's about it. Every 4 pipes passed increases the speed.

Neural Network Mode (Z):
Tired of playing already? Yeah, ditto. Why not watch a population of neural networks evolve over time to learn how to play, instead?
The neural network is pretty basic, but it does support multiple hidden layers and has a basic genetic algorithm included, for all your evolutionary needs.

I'm still learning Lua & PICO-8, but having a blast so far. Thanks for taking the time to read and have a good one!

Cheers,
Taco

v1.1:
-Improved graphics
-Removed jump delay
v1.2:
-Increased jump amount for added difficulty, adjusted "physics"
-Improved game instructions
-NNs now see the_pipe.x
-NNs now see pipe_speed
v1.3:
-2 pipes will now appear on screen at a time, refactored pipe "system"
-Increased starting pipe stats to make it easier at the start
-Every 4 pipes cleared, pip gap becomes smaller, distance between pipes becomes shorter, and the y position jump becomes larger
-Fixed a couple of crash bugs from OOB arrays
-Agents now get additional points from clearing a pipe, instead of just points per frame
-Agents see the closest 2 pipes to them. Pipe x, topY, and bottomY are visible for both pipes
-Increased mutation chance
-Added a fitness graph that shows the average fitness over the last 20 generations

6


I didn't read any of the post before starting the cart, so I was really unclear on why Z wasn't doing anything. But now it makes sense - fun idea, and the agents seem to learn quite well! Great cart.

I'd love to see a running graph of max fitness over generations, or at least a log of what the value was over the last few generations.

I also feel like in some sense the control here is too granular - the upward kick from each control input is super small, which I think makes the agents less interesting to watch than if it were larger. If it's larger, then you have to worry more about overshoot when arresting a fall. That also might perhaps make the x distance to the next pipe a more important thing to send to the NN? (Doesn't look like that's being sent right now, but maybe I'm missing something.)

One other thing that might be interesting is adding a lot more momentum to the control scheme, but giving the player (or the agent) multiple pipes of visibility, so a little more planning is both necessary and possible.


Hey luchak,

Thanks for checking it out and giving feedback- much appreciated!

I agree about the jump amount- it was far too easy. Jump amount has been increased and it does seem to give them a little more to think about. Agents can now also see the pipe's X position as well as pipe_speed, somewhat normalized. More inputs, more awesome. I also updated the game's messages to hopefully make it a little more clear what's going on for first time players.

The graph is a very smart idea. I'll play around with that this weekend and see if I can get something legible on-screen. I went with one pipe out of pure laziness and, yeah, I should fix that.

Thanks again for the suggestions!

Cheers,
Taco


Awesome, the physics in the update look way more interesting to me, and the challenge level seems much better.

I watched a couple of runs, one reasonably successful, one where the birds figured out how not to go to the moon but never made it beyond that - they just kept running into either the first or the second pipe.

If you're not already, I wonder if it might help to give partial credit for getting close to the pipe gap? Like just barely failing to make it through is probably better than running straight into the pipe nowhere near the gap? Probably doesn't help later generations a whole lot (could it hurt? not sure...), but it might help kick-start bad initial state.


Hey again luchak,

2 pipes and a basic fitness graph have been added. Additionally, I modified the scoring system to give each living agent points when a pipe is cleared. This is in addition to them receiving points per frame, if alive. So they were getting partial credit before, but it just wasn't enough. This area takes some tweaking and I'll keep at it.

This should help get the more successful agents to become more successful breeders. It's still possible to see agents struggling into generation 30+, but much less likely. And usually they eventually figure it out and start making progress.

I also made the beginning pipes have a larger gap and start further apart. This should boost the early game, as it were.

It's been a really fun project and I appreciate the great suggestions! Thanks again, luchak.

Cheers,
Taco


This is looking amazing! It's really interesting to watch now, fantastic work on this one. If you make future improvements I'll be very interested to see them.



[Please log in to post a comment]