Alas, DwarfCraft no longer works. See the writeup here
DwarfCraft is a map generator for Minecraft. It aims to make living underground more interesting. You've never seen caves like these before!
This is also, to the very best of my knowledge, the first project to use the Amulet API outside of the Amulet Editor.
Currently, the only way to run DwarfCraft is from source. Pipenv makes this easy as py.
- Install Python 3.8+
- Install Pipenv (
pip install pipenv
) - Navigate to the directory, and run
pipenv install
. This might take a while... - Run
pipenv run python main.py <path to world> <size>
to run DwarfCraft from within the pipenv shell.
Example saves can be found in releases.
I am working on creating an exe for DwarfCraft. As it turns out, this is fairly difficult, due to some of the dependencies needed.
I did <dumb thing> because I literally have no idea what I'm doing. I learned how to use Amulet from looking at the source code and the operations that are a part of Amulet Core. Please, make an issue explaining the right way to do it, or, better yet, a pull request. Maybe we can make it easier for others to build similar programs by examining mine!
A really dumb hack. The motivation is that I wanted to use smooth noise, to generate clusters of things. Obviously, Perlin Noise is the go to for that kind of thing. The problem comes from the fact that numbers closer to 0.5 are more likely to appear. So, say I wanted things to spawn 30% of the time. I couldn't just do
if perlin < 0.3
Like I can do with random.random(), because it wouldn't be true 30% of the time. So what I did was I measured the distance from 0.5, and then ran a program that found the probability that any given distance would be less than the current distance. (For example, if the distance 0.2 had a probability 70%, that means that distances less than 0.2 occur 70% of the time.) Then I ran a linear regression on the output data and found an equation. (This equation can be found in the probability_to_distance function)
Experimentation shows that this method works well enough for my purposes. However, it is obviously far from perfect. If there is a better way, please tell me!
Beta Testers: Cocacolacore
Inspiration: MCDungeonGenerator, by BubbleMod