We investigate the formation of protostellar clusters during the collapse of dense molecular cloud cores with a focus on the evolution of potential and kinetic energy, the degree of substructure and the early phase of mass segregation. Our study is based on a series of hydrodynamic simulations of dense cores, where we vary the initial density profile and the initial turbulent velocity. In the three-dimensional adaptive mesh refinement simulations, we follow the dynamical formation of filaments and protostars until a star formation efficiency of 20 per cent. Despite the different initial configurations, the global ensemble of all protostars in a setup shows a similar energy evolution and forms sub-virial clusters with an energy ratio Ekin/|Epot|∼ 0.2. Concentrating on the innermost central region, the clusters show a roughly virialized energy balance. However, the region of virial balance only covers the innermost ∼10–30 per cent of all the protostars. In all simulations with multiple protostars, the total kinetic energy of the protostars is higher than the kinetic energy of the gas cloud, although the protostars only contain 20 per cent of the total mass. The clusters vary significantly in size, mass and number of protostars, and show different degrees of substructure and mass segregation. Flat density profiles and compressive turbulent modes produce more subclusters than centrally concentrated profiles and solenoidal turbulence. We find that dynamical relaxation and hence dynamical mass segregation is very efficient in all cases from the very beginning of the nascent cluster, i.e. during a phase when protostars constantly form and accrete.