Walls link to buildings like they do to each other.
I realize that having buildings stack "over" walls is ruled out however, this idea is different... make it to where if a wall is placed next to a building, it links up to the building thereby making it impossible to pass between the building and the wall to get to inner structures without first either destroying the wall or the building. This would allow bases to be more customizable allowing more base layouts and more strategy... If not for every building atleast make it linkable to defense buildings like archer towers.