NPC

An NPC (Non-Player Character) is an automated character that provides some service to players. Most NPCs are vendors, providing items in exchange for coins (and coins in exchange for items). Exceptions are the Guide, who provides information, and the Old Man (before he becomes the Clothier). The Nurse doesn't sell items, but provides Health restoration in exchange for coins. Players can utilize NPCs by standing near them and right-clicking on them.

Conditions
An NPC will spawn when its specific conditions are met, usually by achieving a certain level of advancement in the game. Examples include acquiring 50 silver coins for the Merchant to spawn, or beating your first Boss for the Dryad to appear. See specific NPC requirements in the table below.

One additional condition required by all NPCs (except the Guide) is a vacant house built by the player. A house must include one "comfort item", one "flat surface furniture", and a door, be fully enclosed in blocks made of something other than dirt, have walls behind it made of something other than dirt or Dungeon walls(as of 1.0.6,dirt and dungon walls count as "house" walls), and must have at least one Light Source. An NPC may also move into a home with all of the conditions except a table may be replaced with a Work Bench. See Home for a full list of requirements.

As of 1.0.6 NPC's Now only require one "comfort item" and one "flat surface furniture" and no door as can be seen by the Nurse moving in to the basement of the picture. Also all backgrounds now work (including dirt and dungeon walls(taken from 1.0.6 patch notes Item Changes)).