Young stars are mostly found in dense stellar environments , and even our own Solar system may have formed in a star cluster . Here , we numerically explore the evolution of planetary systems similar to our own Solar system in star clusters . We investigate the evolution of planetary systems in star clusters . Most stellar encounters are tidal , hyperbolic , and adiabatic . A small fraction of the planetary systems escape from the star cluster within 50 Myr ; those with low escape speeds often remain intact during and after the escape process . While most planetary systems inside the star cluster remain intact , a subset is strongly perturbed during the first 50 Myr . Over the course of time , 0.3 \% - 5.3 \% of the planets escape , sometimes up to tens of millions of years after a stellar encounter occurred . Survival rates are highest for Jupiter , while Uranus and Neptune have the highest escape rates . Unless directly affected by a stellar encounter itself , Jupiter frequently serves as a barrier that protects the terrestrial planets from perturbations in the outer planetary system . In low-density environments , Jupiter provides protection from perturbations in the outer planetary system , while in high-density environments , direct perturbations of Jupiter by neighbouring stars is disruptive to habitable-zone planets . The diversity amongst planetary systems that is present in the star clusters at 50 Myr , and amongst the escaping planetary systems , is high , which contributes to explaining the high diversity of observed exoplanet systems in star clusters and in the Galactic field .