3 ms·
I have an implementation here [0] if people want to play with it. Supports dynamically changing the controls, has obstacles and predators. Setting weights for s
by matsemann 7y ago
I have an implementation here [0] if people want to play with it. Supports dynamically changing the controls, has obstacles and predators. Setting weights for separation, alignment and cohesion to zero and then increasing only one of them nicely shows which role each of them plays. It's actually made as a workshop [1] for my company, where the shell is provided and one has to implement it step by step. In Norwegian, though.
Update: Dang linked other discussions, and I see I commented on one from 2015 [2]. Someone there asked for the course content, and that's available (in English!) in a PDF in [1]. This workshop/implementation is actually an example of what I wanted the students to make at the time. Which I then retrofitted to a fun workshop for my colleagues.
[0]: https://matsemann.github.io/boids-workshop/ https://matsemann.github.io/boids-workshop/
[1]: https://github.com/Matsemann/boids-workshop https://github.com/Matsemann/boids-workshop
[2]: https://news.ycombinator.com/item?id=9300142 https://news.ycombinator.com/item?id=9300142
- parhamn 7y agoI had fun playing with the parameters, thanks! Now, I want a wallpaper version of this with low maxSpeeds. Very relaxing.
- w-ll 7y agoRemember when Windows allowed you to set a .html file as a desktop background. Wallpaper Engine [0] might be your next best bet. 0. https://store.steampowered.com/app/431960/Wallpaper_Engine/ https://store.steampowered.com/app/431960/Wallpaper_Engine/
- kpgiskpg 7y agoThat's fun, thanks!
- zanderwohl 7y agoThese guys behave just like the implementation I wrote! I worked out how to do separation, cohesion, and alignment based on written descriptions as an exercise.
- nitrogen 7y agoWorks great on my phone. I noticed that flocks tended to split when they wrap around the edge of the field, as if forces weren't being computed wrapped. Makes it hard to accomplish my goal of merging all the boids into a single flock :).
- matsemann 7y agoYeah, the neighbourhood calculation doesn't wrap around. That's trivial to add, but then one has to account for the wrapping when calculating average neighbourposition so it's not completely off. Not too hard, but would have added complexity to the workshop.
- jv22222 7y agoThat's awesome, nicely done! Lot's of fun to play with.