Following the player’s footsteps, always targeting the previous square as the destination? Sounds simple, in theory. But first the game would have to be taught to record and remember the player’s footsteps. Could be the last 10 squares, could be last 50. So the logic would be:
Set the 2nd last square of the player’s recorded path as destination. (the last square being the one player stands on currently)
Attempt to walk on it.
If the square is/becomes hazardous (e.g. fire, acid), select the 3rd last square as destination (exception: NPC’s current gear negates the hazard)
4a. If already on the square (and no hazard, and no movement necessary), attack adjacent monsters with melee/quiet weapons.
4b. Or don’t attack at all, and just take hits from monsters.
If badly wounded, disregard the ‘follow close’ command and attempt to flee the threat.
But what about shouting then? The player can shout. Perhaps that could be used to signal the NPC follower of your whereabouts. On the other hand, that makes noise. On the other hand, zombies can forget noise pretty fast.
A hacky way might be to force nightvision mutations on NPCs so that they can see always you in the dark. Force somehow.
Not to mention nightvision or infrared gear. About that:
The battery drain on NPC nightvision could be far slower.
Or the batteries could last forever on NPCs, to eliminate hassle.
Or the NPCs could be taught to use NV goggles sparingly and intelligently.
Or NPC battery-powered devices could recharge slowly over time. We would pretend that NPCs carry various portable rechargers (solar, or manual cranks).
Or we could simply disregard NPC vision and have them always magically know where the player is once such ‘follow close’ command has been given.
How about just an item? Like a tether between the player and NPC secured via a belt clip. The downside being that if the player is faster than the NPC they’re slowed down to its pace.