Ì find myself in need of turning a polygon position into an array of all neighboring polygons' positions. My current method works, but this is for a pathfinding ICE tree, and the polygon neighbors need to be found thousands of times in a loop, which is slow with this method. Is there no faster, more efficient way of doing this?
The pathfinding works now, and according to the ICE performance tester, over 60% of the calculation time is wasted on finding polygon neighbors with the tree I posted.
do this lookup only one time, store positions/ids of the neighbor polys
on each polgon. then you can perform a fast lookup on each poly without
evaluating the search tree .