Where I currently live, in a medium-density area of town-houses (actually, pretty high-density for town-houses), seems to be the perfect density for community. I see my neighbours all of the time, just doing our things, and you say hi and chat because that's what humans do. Any more dense and you have apartments, where strangely people are more distant (even though closer) (unless effort has gone into the apartment design to get people interacting), less dense and you have a suburbia with its fortresses.