Hi all,
I caught wind of Love on Hacker news, and I decided to try it out. Noticing that you guys were missing a flocking boid simulation in your demos, I decided to write one. The love file is attached at the bottom, and the details of it are in a blog post I wrote.
http://webjazz.blogspot.com/2009/02/int ... icken.html
The source repository is here:
http://github.com/iamwilhelm/frock/tree/master
Comments and patches welcome.
Enjoy!
Introducing Frock, a flying chicken flocking simulation

 Prole
 Posts: 16
 Joined: Thu Feb 12, 2009 5:53 pm
 Contact:
Re: Introducing Frock, a flying chicken flocking simulation
HAHAH! Too neat.

 Prole
 Posts: 16
 Joined: Thu Feb 12, 2009 5:53 pm
 Contact:
Re: Introducing Frock, a flying chicken flocking simulation
Oh, I forgot to mention that clicking on the screen puts more plants in the world.
The current algorithm for calculating knearest neighbors is naive, so it's O(n^2). That'll be remedied as soon as I figure out how to do it.
The current algorithm for calculating knearest neighbors is naive, so it's O(n^2). That'll be remedied as soon as I figure out how to do it.
Re: Introducing Frock, a flying chicken flocking simulation
some people are really talented here...
Very interesting! I love flocks of birds. I've seen recently a similar one like on the video on your website...
Very interesting! I love flocks of birds. I've seen recently a similar one like on the video on your website...

 Party member
 Posts: 215
 Joined: Sun Jan 18, 2009 8:03 pm
Re: Introducing Frock, a flying chicken flocking simulation
You can actually find all n nearest neighbors in O(n log n) time, but it's a bit complicated. See An optimal algorithm for the AllNearestNeighbors problem by Pravin Vaidya (1986): http://ieeexplore.ieee.org.ludwig.lub.l ... 568202.pdf. O(n log n) knearest neighbor is mentioned in the same paper. If you were to implement this, or an approximation or heuristic algorithm, please do share with the rest of us .iamwilhelm wrote:Oh, I forgot to mention that clicking on the screen puts more plants in the world.
The current algorithm for calculating knearest neighbors is naive, so it's O(n^2). That'll be remedied as soon as I figure out how to do it.
If I haven't written anything else, you may assume that my work is released under the LPC License  the LÖVE Community. See http://love2d.org/wiki/index.php?title=LPC_License.
Re: Introducing Frock, a flying chicken flocking simulation
Neat. Somehow reminds me of that PS3demo. Maybe Skasi can use something like this for his Galconlike game.

 Prole
 Posts: 16
 Joined: Thu Feb 12, 2009 5:53 pm
 Contact:
Re: Introducing Frock, a flying chicken flocking simulation
Yeah, I'll let you guys know what I end up coming up with. Been getting some pointers to papers here, and there. Just have to make use to my peeps in universities to get these papers for free...osuf oboys wrote:You can actually find all n nearest neighbors in O(n log n) time, but it's a bit complicated. See An optimal algorithm for the AllNearestNeighbors problem by Pravin Vaidya (1986): http://ieeexplore.ieee.org.ludwig.lub.l ... 568202.pdf. O(n log n) knearest neighbor is mentioned in the same paper. If you were to implement this, or an approximation or heuristic algorithm, please do share with the rest of us .iamwilhelm wrote:Oh, I forgot to mention that clicking on the screen puts more plants in the world.
The current algorithm for calculating knearest neighbors is naive, so it's O(n^2). That'll be remedied as soon as I figure out how to do it.

 Prole
 Posts: 16
 Joined: Thu Feb 12, 2009 5:53 pm
 Contact:
Re: Introducing Frock, a flying chicken flocking simulation
Just an update. Am able to display debugging information now.
Decided to use a spatial hash since it was easiest to do, and Craig Reynolds gets away with it. Almost there.
Decided to use a spatial hash since it was easiest to do, and Craig Reynolds gets away with it. Almost there.
 bartbes
 Sex machine
 Posts: 4946
 Joined: Fri Aug 29, 2008 10:35 am
 Location: The Netherlands
 Contact:
Re: Introducing Frock, a flying chicken flocking simulation
Looks... complicated, but exciting as well. Makes me want to pretend I'm a spy
Who is online
Users browsing this forum: No registered users and 10 guests