The simulations of the solidification of ternary Al-Cu-Ni alloys by means of a general multi-phase-field model for an arbitrary number of phases reveal that the real microstructure can be generated by coupling the real thermodynamic parameters of the phases and the evolution equations. The stability requirements on individual interfaces for model functions guarantee an absence of "ghost" phases in a $n$-dimensional phase-field space. The special constructed thermal noise terms disturb the stability and can produce the heterogeneous nucleation of product phases in accordance to the energetic and concentration conditions. Of particular interest is that in triple points the nucleation of the forth phase occurs without additional noise. Another observation is the growth of the eutectic-like or peritectic-like structure in various alloys.