My goal was to calculate LOS between 2 hexes by checking a line drawn from the center of hex 1 to the center of hex 2. If the line crosses any pixel of a hex that blocks LOS, the LOS would be blocked.
Here's a screenshot:
![hex_los_example.jpg](http://www.gregburger.com/images/hex_los_example.jpg)
I drew in the red lines by hand to illustrate the issue below. The hexes with the red dots are within 10 hexes of the ork - his max sight range.
I've got my code working - as far as it's doing exactly what I intended it to. Here's a image from current test code. The dark hexes are not in LOS of the ork. As you can see, there are some "floating" hexes that are within LOS - according to center-center line method.
So, there seems to be a flaw with that method. I'm unsure what to do.
I was thinking about making a 2nd check, if center-center line method results in blocked LOS, I was going to then check 6 more lines, from the center of the viewer's hex to the 6 vertices of the "target" hex, and if 3 (or 2, or 4) of the vertices are within LOS, I'll say the hex is in LOS. That would open up more hexes to being in LOS.
Or... I could just make islands like that be NOT in LOS, the ruling being that a valid LOS can not pass through any hexes that block LOS, OR any hexes that are blocked themselves.
Any other ideas?
Is there a commonly used solution for such a problem?