Skip to content

Seboops/TerraMath-Max-String-Size

 
 

Repository files navigation

TerraMath Mod for [Fabric/Forge] - 1.20.x

TerraMath_preview

CurseForge Modrinth

Architecury API Fabric API Minecraft

Description

TerraMath is a Minecraft 1.20.x mod that allows you to customize world generation using mathematical functions. Create unique landscapes by defining terrain height through mathematical formulas!

You can also join my Discord to find more formulas or share yours.

Features

  • Custom world generation through mathematical formulas

  • Adjustable basic generation parameters (scale, height, variation, smoothing)

How to Use

image
  • World generation settings interface

Parameter Configuration

  1. Go to "World" tab in world creation screen

  2. Enter your desired formula in the field

  3. Adjust additional parameters (optional):

    • Scale

    • Base Height (determines average surface level)

    • Height Variation (amplitude of changes)

    • Smoothing (terrain transition smoothness)

Formula examples

  • Basic wavy landscape: sin(x)image
  • Spiky volcanic-like terrain with steep slopes: abs(sin(x/10))*exp(cos(z/15))*8 + tanh(sqrt(x^2 + z^2)/20)*15image
  • Rolling mountains: sin(x/8)*cos(z/8)*10 + abs(sin(x/20))*15 + sqrt(abs(x/10))*5image
  • Some crazy and heavy thing: round(sin(x/15))*10 + round(cos(z/15))*10 + sqrt(abs(sin((x+z)/20)))*15image

Available Functions and Operators

Mathematical Functions:

Trigonometric:
- sin(x) - sine
- cos(x) - cosine
- tan(x) - tangent
- asin(x) - inverse sine (arcsin)
- acos(x) - inverse cosine (arccos)
- atan(x) - inverse tangent (arctan)

Hyperbolic:
- sinh(x) - hyperbolic sine
- cosh(x) - hyperbolic cosine
- tanh(x) - hyperbolic tangent

Root and Power:
- sqrt(x) - square root
- cbrt(x) - cube root
- pow(x,y) - x raised to power y
- exp(x) - exponential (e^x)

Logarithmic:
- ln(x) - natural logarithm
- lg(x) - base-10 logarithm

Rounding and Numbers:
- abs(x) - absolute value
- floor(x) - largest integer less than x
- ceil(x) - smallest integer greater than x
- round(x) - rounds to nearest integer
- sign(x) - returns sign of x (-1, 0, or 1)
- mod(x,y) - remainder of x divided by y

Special Functions:
- gamma(x) - gamma function
- erf(x) - error function
- beta(x,y) - beta function

Utility Functions:
- max(x,y) - maximum of x and y
- min(x,y) - minimum of x and y
- sigmoid(x) - sigmoid function (1/(1+e^-x))
- clamp(x,min,max) - constrains x between min and max

Variables:
x, y, z - block coordinates in world

Operators:
+, -, *, /, ^, ()

Known Issues

  • Extreme formulas that produces XXL landscapes may impact performance (probably not a completely solvable problem)

Future Plans

  • Port to 1.20.2+

  • Additional mathematical functions

  • More terrain customization options

  • Performance optimizations

  • Better formula validation and error messages

Contributing

Feel free to report bugs or suggest features through the issue tracker!

About

Custom world generation via math functions that can be as big as 32767

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Java 100.0%