Hello! As the title implies, are there any general ideas as to how to integrate fog of war with A* pathfinding? My biggest issue/fear is units knowing the entire map by heart even though they’ve “seen” only a small portion of it. So the player can order the units to go to the opposite end and they would know the best path immediately.
I suppose one way to do it would be to mask unrevealed game objects out of the pathfinding calculations so that the units will try a straight line until running into an obstacle. Is this kind of masking possible? Also I fear that this would be quite performance-intensive, checking for a new path whenever a new object is revealed. Or I don’t suppose it would be possible to see if a newly revealed object is in the way of the current path and only recalculate if that is the case?
Are there any other “standard” solutions to this problem? Maybe something obvious I’m missing?