
TerraMath
Create custom terrain using mathematical functions and formulas for unique procedural world generation.
- Загрузки
- 21K
- Подписчики
- 144
- Обновлён
- 13 мая 2025 г.
- Лицензия
- GPL-3.0-only
Опубликован 27 ноября 2024 г.
Description
TerraMath is a Minecraft 1.20 - 1.21.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)
- Configurable noise overlay on top of your base formula
- Support for mathematical constants in formulas
How to Use on Client
- World generation settings interface
Parameter Configuration
- Go to "World" tab in world creation screen
- Open the terrain settings screen
- Enter your desired formula in the field
- Adjust additional parameters (optional):
- Scale
- Base Height (determines average surface level)
- Height Variation (amplitude of changes)
- Smoothing (terrain transition smoothness)
- Choose noise type and settings (optional):
- Noise type: Perlin, Simplex, Blended, Normal
- X, Y, Z coordinate multipliers
- General noise height multiplier
How to Use on Server
- Start the server with TerraMath mod installed
- Check the config folder, there will be a
terramath.jsonfile - Set the necessary parameters manually in the file, or...
- ...configure the mod on your client
- Set the parameters and save the config
- Transfer the config file to the server's config folder
Important Server Notes:
- For the config to apply to a new world, make sure the
useDefaultFormulaparameter in the config is set totrue - After changing config settings, you'll need to delete the existing world and restart the server for the new terrain formula to take effect
- Alternatively, you can transfer your entire world folder from a client to the server - the world will continue to generate according to the same formula without requiring config changes
Formula Examples
Basic wavy landscape:
sin(x)Spiky volcanic-like terrain with steep slopes:
abs(sin(x/10))*exp(cos(z/15))*8 + tanh(sqrt(x^2 + z^2)/20)*15Rolling mountains:
sin(x/8)*cos(z/8)*10 + abs(sin(x/20))*15 + sqrt(abs(x/10))*5Some crazy and heavy thing:
round(sin(x/15))*10 + round(cos(z/15))*10 + sqrt(abs(sin((x+z)/20)))*15Terraced landscape with plateaus:
floor(sin(x/20) * cos(z/20) * 5) * 4 + sqrt(x^2 + z^2)/10Crater-filled terrain:
10 * (1 - exp(-((x/30)^2 + (z/30)^2) / 2)) + 5 * perlin(x/50, 0, z/50)
Available Functions and Operators
Mathematical Functions:
Trigonometric:
- sin(x) - sine
- cos(x) - cosine
- tan(x) - tangent
- csc(x) - cosecant
- sec(x) - secant
- cot(x) - cotangent
- asin(x) - inverse sine
- acos(x) - inverse cosine
- atan(x) - inverse tangent
- atan2(x,y) - two-argument inverse tangent
- acsc(x) - inverse cosecant
- asec(x) - inverse secant
- acot(x) - inverse cotangent
Hyperbolic:
- sinh(x) - hyperbolic sine
- cosh(x) - hyperbolic cosine
- tanh(x) - hyperbolic tangent
- asinh(x) - inverse hyperbolic sine
- acosh(x) - inverse hyperbolic cosine
- atanh(x) - inverse hyperbolic tangent
- csch(x) - hyperbolic cosecant
- sech(x) - hyperbolic secant
- coth(x) - hyperbolic cotangent
- acsch(x) - inverse hyperbolic cosecant
- asech(x) - inverse hyperbolic secant
- acoth(x) - inverse hyperbolic cotangent
Root and Power:
- sqrt(x) - square root
- cbrt(x) - cube root
- root(x,n) - nth root of x
- 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
- gcd(x,y) - greatest common divisor
- lcm(x,y) - least common multiple
- modi(x,y) - modular inverse
Special Functions:
- gamma(x) - gamma function
- erf(x) - error function
- beta(x,y) - beta function
Random Number Generation:
- rand() - random number between 0 and 1
- randnormal(mean,stdev) - random number from normal distribution
- randrange(min,max) - random number between min and max
Noise Functions:
- perlin(x,y,z) - perlin noise
- simplex(x,y,z) - simplex noise
- normal(x,y,z) - normal noise
- blended(x,y,z) - blended noise
- octaved(x,z,octaves,persistence) - octaved noise
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
Constants:
- pi, π - 3.14159... (π constant)
- e - 2.71828... (Euler's number)
- phi, φ - 1.61803... (Golden ratio)
- zeta3, ζ3 - 1.20205... (Apéry's constant)
- catalan, K - 0.91596... (Catalan's constant)
- alpha, α, feigenbaum - 2.50290... (Feigenbaum constant)
- delta, δ, feigenbaumdelta - 4.66920... (Feigenbaum delta)
- omega, Ω - 0.6889 (Cosmological constant)
Variables:
x, y, z - block coordinates in world
Operators:
+, -, *, /, ^, (), !
Known Issues
- Extreme formulas that produce XXL landscapes may impact performance (probably not a completely solvable problem)
- Random number generation functions can significantly impact world generation performance when used extensively. Consider using these functions sparingly, especially in complex terrain formulas, as they may cause frame rate drops or increased chunk loading time
Contributing
Feel free to report bugs or suggest features through the issue tracker!
Ченджлог
1.3.0-1.20.6+forgeРелиз1.21.2, 1.21.3, 1.21.4 · 13 мая 2025 г.
Overview
Version 1.3.0 introduces significant improvements to the TerraMath mod, including performance optimizations, new mathematical capabilities, enhanced error handling, and server compatibility.
What's New
New Commands
- Added /terramath [info|formula|settings] command to display information about the world settings, current formula, or configuration settings.
- Added /formula command that outputs the current terrain generation formula in a copyable format for easy sharing.
Mathematical Capabilities
Constants Support: Added support for mathematical constants
- Basic constants: pi (π), e, phi (φ)
- Advanced constants: zeta3 (ζ3), catalan (K), alpha (α), delta (δ), omega (Ω)
- All constants can be referenced by both symbol and name (e.g., π or pi)
New Mathematical Functions
- atan2(x,y) - Two-argument inverse tangent
- root(x,n) - Calculate nth root of x
- gcd(x,y) - Greatest common divisor
- lcm(x,y) - Least common multiple
- modi(x,y) - Modular inverse
- and even more...
Optimized Random Number Generation
- rand() - Generate random number between 0 and 1
- randnormal(mean,stdev) - Generate number from normal distribution
- randrange(min,max) - Generate random number in specified range
Noise Functions
- perlin(x,y,z) - Perlin noise generator
- simplex(x,y,z) - Simplex noise generator
- normal(x,y,z) - Normal noise generator
- blended(x,y,z) - Blended noise (combines multiple types)
- octaved(x,z,octaves,persistence) - Octaved noise for more natural terrain
Technical Improvements
- Formula Compilation: Formulas are now compiled into Java code using Janino rather than represented as node objects, significantly improving performance
- Error Handling: Added detailed syntax error handling with user-friendly notifications
- Dedicated Server Compatibility: Improved support for dedicated servers
- Server configuration file handling
- Fixed loading of noise settings from world data
- Added notification system for corrupted formulas
User Experience
- New config system
- Larger formula input field (up to 1024 characters)
- Added tooltip for long error messages
- Updated config translations for multiple languages
- Added modmenu description translation support
Bug Fixes
- Fixed function shadowing when one name is a prefix of another
- Prevented null exceptions caused by integer division by zero
- Fixed checkbox state persistence
- Improved formula validation and error handling
- Fixed noise settings loading from world data
- Resolved several UI positioning issues
Developer Changes
- Reorganized math package into specialized subpackages (parser, formula, functions)
- Reorganized utility functions into subpackages
- Replaced HashMap with ConcurrentHashMap to prevent concurrency issues
- Added terrain information command for debugging
- Code cleanup and performance improvements throughout
Removed Features
- Removed dependency on Architectury API
- Removed redundant 1.5x multiplier from the base formula
Coming Soon
- More formula examples in the community Discord
- Additional noise types and combinations
- Further performance optimizations for complex formulas
1.3.0-1.20.6+fabricРелиз1.21.2, 1.21.3, 1.21.4 · 13 мая 2025 г.
Overview
Version 1.3.0 introduces significant improvements to the TerraMath mod, including performance optimizations, new mathematical capabilities, enhanced error handling, and server compatibility.
What's New
New Commands
- Added /terramath [info|formula|settings] command to display information about the world settings, current formula, or configuration settings.
- Added /formula command that outputs the current terrain generation formula in a copyable format for easy sharing.
Mathematical Capabilities
Constants Support: Added support for mathematical constants
- Basic constants: pi (π), e, phi (φ)
- Advanced constants: zeta3 (ζ3), catalan (K), alpha (α), delta (δ), omega (Ω)
- All constants can be referenced by both symbol and name (e.g., π or pi)
New Mathematical Functions
- atan2(x,y) - Two-argument inverse tangent
- root(x,n) - Calculate nth root of x
- gcd(x,y) - Greatest common divisor
- lcm(x,y) - Least common multiple
- modi(x,y) - Modular inverse
- and even more...
Optimized Random Number Generation
- rand() - Generate random number between 0 and 1
- randnormal(mean,stdev) - Generate number from normal distribution
- randrange(min,max) - Generate random number in specified range
Noise Functions
- perlin(x,y,z) - Perlin noise generator
- simplex(x,y,z) - Simplex noise generator
- normal(x,y,z) - Normal noise generator
- blended(x,y,z) - Blended noise (combines multiple types)
- octaved(x,z,octaves,persistence) - Octaved noise for more natural terrain
Technical Improvements
- Formula Compilation: Formulas are now compiled into Java code using Janino rather than represented as node objects, significantly improving performance
- Error Handling: Added detailed syntax error handling with user-friendly notifications
- Dedicated Server Compatibility: Improved support for dedicated servers
- Server configuration file handling
- Fixed loading of noise settings from world data
- Added notification system for corrupted formulas
User Experience
- New config system
- Larger formula input field (up to 1024 characters)
- Added tooltip for long error messages
- Updated config translations for multiple languages
- Added modmenu description translation support
Bug Fixes
- Fixed function shadowing when one name is a prefix of another
- Prevented null exceptions caused by integer division by zero
- Fixed checkbox state persistence
- Improved formula validation and error handling
- Fixed noise settings loading from world data
- Resolved several UI positioning issues
Developer Changes
- Reorganized math package into specialized subpackages (parser, formula, functions)
- Reorganized utility functions into subpackages
- Replaced HashMap with ConcurrentHashMap to prevent concurrency issues
- Added terrain information command for debugging
- Code cleanup and performance improvements throughout
Removed Features
- Removed dependency on Architectury API
- Removed redundant 1.5x multiplier from the base formula
Coming Soon
- More formula examples in the community Discord
- Additional noise types and combinations
- Further performance optimizations for complex formulas
1.3.0-1.20.4+forgeРелиз1.20.2, 1.20.3, 1.20.4 · 13 мая 2025 г.
Overview
Version 1.3.0 introduces significant improvements to the TerraMath mod, including performance optimizations, new mathematical capabilities, enhanced error handling, and server compatibility.
What's New
New Commands
- Added /terramath [info|formula|settings] command to display information about the world settings, current formula, or configuration settings.
- Added /formula command that outputs the current terrain generation formula in a copyable format for easy sharing.
Mathematical Capabilities
Constants Support: Added support for mathematical constants
- Basic constants: pi (π), e, phi (φ)
- Advanced constants: zeta3 (ζ3), catalan (K), alpha (α), delta (δ), omega (Ω)
- All constants can be referenced by both symbol and name (e.g., π or pi)
New Mathematical Functions
- atan2(x,y) - Two-argument inverse tangent
- root(x,n) - Calculate nth root of x
- gcd(x,y) - Greatest common divisor
- lcm(x,y) - Least common multiple
- modi(x,y) - Modular inverse
- and even more...
Optimized Random Number Generation
- rand() - Generate random number between 0 and 1
- randnormal(mean,stdev) - Generate number from normal distribution
- randrange(min,max) - Generate random number in specified range
Noise Functions
- perlin(x,y,z) - Perlin noise generator
- simplex(x,y,z) - Simplex noise generator
- normal(x,y,z) - Normal noise generator
- blended(x,y,z) - Blended noise (combines multiple types)
- octaved(x,z,octaves,persistence) - Octaved noise for more natural terrain
Technical Improvements
- Formula Compilation: Formulas are now compiled into Java code using Janino rather than represented as node objects, significantly improving performance
- Error Handling: Added detailed syntax error handling with user-friendly notifications
- Dedicated Server Compatibility: Improved support for dedicated servers
- Server configuration file handling
- Fixed loading of noise settings from world data
- Added notification system for corrupted formulas
User Experience
- New config system
- Larger formula input field (up to 1024 characters)
- Added tooltip for long error messages
- Updated config translations for multiple languages
- Added modmenu description translation support
Bug Fixes
- Fixed function shadowing when one name is a prefix of another
- Prevented null exceptions caused by integer division by zero
- Fixed checkbox state persistence
- Improved formula validation and error handling
- Fixed noise settings loading from world data
- Resolved several UI positioning issues
Developer Changes
- Reorganized math package into specialized subpackages (parser, formula, functions)
- Reorganized utility functions into subpackages
- Replaced HashMap with ConcurrentHashMap to prevent concurrency issues
- Added terrain information command for debugging
- Code cleanup and performance improvements throughout
Removed Features
- Removed dependency on Architectury API
- Removed redundant 1.5x multiplier from the base formula
Coming Soon
- More formula examples in the community Discord
- Additional noise types and combinations
- Further performance optimizations for complex formulas
1.3.0-1.20.4+fabricРелиз1.20.2, 1.20.3, 1.20.4 · 13 мая 2025 г.
Overview
Version 1.3.0 introduces significant improvements to the TerraMath mod, including performance optimizations, new mathematical capabilities, enhanced error handling, and server compatibility.
What's New
New Commands
- Added /terramath [info|formula|settings] command to display information about the world settings, current formula, or configuration settings.
- Added /formula command that outputs the current terrain generation formula in a copyable format for easy sharing.
Mathematical Capabilities
Constants Support: Added support for mathematical constants
- Basic constants: pi (π), e, phi (φ)
- Advanced constants: zeta3 (ζ3), catalan (K), alpha (α), delta (δ), omega (Ω)
- All constants can be referenced by both symbol and name (e.g., π or pi)
New Mathematical Functions
- atan2(x,y) - Two-argument inverse tangent
- root(x,n) - Calculate nth root of x
- gcd(x,y) - Greatest common divisor
- lcm(x,y) - Least common multiple
- modi(x,y) - Modular inverse
- and even more...
Optimized Random Number Generation
- rand() - Generate random number between 0 and 1
- randnormal(mean,stdev) - Generate number from normal distribution
- randrange(min,max) - Generate random number in specified range
Noise Functions
- perlin(x,y,z) - Perlin noise generator
- simplex(x,y,z) - Simplex noise generator
- normal(x,y,z) - Normal noise generator
- blended(x,y,z) - Blended noise (combines multiple types)
- octaved(x,z,octaves,persistence) - Octaved noise for more natural terrain
Technical Improvements
- Formula Compilation: Formulas are now compiled into Java code using Janino rather than represented as node objects, significantly improving performance
- Error Handling: Added detailed syntax error handling with user-friendly notifications
- Dedicated Server Compatibility: Improved support for dedicated servers
- Server configuration file handling
- Fixed loading of noise settings from world data
- Added notification system for corrupted formulas
User Experience
- New config system
- Larger formula input field (up to 1024 characters)
- Added tooltip for long error messages
- Updated config translations for multiple languages
- Added modmenu description translation support
Bug Fixes
- Fixed function shadowing when one name is a prefix of another
- Prevented null exceptions caused by integer division by zero
- Fixed checkbox state persistence
- Improved formula validation and error handling
- Fixed noise settings loading from world data
- Resolved several UI positioning issues
Developer Changes
- Reorganized math package into specialized subpackages (parser, formula, functions)
- Reorganized utility functions into subpackages
- Replaced HashMap with ConcurrentHashMap to prevent concurrency issues
- Added terrain information command for debugging
- Code cleanup and performance improvements throughout
Removed Features
- Removed dependency on Architectury API
- Removed redundant 1.5x multiplier from the base formula
Coming Soon
- More formula examples in the community Discord
- Additional noise types and combinations
- Further performance optimizations for complex formulas
1.3.0-1.20+forgeРелиз1.20, 1.20.1 · 13 мая 2025 г.
Overview
Version 1.3.0 introduces significant improvements to the TerraMath mod, including performance optimizations, new mathematical capabilities, enhanced error handling, and server compatibility.
What's New
New Commands
- Added /terramath [info|formula|settings] command to display information about the world settings, current formula, or configuration settings.
- Added /formula command that outputs the current terrain generation formula in a copyable format for easy sharing.
Mathematical Capabilities
Constants Support: Added support for mathematical constants
- Basic constants: pi (π), e, phi (φ)
- Advanced constants: zeta3 (ζ3), catalan (K), alpha (α), delta (δ), omega (Ω)
- All constants can be referenced by both symbol and name (e.g., π or pi)
New Mathematical Functions
- atan2(x,y) - Two-argument inverse tangent
- root(x,n) - Calculate nth root of x
- gcd(x,y) - Greatest common divisor
- lcm(x,y) - Least common multiple
- modi(x,y) - Modular inverse
- and even more...
Optimized Random Number Generation
- rand() - Generate random number between 0 and 1
- randnormal(mean,stdev) - Generate number from normal distribution
- randrange(min,max) - Generate random number in specified range
Noise Functions
- perlin(x,y,z) - Perlin noise generator
- simplex(x,y,z) - Simplex noise generator
- normal(x,y,z) - Normal noise generator
- blended(x,y,z) - Blended noise (combines multiple types)
- octaved(x,z,octaves,persistence) - Octaved noise for more natural terrain
Technical Improvements
- Formula Compilation: Formulas are now compiled into Java code using Janino rather than represented as node objects, significantly improving performance
- Error Handling: Added detailed syntax error handling with user-friendly notifications
- Dedicated Server Compatibility: Improved support for dedicated servers
- Server configuration file handling
- Fixed loading of noise settings from world data
- Added notification system for corrupted formulas
User Experience
- New config system
- Larger formula input field (up to 1024 characters)
- Added tooltip for long error messages
- Updated config translations for multiple languages
- Added modmenu description translation support
Bug Fixes
- Fixed function shadowing when one name is a prefix of another
- Prevented null exceptions caused by integer division by zero
- Fixed checkbox state persistence
- Improved formula validation and error handling
- Fixed noise settings loading from world data
- Resolved several UI positioning issues
Developer Changes
- Reorganized math package into specialized subpackages (parser, formula, functions)
- Reorganized utility functions into subpackages
- Replaced HashMap with ConcurrentHashMap to prevent concurrency issues
- Added terrain information command for debugging
- Code cleanup and performance improvements throughout
Removed Features
- Removed dependency on Architectury API
- Removed redundant 1.5x multiplier from the base formula
Coming Soon
- More formula examples in the community Discord
- Additional noise types and combinations
- Further performance optimizations for complex formulas
1.3.0-1.20+fabricРелиз1.20, 1.20.1 · 13 мая 2025 г.
Overview
Version 1.3.0 introduces significant improvements to the TerraMath mod, including performance optimizations, new mathematical capabilities, enhanced error handling, and server compatibility.
What's New
New Commands
- Added /terramath [info|formula|settings] command to display information about the world settings, current formula, or configuration settings.
- Added /formula command that outputs the current terrain generation formula in a copyable format for easy sharing.
Mathematical Capabilities
Constants Support: Added support for mathematical constants
- Basic constants: pi (π), e, phi (φ)
- Advanced constants: zeta3 (ζ3), catalan (K), alpha (α), delta (δ), omega (Ω)
- All constants can be referenced by both symbol and name (e.g., π or pi)
New Mathematical Functions
- atan2(x,y) - Two-argument inverse tangent
- root(x,n) - Calculate nth root of x
- gcd(x,y) - Greatest common divisor
- lcm(x,y) - Least common multiple
- modi(x,y) - Modular inverse
- and even more...
Optimized Random Number Generation
- rand() - Generate random number between 0 and 1
- randnormal(mean,stdev) - Generate number from normal distribution
- randrange(min,max) - Generate random number in specified range
Noise Functions
- perlin(x,y,z) - Perlin noise generator
- simplex(x,y,z) - Simplex noise generator
- normal(x,y,z) - Normal noise generator
- blended(x,y,z) - Blended noise (combines multiple types)
- octaved(x,z,octaves,persistence) - Octaved noise for more natural terrain
Technical Improvements
- Formula Compilation: Formulas are now compiled into Java code using Janino rather than represented as node objects, significantly improving performance
- Error Handling: Added detailed syntax error handling with user-friendly notifications
- Dedicated Server Compatibility: Improved support for dedicated servers
- Server configuration file handling
- Fixed loading of noise settings from world data
- Added notification system for corrupted formulas
User Experience
- New config system
- Larger formula input field (up to 1024 characters)
- Added tooltip for long error messages
- Updated config translations for multiple languages
- Added modmenu description translation support
Bug Fixes
- Fixed function shadowing when one name is a prefix of another
- Prevented null exceptions caused by integer division by zero
- Fixed checkbox state persistence
- Improved formula validation and error handling
- Fixed noise settings loading from world data
- Resolved several UI positioning issues
Developer Changes
- Reorganized math package into specialized subpackages (parser, formula, functions)
- Reorganized utility functions into subpackages
- Replaced HashMap with ConcurrentHashMap to prevent concurrency issues
- Added terrain information command for debugging
- Code cleanup and performance improvements throughout
Removed Features
- Removed dependency on Architectury API
- Removed redundant 1.5x multiplier from the base formula
Coming Soon
- More formula examples in the community Discord
- Additional noise types and combinations
- Further performance optimizations for complex formulas
1.2.0-1.20.4+forgeБета1.20.2, 1.20.3, 1.20.4 · 1 января 2025 г.
- Ported to versions 1.20.2-1.20.4
1.2.0-1.20.4+fabricБета1.20.2, 1.20.3, 1.20.4 · 1 января 2025 г.
- Ported to versions 1.20.2-1.20.4
Комментарии
Загружаем…