premium banner
A new Density allowing connecting paths to Position Providers

Description

--Load with the Latest Release: Update 4! Untested on Pre-Release--

This is a new density asset that allows the connection of Positions to each other!

This mod is still in development and mainly used for this project:
https://www.curseforge.com/hytale/mods/a-natural-terrain-pack

Important Notes!

1. Node Editor

Follow these steps in order to see the Branching Density inside the Node Editor:

Download and Enable the following mod:
https://www.curseforge.com/hytale/mods/renode
Open up the biome JSON file in a text editor and modify this line to say the following:

2. Performance

3D branching lines require a lot of math, so for performance reasons try to use in conjunction with the yOverride Node to utilize the quicker 2D math or the ySampled Node if needing to use 3D Lines! Performance will be continued to be worked on for future releases!

PathTypes

Valid PathTypes include "ALL", "MIN", and "RESTRICTED_MIN"

 - "ALL" works by branching all Positions together within the Position's MaxDistance.

 - "MIN" works by connecting a branch to only the minimum Position value within its MaxDistance range. Each Position's value is determined by the PositionNoiseValues Input. It is recommended to cache the Input Noise same as you would the CellValue ReturnType.


This example includes a PositionNoiseValues input that decreases in the SE direction.

 - "RESTRICTED_MIN" works by trying to connect to a Position that is both the minimum and greater than the value of itself. This helps to create more connected paths while also being able to create odd patterns. If no position is greater than itself, it'll connect to the minimum valued Position same as "MIN".


The first example uses a random PositionNoiseValues while the second uses a distance to center PositionNoiseValues to create a unique circular pattern around the center.

Example Setup

The most common example for having 1 random branch per Position for bridges, vines, etc. is setting the PathType to "MIN" and inputting a SimplexNoise into the PositionNoiseValues to randomize it!

This looks like the following in the node editor and JSON:

{
  "Type": "BranchingDensity",
  "Positions": {
    "Type": "Imported",
    "Name": "ImportedPositions"
  },
  "DistanceFunction": {
    "Type": "Euclidean"
  },
  "MaxDistance": 25,
  "PositionNoiseValues": {
    "Type": "Cache",
    "Inputs": [{
       "Type": "SimplexNoise3D",
      "ScaleXZ": 5,
      "ScaleY": 5
    }]
  },
  "PathType": "MIN"
}

The main values to modify are the "ImportedPositions", and "MaxDistance" depending on the situation. Also for caves using this example, it is recommended to change the PathType to "RESTRICTED_MIN".