dmonzonis / lazarus

Engine for creating roguelikes in C++
GNU General Public License v3.0
0 stars 0 forks source link

FOV algorithm produces some weird behavior #14

Closed dmonzonis closed 4 years ago

dmonzonis commented 4 years ago

Right now, the FOV algorithm works by casting rays in all directions. The way the ray lines are calculated produces some weird behaviour, like the one observed in the following image when hugging a wall. Screenshot_20190929_163600 Wall tiles become invisible and then one suddenly becomes visible further away.

Reproduced in fa46b715c651daddd7f449e14a1fd911dc65a30d.

dmonzonis commented 4 years ago

Apparently this is a known problem if doing FOV via raycasting, and some other FOV algorithms have gaps too. It could be a good idea to implement more FOV algorithms to let the user choose what's best for them. Check http://www.adammil.net/blog/v125_roguelike_vision_algorithms.html for a list of FOV algorithms.

dmonzonis commented 4 years ago

Closing this as this is not a bug but an intrinsic problem of the FOV algorithm itself, as the appearance of "gaps" is a known problem when using raycasting. The only solution is to add more FOV algorithms which do not have this problem (but may have others).