Introducing Frock, a flying chicken flocking simulation

Show off your games, demos and other (playable) creations.
Post Reply
iamwilhelm
Prole
Posts: 16
Joined: Thu Feb 12, 2009 5:53 pm
Contact:

Introducing Frock, a flying chicken flocking simulation

Post by iamwilhelm »

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!
Frock_small.png
Frock_small.png (17.23 KiB) Viewed 7002 times
frock.love
(211.88 KiB) Downloaded 397 times
User avatar
Skofo
Party member
Posts: 146
Joined: Mon Dec 22, 2008 10:55 pm

Re: Introducing Frock, a flying chicken flocking simulation

Post by Skofo »

HAHAH! Too neat. :ultrahappy:
Working on: Viator
Need a 64-bit Debian package for LÖVE? Here it is!
iamwilhelm
Prole
Posts: 16
Joined: Thu Feb 12, 2009 5:53 pm
Contact:

Re: Introducing Frock, a flying chicken flocking simulation

Post by iamwilhelm »

Oh, I forgot to mention that clicking on the screen puts more plants in the world.

The current algorithm for calculating k-nearest neighbors is naive, so it's O(n^2). That'll be remedied as soon as I figure out how to do it.
User avatar
farvardin
Party member
Posts: 167
Joined: Sat Jun 28, 2008 6:46 pm

Re: Introducing Frock, a flying chicken flocking simulation

Post by farvardin »

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...
osuf oboys
Party member
Posts: 215
Joined: Sun Jan 18, 2009 8:03 pm

Re: Introducing Frock, a flying chicken flocking simulation

Post by osuf oboys »

iamwilhelm wrote:Oh, I forgot to mention that clicking on the screen puts more plants in the world.

The current algorithm for calculating k-nearest neighbors is naive, so it's O(n^2). That'll be remedied as soon as I figure out how to do it.
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 All-Nearest-Neighbors problem by Pravin Vaidya (1986): http://ieeexplore.ieee.org.ludwig.lub.l ... 568202.pdf. O(n log n) k-nearest 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 :).
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.
User avatar
rude
Administrator
Posts: 1052
Joined: Mon Feb 04, 2008 3:58 pm
Location: Oslo, Norway

Re: Introducing Frock, a flying chicken flocking simulation

Post by rude »

Neat. Somehow reminds me of that PS3-demo. Maybe Skasi can use something like this for his Galcon-like game.
iamwilhelm
Prole
Posts: 16
Joined: Thu Feb 12, 2009 5:53 pm
Contact:

Re: Introducing Frock, a flying chicken flocking simulation

Post by iamwilhelm »

osuf oboys wrote:
iamwilhelm wrote:Oh, I forgot to mention that clicking on the screen puts more plants in the world.

The current algorithm for calculating k-nearest neighbors is naive, so it's O(n^2). That'll be remedied as soon as I figure out how to do it.
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 All-Nearest-Neighbors problem by Pravin Vaidya (1986): http://ieeexplore.ieee.org.ludwig.lub.l ... 568202.pdf. O(n log n) k-nearest 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 :).
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...
iamwilhelm
Prole
Posts: 16
Joined: Thu Feb 12, 2009 5:53 pm
Contact:

Re: Introducing Frock, a flying chicken flocking simulation

Post by iamwilhelm »

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.
Screenshot.png
Screenshot.png (187.78 KiB) Viewed 6655 times
User avatar
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

Post by bartbes »

Looks... complicated, but exciting as well. Makes me want to pretend I'm a spy :?
Post Reply

Who is online

Users browsing this forum: Ahrefs [Bot], Amazon [Bot], Google [Bot] and 6 guests