Hi, I'd like to know some of the benefits of using quadtrees as a data structure to represent 2D maps. I'm not 100% sure how it works, because I've only read about them, but if it's anything like a binary tree (which it sort of seems to be like), it seems that you'd have to spend more time accessing a particular element by quadtree than you would using a 2D array, since you have to follow the branches down instead of having direct access. I've googled a bit about quadtrees, and many people seem to say that they're great for cutting down processing time, but I'm still in the dark about in what specific places - especially pertaining to roguelikes - that they would time down in and how/why. What are the pros and cons of using quadtrees vs a 2D array?
Or is it simply better to use both, if that were possible? If so, how would I do it - would I simply make the data references in a quadtree node point to the corresponding element (for example, a Tile) at indices x,y in the array? Would this potentially cause issues? Is this idea too inefficient to use?