Posted: 28th Apr 2003 4:44
I was trying out some very, very basic AI tricks with sprites, and I came up with something that reminds me of how fish behave

Move the mouse around (the fish will follow) and make these fish swim towards the moving circle.
Posted: 28th Apr 2003 4:57
Thats really cool nice job.
Posted: 28th Apr 2003 17:56
COOL!
nice output
Posted: 28th Apr 2003 21:31
Glad you like it

There is one problem with it however, it's very processor intensive and that problem lies with CheckSprToSpr() (which should be named CheckFishToFish(), oh well).

For each updating fish, it checks the distances to all the others, and tries to keep some distance away, so when the constant MAXSPR is set to 50, that's 50 x 49 checks (2450). Set MAXSPR to 100 and there should be a noticable slowdown (9900 checks), on my system it just about makes 30 fps in fullscreen exclusive mode.