Metals, and steel in particular, play a fundamental role in our everyday life and are used in countless applications, from the construction industry to transport, energy, packaging, and house appliances. Different applications, however, require different material properties of the metals, which need to be designed to meet the requirements. Materials design in its turn requires a deep understanding of the dependence of the mechanical behaviour of the metal on its chemical composition and microstructure. This is not possible without a good understanding of dislocations. Dislocations are defects in the atomic structure of metals which collectively, at the macroscopic scale, determine how metals deform. For this reason, any macroscopic model that aims for a predictive power has to take into account the presence of these defects. However, since the typical number of dislocations in even a small sample of metal is very high, formulating a model that keeps track of every single dislocation is unfeasible except for very small-scale problems. Although good models for dislocations are available at the level of the atomic lattice, it is not yet well-understood how to incorporate the effect of their presence and motion in a model at the macroscopic, engineering scale. This challenge has become the focus of intensive research in the last decade - in the engineering community because of the need of good macroscopic models for the development of new metals and alloys, and in the mathematical community for the central role it plays in understanding complex multiscale systems. Over the years, and in different communities, this challenge has been approached in several ways. The great advantage of a rigorous approach is that it is exact; the price to pay, however, is a strong limitation on the configurations that can be analysed. In the majority of the mathematical literature, dislocations are modelled as straight and parallel lines, while they are in fact three-dimensional curves. This assumption reduces the complexity of the theory enormously, although the mathematical challenges in this idealised setting are still countless. A special configuration that has received great attention in recent years is that of vertically periodic dislocation walls, similar to low-angle grain boundaries. One of the reasons why they are so popular is the general belief that they represent minimum energy arrangements for dislocations. The proposed research poses a more fundamental question: what are the energetically favourable configurations of dislocations? And, also, how do low-energy dislocation structures vary when a small but non-zero temperature is introduced in the model? Low-energy dislocation structures (LEDS) like walls, clusters and cells are one of the main features of the microstructure in metals. These high-density configurations increase the resistance of the material against plastic slip, thus leading to a stronger material. Characterising and hence exploiting and optimising LEDS is a key step in materials design: it would allow designers to construct lightweight structures which nevertheless have a high resistance to deformation, resulting, e.g., in safer and more fuel-efficient cars. Therefore, every advance in our research is relevant to mechanical engineering and industry. The research in this project however goes beyond the specific example of defects in metals. Dislocations are a paradigmatic example of a complex particle system and the analysis developed here would be applicable to a variety of problems dealing with the derivation of the collective behaviour of a large number of individual agents, e.g., crowd and traffic dynamics, swarming, networks.