O'Reilly logo

Learning Game AI Programming with Lua by David Young

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Spreading influences

To actually spread the current influences to their maximum possible regions, you can call Sandbox.SpreadInfluenceMap. Based on how influences are configured to fall off over distances, the spreading of influences will be calculated automatically. The reason behind spreading influences allows for a quantization of areas where multiple systems can access spatial data with no overhead cost of calculating values:

Sandbox.SpreadInfluenceMap(sandbox, influenceMapLayer);

The overall algorithm used to calculate influence has a maximum of 20 iterations in case the set falloff of influence is so low that it could propagate past 20 cells in any direction. Additionally, if the propagation of influence drops below the minimum of one percent, ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required