Page 1 of 2

Boids

Posted: Fri Aug 21, 2009 4:23 pm
by Robin
Since Boids brought me to LÖVE (specifically Frock, via GitHub), I decided to make one myself in LÖVE.

It is not done, but right now, it is broken in a way I find it quite amusing. So I thought I'd share it.

Edit: it gets better if you wait a few minutes.

Re: Boids

Posted: Sat Aug 22, 2009 1:27 am
by Person
That was.... mesmerizing to say the least. I'm not aware of what Boids is trying to become, I might look it up later but some patterns I saw when Boid things hit atomic warp speed was.
• A 6 pointed star
• A pulsating double layered 6 pointed star
• A hexagon
• A triplet that swirls really fast and refuses to let a fourth member nearby join up (this appeared twice in separate areas, prompting me to believe this is kind of like the game of life)

All of which were in glorious greyscale, I had to close the screen before I tripped out. ^^

Re: Boids

Posted: Sat Aug 22, 2009 9:19 am
by Robin
Person wrote:That was.... mesmerizing to say the least.
Very. I made this version intentionally wrong, because I was to lazy to do it right the first time, but I never expected this. I just thought it would be uninterestingly broken.
Person wrote:I'm not aware of what Boids is trying to become
Boids is a simulation of flocking behavior, bird-like in particular. Animation, images and detailed explanation can be found here.

Re: Boids

Posted: Sat Aug 22, 2009 4:28 pm
by Person
Great link, I also checked it up on Wikipedia and now know how to say 'birds' in New Yorker! The applet in the link looks like it would make a great screen saver with some tweaking...

Re: Boids

Posted: Sat Aug 22, 2009 5:13 pm
by Robin
Person wrote:The applet in the link looks like it would make a great screen saver with some tweaking...
Actually, I have such a screensaver. It came on the cd which came with the book that introduced me to Boids (and CAs, and FSMs, and fractals, and Tierra...)

Re: Boids

Posted: Sun Aug 23, 2009 12:20 am
by qubodup
It is entertaining to watch!

Image

Re: Boids

Posted: Sun Aug 23, 2009 5:09 am
by Jasoco
I had created my own version of "Boids" I based on a program on Arkitus.

http://www.arkitus.com/Play/?id=12

It is called Fishies. My version worked so well, had three groups of "fish" that liked to group together sometimes, and could be separated at will.

I wrote my version in TNTBasic and it worked well for a while until I tried to make it more faithful and ended up screwing it up to the point of not working anymore. So it's boned. Oh well. And all my screenshots are gone. :( Oh well again.

His version had an algorithm in place to keep the fish from hitting each other. It wasn't until I tried to implement that feature that it broke. (When I tried to write the part that makes fish avoid other fish.) I eventually gave up when I couldn't fix it.

His version is written in Java. I'm sure I could rewrite it again in Löve.

Re: Boids

Posted: Sun Aug 23, 2009 8:29 am
by Robin
Great vid, qubodup! ;)

I further improved the algorithm: now, instead of going right towards or away from any other agent in sight, the agents subtly turn towards or from their friends. They also turn towards the average direction the other agents in sight are facing.

It's still not quite flocking, although you'll see small groups flying together. I think I need to tweak some parameters to improve their behaviour.

Re: Boids

Posted: Fri Aug 28, 2009 5:54 am
by Robin
New version!

I added min and max speed caps, and tweaked the parameters (CLOSE and TOOCLOSE, turning speed and change in velocity by nearby boids).

Sometimes, I get an actual flock with this. ;)

Re: Boids

Posted: Fri Aug 28, 2009 6:36 am
by Pliskin09
from what im observing, the rule that causes them to shift direction when they are about to collide with another thing breaks the flocks.