3 ms·
> How much more complicated would it be if the obstacles were not polygons but points on a grid? I think with grids, one approach would be to go with a flood f
by legends2k 10y ago
> How much more complicated would it be if the obstacles were not polygons but points on a grid?
I think with grids, one approach would be to go with a flood fill kind of an algorithm, but doing it cell-by-cell will be costly.
An alternative way would be to unify cells together as a polygon and do intersection testing; with a hammer everything looks like a nail :P
I think in games like Baldur's Gate, [Portal Visibility](http://playtechs.blogspot.in/2007/03/2d-portal-visibility-part-1.html http://playtechs.blogspot.in/2007/03/2d-portal-visibility-pa...) is commonly used.