How do i make my enemies more smart and tactical

This old example project of mine may help you, it doesn’t solve everything, but it’s made using ray casting.

2D Stealth