I’ve wanted to do this for years now, since I first heard about them.
And by “this” I mean have a play with flocking algorithms. What’s a flocking algorithm? Well, ever see birds in the sky? How they move around, kinda altogether, but not too close, not too far away? Yeah. This is like that.
These algorithms CAN get very complex, but I’ll just start with something relatively simple. See how they’re all bouncing around the dot? The dot is the centre of mass for the group. What I’m trying (and failing, currently) to do is get them all to point where they’re going (ie, towards the dot). So, more geometry for me!
Now unfortunately, I lost most of today getting my Haxe build cycle sorted out. Yes, I spent a day to cut my build time down from 10 seconds to 0.3s. Worthwhile? Well, when I’m working on complex code (which so far has been Terrain, Make A Maze and Flock – but is going to be increasing chunks of games in the future), I could be running this compile hundreds of times a day. Being able to do it in under a second instead of ten makes a HUGE difference. Not only does it radically speed up the write/test/debug cycle, it also minimises interruption to the thought processes – the key bit. So yeah, a bit tedious, but worth it long term.