Are you settling them to a random colour as they clone or changing colour by x as they clone. Or will they detect colour of boids in range and shift to that colour
Ah, in my new version I change their colour when they move off screen and appear on the opposite side. But the colour I set is based off timer * 10 (or something) + an offset. The offset is 0, 50, 100 or 150 depending on which edge it goes off. I also set the brightness to a random number at the start + - 10 or something
When he said "it's scratchin' time!" and scratched all over the screen, it left 5 tears on my right eye. Truly one of the game developing moments of all time
I still can't believe how easily Griffpatch can explain complex concepts and make us want to program and improve our games even more! Continue Griffpatch🥳
@@griffpatch I particularly enjoyed studying emergent behavior and cooperative tasks in these types of systems... i.e. tweaking the simple rules to cause the individual agents to solve some particular task such as building a bridge like ants.
After roughly 10 minutes of listening to this tutorial at 2x speed, the word 'boid' / 'boids' is said a grand total of 145 times! That's a lot of boids!
you didn't have to count, you could've thrown an AI at it! AIs LOVE counting and definitely won't mistake any words other than boid/boids as boid/boids! (The AI probably will mess up xD)
The fact that Griffpatch pretty much played the whole outro music is awesome! Just some Epic Music! I love your tutorials Griffpatch! I’m looking forward to finally make an RPG from your tutorials!
I've never used any of your scratch tutorials before because they seemed very hard to do, but this one actually was useful, thanks griffpatch! edit: help the boids are on the top of the screen and not on the middle like what you made
Wow! Your direction trick is amazing! A while ago I used trig to point in the direction of movement and it was such a pain, but I got there in the end.
oooh im totally gonna use this to add leeches to a game! Edit: give each object a different "weight" where the food (to distract them) has the most, the player in the middle, and the critters themselves the least. Maybe even negative values for stuff the are repulsed by... Tons of cool stuff to do with this project!
That was a lot of very clever math. I personally found it genius the position difference to actual distance to make a straightforward math equation to calculate how tight the turns need to be.
I was searching for this weeks ago but couldn't find one that's easy to understand I even tried making my own but still failed And I just gave up Definitely didn't expect a tutorial for this But I'm glad you made one ❤️
This helped me in one of my games i used the direction trick thank you it helped me after 2 hours of raging not being able to get the directions to be able to work this helped me for my game!
Congratulations griffpatch 🥳🎉🎊 You just hit 400,000 followers! That's not a small number! We all hope that you do your best and keep growing and keep boosting the number. We believe that you can break the limits of scratch. All the best! Sincere regards, Dipusen
I counted around 101 mentions of boid. But I also lost count somewhere around cohesion... Ah boids! I had a not so great game jam submission where you would have minions that acted like boids, and you could direct them towards enemies. That was around when Sebastian Lague posted their own video on Boids. Each step just makes you more excited for the next!
A couple of tips. 1. If you add a "set color effect to boid count *5" line to the bottom of the Calculate subfunction, the boids will change color based on the number of other boids in the flock. 2. If you want a more visible "avoid mouse pointer" function, multiply the range by 1.5 and the negative separation by 10: the boids will then rapidly flee from the mouse pointer, like fish fleeing a disturbance at the surface of the water. 3. By using separation rather than negative separation, you can also get the boids to swarm towards the mouse pointer, rather than away from it.
I just got this working in python (unfortunately couldn't figure out angle to a coordinate in order to change the direction of boids, i'll look into that soon), and it was so satisfying when i first saw them align to each other!
Update: I went to the scratch wiki for "Finding Direction with Velocity" which was actually what I needed. It seems to be a bad approximation (seems to be always 0 or -90 for some reason) but its not bad.
I recreated your exact setup at 0:26 and if you want to achieve maximum overdrive you just have to use these settings: target speed 5 resolve 0.01 range 150 separation 0.2 cohesion 0.1 alignment 0.01 Then turn on turbo mode for a couple seconds
I’ve become experienced enough to make possibly the most popular Tower Defense games on Scratch, but watching your tutorials helps me learn about the “hidden” features of itself. Along with the value of lists in high numbers of clones, it’s fun to see what you can make.
Hi griffpatch, I have been making a capture the flag like game and this tutorial could be great for the AI! Two questions though: 1: How do I make them go TOWARDS the other team's members? 2: How could I adapt this tutorial to make it scroll on the X (The game only scrolls on the X)
2. Replace the x position reporter blocks with a variable for the x. Have another variable for x scroll. Then in the go to position block, use x+the scroll x instead of x positon+speed x
Hey Griffpatch, I would like to ask you if you could do something on different types of procedural terrain generation like wavefunction collapse and perlin noise. I find procedural generation very interesting, and I think your viewers would love to see it, and we could end up with some really cool games! Thanks for reading! :D
This was like the best thing to watch after I got a commenter trying to make me stop using Scratch to draw scenery for my animation videos. Idk like some zombie game is what comes to mind for me (duh)
a lot of my programming knowledge comes from watching giffpatch explaining how to make it in scratch and then me using the same concepts to use it in other languages.
I remember making this tutorial! I figured out how to make the boids detect boids on the edges of the screen, so they don't clump up there, which was a common thing in this original video
Hi @griffpatch! When I first saw this video, I was so excited to code it up and that's what I did! But one day, while I was playing with the settings of the tutorial, when I set all the sliders to minimum value (except cohesion and allignment; set them to maximum) I saw some bugs: 1. All the boids did not try to join a flock and were only trying to avoid each other at a slow speed. 2. If you wait for sometime, then set the cohesion to the max, wait some more and set it back to max and wait even more, one boid goes faster than the other suddenly and all the boids that join it go faster too. In no time, all the boids are going like rockets, even though the target speed is at minimum! Sometimes it works when you don't finish all the steps. So I was just asking you, @griffpatch to test out these bugs and make a video on how to fix these?
I need help! I have rewatched the video so manyyyyyy times and I can't find the issue. Ever since I made the avoiding thing, they just avoid eachother until they start going in lines from one side to the other on their x position. No y pos movement. And in the group section I found not nothing wrong and they still doing the same thing... What am I doing wrong!?!? Edit: Well I found the issue, I forgot to change it from x to Y in the set distance area... :/
Negative X wouldn't be enough to ensure the boid was still in range on the opposite side... But if you then change x by speed x afterwards then it should be...
I managed to make a game with this by adding a "this player id" variable which is treated the exact same as the "this boid id" variable, making all boids see the player as a potential flock mate and inflating the challenge; trying to survive up to an 100 score without touching a boid
Excuse me, griffpatch, sorry to interrupt, but the direction of the boids isn't actually "itan(sx/sy)". I know you accidentally used "itan" instead of "atan". The actual direction is defined by "(atan(sx/sy))+(180*(sy
9:36 you can actually just put the main sprite in the center and create another sprite to get a point towards boid codeblock and drag it into the boid sprite. Replace the point towards center block with the block you just dragged into the sprite. You can then delete the other sprite.
You could initially set "other id" to "id + 1" and then have the repeat loop be "length of list -1" so it doesn't need the "if not the same id" part as it will be for every id except the boids id
@@griffpatch yeah it would wrap around the list, like if the id was the last item, id+1 would be the first item in the list. It would still do all the items except the id of the boid itself.
@@griffpatch oh... actually I forgot lists don't work like selecting costume numbers... so you would have to use the mod function when changing "other id"....
another way to make the small triangles go off the screen is to make another costume and make the costume a huge square then the script where you put the "move (x pos) (y pos)" right on top of that put "switch to costume ()" and put in the big square, then under the "move (x pos) (y pos)" put "switch to costume ()" and put the costume to the triangle. That makes it go off the screen because it switches to that big costume then moves then switches back to the triangle so it makes it glitch where theres still space for the big square when it goe soff the screen but then it switches back to the triangle and the triangle is in the same position
this is the smoothes boids i ever seen it makes my eyes better too see .. and im not here to say that but thanks for making the smooth better for me to use i said it didn't work even tho the code was wrong ;-; but now it works but i still have to confugire the varaibles
I just make them turn randomly before moving. Edit it makes it look like the AI isn't just a robot following a script ,but a somewhat smart machine putting in some effort to avoid each other Move 1 (or whatever you want) Turn random (-10 to 10 works well) That's literally it! No collision detector needed, if you want predictable AI it doesn't work though.
Are you settling them to a random colour as they clone or changing colour by x as they clone. Or will they detect colour of boids in range and shift to that colour
Ah, in my new version I change their colour when they move off screen and appear on the opposite side. But the colour I set is based off timer * 10 (or something) + an offset. The offset is 0, 50, 100 or 150 depending on which edge it goes off. I also set the brightness to a random number at the start + - 10 or something
how did you comment 19 hours ago when he posted it 16 minutes ago
@@vistaman1 wait thats true
@@UltronZX i'ts bcuz the video was first for members
@@nilzethalves6507 yep
When he said "it's scratchin' time!" and scratched all over the screen, it left 5 tears on my right eye. Truly one of the game developing moments of all time
Best comment i've seen under any Griffpatch video
Personally, I liked the part where he says "it's thing of thing blockin' time!" more.
@@El_Asado nah its when he said "Its Make a new variable'in time!"
@Ian Gustafson lmao
I see these comments, EVERYWHERE I GO, AND I AM LOSING MY MIND
The fact that griffpatch is basically the only scratch tutorial guy (thats useful anyway) means Scratchy is pretty much canon at this point
I still can't believe how easily Griffpatch can explain complex concepts and make us want to program and improve our games even more!
Continue Griffpatch🥳
Boids were always fascinating to me in grad school. So simple, yet such complex (and mesmerizing) group behavior.
Yes indeed :D - And a prime subject for learning some optimisations skills going forward if there's interest!
@@griffpatch I particularly enjoyed studying emergent behavior and cooperative tasks in these types of systems... i.e. tweaking the simple rules to cause the individual agents to solve some particular task such as building a bridge like ants.
@pixel Smiler official good idea
69 likes
Do you have
New x New y
No
After roughly 10 minutes of listening to this tutorial at 2x speed, the word 'boid' / 'boids' is said a grand total of 145 times! That's a lot of boids!
Amazing
imagine counting for 10 minutes then realizing someone counted it already (its a joke)
@@1080GBA_SC lol
you didn't have to count, you could've thrown an AI at it! AIs LOVE counting and definitely won't mistake any words other than boid/boids as boid/boids! (The AI probably will mess up xD)
@@redbirb yes but you need to know how to code it
I once saw this in an episode of "Coding Adventure", I'm so excited to see this in Scratch!
TBH I wanted someone to make this into a scratch tutorial, and naturally, Griffpatch rose to the occasion
The fact that Griffpatch pretty much played the whole outro music is awesome! Just some Epic Music! I love your tutorials Griffpatch! I’m looking forward to finally make an RPG from your tutorials!
It's incredibly outstanding on how he's used his talents for nine years straight just to help us. What a good guy !😊
Agreed.
According to my (unreliable) counting, you said the word boid a grand total of 149 times in this entire 35 minute video! Thanks for the fun dare!
This is insane. I'll try to implement it with pygame and python. Thanks for such a interesting lesson ☺
I love watching your videos! I’ve been a fan for 5 years!
I've never used any of your scratch tutorials before because they seemed very hard to do, but this one actually was useful, thanks griffpatch!
edit: help the boids are on the top of the screen and not on the middle like what you made
Wow! Your direction trick is amazing!
A while ago I used trig to point in the direction of movement and it was such a pain, but I got there in the end.
oooh im totally gonna use this to add leeches to a game!
Edit: give each object a different "weight" where the food (to distract them) has the most, the player in the middle, and the critters themselves the least. Maybe even negative values for stuff the are repulsed by... Tons of cool stuff to do with this project!
Good idea! I would love to see that game
That was a lot of very clever math.
I personally found it genius the position difference to actual distance to make a straightforward math equation to calculate how tight the turns need to be.
I was searching for this weeks ago but couldn't find one that's easy to understand
I even tried making my own but still failed
And I just gave up
Definitely didn't expect a tutorial for this
But I'm glad you made one ❤️
I can't comprehend the amount of creativity and problem solving skills you have...but I still love it!
Griffpatch, you are genies!😄 Thank you for this wonderful tutorial!
This helped me in one of my games i used the direction trick thank you it helped me after 2 hours of raging not being able to get the directions to be able to work this helped me for my game!
19:54 "More variables! I need more variables!"
-Griffpatch (the variable master)
he sounds like an ai
Tanger
bruh
even more bruh
Dude your videos and projects are SO GODDAMN AMAZING!! You deserve more subscribers!
Congratulations griffpatch 🥳🎉🎊 You just hit 400,000 followers! That's not a small number! We all hope that you do your best and keep growing and keep boosting the number. We believe that you can break the limits of scratch. All the best!
Sincere regards,
Dipusen
**makes a 5635638456456d game in scratch** *It's really simple!*
@@-tylerrodgers- wth
I love the "well, hurra!" In the begging!! It makes me so exciting!!
I counted around 101 mentions of boid. But I also lost count somewhere around cohesion...
Ah boids! I had a not so great game jam submission where you would have minions that acted like boids, and you could direct them towards enemies. That was around when Sebastian Lague posted their own video on Boids. Each step just makes you more excited for the next!
I had a great time coding while listening to you explain how it works. Thank you for your hard work.
Keep it up!
Glad it helped!
if you use the script at 9:31 but instead of randomly positioning the boids, you set them all to the centre, you get a really cool pattern
That's interesting :) - What pattern do you get?
@@griffpatch the boids basically explode outwards, and then start coming together in various groups until they all rejoin in the centre.
I have just started back on scratch again after a break for my mental health and your videos have made my day
yay!!!
Omg this is amazing! Thanks Griffpatch 💪 You always surprise ne and teach me new things 🌟
My pleasure!! So glad you enjoyed it :D
@@griffpatch Hi
Out of all the tutorials, I would've never expected boids!
Always love boids. Looks beautiful with that trail version. Are you just stamping the previous frame with a transparent fill?
Yes that's right
@@griffpatch Funut also made a Boids Project :)
Hi Funut! Are you planning To do UA-cam-videos again?
A couple of tips.
1. If you add a "set color effect to boid count *5" line to the bottom of the Calculate subfunction, the boids will change color based on the number of other boids in the flock.
2. If you want a more visible "avoid mouse pointer" function, multiply the range by 1.5 and the negative separation by 10: the boids will then rapidly flee from the mouse pointer, like fish fleeing a disturbance at the surface of the water.
3. By using separation rather than negative separation, you can also get the boids to swarm towards the mouse pointer, rather than away from it.
I just got this working in python (unfortunately couldn't figure out angle to a coordinate in order to change the direction of boids, i'll look into that soon), and it was so satisfying when i first saw them align to each other!
Update: I went to the scratch wiki for "Finding Direction with Velocity" which was actually what I needed. It seems to be a bad approximation (seems to be always 0 or -90 for some reason) but its not bad.
BETTER UPDATE: It turns out I was being a goddamn idiot and already had the CORRECT code in there, I JUST FORGOT TO USE IT
For the direction you can use math.atan2(-speed-y, speed_x) to get the angle in radians of the boid
I recreated your exact setup at 0:26 and if you want to achieve maximum overdrive you just have to use these settings:
target speed 5
resolve 0.01
range 150
separation 0.2
cohesion 0.1
alignment 0.01
Then turn on turbo mode for a couple seconds
Thanks griffpatch for this tutorial! You always make my day better
I’ve become experienced enough to make possibly the most popular Tower Defense games on Scratch, but watching your tutorials helps me learn about the “hidden” features of itself. Along with the value of lists in high numbers of clones, it’s fun to see what you can make.
Brilliant :)
Hi griffpatch, I have been making a capture the flag like game and this tutorial could be great for the AI! Two questions though:
1: How do I make them go TOWARDS the other team's members?
2: How could I adapt this tutorial to make it scroll on the X (The game only scrolls on the X)
2. Replace the x position reporter blocks with a variable for the x. Have another variable for x scroll. Then in the go to position block, use x+the scroll x instead of x positon+speed x
For question 2, probably just don’t do anything for the y values
YES !
A VIDEO !
Love you're videos ! Continue like that !
Hey Griffpatch, I would like to ask you if you could do something on different types of procedural terrain generation like wavefunction collapse and perlin noise. I find procedural generation very interesting, and I think your viewers would love to see it, and we could end up with some really cool games! Thanks for reading! :D
Just appreciate how great Griffpatch's voice sounds!
GUYS WHO SAW THE HIDDEN LEMON🎉
Yes i saw it
As a Scratch lover, this is really satisfying.
Thank you soooooo much for this tutorial, finally i know how to check for nearby clones! You are the best :D
omg ive been waiting for something like that for ages
thank you
I’m not gonna do it, but this is honestly amazing and satisfying. (The fact that two giant circles mixed to make another huge circle)
I loved that too lol
@@griffpatch WAIT *WHA-*
This was like the best thing to watch after I got a commenter trying to make me stop using Scratch to draw scenery for my animation videos. Idk like some zombie game is what comes to mind for me (duh)
This is so useful! Not just for scratch but for others! I made a python boid that has the same effect and it is amazing
This is probably your most satisfying tutorial lol
I recently saw Sebastian Lague's video on this, and wanted to recreate it in Scratch! Thanks!
i didnt do the code for hiding and showing sliders. instead,I coded an options button. thanks for this tutorial ,I loved it!!!!
Oh man this was worth the wait just for the hiding and showing variable script
Underrated video, needs more likes and shares
YES PLEASE!!!! Everyone Like and Share my video :D
@@griffpatch I already have 😎👍
Congrats on 400,000 scratch followers!
Wha- I-… this is incredible! Impressive as always
I love that editing style!
The way you popped eyes on the boids was cute not gonna lie
Finally a new project! Way to go!
21:02 the most hardest math moment I've ever seen in griffpatch tutors
It is lucky that your'e a scratcher, without you... WE WOULDN'T GET EXCELLENT PROJECTS LIKE THIS!!!
congrats to 400k on scratch griffpatch!
Thanks
I always like stuff like this! I'm ready for another great griffpatch video!
Me too... I love simulations and particles, and movement :)
@@griffpatch make a 3d version of conways game of life
Scratch: Fun coding for kids🎉
Griffpatch: Nah, I do what i want to do
I thought it's going to be an unboxing video. well, I unboxed a new type of simulation in scratch. good scratching sir
a lot of my programming knowledge comes from watching giffpatch explaining how to make it in scratch and then me using the same concepts to use it in other languages.
15:00
I’m having issues with only the BOID X list updating and none of the other lists fill up at all, help would be greatly appreciated!
I remember making this tutorial! I figured out how to make the boids detect boids on the edges of the screen, so they don't clump up there, which was a common thing in this original video
*Amazing Work! Keep it up!*
That is amazing! Very great job!
By the end my brain was on a frying pan
I just finished the project, and it turned out EPIC (ty griffpatch) but I think now I have a fear of variables
WHY WONT MY CLONES WORK
Every time you say, “Sorry Scratchy, maybe next time”, ‘Next time’ never comes!😂
Lol
Wow! This is real dang. Loved it.
Hi @griffpatch! When I first saw this video, I was so excited to code it up and that's what I did! But one day, while I was playing with the settings of the tutorial, when I set all the sliders to minimum value (except cohesion and allignment; set them to maximum) I saw some bugs: 1. All the boids did not try to join a flock and were only trying to avoid each other at a slow speed. 2. If you wait for sometime, then set the cohesion to the max, wait some more and set it back to max and wait even more, one boid goes faster than the other suddenly and all the boids that join it go faster too. In no time, all the boids are going like rockets, even though the target speed is at minimum! Sometimes it works when you don't finish all the steps. So I was just asking you, @griffpatch to test out these bugs and make a video on how to fix these?
He he, these don't sound like his to me. Without the right shower settings the boids can do all sorts of crazy things
@@griffpatch Oh ok
I need help! I have rewatched the video so manyyyyyy times and I can't find the issue. Ever since I made the avoiding thing, they just avoid eachother until they start going in lines from one side to the other on their x position. No y pos movement. And in the group section I found not nothing wrong and they still doing the same thing... What am I doing wrong!?!?
Edit: Well I found the issue, I forgot to change it from x to Y in the set distance area... :/
Same
WOW! this so cool, thanks for the tutorial griffpatch!!
Griffpatch is one of the best coders i know
7:04 I think you cuold optimise it by (if abs of x position > 240 change x by negative x position),and same with y position.
Negative X wouldn't be enough to ensure the boid was still in range on the opposite side... But if you then change x by speed x afterwards then it should be...
Hold on... Ok, so you could set x to negative old x. That would do it
I managed to make a game with this by adding a "this player id" variable which is treated the exact same as the "this boid id" variable, making all boids see the player as a potential flock mate and inflating the challenge; trying to survive up to an 100 score without touching a boid
Soo Satisfiying!
WOW! this is sooo AMAZING! thank you soooo much griffpatch!
No problem!!
Excuse me, griffpatch, sorry to interrupt, but the direction of the boids isn't actually "itan(sx/sy)". I know you accidentally used "itan" instead of "atan". The actual direction is defined by "(atan(sx/sy))+(180*(sy
BoldAI was a programming company that used to code and made the one was coding platform called ''Blocksworld'', it got aquired by Linden Labs in 2013.
I like how you say "For All Sprites"
Hey Griffpatch. Why do you put some variable at caps and some a lowercase??
Its to easily determine if the Variable is Local (lowercase | For this Sprite Only) or if it's Global (UPPERCASE | For all Sprites)
Though I have to say that it's not a necessary thing to do, you are free to use any names using any upper or lower cases as you please
Wow you went from projects dedicated to kids to such complex algorithms.
I guess I'll wait for your next AI project in scratch 😅
THE AMOUNT OF VARIABLES ARE CRAZY
this is such a cool simulation! it looks so cool! thanks griffpatch.
10% video: actual tutorial
90% video: griffpatch tells you to make another variable
So excited!
9:36 you can actually just put the main sprite in the center and create another sprite to get a point towards boid codeblock and drag it into the boid sprite. Replace the point towards center block with the block you just dragged into the sprite. You can then delete the other sprite.
Yes indeed :)
griffpatch how can i use x and y variables instead of the positions? i wanted boids for my scrolling game but it doesnt work with variables
Yes it's easy
@@DUMB_PERSON_NEAR_ME i know i got it to work like a day after i commented
You could initially set "other id" to "id + 1" and then have the repeat loop be "length of list -1" so it doesn't need the "if not the same id" part as it will be for every id except the boids id
Sorry, you also need to process through the items before the id...
@@griffpatch yeah it would wrap around the list, like if the id was the last item, id+1 would be the first item in the list. It would still do all the items except the id of the boid itself.
@@griffpatch oh... actually I forgot lists don't work like selecting costume numbers... so you would have to use the mod function when changing "other id"....
Fun fact:
In ancient Greece an R looks like a P --> ρ
(Neg) Res inverted is ser, but in
Greece it should look like this:
---> (neg) seρ...
Did I see AI? I love AI This is going to be so amazing!! Thank you for making this amazing tutorials!!
Hi villeolof!
@@Faker233 Hey!
@@villeolof2000 I'm banned :(
@@Faker233 Why?
@@villeolof2000 IDK :(
For some reason, my boids aren't getting together in groups. Is this just me, or is there something wrong with my code?🤔🤔
I suspect something wrong :( tricky!
Wow. Thnak you so much. I was going to write a program in python. But it's a bit hard for me. This video helps a lot to understand the concept.
another way to make the small triangles go off the screen is to make another costume and make the costume a huge square then the script where you put the "move (x pos) (y pos)" right on top of that put "switch to costume ()" and put in the big square, then under the "move (x pos) (y pos)" put "switch to costume ()" and put the costume to the triangle. That makes it go off the screen because it switches to that big costume then moves then switches back to the triangle so it makes it glitch where theres still space for the big square when it goe soff the screen but then it switches back to the triangle and the triangle is in the same position
this is the smoothes boids i ever seen it makes my eyes better too see .. and im not here to say that but thanks for making the smooth better for me to use i said it didn't work even tho the code was wrong ;-; but now it works but i still have to confugire the varaibles
I just make them turn randomly before moving.
Edit it makes it look like the AI isn't just a robot following a script ,but a somewhat smart machine putting in some effort to avoid each other
Move 1 (or whatever you want)
Turn random (-10 to 10 works well)
That's literally it!
No collision detector needed, if you want predictable AI it doesn't work though.
Out of all the tutorials i watched i feel like this is the first time i saw griffpatch use the "distance to :sprite:" block