NoMansSky:Tutorials/Terrain Generation

From Step Mods | Change The Game
Nomanssky flare.png

Terrain Generation

Introduction[edit | edit source]

Before we begin, it's important to note that terrain generation in No Man's Sky is complex. It's literally various layers of noise being laid over each other to produce the environments one sees in the game. This is largely generated from a file called VoxelGeneratorSettings found under METADATA/SIMULATION/SOLARSYSTEM.

Due to the complexity of this generator (it's in fact an array of settings for different sorts of landscape to generate from, between a set of Min/Max values) there are various elements that are still not fully understood. Nevertheless, below you will find some descriptions of the different parts of the file and what they have been found to affect/influence.

Alongside this file analysis, you will find a brief guide on how to adjust the terrain generation live through the use of Cheat Engine.

VoxelGeneratorSettings.MBIN[edit | edit source]

The VoxelGeneratorSettings file is currently an array of 10 different TkVoxelGeneratorSettingsElement parent entries. Each of these has two children, a Min and Max TkVoxelGeneratorData entry, each also serving as parents to several child entries. While these two children may at first appear to have extremely similar child entries (in some instances, they do appear to literally be the same), it's important to examine their child entries closely as this can help understand why the terrain is appearing the way it is sometimes.

In short, as one might expect, the Min values may at times be lower, while the Max is higher, allowing the terrain to generate within a range between the two values. Other times, the Min and Max may be the same value, resulting in parts of the terrain always appearing either at lower extremes or higher extremes.

The primary child entries of note beneath both Min and Max TkVoxelGeneratorData entries are the following:

  • NoiseLayers, specifically each TkNoiseUberLayerData entry.
  • GridLayers, specifically each TkNoiseGridData entry.
  • Features, specifically each TkNoiseFeatureData entry.
  • CavesUnderground, specifically each TkNoiseCaveData entry.

NoiseLayers[edit | edit source]

There are 7 TkNoiseUberLayerData entries beneath the NoiseLayer parent, and each of these appears to correspond to the relevant section under GcTerrainControls one may locate at the bottom of any decompiled [SpecificBiome]Biome.MBIN, e.g. BarrenBiome.MBIN.

This means that each entry should relate in the following order:

  • Base. This is typically general terrain shape.
  • Hill.
  • Mountain. Not always what one may expect, as this often tends to relate to some sharp points in terrain, but not necessarily what one may describe as a mountain.
  • Rock.
  • UnderWater.
  • Texture.
  • Elevation.

GridLayers[edit | edit source]

There are 9 TkNoiseGridData entries beneath the GridLayer parent, and similar to the NoiseLayers, each of these appears to correspond to the relevant section under GcTerrainControls. However, GridLayers possess a unique feature that separates them from subsequent settings.

Each TkNoiseGridData entry has a child entry, TurbulenceNoiseLayer, which is structurally the same as the TkNoiseUberLayerData mentioned above, except that it contains only a single layer of noise to work with. By working with the TurbulenceNoiseLayer, one may vary the appearance of terrain columns/pillars, floating islands, and resource deposits that appear in the world.

As such, each entry should relate in the following order:

  • Small.
  • Large. Depending on the settings, these may either be terrain columns/pillars or floating islands. Look to the HeightOffsets to determine which, as well as whether TurbulenceNoiseLayer is set to Active True or False. Typically floating islands are currently set to False.
  • Resources_Heridium.
  • Resources_Iridium.
  • Resources_Copper.
  • Resources_Nickel.
  • Resources_Aluminium.
  • Resources_Gold.
  • Resources_Emeril.

Features[edit | edit source]

There are 7 TkNoiseFeatureData entries beneath the Feature parent, and similar to the NoiseLayers, each of these appears to correspond to the relevant section under GcTerrainControls.

As such, each entry should relate in the following order:

  • River.
  • Crater.
  • Arches.
  • ArchesSmall.
  • Blobs.
  • BlobsSmall.
  • Substance.

CavesUnderground[edit | edit source]

There is only 1 TkNoiseCaveData entry beneath the CavesUnderground parent, which also corresponds with GcTerrainControls' relevant section Caves and its only child entry, Underground. Nevertheless, it's important to note that TkNoiseCaveData has 2 child entries to it.

These 2 child entries are:

  • Mouth.
  • Tunnel.

Both of these share their structure with the above TkNoiseFeatureData entries.

Adjusting Terrain Generation in Real-Time[edit | edit source]

While this may seem intimidating at first, this is in fact relatively simple. First, launch No Man's Sky and set it to launch in windowed mode at a resolution that works for you. Once you've done this, close/relaunch the game (whichever you prefer), and download Cheat Engine if you've not already.

Launch Cheat Engine (and if this is your first time, do give the tutorial a run through, then return here) and select the NMS.exe process in the Process List by clicking the computer icon with a magnifying glass in the upper left below File in the Cheat Engine window. Alternatively, if NMS.exe is not immediately clear in the Process List, click the Application tab to bring up an Application List and select No Man's Sky from there, then click Open.

This will attach Cheat Engine to No Man's Sky, and allow you to scan in memory for related settings and values. At this point, click back into your No Man's Sky window and load a save or start a new game, whichever. Once you're at a point where you can launch into space, do so.

From here, look for any planet (including the one you launched from, if you like) and make sure you're approximately between 400,000u-1,400ks from the planet (check your ship dash or HUD for this) and scan it. Once you have the planet name, you have information you can use in Cheat Engine, so switch back to its window.

There, you will want to switch the Value Type on the righthand side to String. Scan Type for this value has only one option, Search for Text, but this varies with different Value Types. Above both Value Type and Scan Type, there's an entry field in which to enter information, and here's where you will type the planet name of the planet you've scanned and are facing in No Man's Sky, then hit First Scan above the entry field.

This should bring up around less than ten addresses in the left hand side of the Cheat Engine window, in the Address List, if you're far enough from the planet (and haven't placed a beacon on it).

Check each address by right clicking on them and selecting Browse this memory region, you're looking for whichever address has the planet name in memory, and beneath that several lines down, a few planetary resources indicated by ID, e.g. "TECH1......TRADEABLE1".

Once you've found this, in the window created by selecting Browse this memory region (the Memory Viewer), select the first letter of the planet name, right click and select Show relative addresses. Then scroll down in this window until you reach +00001830. Once there, right click and select Display Type, Float. This will make the data shown there easier to parse and relate back to settings you may find in the VoxelGeneratorSettings file.

At this point, you may want to open the VoxelGeneratorSettings file in Notepad++, or simply play about with the settings/values you're seeing in the Memory Viewer. Change whichever values you see there (e.g. those that occur around +00001880-1890), fly down to the planet, and see how they may have changed the terrain generation. Since this is all being done through Cheat Engine, you needn't worry too much about messing up your game, as a simple relaunch of the game will restore the game's normal terrain generation settings.