- Home /
Quadtree Neighbor Level Differences
I found a paper on a quad tree constant time neighbor found algorithm here. But iI figured that I only need one part of the algorithm, I don't actually need to find the neighbors, I just need the neighbor level differences which seems to be set in this part of the algorithm: 
However, I don't understand where or how the level differences are being set, can someone explain this bit of pseudocode to me?
Answer by TonyLi · Mar 11, 2014 at 03:59 PM
The level difference calculations are done in the table before that pseudocode. See the box containing Case 1, Case 2, Case 3, & Case 4. The algorithm is a breadth-first search, so it starts with a single node that's grey (partially black -- e.g., enemy -- and partially white -- e.g., empty). Figure 7 shows an example of what happens when you calculate level differences on that node. And then it recursively subdivides until every node is either black or white. You can't get the neighbor level differences without building the whole quadtree.
Your answer
Follow this Question
Related Questions
Can Someone Explain this Code to Me? 0 Answers
xp math equation help 1 Answer
Accessing object in a different level 1 Answer
UI Button deletes Function on start 1 Answer
Classic Resident Evil-style room loading/level streaming? 4 Answers