This PhD thesis considers urban structure and buildings in an energy correlation and use the knowledge to design energy- and comfort-optimized cities and buildings. The parameters are: the structure of nature, the city and the landscape, both in terms of geometry and interrelationships and in terms of opportunities and limitations with regard to light, shade, sun and wind. The aim is threefold: (1) to unfold the link between building energy use and urban density, typology and fabric; (2) to analyse how technical scientific knowledge can be integrated in early urban planning and design decisions (IED); and (3) to show the architect's responsibility and opportunities to rethink their architectural role based on new goals and knowledge. The research results show an impact from urban form on building energy consumption which is much greater than previously thought, more precisely described, and more dynamic in character as daylight is taken into account. Furthermore the results suggest that there are limits to urban densification (200-300%) as an energy optimization strategy. The solar energy and daylight potential should be considered, and indeed protected, as a common resource in urban design. The most important observation for qualitative design research is that the first step to improving energy performance must be taken with the architect's first sketch on paper. It is here that the framework and preconditions for the city and the building's performance will be set. Argued this way, optimization of the special properties of urban density, typology and fabric takes priority over the optimization of technical service systems. This means that in the design process the architect's responsibilities outweigh those of the engineers. The research is reported in the main body of this thesis and in the papers for scientific journals.