By the 14th century, castles were combining defences with luxurious, sophisticated living arrangements and landscaped gardens and parks. Early gunpowder weapons were used to defend castles by the end of the 14th century and gunports became an essential feature for a fashionable castle. The economics of maintaining castles meant that many were left to decline or abandoned; in contrast, a small number of castles were developed by the very wealthy into palaces that hosted lavish feasts and celebrations amid elaborate architecture. Smaller defensible structures called tower houses emerged in the north of England to protect against the Scottish threat. By the late medieval period, town walls were increasingly less military in character and more often expressions of civic pride or part of urban governance: many grand gatehouses were built in the 14th and 15th centuries for these purposes.