Original Post
I have a bit of a problem. Because of the format (I''ll get into that later) of the game, a 2d LOS algorithm just isn''t enough. But I don''t want to go with a full 3d one, as the game is still ultimatly tile based.
The world consists of a height map, which is transformed into a full 3d landscape. In order to tell if a square is visible from another, I can do a simple 2d thing, treating any squares higher then those two as walls. But this is still a problem. Take the map below -
1111
1455
1455
1111
When looking from the 1 on the left next to the four, the current algorithm thinks the second five is visible. Well, it''s not supposed to be. The four blocks the view of it quite nicely.
I simple algorithm works fine when this happens along a grid axis, but not in cases like this:
1115
1455
1445
1114
When looking from the bottom-left, ALL the 5s should be unseen.