Text this: The effect of diffusion barriers, stress and lateral diffusion on thin-film phase formation