angus Posted May 18, 2020 Share Posted May 18, 2020 (edited) I implemented the agent-based flocking algorithm "Boids" in the Unigine component system for fun. See http://www.kfish.org/boids/pseudocode.html It's an incomplete implementation, don't expect too much. But it does make for a nice organic-feeling movement pattern. To get started with the attached code, make a new project making sure to tick the "Component System" box Unpack the .ZIP attached C++ files over the defaults. In the editor, make a bunch of ObjectMeshDynamic cubes (Create->Primitive->Cube) and scatter them around. I used 14, but you can use any number. Scale them down to 0.1. If you click-drag you can clone them or select some in the "world" tab and right-click for "clone". So long as they're called "Cuboid<something>" (hard coded, see source) they'll be animated. Action shot with rule-vector debugging on. cs_1.zip Edited May 20, 2020 by angus 5 Link to comment
Recommended Posts