FOG OF WAR

What is Fog of War

The Fog of War is a military science concept that refers to all the factors that complicates the attainability of goals, achievement plans and creates uncertainty in situational awareness in military operations and its participants, such as delays, troubles in communication, confusions or even the weather. The concept was introduced by the Prussian military Carl von Clausewitz in his book “Vom Kriege” (“On War”), referring, metaphorically, to the confusion dominating in a battle.

C&CRA2

This metaphoric concept has become one of the most important and unseen mechanics ever made in videogames, and brings multiplies implications to players, designers and developers. We can define the Fog of war in videogames as: “Everything that hides information from the player, and incites him/her to gather information in real time”. This simple mechanic allowed the apparition of the first games that simulates real battles, starting from war games to real time strategy games and turn based strategy games. Fog of War is the main mechanic of every single strategy games, without it, this games wouldn’t be possible. By extension, Fog of War is also used to describe the limited view distance of first-person shooters. The primary function of fog of war is to recreate information warfare, so that it is possible to get an advantage over an enemy by knowing the location and composition of their army or base.

TWRome2

FoW In Videogames

Fog of War benefits the players by memorizing and remembering facts about the game or game state. Knowing what can happen in games is an advantage to players, and when this information is shown just temporarily, they have to memorizing, affecting both, player and designer. Especially, if the fog returns after the players have explored the area. This give players’ cognitive immersion in the game, focusing their attention in how to solve problems derived from various aspects from the game. The designer has, also, to provide strategic knowledge to the player, this means information about game elements, rules or possible actions, doing a constant evaluation of the game.

Fog of War relies on the movement and range of view of units to explore unknown areas. This provides the game designer with opportunities to provide different of profiency for different units, giving them privileged abilities or asymmetric abilities and creating an orthogonal unit differentiation. Fog of War also allows to distract or mislead the player from their current goals by hiding information from them. This is called “Red Herrings”. The use of Red Herrings gives the players more potential outcomes and more things to consider while playing the game, increasing tension, trough uncertainty, and disrupting their attention.

It also allows, designer and players to hinder other players’ ability to gain information. The designer prevents the players to gain information by hiding goals, locations or keeping some information away from players. Summarizing, the designer needs to find the right balanced between the information that is given to the player and how that information can be gained, hiding facts from the player can make the game impossible to play enjoyable, even making it impossible to win, but in the other hand, showing too much information can make the game easy to win, boring the players fast, to abandon the game later. And too much chaos and confusion will frustrate the player.

The player needs to believe they have some reasonable chance to win until the moment the game ends, or then the game is not fun. If the player feels there is no chance to win, he/she will leave the game, but as long as they believe they have a chance to, they will be able to have fun, and the fog of war conceals the information that would strip them of their belief.

Ambush
Tile

Tile Based Approach

Some 2D games are made up of tiles which can have different shapes: orthogonal, hexagonal, isometric or squared. Despite the different shapes of the tiles, we can still apply the same approach for a 2D tile based game. In this approach, we will keep track of all the tiles in the map, to know what must be done at each tile in terms of visuals and logic, in what we will call states. Generally, in this kind of games, we have 2D container with the same size as our map. In the container, we will store ID’s referring to the state of each tile in its correspondent position, to know if it’s unexplored, covered in fog or visible. With this approach we can also have metadata to create zones with special conditions.

Learn more...
Mask

Mask Based Approach

Another approach for 2D games consists in drawing a surface overlapping the map, covering it with a determinate colour and alpha. Then we can create a png sprite with the shape and radius we want, this sprite will be following our player and each time our character moves, we will be subtracting the transparent area of the sprite we created onto the surface that is covering the map. We can create another grey layer with some transparency that will go under the main black mask of the Fog of War, where we refill the previous shape subtracted pixels before subtracting the sprite onto the surface.

Learn more...
Raycast

Ray Casting Approach

For 2D Top-Down View games we can use an approach that simulates the vision of our character depending on its position. In this approach we determinate which parts are visible and which are not, depending on our player’s position and the environment surrounding it. In first place we need to print a dark layer overlapping the map, then we need to raycast from the center of our player in all directions, and finally we get triangles that are formed in-between the rays, and we subtract them to the dark layer. To be more efficient, we can raycast directly to the beginning and ending of the walls to generate the triangular shapes that are visible.

Learn more...

Contact