Day 9, turned the walker into a wandering blackhole eating the points up in the array. Got to name an array rememberedDead. It has got to be the rain!
#quadtree #30DaysOf #NatureOfCode #p5js #CreativeCoding #GenerativeArt #CodeInLink
https://carlynorama.github.io/2023January-30DaysNatureOfCode/09-quadtree-update/
#codeinlink #generativeart #creativecoding #p5js #natureofcode #30daysof #quadtree
So I got around to checking out your #boids project. You definitely have better performance than me from the SpatialHashSet you use.
I believe you can generalize this further for better performance by making the spatial structure recursive. Here's an example I whipped up a year or two back. Only works in 2d, but could be easily refactored to 3d as well:
https://gitlab.com/chihuamaranian/collisionlib2d
It's a #quadtree #spatialpartitioning structure.
#boids #quadtree #spatialpartitioning #gamedev #programming
I have a C# #quadtree implementation I've hand-rolled in a previous project.
Without checking the docs, I bet #godot implements something similar behind the scenes that is more performant than I could realistically make.
In theory, each #boid 's next move is calculated independently from the others. This could be threaded or even put on the GPU. But those are both categories of optimisation that bring a lot of mental (and digital) overhead. Gains might not be as good as expected.