-
Notifications
You must be signed in to change notification settings - Fork 214
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
How to use use? #3
Comments
i dont know either somebody pls explain |
Use this fork, it has instructions: https://github.com/turboxx/SnakeFusion/commit/2da3088b1d9512af07b424decba6faea225e8d73 |
Hi, I tried this code and rewrite the Genetic Algorithm and also Fitness function, but my snake still nedd at least 100 Gen to avoid 1 or 2 wall in a row and eat 1 apple then other 200+ gen to do other super simple movement! |
I ve also made my own neural net and made some tweaks to his code but all in all its working (more or less). The issue is you need to get lucky with a random seed. While I was testing his setup i noticed that if you don't get the fitness/score as he did in the video you can just stop the training. But if you get "lucky" which happens actually alot you will see the same results as him. Sooo just keep restarting the 100 generations until you see like 11 or 12 apples eaten. Hope this helps :D Btw. you should try implementing elitism ( about 10%) because I 've noticed it is helping alot with the results in combination with higher 5% mutation rate. |
@Xenossolitarius Hey, thanks for reply! Anyway I dont know what is elitism but im saure that a 5% mutation rate is a bit high. |
@Trikos Actually I would be glad to help 👍 because it took me ages with the same problem. I can send code to you, no problem. It works for me with no changes but yesterday at 2 am I wrote a much better fitness function. Where can I send you the code ? ( C#) |
Can you publish it on your profile??? |
nah I will keep it to my self but ill give you the changes and directions here: https://pastebin.com/MEchCRUS |
Man appreciate your help but I get some part of your code not working cause I cant see the other code! |
@Trikos , buddy why don't you use python where a prebuilt Neuro Evolution of Augmented Topologies (NEAT) library is availiable and you don't have to ge into the details of writing all the mutation and crossover stuff by yourself. You can find the game-AI that i have made using NEAT here: |
Well, currently I have no info about NEAT but instead I study the Q-Learning which is really bad for Snake, taking a life to learn how to play cause of Fitness function and the super space of solution! |
@Trikos I think you're gonna find that learning python is pretty much the easiest job on the planet.. And i'm pretty sure that you're gonna love python.. Anyway.. Good luck!! :) |
it is one of the best beginner languages, very versatile too. |
How do I train the snakes in 0-4? They always do the same moves and die at almost the same spots. It doesn't seem like they're learning anything.
The text was updated successfully, but these errors were encountered: