Important alert: (current site time 7/16/2013 4:00:55 AM EDT)
 

winzip icon

vbBoid

Email
Submitted on: 9/26/1999
By: Richard Lowe 
Level: Not Given
User Rating: By 103 Users
Compatibility: VB 5.0, VB 6.0
Views: 23528
 
     This program uses three simple rules for each BOID, which when applied in the correct proportion produce emergent flocking behaviour. This program is entirely based on the work of Craig Reynolds (http://htm.com/cwr/boid.htm). I developed this program after a debate with a c++ programmer, who said that VB wasn't up to the job. See what you think.
 
winzip iconDownload code

Note: Due to the size or complexity of this submission, the author has submitted it as a .zip file to shorten your download time. Afterdownloading it, you will need a program like Winzip to decompress it.Virus note:All files are scanned once-a-day by Planet Source Code for viruses, but new viruses come out every day, so no prevention program can catch 100% of them. For your own safety, please:
  1. Re-scan downloaded files using your personal virus checker before using it.
  2. NEVER, EVER run compiled files (.exe's, .ocx's, .dll's etc.)--only run source code.
  3. Scan the source code with Minnow's Project Scanner

If you don't have a virus scanner, you can get one at many places on the net including:McAfee.com

 
Terms of Agreement:   
By using this code, you agree to the following terms...   
  1. You may use this code in your own programs (and may compile it into a program and distribute it in compiled format for languages that allow it) freely and with no charge.
  2. You MAY NOT redistribute this code (for example to a web site) without written permission from the original author. Failure to do so is a violation of copyright laws.   
  3. You may link to this code from another website, but ONLY if it is not wrapped in a frame. 
  4. You will abide by any additional copyright restrictions which the author may have placed in the code or code's description.


Other 3 submission(s) by this author

 


Report Bad Submission
Use this form to tell us if this entry should be deleted (i.e contains no code, is a virus, etc.).
This submission should be removed because:

Your Vote

What do you think of this code (in the Not Given category)?
(The code with your highest vote will win this month's coding contest!)
Excellent  Good  Average  Below Average  Poor (See voting log ...)
 

Other User Comments

9/27/1999 7:05:00 AMRichard Lowe

If you would like any further information....please mail me
(If this comment was disrespectful, please report it.)

 
9/27/1999 7:17:00 AMBruce Reid

Excellent work! I'm also a huge Craig Reynolds fan. I've been working on my own boids for a few months now and was having trouble with making Collision Detection work in a fast enough way. Hopefully your code will help me fill in some blanks. Haven't looked at your code yet, but your EXE looks great!
(If this comment was disrespectful, please report it.)

 
9/27/1999 7:36:00 AMRichard Lowe

Note : You can also add more obstacles by clicking in the picture !!!
I Should have mentioned that somewhere....
(If this comment was disrespectful, please report it.)

 
9/27/1999 9:57:00 PMJeffrey Haluska

About 5 years ago I wrote a program in VB that
was very similiar to this. (I was 14)
In many ways this is superior.
I always had problems with the boids
flying through complex objects too.
Keep up the great work.
(If this comment was disrespectful, please report it.)

 
9/28/1999 6:52:00 AMl_marvin

"I did this when I was 14" or "It was my Year 1 work" is, not only irrelevant, but a bit distasteful; would people refrain from doing that.
(If this comment was disrespectful, please report it.)

 
10/3/1999 7:51:00 PMHerman

A marvelous piece indeed. To me it has the kind of beauty of Kevino's 3D Mathematical Plot(beyond my grasp though, as I come from a different profession).
(If this comment was disrespectful, please report it.)

 
10/4/1999 3:02:00 PMJOe

It Rocks!!!!!!!!!!
(If this comment was disrespectful, please report it.)

 
10/5/1999 7:16:00 AMJeffrey Haluska

Well I did make this in the past and if you dont like me saying so then dont read my comments. And i didnt say it before because i was being nice, but mine was actually much better than this one!
(If this comment was disrespectful, please report it.)

 
10/5/1999 8:53:00 AMRichard Lowe

Jeffrey. I did not take offense to your comment, in fact I was quite impressed that you did this at the age of 14.
I would be interested to see your version - please post it on this site
(If this comment was disrespectful, please report it.)

 
10/5/1999 11:40:00 AMEric Miles

The correct web address for Craigs work is
http://hmt.com/cwr/boid.htm
(If this comment was disrespectful, please report it.)

 
10/5/1999 11:43:00 AMEric Miles

whoops I meant:
http://hmt.com/cwr/boids.html
(If this comment was disrespectful, please report it.)

 
10/5/1999 6:45:00 PMAndrew

Wow! Although I don't know much about boids, I am still very impressed with what I am seeing. This is very cool. Great work!!!
(If this comment was disrespectful, please report it.)

 
10/5/1999 6:54:00 PMAndrew

After visiting Craigs' web site on boids, I have a better understanding of boids. All I can say is that this is probably beyond my skills at this time; however, I am motivated to research more on this. I think this is really great stuff!
(If this comment was disrespectful, please report it.)

 
10/6/1999 11:08:00 AMl_marvin

(1) Re: Jeffrey's comment - This time it is not distasting, it has become disgusting now. (2) What make Richard's posting outstanding is that it has refresh input, hence it has live, forget about technical aspect for a moment (look at the many repeated old topics every day on this site). 3. Richard: Would you please take a look of "Clear" button; a minor point though, seems not working?
(If this comment was disrespectful, please report it.)

 
10/6/1999 2:07:00 PMRichard Lowe

Thanks for all the great comments guys.
The Clear button does work - but only when the boids are running - a minor bug I know....
Please mail me with any other bugs, suggestions....
I intend to implement some of the other grouping behaviours discussed by Craig reynolds (seek, avoid, dock, etc) in the next version.

(If this comment was disrespectful, please report it.)

 
10/6/1999 2:30:00 PMPaul

Way Cool... Richard! And I to would like to see Jeffey's code! 5 years ago ---right????
(If this comment was disrespectful, please report it.)

 
10/6/1999 5:10:00 PMBruce Johnson

Very very Nice.
(If this comment was disrespectful, please report it.)

 
10/6/1999 5:36:00 PMJonathan Feucht

This is great! GREAT!!!
(If this comment was disrespectful, please report it.)

 
10/6/1999 7:37:00 PMAndrew

Hi Richard,

I think I have found something interesting in this boids simulation. This is what I have discovered:

When I place more than a dozen circular obstacles in a way similar to a bowling pins placement tightly with only a little room for the boids (30 of them) to manuver, some of boids actually would go through the obstacles close to the curve area of the obstacles (basically the boids would go inside the obstacle a little bit and come out quickly)! Is this suppose to happen or is this because I have not given them enough room to avoid obstacles? If you can give me some hints, that would be great. Thanks.

Andrew
(If this comment was disrespectful, please report it.)

 
10/6/1999 10:37:00 PMJeffrey Haluska

I sincerely did not try to be distastesful. If you took it that way (which Richard didn't) it is your problem.

After rooting around for a couple minutes, I actually DID manage to find the code along with an email reply I got from Craig Reynolds, a very nice guy. I was wrong it was only 4 years ago.
As right now it doesn't compile, cause it was written for VB 4.0 (I have VB 6.0 now), and my EXE requires a VB40032.DLL.

If I get time, I'll try to get it to work in 6.0, and upload it.

Also, if you think it runs slow on your computer with lots of boids, I originally had to write it on a 486 66.

Jeff

(If this comment was disrespectful, please report it.)

 
10/6/1999 11:34:00 PMsuresh

good program
(If this comment was disrespectful, please report it.)

 
10/7/1999 3:46:00 PMRichard Lowe

Andrew - It is quite possible that the boids will go into an object. The Calculations TRY to make them avoid this - but if other obstacle or boids get in the way - BANG. This is also true in Nature - birds, fish etc will try to avoid hitting and obstacle - but don't always succeed - If you read the multitude of documentation on the net about boids - you will find this is very common. If you change the maths to try to ensure they boids avoid the obstacles - the flocking behavoiur falls apart.

Jeff - glad you found the code - look forward to seeing it - let me know if you need any help in the conversion.

(If this comment was disrespectful, please report it.)

 
10/8/1999 12:30:00 AMBryan Cairns

That's one of the most amazing things i have seen done in VB - great job
(If this comment was disrespectful, please report it.)

 
10/8/1999 10:21:00 AMRichard Lowe

Jeff - Thanks for the code - It looks great. I too was inspired by Steven Levy's book Artifical Life - a great read.
(If this comment was disrespectful, please report it.)

 
10/16/1999 8:44:00 AM122

GREAT WORK!!!
(If this comment was disrespectful, please report it.)

 
10/16/1999 8:45:00 AMJohn Doe

COOL!!
(If this comment was disrespectful, please report it.)

 
10/16/1999 5:38:00 PMRuss Smith

What an incredible piece of work - I am fascinated by these "BOID" things and have begun to research them. Sadly I didn't even realize such a thing could be done in VB - not to mention it being done in so very few lines of code. GREAT JOB!
(If this comment was disrespectful, please report it.)

 
10/21/1999 9:12:00 AMLupine

i have seen this before on the site. i like it alot very good work
(If this comment was disrespectful, please report it.)

 
10/25/1999 2:06:00 AMShambler

Very slick indeed. Time for a group session of "screw you!" to all the C++ snobs...
(If this comment was disrespectful, please report it.)

 
10/26/1999 7:45:00 PMChen Gang

A Bug. When set Sensor Range to 0,a runtime error arises and the app exits.
(If this comment was disrespectful, please report it.)

 
10/31/1999 4:58:00 AMAlexandre Moro

Guys,
Apart from any bug, I think MANY congratulations go to Richard by implementing such algorithm in VB.
This is EXTREME DIFFICULT, I know what I'm talking about...
Richard, parabéns!!!

(If this comment was disrespectful, please report it.)

 
1/24/2000 10:19:40 AMOmarSwan

Great Work.
(If this comment was disrespectful, please report it.)

 
3/23/2000 6:51:56 PMArmen Nalian

It is great!!!!!!
(If this comment was disrespectful, please report it.)

 
9/25/2000 1:43:07 AMCraig Reynolds

Despite the fact that it was almost a
year ago that Richard Lowe told me about
his VB boids implementation, I am just
now getting around to updating my boids
page to include a link to this page.
(BTW after two domain changes my page is
now at http://www.red3d.com/cwr/boids/)
Sorry for the delay, and happy flocking!

(If this comment was disrespectful, please report it.)

 
7/30/2001 10:25:13 PMbrewguru99

Wow! a celeb!
BTW - I recently re-downloaded this program and am currently implementing my own version, with added AI attributes... Oohhhhh I'm so excited about this.
(If this comment was disrespectful, please report it.)

 

Add Your Feedback
Your feedback will be posted below and an email sent to the author. Please remember that the author was kind enough to share this with you, so any criticisms must be stated politely, or they will be deleted. (For feedback not related to this particular code, please click here instead.)
 

To post feedback, first please login.