Star and planet formation are inextricably linked. In the earliest phases of the collapse of a protostar a disc forms around the young star and such discs are observed for the first several million years of a star's life. It is within these circumstellar, or protoplanetary, discs that the first stages of planet formation occur. Recent observations from ALMA suggest that planet formation may already be well under way after only 1 Myr of a star's life. However, stars do not form in isolation; they form from the collapse and fragmentation of giant molecular clouds several parsecs in size. This results in young stars forming in groups -often referred to as 'clusters'. In these star-forming regions the stellar density is much higher than the location of the Sun, and other stars in the Galactic disc that host exoplanets. As such, the environment where stars form has the potential to influence the planet formation process. In star-forming regions, protoplanetary discs can be truncated or destroyed by interactions with passing stars, as well as photoevaporation from the radiation fields of very massive stars. Once formed, the planets themselves can have their orbits altered by dynamical encounters -either directly from passing stars or through secondary effects such as the Kozai-Lidov mechanism. In this contribution, I review the different processes that can affect planet formation and stability in star-forming regions. I discuss each process in light of the typical range of stellar densities observed for star-forming regions. I finish by discussing these effects in the context of theories for the birth environment of the Solar System.
When I was asked to contribute a review article to this Royal Society volume one topic immediately sprung to mind. It is something that, quite obviously as I'm authoring this review, I find fascinating, but I've yet to find either a professional astronomer, an amateur astronomer or a layperson who isn't fascinated by the question of whether our Solar System is typical amongst the thousands of planetary systems orbiting other stars. In a sense, the question can be conceptually quite straightforward; all we need to do is to work out what the typical conditions are for star formation, and then model these conditions as planets are forming(!). In reality, this is an extremely complicated thing to work out, and this review article aims to give the reader a flavour of the many different strands of research that make up this problem.
During my PhD studies (2007 -2010) I worked on computing the rate of dynamical encounters in star-forming regions, and how these encounters could disrupt primordial binary star systems. One of the underlying assumptions of this work (an assumption which I now consider to be at best too simplistic, and at worst completely wrong) was the idea that all star-forming regions had very high stellar densities (>1000 M pc −3 , which is four orders of magnitude higher than the stellar density in the local Milky Way Galaxy near our Sun). This assumption was born of its time; the previous twenty years of observations of young stars had shown them to be grouped together in their birthplaces -Giant Molecular Clouds -and although one can measure the present-day density of a star-forming region, at that time it extremely difficult to infer, or guess at the initial density of a star-forming region, other than the present-day density is probably a lower limit to the initial density.
Whether this assumption is right, wrong, or as is the case with most things, somewhere in the middle, as a PhD student I wondered what effect such a high stellar density would have on planetary systems. I wondered whether they would be able to form at all, and if they were able to form, what the long-term effects of being born in a dense environment would be on such planets. Whether by fluke or design, my boss in my first post-doctoral position put me in the same office as an expert on directly imaging exoplanets. One day my office-mate asked "Do you ever put planets in those simulations of yours?", and that conversation eventually led to Parker & Quanz 2012 [1] , the first piece of work I did that was independent of my PhD supervisor.
I remember the literature search for that paper being a Herculean slog; I rapidly realised many people had done similar work before, but in the late 90s and early 00s the field had moved so rapidly that a comprehensive review article on the topic was lacking. I subsequently started working on the effects of the star-forming environment on the early Solar system (on which Fred Adams had written an excellent review back in 2010 [2] ), but then struggled to assimilate and digest the vast literature on external photoevaporation of protoplanetary discs; something that turns out to be relevant for both Solar System formation and the formation of planets in star-forming regions in general.
Later, when I was fortunate enough to be supervising other people's PhD theses, these students would invariably say the same thing: why isn't there a review article broadly covering the physics of the birth environment of planetary systems? Just as I had in my PhD, they were missing a starting place to learn not just about star formation, but star cluster dynamics, planetary dynamics and protoplanetary disc destruction.
In recent years, huge strides have been made in all of these areas. The initial conditions for Nbody simulations of star-forming regions now try to mimic the filamentary and substructured appearance of observed star-forming regions, whereas the early simulations were limited to modelling smooth, spherically symmetrical star clusters. Graphical Processor Units (GPUs) have enabled multi-planet systems to be modelled within N -body simulations of star clusters, which is making these studies more realistic than ever before. At the same time, state-of-the-art modelling of both photoevaporation and the internal evolution of discs -again, within global Nbody simulations of star-forming regions -is completely changing our understanding of planet formation in environments where massive stars are present.
My intention with this article is not to cover everything, but to give an overview that is accessible to Masters and PhD students, as well as people who may not work directly in this field. I begin by giving an overview of star formation to try to qualify the density of star-forming regions where planet-host stars form, and how these regions may disperse into the Galactic disc. I then discuss the effects of the star-forming environment on protoplanetary discs, before moving to a discussion on the effects on fully formed planets. I finish with a short review of the birth environment of the Solar System.
If you only take one thing away from this review, at least consider that star and planet formation are inextricably intertwined, and cannot be treated as isolated events. And also realise that even though this is a review, and it has been refereed, this article will still be biased, if only from the selection of material I have chosen to include.
When discussing the likely birth environments of planetary systems, it is first useful to consider the formation environment of the planets' host stars. Stars like the Sun do not form in isolation, but rather in the company of many other young stars. Therefore, the regions in which stars form are often called 'clusters', although this term is used interchangeably with 'groups', 'star-forming regions' and 'associations'. Various definitions exist for each of these [3, 4] ; from herein I will use the catch-all term 'star-forming region' to describe any collection of young (< 10 Myr) stars. I will limit the use of 'cluster' to describe a gravitationally bound set of stars, and an 'association' to describe a gravitationally unbound set of stars [5] .
Observations with the Spitzer and Herschel space telescopes reveal young stars to be deeply embedded in the Giant Molecular Clouds (GMCs) from which they form, and it is thought that this naturally explains the clustering, or grouping, of young stars with other stellar objects. GMCs are predominantly composed of molecular Hydrogen, and have temperatures of only several 10s K. GMCs are expected to collapse and then fragment, with the mass-scale for each fragment (the Jeans mass) around 1 M and the size of the fragment around 0.1 pc.
Once the GMC has undergone collapse, the individual fragments -referred to as pre-stellar cores -undergo further collapse to pre-main sequence stars (objects with stellar densities that have not commenced hydrogen fusion in their cores) and also further fragmentation, so that an individual core can form a single star or a multiple star system. Multiple star systems are small collections of stars -either binary, triple, quadruple (or even higher-order) systems -that orbit a common centre of mass. Multiple systems -especially triple, quadruple or higher -are not always stable for the lifetime of a star, but observations show that almost half of all Solar-mass (0.8 < m/M < 1.2) stars are in binary, triple or quadruple systems [6, 7] . Indeed, because both dynamical decay (where an unstable multiple system loses members) [8, 9] and direct destruction from encounters [10] [11] [12] destroy multiple systems and create more single stars, the primordial, or birth binary fraction, may be even higher than 50 per cent.
The distribution of individual stellar masses formed from the collapse and fragmentation of a GMC usually follows a log-normal distribution at low masses (0.1 -1 M , with a peak between 0.2 -0.5 M ), and above 1 M it follows a power-law slope of the form
which is sometimes referred to as the 'Salpeter' slope after the seminal paper by Salpeter [13] , who was the first to measure the mass function of stars. Most formulations of the stellar mass distribution (the Initial Mass Function) agree that low-mass stars are inherently more common than higher mass stars [13] [14] [15] [16] [17] [18] , predominantly because of the steep slope of the mass function.
The IMF tells us that on average, the more stars in a star-forming region, the more likely it is that the region will contain massive (> 10 M ) stars. The relation between the total mass of a star-forming region and the most massive star that is able to form has been the subject of much debate [19] [20] [21] [22] [23] [24] [25] [26] [27] [28] [29] [30] higher than some threshold (typically higher than ∼500 M , [26] ) in order to form massive stars (with that threshold being significantly higher than the mass of the massive star(s)). However, several examples of low-mass (∼100 M ) star-forming regions are known to contain massive stars, including σ Orionis and γ 2 Velorum.
Massive stars have both a positive and a detrimental effect on planet formation, as we will see in Sections 3 and 5, and on average the presence of massive stars implies a significant number of lower-mass stars like the Sun. This then factors into an important discussion on whether stars form in regions with a typical density (number, or summed mass of stars per unit volume), or range of densities. If stars form within a fundamental length scale, then the more stars there are (i.e. the more massive the GMC), the higher the stellar density is likely to be. By way of an example, if a region contains a few hundred stars within a 1 cubic pc volume, its density is of order 100 M pc −3 . If a region contains several thousand stars within the same 1 cubic pc, the density is a factor of ten higher (1000 M pc −3 ).
The density of a star-forming region then sets the level of perturbation a planetary system can expect. There are essentially three density regimes that pose a threat to planetary system formation and evolution. In the presence of massive stars, FUV and EUV radiation can affect protoplanetary discs at stellar densities as low as 10 M pc −3 . At stellar densities > 100M pc −3 , planetary orbits can be altered (which can include changes to the oribtial eccentricity, inclination and semimajor axis of individual planets). At higher densities still (> 1000 M pc −3 ) protoplanetary discs can be physically truncated by encounters. (We will discuss each of these processes in more detail in the following sections.)
One of the most important issues when considering the density of a star-forming region is that the present-day (observed) density of a star-forming region may be significantly lower than the birth, or maximum density [31] . Star-forming regions are collisional systems, and strive to reach equilibrium via dynamical relaxation, which has the effect of causing the region to expand. Depending on the initial density, this expansion may cause a decrease in the stellar density by several orders of magnitude. It is therefore impossible to pinpoint the maximum density by simply observing the current density at a given time, and extra information is required.
Stars appear to form in filamentary structures within GMCs [32,33] and so star-forming region that has not undergone significant dynamical evolution is expected to exhibit a large degree of spatial and kinematic substructure [34] [35] [36] [37] . This substructure is progressively wiped out as a starforming region undergoes relaxation [38, 39] , meaning that we can use the amount of substructure as a dynamical clock. This has proven effective at predicting the initial density of several observed star-forming regions, and by extension, predicting the amount of perturbations planetary systems in those regions would expect to experience. In general, most star-forming regions are consistent with having initial densities of at least 100 M pc −3 , which would cause some disruption to the orbits of planetary systems, and cause significant mass-loss to the protoplanetary disc if the region contains massive stars.
When considering the environment of either very young planets (< 10 Myr) or protoplanetary or debris disc host stars, the inferred birth density from nearby star-forming regions is probably valid. However, many of the exoplanet host stars are of a similar age to the Sun and therefore formed at a redshift of z ∼ 1, which coincides with a known period of intense star formation in the Milky Way, betrayed by a high rate of star formation at this time [40] . Environments where the star formation rate is higher than the present average in the Milky Way disc are characterised by very dense star-forming regions [41, 42] , and so similar conditions in the Galaxy when the Sun and the other exoplanet host stars were born suggests that the environment for planet formation may have been much more hostile [43] .
A further uncertainty in assessing the birth environment of planetary systems is that we do not yet understand how star-forming regions disperse into the Galactic field, and whether a certain type of star-forming region (in terms of some property such as total stellar mass, or density, or overall bulk motion) is more likely to dissolve into the disc than any other. Part of the issue is that we do not know the dominant mechanism by which star-forming regions disperse.
most commonly cited mechanism is called 'residual gas expulsion', and uses the fact that star formation is an inherently inefficient process -only around 30% of the mass of a GMC is converted into stars, leaving a significant gravitational potential in the form of gas. As the stars reach the main sequence, the combined effect of their stellar winds, coupled with the effects of the first supernovae, causes the rapid removal of the remaining gas and has the effect of unbinding the star-forming region, causing it to expand and disperse [44] [45] [46] [47] [48] [49] [50] .
This gas expulsion scenario was initially quite successful at explaining the observed properties of star clusters, especially the apparently supervirial motion of stars in many clusters, and the significant decrease in clusters at ages older than 10 Myr [48, 51] . However, subsequent studies showed that the supervirial motion was likely due to a mis-interpretation of the velocity dispersion in these clusters -orbital motion from binary stars has the effect of inflating the velocity dispersion if not accounted for, making the stars in the clusters appear to be moving faster than they are [52] . Furthermore, numerical simulations of star formation in GMCs have shown that the local star formation efficiency is quite high, i.e. the locations where groups of stars form tend to be gas-poor -removing this extra mass therefore has a negligible effect on the gravitational potential of the stars in question [53] .
The main agent for dispersing star-forming regions may be the tidal field of the Galaxy itself. Each star-forming region has a tidal radius where the gravitational influence of the Galaxy exceeds that of the star-forming region (this is analogous to the Hill sphere in planetary dynamics, or the Roche lobe in contact binary stars). For star-forming regions, the boundary between the gravitational influence of the Galaxy and the gravitational influence of the star-forming region is called the Jacobi radius, r J , and is a function of the position of the star-forming region in the Galaxy, R G , the mass of the Galaxy M G and the mass of the star-forming region, Mc:
As star-forming regions expand due to dynamical relaxation, eventually stars pass the Jacobi radius and the tidal field of the galaxy dominates. The star-forming region formally loses mass [54] , and therefore its Jacobi radius decreases. This decrease in Jacobi radius then makes the starforming region even more susceptible to losing stars, and the process repeats until presumably the star-forming region completely disperses. It is not clear how long this process takes, nor how it depends on the initial properties of the star-forming region. However, it is clear that the more massive and compact a region is, the more likely it is to remain a bound entity for a significant fraction of the age of the Universe.
An often overlooked aspect of star formation, but one that is fundamental to our understanding of the Sun's place in the cosmos, is the fact that the majority of stars form as binary, or higher order (e.g. triples or quadruple) systems. In the local Solar neighbourhood, around 50% of stars are in binary systems [7] . In nearby star-forming regions, the fraction of stars in binary systems is either the same, or higher than in the field [55] , with some authors arguing that all stars forming in some sort of multiple system [10, [56] [57] [58] .
It is not clear how much the binarity of stars hinders planet formation and evolution. In a given binary system, there will be some region of the orbit where planets are unstable, and this has been quantified to some extent by numerical simulations [59] . If a planet is on a 'satellite', or S-type orbit (i.e. where the planet orbits one of the two stars), then there will be some maximum semimajor axis beyond which the orbit of the planet is unstable. Similarly, if a planet is on a 'planet', or P-type orbit (i.e. it orbits both stars), then there is a minimum semimajor axis, below which the planet is unstable.
Observations have established that planets, and protoplanetary discs, readily form and survive around binary systems [60, 61] . However, in a star-forming environment, binaries have the extra complication that they present a larger cross section for encounters with other stars, and therefore an interaction that could subsequently destabilise the planetary system is more likely that around a single star [62] .
Some of the very first attempts to describe star formation by Laplace and Kant recognised that conservation of angular momentum would result in a circumstellar disc around stars as they are forming. These discs, composed of dust and gas, are now known to form planets around stars as they themselves are forming.
This particular field has been completely revolutionised by observations with the Atacama Large Millimetre Array (ALMA), an interferometer located in the high and dry desert in Chile. One of the first images to come from ALMA was the now famous HL Tau disc, a disc surrounding a young, nearby star in the Taurus star-forming region [63] . Further observational studies, in particular the Disk Substructures at High Angular Resolution Project (DSHARP) [64] , have shown that discs around young stars display features than can be attributed to a change in disc composition [65] [66] [67] [68] as a function of radius, or the presence of fledgling planets within those discs [69] [70] [71] [72] [73] (although the latter scenario is still hotly debated [74, 75] ).
The presence of a protoplanetary disc was previously inferred by examining the spectral energy distribution (SED) of a star, which should display very little deviation from a black-body spectrum. However, pre-main sequence stars often have a strong excess in the SED at infrared wavelengths [76] [77] [78] , with the only viable explanation being that the star is surrounded by a disc composed of micron-sized dust grains, which absorb light from the host star and then re-emit this light at redder wavelengths [79] [80] [81] . Some estimates find that the disc mass can be up to 10% of the host star's mass. A lower limit for the mass of the Sun's protoplanetary disc can be estimated by adding up the material in the Solar system (planets, dwarf planets, asteroids) to determine the 'Minimum Mass Solar Nebula', which is at least 1% of the Sun's mass [82, 83] .
Pre-main sequence stars that display infrared excesses indicative of a disc are almost exclusively found in star-forming regions, and there is evidence of a trend of decreasing numbers of discs with stellar age, such that very young (∼1 Myr) stars almost all have discs, whereas at 5 Myr almost no stars have discs [84, 85] . This observation is interpreted as either planets form very quickly, or the majority of discs are destroyed (or both).
In star-forming regions, the natural assumption is that many of the discs are destroyed, either by encounters with passing stars, or by the radiation fields from stars more massive than 10 M . The efficacy of both scenarios depends on the stellar density of the star-forming region, and we discuss both below.
Protoplanetary discs can in theory be destroyed or truncated by an encounter with a passing star in a dense stellar environment. Early simulations [86] showed that material would be removed from a disc up to one third of the distance of the encounter. For example, if the closest approach of a star were 300 au, then the disc would be truncated to a radius of 100 au [87] .
Further simulations showed that an encounter with the disc truncates the outer edge but steepens the density profile of the remaining material in the disc [88] , and that prograde, coplanar encounters are the most destructive to the disc [89] . Material from the disc can also be transferred onto an orbit around the intruding star [90] .
All of these early simulations were essentially isolated systems, with the disc constructed in a hydrodynamical simulation with a simulated encounter with a single, passing star. In reality, a star may undergo multiple interactions in its birth environment. However, current limitations in computing power mean that it isn't possible to self-consistently model discs to the required resolution within N -body simulations of realistic star-forming regions (though some attempts at modelling discs in regions where the number of discs is low and the initial conditions of the regions are fairly basic have been made [91] ).
The usual approach to quantifying disc destruction in star-forming regions is to apply an afterthe-fact post-processing analysis to the N -body simulations. The simulations are run without discs, and then discs are 'assigned' to stars and modified according to the encounter history of the individual star. As such, the discs are not real and their gravitational influence (which can be significant if their masses are ∼10 per cent of the host star) is ignored, as are the possible effects of gravitational focusing during encounters. However, the advantage of this method is that the disc destruction recipes can be easily applied to simulations of an entire star-forming region, and significant amounts of work have been done in this area [92] [93] [94] [95] [96] [97] [98] .
Using the approach of post-processing in full N -body simulations of star-forming regions, most authors tend to find that only the most dense star-forming regions (> 10 3 M pc −3 ) lead to significant disc truncation. In the vicinity of the Sun (within the nearest 500 pc), the Orion Nebula Cluster (ONC) is probably the only star-forming region that may have been this dense [31] . However, the larger Orion star-forming region makes up a significant fraction of the nearest young stars to the Sun [99] and so many studies have focused on disc destruciton in this starforming region [92, 95, 96] .
For ONC-like clusters, research has found that that disks with radii larger than 500 au are affected by truncations due to the star-forming environment [95] , which is consistent with the observation that 200 au-sized disks are common. In simulations of the more distant (1740 pc) Eagle Nebula, a.k.a. NGC 6611, which is thought to have a higher stellar density than the ONC, the disk sizes are cut-down on average to roughly 100 au. A potentially observable test of these simulations (and others like them) would be that the disks in the center of NGC 6611 should be on average 20 au and therefore considerably smaller than those in the ONC.
These simulations are of very dense star-forming regions, where a high degree of dynamical relaxation, involving encounters and mixing between disc-hosting stars, would be expected to affect the discs in equal measure. The simulations find that on the outskirts of clusters, discs above a certain radius tend to have a large size, but there is no dependence on the star's location if the disc radius is less than 100 au.
To date, observations of star-forming regions indicate that the properties of discs -particularly their radii, which tend to be smaller -are different in the most dense star-forming regions compared to lower-density regions [98, [100] [101] [102] , but is is unclear whether this is due to truncation by dynamical encounters, or external photoevaporation, which we discuss in the next section.
An interesting additional problem is that the disc can in principle grow in mass in a star-forming region by accreting gas from the surrounding medium [103] [104] [105] (recall that starformation is inefficient, and young stars are almost always embedded in their natal GMCs, so the reservoir of gas from which stars can accrete is plentiful). Interaction with the background gas can be important and recent results indicate that face-on accretion dominates over mass loss from stellar encounters at low densities [106] .
Once the protoplanetary discs have evolved to form planetessimals, they are referred to as 'debris discs'. These discs become even more robust to the environment, with simulations finding that debris discs are only depleted in star-forming regions with stellar densities exceeding 2 × 10 4 M pc −3 [107] .
Some of the first images taken with the Hubble Space Telescope following the much publicised optics correction carried out by space shuttle astronauts were of the Orion "proplyds" -disclike structures observed around pre-main sequence stars in the vicinity of the Orion Nebula cluster [108] [109] [110] [111] . Not only were these images some of the first direct detections of protoplanetary discs around young stars, the images also indicated that the star formation environment plays an important role in shaping the planetary systems that subsequently form around young stars.
The "proplyds" were discs, or more specifically ionisation fronts of material being liberated from the discs around young stars in very strong radiation fields, and the term proplyd -a contraction of 'PROtoPLanetarY DiSc' -is usually nowadays only reserved for discs that are being externally irradiated.
The relatively close-by (∼ 400 pc, [112, 113] contain stars more massive than ∼ 5 M (recall that this is probably simply due to a statistical sampling argument -nearby star-forming regions tend to be low-mass, and so will not form such massive stars).
Stars more massive than 5 M emit highly energetic photons in both the far and extreme ultraviolet regions of the spectrum. The typical energies of individual photons are in the range 5 < hν < 13.6 eV for far ultraviolet (FUV) radiation, whereas the photons from extreme ultraviolet (EUV) radiation have energies exceeding 13.6 eV. These two radiation regimes constitute a significant proportion of the luminosity from massive stars. For example, collating stellar atmosphere models, a 20 M star produces an FUV luminosity, L FUV 10 38 erg s −1 , and an EUV luminosity L EUV 10 37 erg s −1 [114] . (Note that 1 erg = 1 × 10 −7 J.) The EUV luminosity exceeds the FUV luminosity only at stellar masses above 60 M .
To determine how much of this radiation is received by a disc-hosting star, we must convert the luminosity into a flux, usually expressed in units of erg s −1 cm −2 . For example, in a typical starforming region a disc-hosting star may be around 0.5 pc from an ionising massive star producing FUV and EUV radiation. 0.5 pc = 1.54 × 10 18 cm, so the EUV flux received from a star 0.5 pc from a 20 M star will be
If d = 1.54 × 10 18 cm and L EUV = 10 37 erg s −1 , then F EUV = 0.3 erg s −1 cm −2 . As the FUV luminosity for a 20 M star is a factor of ten higher, we have
where L FUV = 10 38 erg s −1 and d = 1.54 × 10 18 cm, as before. This gives F FUV = 3.34 erg s −1 cm −2 , but the FUV flux is usually expressed in terms of the background FUV flux in the interstellar medium, referred to as the 'Habing unit' [115] , or the 'G 0 field', where 1 Habing unit is 1 G 0 = 1.6 × 10 −3 erg s −1 , meaning that the FUV flux in this particular scenario is F FUV = 2090G 0 , i.e. more than 2000 times the background ISM radiation field. When FUV radiation is incident on a disc, it heats the material in the regions where the surface density of the particles is lowest, which tends to be on the edges of the disc [116] . The thermal pressure exerted causes a wind to be launched from the edge of the disc, allowing gaseous material to escape from the disc [117] [118] [119] . This planar geometry means that the process can be effectively modelled as a 1-D or 2-D system. The initial calculations of mass-loss in discs due to incident FUV radiation [120] demonstrated that dust particles could be entrained in the wind from the disc; however more recent calculations using the FRIED grid [121] show that -whilst the gas component of the disc is readily evaporated -the dust content is largely retained.
The first calculations often assumed that the EUV radiation would dominate the mass-loss from discs. However, in practice it appears that the wind launched by the incident FUV radiation creates an ionisation front around the disc, which shields the disc from further destruction from EUV radiation. The mass-loss due to FUV radiation appears to be extremely high in star-forming regions that contain any massive stars [122] . Even at distances commensurate with those in extended OB associations (several pc), the G 0 field from a 20 M star is still 5 times that of the field in the ISM.
The most recent calculations (the FRIED grid) use the G 0 field as an input, as well as the disc mass M disc and disc radius r disc to determine the mass-loss rate. As an example, for a disc with initial mass M disc = 0.1 M (a reasonably massive disc), initial radius r disc = 100 au, an FUV field of G 0 = 1000 would completely destroy the gas component of the disc with just 0.1 Myr. However, if the same disc were much more compact (10 au) then very little mass (1 × 10 −4 M ) is lost in 1 Myr.
Several authors have performed simulations of the evolution of star-forming regions to quantify the mass-loss due to both FUV and EUV radiation over the first 10 Myr of a star-forming region's lifetime. A detailed set of simulations utilising the FRIED grid is currently in preparation, but a rough estimate of the mass-loss can be made using the following prescriptions [123] , which implements the effects of both FUV and EUV radiation [117] [118] [119] . In these models, the FUV field around a massive star is effective out to a radius of around 0.3 pc, beyond which it does not contribute to the mass loss due to photoevaporation. Within this 0.3 pc radius, the mass loss due to FUV radiation (photon energies hν < 13.6 eV) is dependent only on the radius of the disc r d and is given byṀ
The disc also loses mass due to EUV radiation (photon energies hν < 13.6 eV), and this does depend on the distance from the massive star(s) d as well as the radius:
Here, Φ i is the ionizing EUV photon luminosity from each massive star in units of 10 49 s −1 and is dependent on the stellar mass according to the observations [124, 125] .
In a simple 'post-processing' analysis of N -body simulations one can follow the mass loss in the discs due to photoevaporation by subtracting mass from the discs according to Equations 3.3 and 3.4. Here, we assume each disc is initially 10% of the host star's mass, and subtract mass at every output of the N -body simulation. This allows us to determine the fraction of stars that retain some disc gas mass at each point in time.
In Fig. 1 we plot the fraction of discs that remaining following mass-loss due to photoevaporation in two different star-forming environments. In panel (a) the initial stellar density is ∼ 1000 M pc −3 (thought to be similar to the initial density in the Orion Nebula Cluster), and in panel (b) the initial density is much lower (∼ 10 M pc −3 , which is typical of extended OB associations). In both panels the red lines are discs with initial radii of 10 au, and the blues lines are discs with initial radii of 100 au.
Clearly, in very dense environments, we would not expect large (100 au) discs to retain gas beyond an age of 1 Myr if there were massive stars present [122, 126] . This has two very interesting implications for giant planet formation:
(i) Gas giant planets must form extremely quickly (within 1 Myr) (ii) Alternatively, gas giant planets form exclusively in star-forming regions that do not contain massive stars. This latter point is in direct tension with meteoritic evidence suggesting that our own Solar system was in close proximity to massive stars as planets were forming.
Note that these calculations are likely to be underestimates of the amount of gas lost due to photoevaporation, with the new FRIED grid models showing an even more destructive pattern.
Interestingly, in star-forming regions where massive stars are present, there are very few detections of gas in protoplanetary discs [101, 127, 128] , suggesting that the gas may have already been photoevaporated from these discs.
If a planet has already formed around a star, then in a dense star-forming region (≥ 100 M pc −3 ) encounters between passing stars can significantly disrupt the orbits of these planets. Consider a planet, p 1 , with mass m pl orbiting a star s 1 with mass M . The planet is on a bound, closed orbit with semimajor axis a pl and eccentricity e pl . The orbit has a total energy,
If the planet encounters a second star, s 2 with mass m ,2 , there are several different possible outcomes of that interaction. (ii) The planet is stolen by the incoming star, s 2 , and subsequently orbits this star. Its motion around the secondary star may be prograde or retrograde, and it is likely to have a high eccentricity and inclination. (iii) The planet is removed from its orbit around the parent star s 1 , and becomes a free-floating planet within the star-forming region.
(There are variations of these interactions and we refer the reader to Table 1 in [129] for a more comprehensive summary.) In scenario (1), the final orbit of the planet depends to large extent on the exact energetics of the interaction with the incoming star s 2 . In any binary system (be it a star-star system, or a starplanet system such as the one considered here), the binding energy of the system |E tot |, relative to the Maxwellian energy of the star-forming region, governs the outcome of that interactionthe so-called 'Heggie-Hills law' [130] [131] [132] . The Maxwellian energy is simply the average motion of a star in the region, and can be thought of as being analagous to the average motion of an atom or molecule in a gas in thermal equilibrium. In a star-forming region, this Maxwellian energy can be approximated by
where m is the average stellar mass, and σ is the velocity dispersion -the statistical dispersion about the mean velocity -of stars in the region. For a system where the binding energy exceeds the Maxwellian energy, the semimajor axis is likely to decrease, i.e. in our scenario the planet would move closer to its host star. Conversely, when the binding energy of the system is lower than the background Maxwellian energy, the semimajor axis is likely to increase, i.e. in our scenario the planet would move further away from its host star. Because the binding energy is inversely proportional to the semimajor axis, an increase in the planet's semimajor axis therefore reduces the binding energy and makes the planet more susceptible to further interactions. However, these three outcomes of an interaction with a passing star do not describe all of the physical processes that occur to planets in dense stellar environments and in order to learn in detail about the effects of stellar interactions on planetary orbits, simulations of the star-forming environment are required.
There are two different approaches to modelling the interactions between planetary systems and passing stars. We will refer to the first a 'direct' calculation, where a brute force approach is adopted. These calculations include the planets in the simulations of the star-forming region, and calculate the gravitational force due to all of the stars in the region on each planet [1, 133, 134] . This approach is computationally expensive, due to the very different timescales involved. A star will orbit the centre-of-mass of the star-forming region on timescales of Myr, whereas a planetary orbit has timescales of days or years. However, most N -body codes are designed to cope with primordial stellar binary systems, so the planet merely represents a low-mass companion to the star [135] [136] [137] . The main disadvantage with this approach is that -aside from several pioneering simulations utilising Graphical Processor Unit technology -these simulations are limited to one or two planets per star (although there are notable recent exceptions [138, 139] , which use a hybrid selection of numerical integrators to model 4-planet systems around some stars).
The alternative approach is to use Monte Carlo simulations to choose the parameters of a stellar encounter (velocity) with a planetary system, and then follow the planetary system with a numerical integrator to determine the fate of the system [62, 140] . These calculations are less computationally intensive, and have the advantage that more than one planet can be modelled around each star.
It is almost impossible to compare these two different approaches. Due to computational constraints, the direct approach cannot be used to model more than one or two planets, whilst the scattering calculations routinely include four or more planets. Furthermore, the huge parameter space available in these simulations (stellar density, stellar velocity dispersion, initial planetary orbits) means that simulations by different authors are unlikely to overlap so that they are directly comparable. The only thorough comparison between these two techniques for planet disruption calculations is the work in [141] . Even this study uses different initial conditions for the modelled star-forming regions, adopting the Monte Carlo approach for large-N environments (e.g. Globular clusters) and direct N -body for smaller-N environments (e.g. open clusters).
In the Monte Carlo approach, we assume an interaction rate -i.e. how often does a star-planet system encounter another star in the star-forming region -which is written
where n is the stellar number density, Σ is the cross section for the interaction, and σ is the velocity dispersion within the star-forming region. The cross section for the interaction, Σ, can be written
where Renc is the radius of the encounter, or put more simply, the size of the 'target' -the planetstar orbit. However, the larger orbits (tens of au) will be more susceptible to interactions that change the planet's orbit, and as such a term that accounts for gravitational focusing is required, such that
where M int is the mass of the intruding star. The earliest work in this area [140] estimated that for a star-forming region with a stellar density of 1000 stars pc −3 , around 10 per cent of planets will experience a disruptive event, although these simulations assumed a very long-lived star-forming region (10 8 years, when most star-forming regions have dispersed after 10 7 years [142] [62] . Their Monte Carlo scattering simulations placed planets of the same mass and semimajor axis as the four giant planets of the Solar System. They computed the cross section for collisions, Σ, assuming the interactions are typically with an incoming binary star system (as a significant fraction of stars in the Galactic field are in binary systems [6, 7, 143] , and this fraction may be even higher in young star-forming regions [144] ). In these simulations, [62] find that Neptune, as the outer planet, is more readily disrupted (despite it having a higher mass than Uranus). Furthermore, they find that disruption of planets is more likely around lower-mass stars, with the cross section for disruption scaling as:
(4.6) (a) Unbound, or free-floating planets
Despite the unavailability of appropriate comparisons between the direct N -body approach and the Monte Carlo scattering experiments, it appears that the scattering experiments are more conservative in their predictions for planetary disruption. This was first noticed in simulations where free-floating planets were created -planets that become unbound from their parent star and then move around the star cluster as a gravitationally distinct entity. Free-floating planets (FFLOPS) have been observed in star clusters [145] [146] [147] [148] , including old open clusters such as the Pleiades [149, 150] , though their physical origin is the subject of much debate [151] , with some authors arguing they form from the collapse and fragmentation within the GMC ("like stars"), whereas other authors argue they form around stars ("like planets") and are then liberated from their host stars.
The latter formation channel was explored in some of the earliest scattering simulations [152, 153] , and these authors found that the planets were liberated from the host stars at such high velocities that they could not be retained by the gravitational influence of the cluster, which appears at odds with the observations [145] . However, some of the first direct N -body simulations [133] predict significant retention of free-floating planets in open clusters, as well as in globular clusters (if planets are able to form in such low-metallicity environments). This was later corroborated by several authors [1, 134] who found significant numbers of FFLOPS could be retained by clusters, in contrast to the Monte Carlo approach [154] .
Interestingly, the estimates of the number of FFLOPs in the Galactic field can be very high [155] , with some authors claiming several free-floating planets per star in the Milky Way galaxy [though see 156] . Such a population cannot be created entirely by instabilities within planetary systems leading to the ejection of planets (so-called 'planet-planet scattering') [157] , so an additional mechanism would be required. Star-forming regions with stellar densities of the order 1000 stars pc −3 can liberate up to 10% of planets [1, 134] , although this is a lower limit because these simulations typically only contain one planet around each star and an interaction that disrupts a planet so that it becomes free-floating is likely to have a significant impact on the entire planetary system [139, 158] .
If an interaction with a passing star is not strong enough to liberate the planet completely from its orbit and create a FFLOP, the orbit may be significantly altered. Early simulations predicted that to disrupt the orbits of planets, the star-forming region must be either very dense (> 1000 M pc −3 ) [153] , or that the host star must remain in a star-forming region for a significant amount of time (100s of Myr, i.e. > 10 8 years). As we have discussed, these early simulations generally adopt the Monte Carlo scattering approach, which tends to be conservative in its predictions for disrupting orbits, and these simulations assumed a very simplistic set of parameters for the cluster environment. Typically, these early simulations assumed a uniform velocity dispersion across the cluster of ∼1 km s −1 , as well as a smooth, centrally concentrated density profile for the stars in the cluster (usually a Plummer [159] or a King [160] profile, although some authors [92] use a variations of these types of distributions). It must be emphasised that these smooth distributions tend to be excellent models for star clusters as we observe them at older ages, but fail to capture the dynamics of stars in young star-forming regions.
We know from both observations and simulations [33, [161] [162] [163] that young star-forming regions possess significant degrees of spatial and kinematic substructure. Visually, they appear to have a very clumpy, or ragged distribution and the clumps of stars tend to have very correlated velocities on local scales [164] , but can have very different velocities to (clumps of) stars in other areas of the star-forming region. Dynamical relaxation erases this substructure on a timescale that scales with the median local density of a star-forming region [31, 38, 39, 165, 166] , and if the global virial ratio of the stars is low, the star-forming region may fall in on itself to form a smooth, spherical cluster [39, 167] . The point is that assuming a smooth distribution for disruption of planetary orbits, much of the physics that occurs in star-forming regions as planets are forming is ignored. Loosely speaking, this means that spatially and kinematically substructured star-forming regions are more dynamically active, and planetary orbits can therefore be affected at much lower stellar densities than previously thought (though still upwards of 100 M pc −3 ).
In Fig. 2 we show the typical outcome of a simulation with a stellar density initially in the region of 1000 M pc −3 , where each low-mass (< 3 M ) star has been assigned a planet initially on a zero eccentricity orbit with a semimajor axis of 30 au [1] . Following 10 Myr of dynamical evolution in the star-forming region, during which time the substructure is erased due to violent relaxation and the region collapses to form a cluster, and then expands, the orbits of up to 20% of the planets are significantly disrupted. Primarily, the eccentricity of a planet can be raised from zero to anywhere between zero and unity, and a smaller number of systems (10%) have their semimajor axes changed by ±10%. Several groups of researchers find similar results when following the evolution of planets in substructured star-forming regions [134, 168] .
In addition to direct interactions between a passing star and a planetary system, planets can be disrupted by so-called 'secondary' dynamical effects, often if they orbit a star that is part of a binary system. In this scenario, the passing star changes the orbit of the binary, which could lead to future dynamical instabilities in the planetary system.
Typically, a planet orbiting a component within a binary system is stable if its semimajor axis is less than one third of the semimajor axis of the binary [59] . However, if an interaction either increases the eccentricity of the binary, or hardens the binary (decreases the semimajor axis) then the planet's orbit may no longer be dynamically stable.
One of the most notable secondary effects is the Kozai-Lidov mechanism, or the von Zeipel-Lidov-Kozai (vZLK) mechanism [169] [170] [171] [172] [173] . The vZLK mechanism was first developed to explain peculiarities in the orbits of asteroids, but is applicable to different types of three-body systems, including planets within binary stars. The vZLK mechanism posits that if the inclination of two stars in a binary increases by more than 39.23 • , then a transfer of angular momentum from the secondary star in the binary onto the planet occurs. This in turn causes the eccentricity and inclination of the planet to oscillate wildly, creating dynamical instabilities in the planetary system which can lead to orbit crossings and ejection of the planets entirely from the system.
If the Solar System underwent oscillations due to the vZLK mechanism, then it is probable that both Uranus and Neptune would be ejected, with Saturn and Jupiter pumped to higher eccentricities [174] . Given a typical population of binary stars in a dense star cluster, it is likely that up to 10% of binary stars could undergo Kozai cycles [175] , which usually occur on timescales less than 1 Myr [176] . Planets in binary systems occur as frequently as planets orbiting single stars [60] , so the vZLK mechanism and other secondary effects could be important. 
Whilst the most common avenue of planet formation is thought to be the core accretion scenario, where bodies grow by dust coagulation [177] and pebble accretion [178] . However, planets could also form from the fragmentation of circumstellar discs [179] . If planets do form via fragmentation, then if interactions with passing stars occur during the protoplanetary disc stage then they can suppress planet formation [180] . Furthermore, some authors find that the orbital and physical properties of planets that form in discs affected by stellar flybys that the planets are more massive and at larger orbital distances formed [181] .
Interactions with passing stars can both induce planet-planet scattering [182] , as well as regulate its effects. Some planet-planet scattering events coupled with fly-bys from passing stars in relatively low-density environments find that the passing stars stablise the orbits of planets ejected from the scattering process, thus creating 'Oort planets' [183] .
Whilst star clusters and star-forming regions in general are destructive to planetary systems, it is worth noting that only between 10 -20% of systems are affected by direct interactions. Even assuming secondary effects such as the Kozai-Lidov mechanism can further destabilise planetary systems, more than 50% of planetary systems in dense stellar envionments would remain unscathed. Over the typical lifetimes of star clusters, solar systems can be disrupted [158] but many planets survive in these environments [184, 185] , so it is unsurprising that planets are observed in open clusters [186, 187] .
Whilst we are primarily interested in a discussion of where all planet-hosting stars may have formed, this is naturally framed around the anthropic question of whether our Sun and its planets formed in a fashion typical of many other stars in the Universe, or whether we are somehow special in the context of all other planetary systems. In the following, we will assume that the Sun formed from a molecular cloud that collapsed and fragmented, but we will make no a priori assumptions about the initial stellar density, or total mass of the cloud.
The main planets in our Solar System (Mercury, Venus, Earth, Mars, Jupiter, Saturn, Uranus and Neptune) all have prograde orbits, very low orbital inclinations and very low orbital eccentricities. Furthermore, unlike many of the observed exoplanetary systems, there are no massive planets on very close orbits, implying that planet-planet scattering, and/or significant orbital migration, have not taken place in the Solar system. (Note that a small degree of orbital migration may have taken place, and has been invoked to explain certain features of the Solar System [188, 189] .) However, the Solar System appears not to have been completely unscathed by its birth environment. The remainder of the Sun's circumstellar disc, the Edgeworth-Kuiper Belt, has a rather abrupt edge at 50 au [190, 191] , where we would expect a more gradual drop-off in surface density of the disc. Furthermore, some Kuiper Belt objects, such as Sedna, have highly inclined orbits out of the plane of the Solar System, suggestive of a reasonably close encounter (400 < aenc < 1000 au) with a passing star [192] , although [193] argue the encounter could have been as close as 50 -150 au.
More recently, some authors [194] have suggested that the clustering in argument of perihelia of some EKBOs suggests dynamical stirring by a much more massive (20 M ⊕ ) planet (the socalled 'Planet 9'). Whilst some authors suggest the unseen planet have been able to form at such large distances from the Sun [195] , in general massive planet formation is thought to occur closer in. Several authors have proposed that Planet 9 was either captured or stolen from another star [196, 197] , which would happen when the Sun was still embedded in its natal star-forming region. For this to happen, the stellar densities must be reasonably high (100 M pc −3 ), but not so high that the inner planets would be disrupted.
An interesting experiment is to determine the fate of the Solar System if it were in a much more dense environment (1000 M pc −3 ). If we place simulated Solar Systems in star-forming regions of varying stellar density we obtain several interesting results [139] . First, Neptune and Uranus are more susceptible to liberation from the Solar System than the inner planets.
Secondly, the presence of Jupiter has several interesting implications for the habitability of Earth-like terrestrial planets. In a fairly low stellar density, Jupiter acts as a shield from perturbations from passing stars. However, when the stellar density is much higher, Jupiter is itself is perturbed to such an extent that it negatively impacts the habitability of Earth
The architecture of the Solar System therefore argues for a fairly benign, or low density stellar environment for the formation of the Sun. However, there are some tantalising clues to the birth environment of the Sun present in some of the oldest objects in our Solar System, the chondritic meteorites [198] [199] [200] . These objects date from the epoch of planet formation around the Sun, and contain enhanced levels of short-lived radioisotopes (SLRs) relative to the ISM. Two SLRs, 26 Al and 60 Fe are particularly interesting, as they have very short radioactive half-lives (0.7 Myr and 2.6 Myr, respectively [201] ). The presence of SLRs with such short half-lives means that this 26 Al and 60 Fe-rich material must have been incorporated into the Solar System either as it was forming, or just after planets started to form. appears to be. This SLR can also be produced during the Asymptotic Giant Branch phase -and advanced stellar evolutionary phase of Sun-like stars. However, AGB stars are not found in starforming regions, nor was the Sun ever likely to have had a chance encounter with one [203] . Both of these processes cannot produce 60 Fe in the abundances observed in the Solar System. 26 Al and 60 Fe are produced in the cores of very massive stars (>20 M , [204] ), and are released either during the supernova explosion of these stars at the end of their lives (typically 8-9 Myr or less, with more massive stars exploding earlier [205] ), or in the case of 26 Al, emitted via the stellar wind during the massive star's evolution off the Main Sequence. There are two different mechanisms for seeding the Solar System with these SLRs. The first is via the capture of the 26 Al and 60 Fe material by the Sun's protoplanetary disc after the massive star(s) explodes as a supernova, or via the capture of 26 Al from the stellar wind [206, 207] . In this 'disc enrichment' scenario, the Sun is required to be "in the right place at the right time", i.e. close enough to the massive star to collect enough of the material without being destroyed by the supernova blast wave itself [208, 209] . This scenario also requires the Sun to have been born in a star-forming region with at least one massive star. Typically, this would mean the Sun formed with hundreds, if not thousands, of other stars, as massive stars only occasionally form in low-mass star-forming regions (although there are some observed examples).
The second mechanism posits that the Sun formed in a Giant Molecular cloud that was already pre-enriched in 26 Al and 60 Fe [210, 211] . In order for this to happen, the Sun must have been a member of an inter-generational star-forming sequence. First, a population of stars form in the GMC. The most massive of these explode, triggering a second burst of star formation in which the stars that form are enriched in 60 Fe. The second generation must contain at least one massive star (>20 M ), which undergoes a Wolf-Rayet phase [212] , during which its stellar wind is rich in 26 Al. This WR star in turn triggers the formation of a third generation of stars, one of which is our Sun. This mechanism ensures the levels of 26 Al and 60 Fe observed in the Solar System are reproduced, and is based on the notion that star-forming region regularly trigger additional star formation [213] .
Both the disc enrichment, and sequential enrichment scenarios have their drawbacks. The disc enrichment model requires a very fine-tuned set of circumstances; the Sun must have been in the right place at the right time, the disc cannot be destroyed by the supernova. Even the most massive stars explode as supernovae after ∼4 Myr, by which point the protoplanetary disc may have been significantly depleted [84, 85] . In the sequential enrichment scenario the giant molecular cloud must remain for around 15 Myr, which is unlikely in the presence of feedback from the most massive stars [214, 215] . Furthermore, multiple generations of stars wold be observed to have significant age spreads, or dichotomies in ages [216] , which are not observed in star-forming regions [217, 218] .
However, based on our consideration of disc photoevaporation, the biggest drawback with both enrichment scenarios is that massive stars will be close (<1 pc) from the young Sun, and FUV radiation will potentially destroy the gas component of the protosolar disc before enrichment can take place. There is, therefore, a significant tension here; on the one hand, enrichment from massive stars is required to apparently drive the internal evolution of Earth [219] , but photoionising radiation is likely to significantly disrupt the formation of Jupiter and Saturn. Resolving this tension remains an active topic of research in the field [2, 122, 126, 220] .
We know from our earlier discussion that most star-forming regions disperse into the Galactic field within the first 10 Myr, and the fact that the Sun is now an isolated member of the Galactic field suggests that the Sun's birth environment is now long gone.
However, work has demonstrated that stars that originate from the same stellar nursery as the Sun could in principle be traced using their unique chemical signatures [221] [222] [223] . This method, known as 'chemical tagging' [224] , is largely in its infancy [225] but high resolution spectral surveys mean that data of the required quality and quantity are now readily available [226] [227] [228] [229] .
Indeed [230] . We know from observations that planets are present around stars in this cluster including around Solar twins [231] .
As M67 is a relatively massive open cluster, it is likely that the young Sun may have experienced significant radiation fields that could have evaporated the gas in its protoplanetary disc. However, this also suggests that enrichment in 26 Al and 60 Fe could have occurred. If the Sun did originate in M67, it may have been ejected early on, so that subsequent interactions in the cluster did not disrupt the outer planets [232] . Interestingly, attempts have been made to calculate when and where in time the Sun and M67 intersect, without much success, arguing that perhaps the Sun may have originated elsewhere (and the similarity in the chemistry of M67's stars to the Sun could be chance [225] ). Alternatively, a collision with a GMC could have disrupted the orbit of M67 itself, making it impossible to rule out the Sun's origin in this cluster [233] .
Whilst there are other factors that determine the amount of outside influence a planetary system can expect during formation, the main variable is the stellar density in the star-forming region in question. The stellar density determines the number of encounters a star and its planetary system can expect to experience, and also governs the flux of EUV and FUV radiation that can potentially photoevaporate protoplanetary discs.
Studies of star-forming regions suggest that most have initial stellar densities of at least 100 M pc −3 (a factor of 1000 higher than the stellar density in the Sun's current environment). However, there are some star-forming regions that have lower densities, as well as a small fraction of star formation that occurs in very dense (>1000 M pc −3 ) regions.
If massive stars are present, then we expect planet formation to be disrupted or altered by photoevaporation in star-forming regions of all densities. In low mass, low density starforming regions, we do not expect many detrimental effects on the planet formation process, but crucially, we do not really know what fraction of planet hosting stars form(ed) in such benign environments.
In moderate to high density star-forming regions (100 M pc −3 ), interactions between stars are common enough that the orbits of newly-formed planets can be altered, either directly by a perturbation from a passing star, or indirectly through secondary dynamical processes, such as the vZKL mechanism. It is only in star-forming regions with extremely high densities >1000 M pc −3 that we expect significant truncation of protoplanetary discs due to encounters with passing stars. Typically, star-forming regions with such high densities are also very massive, in which case we would expect the discs to be severely affected by photoevaporation.
The next steps in this research field require a multi-faceted approach. Ideally, one would like to follow the formation of planets from a disc within a global hydrodynamical simulation of star formation in a GMC. Unfortunately, this is some way off, but promising steps are being made to model the interaction of stars in an N -body simulation with an evolving background gas potential [234, 235] . This will enable us to model the formation and evolution of star-forming regions from the early gas-dominated phase to the later gravitationally-dominated phase (i.e. what we traditionally think of as being a star cluster). Simultaneously, the resolution of of hydrodynamical simulations can also be used to model the formation and evolution of protoplanetary discs within a star cluster [236] . In a similar spirit, N -body simulations can now incorporate the integrations of multi-planetary systems, thanks to the use of different numerical integration schemes within the same simulation [138, 237] .
At the same time, the advent of ALMA has revolutionised observational studies of protoplanetary discs [64] , and the discovery and characterisation of exoplanetary systems continues apace. The next generation of ground-and space-based telescopes are likely to further our understanding of the Solar System in the context of other planetary systems. Perhaps (and I hope) we will reach the stage where we can disentangle the internal processes that alter a planetary system (migration, internal photoevaporation from the host star, planet-planet scattering) from external influences, and search for these differences in observations. . 