> For the complete documentation index, see [llms.txt](https://tfg-bravoperezrubio.gitbook.io/cosmicarchitectdocumentation/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://tfg-bravoperezrubio.gitbook.io/cosmicarchitectdocumentation/explanation-of-classes-and-components/system.md).

# Cosmic System Generator

It is the actor that allows generating planetary systems. The systems always have a central star with a directional light, and the planets are created around it. To generate them, random parameters are produced within reasonable ranges, and based on these parameters, the planets are classified as a gas giant, asteroid, or telluric planet (similar to Earth). Random noise values are established within a range, as well as values like the distance to the star and the planet's radius.\
​\
This is the data structure used to classify each planet (`FPlanetClassification`):

* `EPlanetType Type` (GasGiant, Telluric o AsteroidBelt)
* `bool bHasOcean`
* `float OceanSeaLevel`
* `bool bHasRings`
* `bool bHasMoons`
* `int32 MaxMoons`

Parameters that can be modified in the System Generator:

* **Seed:** Seed for generating random numbers (Determinism).
* **OrbitSpeedMultiplier:** Global speed multiplier for all orbital periods in the system. 1.0 = normal speed. Higher values accelerate all orbits proportionally.
* **bIsSimulatingOrbits:** Indicates whether the orbital simulation in the editor is active. This value is modified using the StartOrbitSimulation and StopOrbitSimulation buttons.
* **Debug:** Section to visualize the area covered by the planetary system to be generated. A line is drawn to trace the bounding box that will contain the planets upon generation. The width and color of this line can be configured.
* **Number of Bodies:** Number of celestial bodies to be generated.
* **VolumeSizeKm:** Size of the volume in which the planets will be generated. The star's radius is calculated from this value, and it is also used to define the random range of distance values for the planets relative to the star.
* **BodyDiameterRangeKm:** Random diameter range in Kilometers (Min, Max) for each body.
* **MinDistanceBetweenBodies:** Minimum distance between bodies to avoid overlapping.
* **MaxDistanceToNearest:** Maximum distance to the nearest neighbor. If > 0, it forces the bodies to cluster together.
* **MaxGenerationAttempts:** Maximum number of attempts to find a valid position before discarding a body.

For the planets, a random number of satellites (moons) is established within a range: from 1 to 6 for gas giants, and from 0 to 3 for rocky planets. These satellites are generated with an orbit around their respective planet.

![System](/files/ay7SZ1QeRFhDskLXU2AN)


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://tfg-bravoperezrubio.gitbook.io/cosmicarchitectdocumentation/explanation-of-classes-and-components/system.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
