Usually influence maps don’t need to calculate line of sight of an agent/unit. But sometimes range units of some game genres like shoorters and RPGs need to calculate their influence based on the fact that they can see a point on the map to shoot at it or not.

A client of us asked us to implement it in our Influence Maps package. Obviously we did so.

To do such a thing for every point on the template, you need to calculate if there is any obstacle between the center of the agent’s template and that point and then decide to write to the cell or not.

You can use any line drawing algorithm like Bresenham or a simple interpolation of the float point and rounding the points to integer then you can find out which cells are on the line and you can check their values in your obstacles map.

You don’t need such a feature in most use-cases of influence maps but when you need it, it is good to have it around and now we support it out of the box.

You can watch a demo of it in the video below.