Closed ogrady closed 10 years ago
I am currently in on implementing QuadTrees and using them for the map-collisions.
http://gameprogrammingpatterns.com/spatial-partition.html this might also be interesting for entities, like bullets and mech, when collision-detection should still be an issue after employing the quadtree for the map.
done in ca50ca1e536b6b39a0f34ba45d195b872b67300e
As for now, collision-detection puts some heavy load on the game, as whenever an entity moves, it will check for collisions with all other entities. Even if they are not near themselves. This slows the game down considerably, even in a 50x50 map (=2500 tiles to check) with some flying bullets and just one Mech. As we are planning on larger maps and multiplayer-support (= a multitude of bullets and mechs at a time), do you think it would be feasible to maintain a (B+-)Tree over the coordinates of entities in addition to the current list? Especially in regards to having to update the tree whenever an entity moves.