Boids

Showcase your libraries, tools and other projects that help your fellow love users.
User avatar
Robin
The Omniscient
Posts: 6506
Joined: Fri Feb 20, 2009 4:29 pm
Location: The Netherlands
Contact:

Boids

Post 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.
Attachments
boids.love
Version 0.0 -- Hilariously Broken
(851 Bytes) Downloaded 385 times
Help us help you: attach a .love.
User avatar
Person
Prole
Posts: 39
Joined: Thu Jun 18, 2009 2:35 am

Re: Boids

Post 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. ^^
"Here's another curse for you, may all your bacon burn."
User avatar
Robin
The Omniscient
Posts: 6506
Joined: Fri Feb 20, 2009 4:29 pm
Location: The Netherlands
Contact:

Re: Boids

Post 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.
Help us help you: attach a .love.
User avatar
Person
Prole
Posts: 39
Joined: Thu Jun 18, 2009 2:35 am

Re: Boids

Post 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...
"Here's another curse for you, may all your bacon burn."
User avatar
Robin
The Omniscient
Posts: 6506
Joined: Fri Feb 20, 2009 4:29 pm
Location: The Netherlands
Contact:

Re: Boids

Post 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...)
Help us help you: attach a .love.
User avatar
qubodup
Inner party member
Posts: 775
Joined: Sat Jun 21, 2008 9:21 pm
Location: Berlin, Germany
Contact:

Re: Boids

Post by qubodup »

It is entertaining to watch!

Image
Attachments
boids-q_mod1.love
(1.18 KiB) Downloaded 163 times
lg.newImage("cat.png") -- made possible by lg = love.graphics
-- Don't force fullscreen (it frustrates those who want to try your game real quick) -- Develop for 1280x720 (so people can make HD videos)
User avatar
Jasoco
Inner party member
Posts: 3726
Joined: Mon Jun 22, 2009 9:35 am
Location: Pennsylvania, USA
Contact:

Re: Boids

Post 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.
User avatar
Robin
The Omniscient
Posts: 6506
Joined: Fri Feb 20, 2009 4:29 pm
Location: The Netherlands
Contact:

Re: Boids

Post 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.
Attachments
boids_i2.love
Version 0.1 -- Less Hilarious, Still Broken
(1.19 KiB) Downloaded 157 times
Help us help you: attach a .love.
User avatar
Robin
The Omniscient
Posts: 6506
Joined: Fri Feb 20, 2009 4:29 pm
Location: The Netherlands
Contact:

Re: Boids

Post 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. ;)
Attachments
boids_i3.love
Version 0.2 -- Slightly Better Flocking
(1.21 KiB) Downloaded 189 times
Help us help you: attach a .love.
User avatar
Pliskin09
Citizen
Posts: 89
Joined: Fri Jul 24, 2009 8:30 am

Re: Boids

Post 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.
Post Reply

Who is online

Users browsing this forum: Ahrefs [Bot] and 4 guests