Mass Amounts of Objects : Octree vs Spatial Hash Grids?

Hello! I am working on a game and it requires a mass amount of entities and humanoids to be shown to the client. I have made a Spatial Hash Grid system in case. But i’m also aware of Octrees as well.

My question is whether I should use my Spatial Hash Grid system or look up on Octrees?

I would also like to know if there are other methods that achieve the same result, or even better. I would also like to brush more up on threading, and see if it can help me here. It would also help to know more about Actors and their use cases.

One more question I have is, Should I make the Server handle mass pathfinding or the client?

My game will use lots of pathfinding, and I want to make sure that it isn’t laggy for the server or the client. So what is the best option here?

Sorry if this post was confusing, I probably should have worded it better or made the post much shorter. :^P

2 Likes

I feel like Octrees would be more performant here, but it would take you longer to implement. The reason octrees are so performant is the bounding boxes/areas of the octree are different scales.

For example, In the middle of the map there are lots of objects in them, and the beyond that point it’s just empty space. An octree can solve this issue by subdividing multiple times until it reaches an object’s bounding box or it is less than or equal to it’s minimum threshold.

A Spatial Hash Grid system on the other hand contains multiple boxes with a consistent distance and a consistent size that is set to a certain number.

So I recommend using Octree’s instead. Although it will be harder to implement, it is more performant and optimized for your game.

1 Like

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.