I need help with an NPC engine to my RPG. I have no idea of how this would be done so any help is welcome.

The engine should include both shops'n stuffs, and people walking around (which is the main problem) the town. The engine is just tile-base (i'm somewhat new to it, so i start with that).