In the opening and middlegame , the king will mostly not play an active role in the development of an attacking or defensive position . In the opening and middlegame , the king will rarely play an active role in the development of an offensive or defensive position .