Skip to content

[Feature] Layered Generator #340

@astrsh

Description

@astrsh

Pre-Request Checklist

  • I have checked that I am on the latest version of Terra.
  • I have searched github for similar features requests, including closed
    ones, and found none.
  • I believe this is within the scope of Terra.
  • This feature request is for all of Terra, and isn't something that
    should be implemented by a pack or addon.

Feature Description

A generator that generalizes terrain, carving, and ocean, referred to as 'layers'. These layers and their generation behaviour would be config defined rather than hardcoded by the generator.

What Problem Does This Solve?

Adding new aspects of generation to a pack such as aquifers is difficult to do properly without code changes to facilitate it. Data driven generation layers should provide the functionality required for such aspects, and is also in line with the Terra design philosophy, such that concepts like 'ocean' and 'carving' are not hard coded in.

A Solution You'd Like

  • Pack defined generation 'layers'

  • A layer consists of block palette(s) distributed in some way, e.g via sampler:

    • These block palettes and distribution may be determined within the layer definition.

    • In addition individual biomes may define their own specific palettes and or samplers for a layer.

    • Whether a biome or the layer itself determines these parameters could be dependent on what the layer specifies:

      Default palettes and or distribution would optionally be determined within the layer definition, otherwise if not
      specified then biomes would be required to define palettes and distribution for the relevant layers.

      Biome specific palettes and or distribution config keys would dynamically be registered similar to keys under features.

      A layer palette would be analogous to the palettes key, and distribution would be analogous to the parameters under
      terrain.

  • Layers could also determine sampling and interpolation behaviour: see New generation config #126.

  • The way each layer generates would be determined by some kind of pack defined logic, e.g a binary decision diagram based on each layer's distribution.

    For the layers terrain, ocean and carving, the gen logic would be something like the following:

    if terrain
      if carving
        place carving palette (e.g air)
      else
        place terrain palette
    else
      if ocean
        place ocean palette
    else
      some other behaviour, or no op
    

Alternative Solutions

The best alternative available right now would be using features to generate things like aquifers, and underground lava oceans, however doing it that way lacks advantages of this generator such as control over interpolation and sampling, more control over initial chunk generation, etc..

Metadata

Metadata

Assignees

Labels

Platform: AllIssue/PR is applicable to all platforms.Status: AcceptedIssue/PR is accepted.Subsystem: GenerationIssue/PR has to do with all other generation subsystems.Type: EnhancementA request for a new feature or enhancement to be added.

Type

No type

Projects

Status

No status

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions