Instead of implementing fog of war the standard way, we came up with an entirely new approach. Instead of using pixels, the EVIL engine calculates fog of war using geometry. Each unit that provides vision starts out as a perfect circle. Then we iterate over all objects in the level that block vision, such as walls and brush, and we subtract their shape from the circle of vision of each unit. By extending their geometry outwards, away from the unit for which we’re calculating it’s fog of war contribution, we’re left the exact geometric shape for the vision of that unit (figure 2b).

If there are a lot of units and objects blocking vision, this means a lot of calculations in every frame (figure 3a). And this is where the power of the A11 Bionic chip really shines. The A11 is a multi-core chip meaning that instead of just being able to calculate one thing at a time, with some clever programming, the A11 is capable of calculating 6 operations all at once. Vainglory uses the A11 chip to greatly speed up fog of war calculations on the iPhone X. The work for calculating each batch of vision geometry is spread out over the available CPU cores, making the calculation up to 6 times as fast (figure 3b).