Simply make the city a different map than your wild lands. For example, you can add a gate which leads into your city or town. Of course, this may remove some realism, but it is a good workaround for new developers. It doesn't solve the issue of monsters waiting for you outside, but it's called a workaround, not a fix.