Quantcast
Channel: Community | MonoGame - Latest topics
Viewing all articles
Browse latest Browse all 6821

Quadtree or List?

$
0
0

@StealthKilly wrote:

Lets say you have a big gameworld with 100000 enemies or objects spread all over the world.

To have a better performance you will only draw/update enemies which are in the viewport.
You will have much more perfomance when doing this, but you still have to go trough 100000 List Elements and check each of them if their position is inside your current visible area.

This method works fine but would it be better to use a Quadtree for such a scenario?

As far as I know Quadtrees are like BinaryTrees just with Rectangles(Quads) and the whole world is divided to some Quads and you check only those Quads where your visible area is instead of going trough the whole list?

Posts: 5

Participants: 4

Read full topic


Viewing all articles
Browse latest Browse all 6821

Trending Articles