Yes, the AI always knows where everything is, without fail, BUT it can't plan ahead, at all, so if it can't move and shoot a target in the same turn, its behaviour becomes erratic at best. Sure they try to end their turn hidden but that is defined as 'not seen by the enemy' (I've seen them hide directly behind my soldiers
) if they can't be seen and can't shoot in that turn they just wander around randomly