Hope you enjoyed this video! if you did, please press that like button and subscribe for more content like this. It costs you nothing, but for me it's everything! Consider supporting this channel on Patreon for exclusive content as well as early access to future videos and projects: www.patreon.com/Kofybrek
I wonder how well would the snakes perform with 2 hidden layers(or a cascaded hidden layer where each node receives from all previous nodes in its layer, computed sequentially). I mean, Chrispresso and 1 other guy managed to completely win Snakes with it, so imagine having them in a battle royale...
I just noticed that the video is new, I watched it about 2 Times and I recommend putting a path finding algorithm in one o the snakes than see the result😶
If the snakes had better vision they could probably evolve rather complex strategies If it's not too laggy make their vision like a 9×9 block (larger = better) of all the tiles around them, and differentiate between walls, themselves and other snakes
@@Kofybrek Also, one question about the genetic algorithm you used: did you actually set some weights to have new random values during mutation or did you add gaussian noise to them like a sane person?
@@Kofybrek Lol ok I'm surprised it converged that well... I'm not an expert at this topic but my reasoning is that you want your policy (ai) to converge to a good policy, and when your policy is already not too bad, adding some small random values to a few parameters might bring it closer to where those parameters should be, kind of like gradient descent except you generate random gradients and hope they're good... On the other hand, your parameters might already be close to where they should be but not quite there, and the right amount of noise would nudge them closer to there (if they should be increased, note there's a 50% chance of the noise value being positive, so pretty good), while setting it to any random value has a very low probability of getting it closer to where it should be if it already is close. That's just my reasoning though and I might be missing something, also reality sometimes doesnt like reasoning and instead prefers random bs like it does with the lion optimizer (which is better than adam, previous SOTA, but only uses the sign of the gradient to update, which is nuts)
First I thought you were gonna use Network module from SFML... But the video is still really good! GG to Daniel who is the top 1 snake and the first one to win this tournament!
Snake 24 place 4 I had to look the position at leader board as i am color blind i cant diff between similar colors so i forgot which was mine but i knew the # So yea Les go😎😎
I made a snake game using just text. All you have to do to prevent the snake from moving 180° is check to see if a snake body already occupys that cell.
@Kofybrek to me that makes sense though, because the snake can't flip 180, cause the body is in the way. But if there's no body, it has freedom to move. Also if you attempted a 180 you would die... I don't remember if that's what my final product did. I'll have to check. Love your videos! I just found you and you have a new sub.
Remember your raycaster? What about an fps with it's movement, So if we have like seven teams and they all shoot each other(In 2d) and then seeing which team does best, When only one remains, All teams are regenerated using the brains of the best two of their color(Like the snakes here) For extra flair, Perhaps the individual agent with the most kills could get a small section on the screen to render their view. 🙃
I believe its call "Yoda notation" it is useful to avoid some kind of unintended compilations which can result to bugs insanely hard to find if I remember correctly
no rectangle is not more efficient if you want to fill 800x600 window with 32x32 rectangles this will take around 470 iteration per second on other hand lines would take only 40 iteration :)
What activation function did you use instead of yours? Without the activation functions the neural network will have the same expressiveness of a single linear layer, adding more layers don't really do anything.
@@Kofybrek I mean there is usually a huge difference between a simple linear projection and an actual neural network. Add something simple like ReLU or remove the hidden layers because they don't actually do anything in this case.
I do not know about you but WHY IN THE WORLD you put the constant value before the variable when comparing them in an if/while statement and prob in a for ?
@@Eren_Yeager_is_the_GOAT my journey began with some genetic algorithms on TH-cam. Then I followed backprop tutorials online. Then learned about momentum and reinforcement learning I suggest starting with evolution strategies, it's super simple like genetic algorithm, yet can be more powerful than backpropagation
@@Kofybrek Your videos are great. I like those very much. Most of the content creators are commercial instead of being aesthetic. Hope you do greater in the future.
Hope you enjoyed this video! if you did, please press that like button and subscribe for more content like this. It costs you nothing, but for me it's everything!
Consider supporting this channel on Patreon for exclusive content as well as early access to future videos and projects: www.patreon.com/Kofybrek
@@NieProg Agreed, I would love to see that
I wonder how well would the snakes perform with 2 hidden layers(or a cascaded hidden layer where each node receives from all previous nodes in its layer, computed sequentially). I mean, Chrispresso and 1 other guy managed to completely win Snakes with it, so imagine having them in a battle royale...
I just noticed that the video is new, I watched it about 2 Times and I recommend putting a path finding algorithm in one o the snakes than see the result😶
@@adamebadra3171 might be neat, considering how pathfinding is one of the most common input preprocessing among Neural MMO winners
Ready for 14 minutes that will go by very quickly :(.
Just 13 minutes and 15 seconds left :(
I love how Daniel killed himself immediately right after winning
l love how snakes managed to generate food at a point LMAO
where, when
Lol I guess the heads shouldn't also convert into food, that way the number of food + body segments is conserved
@@The_Dr_Fate when dying snakes were set to turn into food
@@revimfadli4666 l agree
I have a feeling this was done in paint. And i love it. Earned my subscription
10:01 This is such a good burn.
2:30 "i wish i had that button >:)" got me dying LOL
Keep up the content man, this was great! Informative but not dry in the least. Also, I'm sad James didn't win. :(
i love this video, the way you explain how AI weights&mutation works is very cool, thank you
01:26 I love the snake face xD.
If the snakes had better vision they could probably evolve rather complex strategies
If it's not too laggy make their vision like a 9×9 block (larger = better) of all the tiles around them, and differentiate between walls, themselves and other snakes
From my experience, increasing the number of inputs makes them perform worse. Maybe I'm wrong though.
@@Kofybrek Because genetic algorithm can't handle it... (deep) Q-learning should do the trick though if you take the time to build an AI with it
@@Kofybrek Also, one question about the genetic algorithm you used: did you actually set some weights to have new random values during mutation or did you add gaussian noise to them like a sane person?
@@barni_7762 ...I just set a new random value.
@@Kofybrek Lol ok I'm surprised it converged that well... I'm not an expert at this topic but my reasoning is that you want your policy (ai) to converge to a good policy, and when your policy is already not too bad, adding some small random values to a few parameters might bring it closer to where those parameters should be, kind of like gradient descent except you generate random gradients and hope they're good...
On the other hand, your parameters might already be close to where they should be but not quite there, and the right amount of noise would nudge them closer to there (if they should be increased, note there's a 50% chance of the noise value being positive, so pretty good), while setting it to any random value has a very low probability of getting it closer to where it should be if it already is close.
That's just my reasoning though and I might be missing something, also reality sometimes doesnt like reasoning and instead prefers random bs like it does with the lion optimizer (which is better than adam, previous SOTA, but only uses the sign of the gradient to update, which is nuts)
Great video!
Good balance of explanations, practical examples, creativity and fun :)
Keep up!
First I thought you were gonna use Network module from SFML... But the video is still really good! GG to Daniel who is the top 1 snake and the first one to win this tournament!
I don't remember the last time I laughed at a coding video. Very successful video.
You are so underrated. This was an awesome video and now I want to go and build my own neural network generational thingy.
I love the little character you use
I love this video omg its my favourite! You are so entertaining and i love your voice!
Very cool video 😎 I made a snake game myself (smfl ofc)
It got tricky when i added bridges but it looks sick
'The code is super simple so I wont explain it to you'
Me: wait how does it work 👁👄👁
Amazing video. I bet for snake number 22, almost got the gold medal ❤
Dude this shit is too funny I almost choked.
HEY! THAT'S ENOUGH! *patting snake on the head* LOL
i think it would be better if you could make a sprite for the head, to make it easier to know the difference between the tail and the head
Yeah, you're right. For some reason, I forgot to do it.
Eyo. As usual, great content! Looking forward for more :D
6:28 ✨ n a t u r a l s e l e c t i o n ✨
You should make a project using SFML and OpenGL
Can't believe you write bracket in a separate line. (Great video though)
This was such a good video so you earned a sub
This is a banger video
Snake 24 place 4 I had to look the position at leader board as i am color blind i cant diff between similar colors so i forgot which was mine but i knew the # So yea Les go😎😎
So happy new vid is out :D
I made a snake game using just text. All you have to do to prevent the snake from moving 180° is check to see if a snake body already occupys that cell.
But that won't work if the length of the snake is 1.
@Kofybrek to me that makes sense though, because the snake can't flip 180, cause the body is in the way. But if there's no body, it has freedom to move.
Also if you attempted a 180 you would die... I don't remember if that's what my final product did. I'll have to check.
Love your videos! I just found you and you have a new sub.
These videos make me want to try making something with sfml once again
I made snake using SDL2 not too long ago and now I want to try and adding some AI to it.
New video! Great as always
Wow, awesome!
Remember your raycaster?
What about an fps with it's movement, So if we have like seven teams and they all shoot each other(In 2d) and then seeing which team does best, When only one remains, All teams are regenerated using the brains of the best two of their color(Like the snakes here)
For extra flair, Perhaps the individual agent with the most kills could get a small section on the screen to render their view. 🙃
wish I was this advanced wit c++ lol
2:46 real men make their own random system from scratch using atmospheric data
AI will took over the world but will not able to play snake game
Lol exactly!
It's good that Kang Daniel had won the battle royale 😁😁😁
"i wished i had that button" lmao!!!
daaaamn, ai battle!
I love these videos
The greatest!
Nice snacks
nice cometari
Have you tried training the network via reinforcement learning (PPO for example)?
No, I haven't. Sounds interesting though.
I think evolution strategies would be much easier to implement
holly molly my snake won! :D
i hope for an actuall 3d sometime, or a long series/video on some amazing clone like terraria/minecraft/dont starve
it's not cool, but it's very interesting how it algimetrically works
who the f would look at this and say this ai is good
Funny, but everyone knows that the first snake is supposed to be named Jake and the second one is Sammy.
are you using aseprite to make some animations for your viedos ?🤔
Yes.
Y͛o͛u͛ make such good vids!
good stuff
My bet on snake #26 got 26th rank.
You are a smart smart man. But when I saw "if (50 == generation)" I nearly died. Who puts 50 first?!?!?! WHY!!
I believe its call "Yoda notation" it is useful to avoid some kind of unintended compilations which can result to bugs insanely hard to find if I remember correctly
exactly!
Yeah, I'm weird.
no rectangle is not more efficient
if you want to fill 800x600 window
with 32x32 rectangles this will take around 470 iteration per second
on other hand lines would take only 40 iteration :)
yeah exactly!
Damn, you're right! I didn't think about it that way.
What activation function did you use instead of yours? Without the activation functions the neural network will have the same expressiveness of a single linear layer, adding more layers don't really do anything.
I didn't use any others. And I don't think using them is gonna change something.
@@Kofybrek I mean there is usually a huge difference between a simple linear projection and an actual neural network. Add something simple like ReLU or remove the hidden layers because they don't actually do anything in this case.
Top!!!
Hi! what does the i_ prefix in variable names mean?
it's short for "input".
@@Kofybrek thank you, very useful prefix btw
Whered you learn this
On the internet mostly.
I do not know about you but WHY IN THE WORLD you put the constant value before the variable when comparing them in an if/while statement and prob in a for ?
It just looks better to me.
Ураа змейка против змейки, лол
cool video, how did you learn to create AI in C++?
AI is not language deoendent. Its pure maths
@@Ezdiess alright then where did he learn those maths
@@Eren_Yeager_is_the_GOAT my journey began with some genetic algorithms on TH-cam. Then I followed backprop tutorials online. Then learned about momentum and reinforcement learning
I suggest starting with evolution strategies, it's super simple like genetic algorithm, yet can be more powerful than backpropagation
@@revimfadli4666 thanks 😊
You should make something in raylib
music plsssss
Why would they be better without an activation function? that's very weird..
Why does nobody realise that his voice is lower?
6:19 😂😂😂😂😂😂
NIce
make 3d game in sfml pls
Было бы интереснее, если бы змеи могли размножаться
Can you make tic tac toe ai?
You can use the Minimax algorithm to achieve it. It's very easy to do.
@@Kofybrek Your videos are great. I like those very much. Most of the content creators are commercial instead of being aesthetic. Hope you do greater in the future.
wait why do real men use random?
It's a joke, and "rand()" is less accurate than the random library.
Bro
Жаль я не понимаю английский (
LOL writing an ai in c++ instead of python BORING
@@themightycxzeriallord Ohh... i mean you a right and i would love to keep my ribs pls.. xD
I would've preferred C, but not everyone is ready for that. However, Python would be the worst choice.
@@anon_y_mousse python is actually the best choice when it comes to data sience and ai