Developer Diaries

The diaries we keep while building MKA Engine: what we built, why, and what we measured.

The diaries we keep while building MKA Engine. Each diary covers one decision, the reason behind it and the result we measured. For the engine itself, see the MKA Engine page.

Developer Diaries

Dev Diary #9: Fog of War and Vision in a Strategy Engine

· Open separately

An old paper map under soft fog on a dark wooden table; only a small patch, lit by a lamp, shows terrain, with wooden pawns and a magnifying glass

In short: Fog of war separates the places a side sees today from those it explored earlier. MKA Engine keeps that information; the game chooses the rules for range, alliance sharing, detecting hidden units and what information its artificial intelligence (AI) can use.

How do current vision and past exploration differ?

When a scout leaves a valley, the player faces two different questions: Which places can this side see right now? Should land discovered earlier remain on the map? Hidden units add another question: if an ally can see an area, does that also reveal an enemy concealed there?

There is no single answer for every strategy game. If vision exists only as fog drawn on the screen, it becomes harder to explain what information guides the AI and the player. We keep vision and exploration as part of the game state, while leaving the meaning of each rule to the game.

Vision, sharing, and hidden-unit information

Current vision and past exploration

The engine keeps two facts separate for each side: places seen today, and places explored before. When a scout moves away, current vision can shrink; the game can choose to keep land it has already revealed on the map. The player can then distinguish unknown territory from ground seen in the past.

Range is also a game choice. In a simple game, a unit gains vision by counting neighbouring steps on the map. Another game can assign a travel cost to each piece of terrain; range then works like a budget, and vision stops when the cost runs out.

A bright area around a scouting marker shows current vision; muted revealed terrain shows past exploration; dark fog marks unknown land.

Sharing, detection and the AI

A game can share allies' current vision; sharing past exploration is a separate choice. When the sharing relationship ends, the live transfer of vision stops. Places already explored together can remain on each side's map if the game enabled that option.

Vision is not the same as detecting a hidden unit. An ally's light may reveal a valley, while a concealed force behind a ridge remains unseen. To spot the unit, the side's own detection strength must reach its concealment level.

The game can also choose how its AI treats a strength it cannot see: it can count it as unknown, remember the last observed value, or use an intelligence-based estimate. In the military example we verified, the AI did not choose a target outside its vision or detection; with the game's separate rule that closes unexplored land, its route also stayed out of that territory.

Allied lookout points illuminate the valley, while a concealed unit behind the mountain ridge remains in darkness.

What did the military scenario and later measurement show?

This diary keeps its original content date, October 15, 2026. The figures below come from a later measurement record dated October 17, 2026. One headless-runner pass was taken while the shared machine's recorded system load was 20–30: 30,000 locations, 8 sides, range 3 and 5,000 sources that start vision. It measured one vision update, not a full game day.

Range ruleTime (microseconds)Locations seen per side
Neighbour-step count1,2169,855
Cost of 1 for every location3,6429,855
Location costs from 0.5 to 1.55,2519,039
One vision update with different range rules

These figures describe only the stated example conditions; they are not an engine range limit or the time for a full game day. Giving every location the same cost produced the same visible area as counting neighbour steps; the varied-cost example reached fewer locations.

Separating vision data from game rules

A strategy game should be able to define exploration, alliance sharing and hidden units according to its own rules. Instead of fixing one fog-of-war model, the engine supplies the pieces for vision, exploration and visibility. How the player's map is shown is part of the game's choice too.

Limits of sharing information and measurement

In this single update, cost-based range took longer than neighbour-step range; a cost model can also cover a different area. This measurement did not capture the full-day effect of open vision in a real game.

What should the next measurement cover?

A useful next measurement would cover a full day in a real game world with its vision rules enabled. This one-step run does not show that total.

Frequently asked questions

Does explored land disappear when a unit leaves?

Current vision and past exploration are separate facts. A game can choose to keep previously explored terrain on the player's map.

Does an ally's sight reveal a hidden unit?

Not necessarily. Shared vision can reveal the area, but the side's own detection strength must reach the unit's concealment level for the unit to be seen.

Does the engine choose the fog-of-war rules?

No. The engine keeps vision and exploration; the game defines the rules for range, sharing, detection, AI knowledge and the map shown to the player.

Sources and links

For questions or suggestions, write to us through the contact page. For an overview, see MKA Engine; the full list is on the Developer Diaries page.