#IMPLEMENTING NEAT INTO MY FLAPPY BIRD GAME

24 messages · Page 1 of 1 (latest)

worthy tusk
#

So I remade flappy bird using pygame and I wanted to use NEAT to have an AI control the bird but i'm completley lost on how to begin doing it. The neat documentation is extremely confusing to me and I'm having a really hard time following it.

minor gyro
#

@rugged totem thoughts?

rugged totem
#

Neat is super cool for these tasks! What parts of it do you need some help with?

#

And it's weirdly flattering you @ me when people mention neat <3

minor gyro
#

😉

#

I'm just glad you're willing 🙂

rugged totem
#

youd be even more impressed and concerned if you knew what's going on at the same time, but honestly helping ppl makes me feel better and this is my favorite topic

#

@worthy tusk feel free to ping me when you're ready though :)

worthy tusk
#

hey @rugged totem sorry I missed this, I was doing some other stuff. Is it okay if I ping you later about it?

rugged totem
#

sure!

worthy tusk
#

thanks

worthy tusk
#

right now I have the config path setup but besides that I don't really know how to create the fitness functions based on what I have so far

rugged totem
#

Fitness functions in games like these are typically very simple. Their fitness is the distance they traveled.

worthy tusk
#

Yeah thats what I've been told as well. From what I understand their based on the score you have in the game (like the timer)

#

I'm just lost on how you would first write the function

#

well thats one of the things im lost on

#

I guess to put it plainly, where would I go after I make the function to run the neat algorithm (cause I wrote that out)

rugged totem
#

NEAT has several phases which makes what you said confusing to me. The steps are plainly put:

  1. Make a random neural network
  2. Make P clones of the network
  3. Test all clones and score them
  4. Decide the best clones
  5. Make P total clones from those best clones. Mutate each clone. Repeat Step 3 until goal is achieved.

The fitness algorithm is just to assign them a score so you can sort them by who did the best. You can pick the top 10% to clone or pick the best, both have pros and cons

worthy tusk
#

What do you mean specifically when you say make a random neural network?

rugged totem
#

If you're doing a simple neat experiment, then assigning random weights to the connections. It can evolve from no starting connections at all though.

Tuning the mutation rates of the neurons and connections will be half of the work tbh

worthy tusk
#

I know what weights are but i'm still confused as to how I would apply that to my code

rugged totem
#

You'd likely have to check with the libraries you're using specifically

worthy tusk
#

thats what im confused on. I don't know how apply NEAT into my code