Code AI Swarms, Flocks & Hordes | Boids Scratch Tutorial

preview_player
Показать описание
Learn how to code Boids AI in Scratch (originally created by Craig Reynolds in 1986 to simulate the realistic flocking behaviour of birds). But this can be used for swarms of aliens, hordes of Zombies or waves of enemy NPCs, so you too can bring amazing artificial life simulations in to your games. Follow the basic 3 steps, Separation, Cohesion, & Alignment and get 50+ boid clones interacting with each other and with your mouse - Now Scratch on Guys!

My tutorials are for all budding game & software developers using Code Blocks. Full of useful Scratch Tips and coding goodness for beginner coders to advanced Scratchers!

🚀 *Boost Your Creativity with Griffpatch*
The Griffpatch Academy will take you from "Gamer to Game Creator"

--------------Video Chapters--------------
0:00 Intro
1:49 Draw a Boid
3:01 Clone the Boids
4:38 Get them moving
8:10 Pointing a sprite towards a vector (speed x, speed y)
9:53 Speed Levelling
13:51 Sight – Awareness of other Boids using Lists
16:58 Separation / Avoidance
23:23 Cohesion – Herding / Sticking together as a group
26:48 Alignment – Heading in the same direction
30:05 Show Hide the UI Sliders
31:34 Avoid Mouse?
32:58 Outro
Рекомендации по теме
Комментарии
Автор

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

DanielHCassidy
Автор

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

pastapastel
Автор

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!

jameswoodcock
Автор

The fact that griffpatch is basically the only scratch tutorial guy (thats useful anyway) means Scratchy is pretty much canon at this point

Enderia
Автор

Boids were always fascinating to me in grad school. So simple, yet such complex (and mesmerizing) group behavior.

Resseguie
Автор

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🥳

Titouan_Jaussan
Автор

I once saw this in an episode of "Coding Adventure", I'm so excited to see this in Scratch!

gakersc
Автор

19:54 "More variables! I need more variables!"

-Griffpatch (the variable master)

orangeisntavailable
Автор

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!

INotSillyTV
Автор

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

LilKaijuPH
Автор

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!

penwozhere
Автор

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.

Phillip_Duck
Автор

It's incredibly outstanding on how he's used his talents for nine years straight just to help us. What a good guy !😊

FederationOG
Автор

Dude your videos and projects are SO GODDAMN AMAZING!! You deserve more subscribers!

BD-tqxg
Автор

This is insane. I'll try to implement it with pygame and python. Thanks for such a interesting lesson ☺

lestylo
Автор

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!

dog_
Автор

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

scienceboy
Автор

Griffpatch, you are genies!😄 Thank you for this wonderful tutorial!

virtualworldwithme
Автор

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 ❤️

bruhder
Автор

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.

Richard_Nixon-mrrq