Pointless project #2: Boids!

Show off your games, demos and other (playable) creations.
Post Reply
Kyle
Party member
Posts: 146
Joined: Sat Mar 16, 2013 9:46 pm

Pointless project #2: Boids!

Post by Kyle »

Download (0.9.0, compatible(?) with 0.8.0)

Image

I got bored so I implemented a swarming algorithm in LOVE! It's based off of Craig Reynolds's iconic Boids page. Feel free to play with it! It'd make a fantastic screensaver as well.
Kyle
Party member
Posts: 146
Joined: Sat Mar 16, 2013 9:46 pm

Re: Pointless project #2: Boids!

Post by Kyle »

Oh man, this one is fun to watch.

Download

This release adds four teams. "Swarmies" tend to follow their teammates, but they can convert to other teams if they hang out with them too much! Press C to randomize teams if things are getting boring.
User avatar
micha
Inner party member
Posts: 1083
Joined: Wed Sep 26, 2012 5:13 pm

Re: Pointless project #2: Boids!

Post by micha »

Good work! I like Boids.

I am still waiting for some people to come up with a game idea based on swarm behavior.
Germanunkol
Party member
Posts: 712
Joined: Fri Jun 22, 2012 4:54 pm
Contact:

Re: Pointless project #2: Boids!

Post by Germanunkol »

I second Micha's post!

Soooooo pretty!
What's the short flash with the circle around the entities? First, I thought it was the leader, but I don't think there's any leadership involved in the algorithm...?
Edit: Ah, they change color if they're too close to other "birds"?
trAInsported - Write AI to control your trains
Bandana (Dev blog) - Platformer featuring an awesome little ninja by Micha and me
GridCars - Our jam entry for LD31
Germanunkol.de
Kyle
Party member
Posts: 146
Joined: Sat Mar 16, 2013 9:46 pm

Re: Pointless project #2: Boids!

Post by Kyle »

Germanunkol wrote:I second Micha's post!

Soooooo pretty!
What's the short flash with the circle around the entities? First, I thought it was the leader, but I don't think there's any leadership involved in the algorithm...?
Edit: Ah, they change color if they're too close to other "birds"?
Yep, that'd be it! They slowly convert to the team of the most prevalent one in their vicinity. It's a bit wonky sometimes though, and I'm not too sure why. I think it's time to move on to pointless project #3 now so I don't think I'll be working on it anymore. However, I do have an update that fixes their separation drive - before, it wasn't being scaled properly and frankly just did not work as intended.

Download here

Note that you can still press space to enable the pretty debugging info. The circles show their "neighbor radius", and the lines show that they are considered neighbors. The pink dot shows where each boid wants to steer towards for their "cohesion" drive - it's what keeps the flocks tight.

There are three main drivers: common direction, cohesion, and separation. Common direction just means they all try to steer towards the average direction of their neighbors (this results in it evening out into one common direction :D!). Cohesion means they try to steer towards the average POSITION of their neighbors, which keeps them bunched up. Separation is what keeps the flocks from collapsing into a single blob - they all try to maintain a certain distance from each other. I was going to make up a nice little UI for adjusting each value, but it'd take too long. If you want to play with it, most of the values are at the top of main.lua. Have fun! It's endlessly entertaining, IMO.
Post Reply

Who is online

Users browsing this forum: No registered users and 160 guests