Hacker News new | ask | show | jobs
by diggan 387 days ago
Noticed that all the boids lifetime seems to be the same, so you go from "a flock" to "nothing" very quickly if the lifetime been hit. What I've done before with "crowd simulations" like these, is add another params, something like "random lifetime interval" where if set to say 100, it'll set the actual lifetime to be randomly chosen between $LIFETIME - 100 and $LIFETIME + 100, so things die a bit less predictable. Helps stabilize the simulations too when you're doing reproduction too.
1 comments

yes had the same idea but applied that by doing randomization in age: floor(random(0, this.lifespan))

for me its not vanishing suddenly, so not sure how to reproduce now