I know there was a thread on this subject back in the day, although I don't believe it focused much on how to implement the FOW but rather discussed what kind of fog we wanted. I hope this topic will adress some of the difficulties in implementing it, so that we can enjoy a nice FOW sometime before release 1.0.
Why a Fog of War is needed
First of, we need a Fog of War imho. I can see several reasons:
- In the current situation you can 'scout' for enemy structures by looking for ground deformations, or by trying to build a structure where the enemy has one.
- You can see all of the map at the beginning. Some consider this a good point, as experienced players have no advantage over newbies when it comes to knowing the map. I myself disagree, and are in favour of scouting the map to see what it looks like. This makes scouting and / or knowing the map part of what it takes to be a decent player.
Bare in mind that a FOW that would fix these problems would go beyond the current LOS feature, that is invoked by pressing L. So please don't reply with comments like "I like L the way it is now"; it needs to be replaced.
What does it need to obscure?
First problem is what the FOW has to obscure. I think a real fog in the places where you haven't been is out of the question: that would block an overhead camera because you don't have LOS all the way to the heavens.
My suggestion is to have the an effective 2D FOW that depends on where you have LOS on the ground. All positions above it should then also be visible. This is of course not a perfect solution, as planes then can be outside the FOW but also outside your LOS.
So far there seems to be some kind of agreement on this point (but correct me if I'm wrong).
How to visualize it
The second problem is how to visualize it. Here the opinions begin to differ. Some want a real fog, but I believe that can be ruled out (see the previous point). There are two feasable options mentioned so far:
- Simply draw nothing where you haven't been before (or a black area), and a greyed out (or darkened) map where you have been before.
- Show the whole map from the beginning, with the areas where you have no LOS in gray or darkened.
- Or a mix; darkened terrain for the unscouted areas, grey terrain for the scouted areas. That way you can keep track of where you've been.
Ideally there would be an option in the battleroom to select what kind of FOW you want; that would satisfy everyone.
How to code it
Thirdly it has to be written in code.
I'm thinking assigning a heightmap to every AllyTeam. It only contains the part of the map you have scouted so far. The area outside your LOS is 'static' in the way that it won't get updated when it deforms, and can be drawn in grey (or darkened). The area in your LOS gets treated the way it is now.
Comments still welcome
I'll update this start-post if someone says something reasonable in this topic, so keep up the comments!