2 ms·
Yeah for perfect data its a bit soso, but if you don't care about that its great. I'm using some Morton curves for finding neighbours for movement and targeting
by animal531 2y ago
Yeah for perfect data its a bit soso, but if you don't care about that its great. I'm using some Morton curves for finding neighbours for movement and targeting in a 2d space for a large amount of points (in a compute shader).
One can divide the space into buckets, but for example for targeting at say 10 units the bucket can be 5k long for 1 million entities in a smallish area.
Using Morton which is fast to compute I can usually get a great selection of good candidates within a max set left/right distance and/or under an x,y distance check of some bigger value (as in allow 2d distances to climb to 3x max of our desired distance before breaking).