NPCs spawn when camera approaches, patrol, follow player when in range, return to patrol, deactivate when off camera, etc.
https://j.gifs.com/8qzjDg.gif