I'm developing a turn based strategy game, and I'm trying to figure out the best way to figure out what tiles are visible to the users. So if the user has say, 50 units in their army, they can see any tile that any of those 50 units has a line of sight to that isn't blocked by an obstacle tile. I'm looking for something that's not too inefficient, since it's a server based game and I'd rather not bog down the server with a lot of calculations. Can anyone point me to some resources, if possible some code? It's in C#, and would be done entirely in an asp.net project (so no access to DirectX or XNA) libraries, etc.
Thanks!
I'd like to add that, in a tiled turn-based strategy game, line of sight is pretty much up to you to design. A turn-based strategy game is fairly abstract. You're basically making a fancy board game, not a simulation. I'd look at the rules for board games for inspiration, and then figure out how to port a board game mechanic I like into software.
For example, I remember one system with a pretty simple line-of-sight rule - the D&D miniatures game. I think it's got a slightly different name and set of rules now but I'm sure Wizards of the Coast still hosts the rulebook for free somewhere on its website. I think the rule is that you can see another square if you can draw a line from any corner of your square to any corner of the target square without passing over an obstacle square. I think you could see past corners as long as both sides of the corner are not blocked. If you cannot picture that, I'm sure if you find a rulebook there will be diagrams. So, to brute-force the test, all you need is to intersect a line and a square, and then iterate over corners.
My main point is that there is no one true algorithm for what you want. You need to play game designer a bit more before you play software engineer. Of course your software engineer half might tell your game designer half that his idea is impossible to program, but currently I think you should focus on what you want the rule to be.