DevMaster.net Forums
[[ Home | Forums | 3D Engines Database | Wiki | Articles/Tutorials | Game Dev Jobs | IRC Chat Network | Contact Us ]]

Go Back   DevMaster.net Forums > Site Discussions > Code & Snapshot Discussion
User Name
Password
Register FAQ Members List Search Today's Posts Mark Forums Read

Reply
 
Thread Tools Search this Thread Display Modes
Old 10-07-2004, 01:43 PM   #1
NomadRock
Senior Member
 
NomadRock's Avatar
 
Join Date: Aug 2004
Location: USA
Posts: 826
Default



Description
This pair of screenshots is shows off a graphics project I did for school. It was an intro class, and I am no artist, so the graphics aren't anything to scream about among fellow graphics programmers, but they fit the purpose, and that is the whole idea. I wrote code on and off for about two months to get this project written from scratch.

I first wrote a 3d math library to make my life easier. Then I got a font renderer functioning, and finally wrote up a GUI system for it, that is pretty cool if I do say so myself. It is increadibly non intrusive, and it uses seperate layout files to specify the GUI itself that do not require recompiling. It also has a fun logging class that outputs to an html log with timestamps, and is color coded for importance of entries. I also got a smartpointer class going to take care of objects with reference counting.

The point of this app is to show off the boids algorithm, and there are 3 flocks of boids that will fly around the scene following random waypoints. They start scattered randomly, so they require a little bit of time to regroup before they start flying about as a group.

Also of interest, is a procedurally generated terrain that allows for infinite repetition. The trees are all randomly placed, and repeat along with the terrain. There are only 20 unique trees, to give you an idea of scale.

Everything implemented here is rediculously simple, but it all comes together rather nicely, and could be polished into a nice product very easily if I was so inclined.

The definition of the assignment required me to use Windows, but the code uses SDL, OpenGL, and DevIL, and entirely cross platform compatable to wherever those are supported.

It is mostly unoptomized debug code, and I think it still generates a gprof file for profiling, but it is fast enough as is, so I havn't bothered with optomizing it any further.

Download Windows Binary
NomadRock is offline   Reply With Quote
Old 10-07-2004, 09:58 PM   #2
NeZbiE
Member
 
NeZbiE's Avatar
 
Join Date: Sep 2004
Location: Planet Earth
Posts: 61
Default

Hey, the "flocks" look pretty neat. It would be nice if you provided some information on how the algorithm you used works =)
Just to make sure I have things right, a "Boid" is one of the individual artificial objects in a simulated flock, right?
NeZbiE is offline   Reply With Quote
Old 10-08-2004, 07:59 AM   #3
LuciferX
Member
 
LuciferX's Avatar
 
Join Date: Sep 2004
Location: Texas
Posts: 59
Default

No Nez,

It the formula that Woody Boid from Cheers would take while walking from place to place. Needless to say the bird algorithm would be much more intellegent. :tongue:
___________________________________________
"Do or Do Not, There is no try" -- Yoda
LuciferX is offline   Reply With Quote
Old 10-08-2004, 11:00 AM   #4
NomadRock
Senior Member
 
NomadRock's Avatar
 
Join Date: Aug 2004
Location: USA
Posts: 826
Default

Yes a boid is one simulated bird, but could just as easily be a fish, or if limited to a 2d plane it could be a member of a herd. Anything that flocks.

Each time step, each boid:
tends toward the next waypoint
tends toward the flock's center or the average position of the boids
tends away from any boid close enough that it might collide with
tends away from the ground if it might collide with it.

The ammounts are then tweaked endlessly to get the behavior you want.

Web search for boid algorithm, it is as known in behavioral AI as A* is known in pathfinding.

http://en.wikipedia.org/wiki/Boids has some nice history.
___________________________________________
Jesse Coyle
NomadRock is offline   Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Forum Jump


All times are GMT -7. The time now is 04:40 AM.


Powered by vBulletin
Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.