Live progress #24 – Terrain got some Fog Of War

Since we are now in fair 3D, it’s time to use some clever tricks. One of such is terrain Fog Of War (FOW).

The trick is to keep in-game FOW data layout texture-friendly. That means that FOW data can be converted to a texture without additional processing simply as passing it as a pointer to texture maker function. Within terrain render FOW texture gets applied to the whole terrain at practically no cost.

2014-08-08 terrain fow

Caveats:

  • FOW edge is kind of troublesome at the moment, it shows an ugly “ladder” pattern. I hope there are techniques to make it more smooth without performance loss (maybe multi-tap sampling?).
  • Objects, Units and Houses need to be treated separately, that’s not a big deal
  • Water shader needs update too
  • Black color is under question. Maybe it’s better to keep it dark-grey alike Fog?

And as always – post your feedback and comments!

This entry was posted in Live progress. Bookmark the permalink.

4 Responses to Live progress #24 – Terrain got some Fog Of War

  1. The Dark Lord says:

    Sorry for not having replied on anything in a while. But now I’m back. 🙂

    Usually, there are two kinds of fog of war: complete darkness (the black you are referring to?) and just the normal terrain with objects, but darkened. The first is used for unrevealed terrain (that has yet to be discovered, like at the start of the game), while the second one is used for terrain that has already been discovered but of which the player has no vision at that moment (for example after a lost battle). Is that how you’re planning to do it too?

    • Krom says:

      Good to read from you TDL!

      I’m not really sure yet. FOW we have now kind of supports semi-fog, but it is not “proper”. FOW that we have allows shading levels from pure black to fully revealed terrain, but in idea, each player needs to have it’s own copy of terrain and see only things he did explore. For example if player 1 explored a forest and went away, when player 2 chops the forest, player 1 still should see it under semi-fog. Same goes for height changes caused by houses/roads/mining. For that to work there should be 1 true terrain and one “subjective” terrain for each player. Which is kind of a lot of work.

      Secondly, there’s the games pace. NG could be faster, but still slow compared to modern competitive RTSs. In that light, perhaps there should be no full-black FOW, but maybe semi-fog from the start, so that players could have a sense of direction in the game.

      I’ll see about semi-fog screens after dealing with gui stuff.

  2. The Dark Lord says:

    Hmm I don’t like the idea of no full-black FOW. It would just give too much away, especially in single player. Maybe just start with a large revealed circle around your initial start position, or a normal one with some semi-fog around it.

    • Krom says:

      Yeah, I agree, always revealing foes territory in SP is a bad idea. Even if that’s only terrain – it will ruin exploration phase and reveal important tactics info.

Leave a Reply to The Dark Lord Cancel reply

Your email address will not be published.

This site uses Akismet to reduce spam. Learn how your comment data is processed.