Unleash your creativity by crafting custom terrains using mathematical functions and equations to experience a unique procedural world generation in Minecraft.
Overview
Introducing TerraMath, a mod for Minecraft 1.20.1 that revolutionizes your gaming experience by allowing you to manipulate world generation through mathematical principles. With this mod, you can design distinctive landscapes by setting terrain heights with advanced mathematical formulas!
Key Features
-
Create personalized world generation using mathematical functions.
-
Customizable generation parameters (scale, base height, variation, smoothing).
-
User-friendly interface for world generation settings.
Getting Started
-
Navigate to the “World” tab in the world creation screen.
Configuring Parameters
- Input your desired formula into the designated field.
- Make adjustments to supplementary parameters (optional):
- Scale – governs the terrain’s size. For instance, at 1, one function period equals one block, whereas at 10, it equals ten blocks. Higher values yield more stretched terrains.
- Base Height – serves as the primary level for generation (measured in blocks). If set to 64, this represents sea level, and the terrain forms in relation to this height.
- Height Variation – defines the maximum variation from base height (in blocks). Setting this to 32 means the terrain can fluctuate 32 blocks above or below the base height, resulting in taller mountains and deeper valleys with higher values.
- Smoothing – minimizes abrupt height transitions. A value of 0 results in raw terrain generation, while increasing this value softens sharp angles and cliffs.
Formula Illustrations
Basic undulating landscape: sin(x)
Sharp, volcanic-like formations: abs(sin(x/10))exp(cos(z/15))8 + tanh(sqrt(x^2 + z^2)/20)*15
Rolling hills: sin(x/8)cos(z/8)10 + abs(sin(x/20))15 + sqrt(abs(x/10))5
A wild and intricate design: round(sin(x/15))10 + round(cos(z/15))10 + sqrt(abs(sin((x+z)/20)))*15
Available Mathematical Functions and Operators
Here are some functions you can utilize:
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 the y power
- exp(x) – exponential function (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 the nearest integer
- sign(x) – returns the 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) – keeps x within min and max range
- x, y, z – block coordinates in the game world
Operators:
- +, -, *, /, ^, () – standard operations
Known Limitations
- Using complex formulas that create extremely large landscapes may lead to performance issues (this may not have a straightforward resolution).
Future Developments
- Upgrade compatibility to version 1.20.2+
- Add more mathematical functions
- Enhance terrain customization features
- Optimize performance
- Improve formula validation and provide clearer error messages
Contributing to the Project
If you wish to report bugs or propose new features, please use the issue tracker!