News for hackers. Stuff that matters.
Re:Boids by matsemann on Saturday March 28, 2020 @05:10AM (#22710069)
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/ [1]: https://github.com/Matsemann/boids-workshop [2]: https://news.ycombinator.com/item?id=9300142

Re:Boids by parhamn on Saturday March 28, 2020 @08:57AM (#22710853)
I had fun playing with the parameters, thanks! Now, I want a wallpaper version of this with low maxSpeeds. Very relaxing.
Re:Boids by w-ll on Saturday March 28, 2020 @09:54PM (#22715739)
Remember 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/

Re:Boids by nitrogen on Saturday March 28, 2020 @05:20PM (#22714411)
Works 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 :).
Re:Boids by matsemann on Saturday March 28, 2020 @07:11PM (#22715006)
Yeah, 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.
Re:Boids by zanderwohl on Saturday March 28, 2020 @04:09PM (#22713956)
These 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.
Re:Boids by jv22222 on Saturday March 28, 2020 @10:57PM (#22715987)
That's awesome, nicely done! Lot's of fun to play with.
Re:Boids by kpgiskpg on Saturday March 28, 2020 @03:51PM (#22713841)
That's fun, thanks!