Modular castle walls were a feature of LEGO Castle sets of the 1980s. It involved wall segments with a common design that could be connected via Technic pins and recombined in different ways, allowing to extend castles with additional facilities or to built other larger structures like city walls. There was also the opportunity to buy such a set several times to built large circular walls or castles. Most sets with this feature were part of the Crusaders or Black Falcons lines.
This feature first appeared in 1984, when the Castle theme was relaunched and started to feature grey walls instead of yellow ones. Despite there were two different (sometimes antagonist) factions, the Crusaders and Black Falcons, both had buildings with a similar style, in particular similar walls that consisted of wall panels with battlements at the top, allowing a smooth transition between the different sets.
This design was already present in the first two castles of 1984, 6080 King's Castle and 6073 Knight's Castle. The first one was built on flat baseplates instead of normal plate-pieces like all other sets with modular walls, making it slightly difficult to integrate the castle due to the height difference. All other buildings from the same year 6040 Blacksmith Shop and 6061 Siege Tower included the wall feature as well. The Guarded Inn from 1986 featured a wall segment attached to a timber framed house. 6062 Battering Ram contained a large wall segment with a tower that was unlike any of the towers from the contemporary castle sets. 6081 King's Mountain Fortress from 1990 did not feature this wall design any longer but one its the sidewalls had a brick with a hole, making it possible to combine it with the previous sets.
Some sets of the Black Knights reprised this concept, but there were only limited possibilities since there existed only three compatible sets with connection points: The large Black Monarch's Castle, 6059 Knight's Stronghold and 6034 Black Monarch's Ghost. Those sets didn't feature a common wall design, making a smooth transition impossible.