Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Lua API: Worldgen / Terrain formula #149

Open
Unarelith opened this issue Jul 8, 2020 · 0 comments
Open

Lua API: Worldgen / Terrain formula #149

Unarelith opened this issue Jul 8, 2020 · 0 comments

Comments

@Unarelith
Copy link
Owner

@KdotJPG To me there could perhaps be three PR stages:

  1. Setup lua scripting for per-biome terrain formulas, adding it to the dimension rather than individual biomes
  2. Implement biome smoothing, and move it into the biome definitions
  3. Revamped biome placement that places+sizes the biomes correctly no matter what the parameters are.

Example of API for terrain formulas:

mod:dimension { -- or later mod:biome
    -- ...
    
    terrain_formula = function(block_pos) {
        noise1 = simplexSmooth(block_pos * 0.0625))
        noise2 = simplexSmooth(block_pos * 0.03125)) * 0.5
        return (1 - abs(noise1)) * (1 - abs(noise2))
    },

    -- ...
}

Note: This would use operator overloads to generate an internal "node graph" of objects, which then will be used in the actual worldgen instead of calling the function each time.

@KdotJPG feel free to add your ideas here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant