The Python-embedded Domain Specific Language for Minecraft Terrain Generation
pip install git+https://github.com/annhilati/rhombus.git
Rhombus is a Python sub-language delivered as a package that can be used to create expressions resembling the abstract syntax trees of density functions for Minecraft.
It allows you to comfortably write density functions while benefiting from Python's forgiving syntax.
This project is pretty similar to misode/gaia-beet, which you might also find useful. But know that I started developing Rhombus before I knew about it.
The similarities in concept are quite frightening though. The biggest difference to Misode's gaia-beet is that Rhombus is not primarily a beet plugin — although integration is possible and recommended — but rather it is to be seen as a coherent, albeit simple language and it will be further developed and improved in exactly this sense.
Note
State of Development
Rhombus already has most features I imagined it to have. But it hasn't been put through its paces yet. There also probably is a lot of potential for optimizing it's internal API.
- 📦 Object-oriented Design
Full use of Python’s object model for composing, reusing, and structuring density functions. - 📝 Native Comments
Since Python code is in use, comments work naturally without any custom syntax. - 📖 Integrated Documentation
Functions and classes provide detailed docstrings describing behavior, parameters, and usage. - ⚡ Efficient Worldgen Performance
Density expressions are transpiled into as few files as possible, reducing overhead during chunk generation. - ⚙️ High Compatability
As long as the density function definiton format remains unchanged in new version, generated data works across all Minecraft versions. - 🛠️ Generous Modding-API
Classes can be used to derive support for any features from mods.
- Unified Density Type: Represents any computed density value, independent of its underlying implementation.
- Intuitive AST Construction: Density function trees can be built using arithmetic operators, provided interfaces, or custom methods.
- Data Model Base Classes: Most funcionality comes from few base classes, so inheriting new classes is very easy.
- Complete Vanilla Coverage: High-level Python interfaces for all vanilla density function types.
- Advanced Macros: Shortcuts for more complex, commonly needed processes.
- A Visualizer Tool: Currently, all exising density function visualizing tools are based on JavaScript, making it difficult to embed in Rhombus. But by working with Rhombus in combination with Beet watch and Misode's Worldgen Tools Extension you can get quite efficient anyway.