Wednesday, February 5, 2020

c# - 2D Spatial partitioning alternatives to spatial hashes and quadtrees


I've been trying to implement a spatial partitioning algorithm in my game, but both spatial hashes and quadtrees aren't what I'm looking for.


My level size is not supposed to have a limit (only Int32 limits). I need a spatial partitioning algorithm that doesn't need a "Level Width" and a "Level Height".


I have many moving physical objects. I need the algorithm to be fast enough to support 500+ objects.


Any alternative?




Answer



I've decided to go with fixed 2D grids.


I've made two videos which explain in-depth how I implemented them, and the current implementation is available on my GitHub page: https://github.com/SuperV1234/SSVSCollision


http://www.youtube.com/watch?v=7HY_SqqaoL4


http://www.youtube.com/watch?v=vYB37BDtHuQ


No comments:

Post a Comment

Simple past, Present perfect Past perfect

Can you tell me which form of the following sentences is the correct one please? Imagine two friends discussing the gym... I was in a good s...