We closed this forum 18 June 2010. It has served us well since 2005 as the ALPHA forum did before it from 2002 to 2005. New discussions are ongoing at the new URL http://forum.processing.org. You'll need to sign up and get a new user account. We're sorry about that inconvenience, but we think it's better in the long run. The content on this forum will remain online.
IndexDiscussionExhibition › flocking (from hell on drugs)
Pages: 1 2 
flocking (from hell? on drugs?) (Read 3427 times)
flocking (from hell? on drugs?)
Jan 27th, 2009, 11:51pm
 
See my flocking project here: http://code.google.com/p/kuhn/

Google Code doesn't let me add an applet to a wiki page, so to run this you'll have to download the jar at: http://kuhn.googlecode.com/svn/trunk/flock/distrib/flock.jar and run it with "java -cp flock.jar kuhn.flock.Flock".

I based the core algorithm on the flocking example from this website. I added additional species and behaviors such as scavenging, hunting, and reproduction. I added additional aspects such as energy and death. I also made the camera pan, zoom, and rotate. Whew.

I'd love to hear what you think, or other ideas you have. I'm an absolute beginner to graphics programming and simulations, so any feedback would be appreciated.

Update: This is now hosted at http://landonkuhn.com/?page_id=7
Re: flocking (from hell? on drugs?)
Reply #1 - Jan 28th, 2009, 5:40am
 
throw it up on openprocessing.org, dude!
Re: flocking (from hell? on drugs?)
Reply #2 - Jan 28th, 2009, 5:54am
 
I didn't know about this site. Cool!

Too bad I wrote it directly in Java. It doesn't look like this site supports plain old jar files. Sad Not yet anyway.
Re: flocking (from hell? on drugs?)
Reply #3 - Jan 28th, 2009, 6:50am
 
Interesting. I appreciate the various kind of beasts, and how the camera goes toward areas of interest.

A little technical tip: in the MANIFEST.MF file, you can put the line:
Main-Class: kuhn.flock.Flock

Thus we don't have to go to command line (or make a bat/shell file) to run it.
Re: flocking (from hell? on drugs?)
Reply #4 - Jan 28th, 2009, 8:18am
 
Thanks. I've added a manifest. Now the jar can be downloaded and executed without any command line arguments.

The logic to find a boid to follow is actually dirt simple. I planned something more elaborate, but this seems to work pretty well, so I left it.

Landon
Re: flocking (from hell? on drugs?)
Reply #5 - Jan 30th, 2009, 3:58pm
 
Very nice! I'm working on an adaptation of the flocking algorithm too. I completed an original for a course but it's sadly not appletized: my boid world had prey and predators, and I let them evolve by exchanging vector and field of view genes. They each have six fields of view, which have their own genes, and for each they react differently to prey and predator.

They didn't evolve flocking, but did evolve a very insectile chasing and running away behaviour. I must get on with that port to Processing...
Re: flocking (from hell? on drugs?)
Reply #6 - Jan 31st, 2009, 12:35am
 
Super nice! I know it's probably not what you were after, but it reminded me of the animated title sequences to movies like The Pink Panther. I guess the colors and the jump cuts made me start looking for words like: "Directed By 12 Blue Birds". At first I wanted the world to be bigger, but now I'm not so sure it needs to be.

Thanks for sharing!
Re: flocking (from hell? on drugs?)
Reply #7 - Jan 31st, 2009, 12:45am
 
Thanks. I've tried to make the source easily tweakable, so feel free to download it and play around. I'd actually like to make it full screen, but so far haven't figured out how to run it in OPENGL, which would be necessary to keep the frame rate up.

I also think it would be fun to give them some sort of objective (other than killing and eating each other, that is), and keep to score.
Re: flocking (from hell? on drugs?)
Reply #8 - Feb 25th, 2009, 12:07am
 
I finally got around to hosting this someplace people can try it in a browser: http://landonkuhn.com/?page_id=7

If you haven't tried it, please do and let me know what you think.

-Landon
Re: flocking (from hell? on drugs?)
Reply #9 - Feb 25th, 2009, 10:50am
 
Very pleasing to watch as it gets busier. I notice in the code you've gone for default 2D - I had presumed it would have been P3D and you'd used a camera to achieve the zooming/panning, but no. Was that difficult?

One possible additional option: perhaps mouse or key could change the view to a stationary one of the whole field.
Re: flocking (from hell? on drugs?)
Reply #10 - Feb 25th, 2009, 4:50pm
 
Actually, the camera movement was an afterthought, and was easy to add, thanks to processing's translate, rotate, and zoom functions. I simply call those functions to get the camera to the desired pan, zoom, and rotation, and then draw all the boids as normal. Along with the push and pop matrix functions, it's actually a fairly elegant and unique example of encapsulation.
Re: flocking (from hell? on drugs?)
Reply #11 - Feb 25th, 2009, 7:05pm
 
Nice. Watching this reminds me a bit of something from 'Blue Planet' with the dolphins sharks and gulls
Re: flocking (from hell? on drugs?)
Reply #12 - Feb 28th, 2009, 8:32pm
 
magnificent, it's the battlefield of pseudo natural selection:) sort of sluggish in parts on my laptop but smooth on the desktop! inspirational






Re: flocking (from hell? on drugs?)
Reply #13 - Jun 12th, 2009, 6:50pm
 
Dude, this is cool. Does it work like an ecosystem, like, predators, decomposers, and stuff? I think I saw a bunch of small green critters eating a dead guy, but I can't be sure.
Re: flocking (from hell? on drugs?)
Reply #14 - Jun 13th, 2009, 11:27am
 
Very nice! Smiley
Pages: 1 2