Fog of War

From Valve Developer Community
Jump to: navigation, search
简体中文
The fog of war system in Dota 2 is a dynamic system that is calculated at run time during a game on a custom map. Custom game modes can enable or disable this feature as desired in script but by default will be enabled.
Note:The Tile Editor handles these constraints. This information may still be useful when building custom geometry.

Limitations/Requirements

Trees blocking line of sight in a custom map.

There are several limitations built into the system as optimizations that level designers need to be aware of when building a custom map.

Flat Terrain

Gameplay spaces in Dota 2 map are entirely flat outside of stairs and ramps to different elevations. Blending of various layers of materials help to break up this flat surface and make it appear as though there's a lot more depth than there really is.

It is possible to create rolling hills and variation in the ground however the fog of war system will not function in an expected fashion as it tries to draw line of sight based on the navigation spaces next to a unit.

Elevation Changes

While the terrain itself is flat there can be elevation changes. A good example of this in the Dota 2 map is the mid lane to river transitions where the units drop down to the river and then path back up to the higher surrounding terrain. The mid lane is at 128 units on the Z axis and the river is at 0 on the Z axis.

  • All traversable areas should be built at 128 unit height increments.
  • The fog of war is limited to 32 levels of elevation.

Elevation Limitations

No traversable terrain should be built below 0 on the Z axis. The fog of war system will stop calculating line of sight for those units below 0 as an optimization. In the Dota 2 map the river is the lowest point.

Maximum Map Size

The playable space may not exceed 16384x16384 units. Beyond this the fog of war system will not function correctly.