NoMansSky:Reference Guides/AsteroidGeneration

From Step Mods | Change The Game
Nomanssky flare.png

Asteroid Generation

All about space rocks!

Introduction

Yay! Space balls!

Properties

All of the properties for asteroid generation are contained with the GCSOLARGENERATIONGLOBALS.GLOBAL file.

PlanetInvalidAsteroidZone
The distance around planets that no asteroids will spawn.
AsteroidsEnabled
Enables or disables the asteroid generation altogether.
True = generate asteroids
SparseAsteroidSpread
"Sparse Asteroids" are the asteroids floating out in space not connected to any asteroid fields. This determines how sparse they will be.
Lower values = more sparse
LargeAsteroidFadeTime
The time it takes the large asteroids to fade from view.
AsteroidNoiseOctaves
This controls the waveform used for generating the noise field. The higher the setting the more granular the changes in the shape of the waves.

AsteroidSettings Property

Within the AsteroidSettings property container are sub-containers for each of the asteroid types, which hold all the settings for the generation of that specific asteroid type. Since each of these are identical besides a change in type, only the Common asteroids will be covered. What is learned here can be applied to the other sub-containers.

Code

  <Property name="AsteroidSettings">
    <Property value="GcAsteroidSystemGenerationData.xml">
      <Property name="CommonAsteroidData" value="GcAsteroidGenerationData.xml">
        <Property name="Scale" value="0.28" />
        <Property name="ScaleVariance" value="Vector2f.xml">
          <Property name="x" value="0.25" />
          <Property name="y" value="1.6" />
        </Property>
        <Property name="Health" value="1000" />
        <Property name="Spacing" value="645" />
        <Property name="NoiseRange" value="Vector2f.xml">
          <Property name="x" value="0.78" />
          <Property name="y" value="0.92" />
        </Property>
        <Property name="FadeRange" value="9000" />
        <Property name="NoiseScale" value="50000" />
      </Property>
Scale
The initial size of the asteroid.
ScaleVariance
Starting from the Scale, above, this controls the variance range asteroids will spawn in size.
x= minimum size // y= maximum size
Health
The amount of damage the asteroid will receive before being destroyed.
Spacing
The minimum distance the asteroids will spawn from one another.
NoiseRange
The position within the "total noise field" that the asteroid field, itself, will spawn.
Also determines the width of the asteroid field along the y-axis.
See detailed description below
FadeRange
The distance at which point the asteroids will start to fade from view.
NoiseScale
The distance from the center plane that the asteroids will spawn on the +- Z-axis.
See detailed description below

Understanding the Noise Field

Asteroids are spawned within a spherical noise field using a waveform. This field starts at 0, or the center of the sphere, and ends at 1. To help align within the field consider it on a X, Y, Z-axis:

  • X-axis is horizontal width of field (can not be controlled / center plane that asteroids are spawned along)
  • Y-axis is field width (depth) along the X-axis = NoiseRange
  • Z-axis is field width above and below the X-axis = NoiseScale

NoiseRange Details

NoiseRange controls both the position of the asteroid field along the X-axis, as well as, the depth of the field. The valid range is from 0 to 1.

        <Property name="NoiseRange" value="Vector2f.xml">
          <Property name="x" value="0.78" />
          <Property name="y" value="0.92" />
        </Property>

The position of the field will be determined by where along the range (0 to 1) the X and Y settings are located. For example, imagine a planet is the start of the range at 0 and Common asteroids are set within the 0.2-0.3 range and Large asteroids within the 0.5-0.6 range. If leaving the planet and traveling straight along the X-axis, Common asteroids would be encountered first, followed by a gap, and then followed by Large asteroids.

0 __ 0.2-0.3 __ 0.5-0.6 __ 1

The asteroid field's depth is determined by the width of the range. For example, consider if Common asteroids are in the 0.4-0.6 range and Large asteroids in the 0.3-0.7 range. With these ranges, the Large asteroid field will encapsulate the Common's field. The means no Common asteroids will spawn within the 0.3-0.4 and 0.6-0.7 portions of the Large asteroid range; since Common are confined to just the 0.4-0.6 range, but the two will mix where the ranges intersect.

0 __ 0.3-0.4 ::::: 0.6-0.7 __ 1

NoiseScale Details

NoiseScale controls the distance above and below the X-axis that asteroids will spawn.

        <Property name="NoiseScale" value="50000" />

AsteroidNoiseOctaves Details

AsteroidNoiseOctaves controls the waveform used for generating the noise field. The higher the setting the more granular the changes in the shape of the waves.