This question already has an answer here:
I am currently writing a little roguelike and wondered how Nethack/other games do the FoV of the player. I had a look at Nethacks source code, but since it's C it's pretty hard to read.
For people who don't know how it looks in nethack:
I couldn't find good resources on how to achieve this result.
Of note is that my maps are a little more complex with regards to shape and objects that block sight.
So how would I actually implement that? Map is just an array of ints.
I figure I should have flags on each cell saying if it's been discovered or not, but how to I simulate the FoV?