New Minecraft-compatible Mineclonia map generator

Post Reply
repetitivestrain
Member
Posts: 138
Joined: Fri Aug 09, 2024 01:54

New Minecraft-compatible Mineclonia map generator

by repetitivestrain » Post

My new Lua map generator and biome system for Mineclonia, which was implemented in the span of the past 3-4 months and is now ready for testing, may be of interest to players who are interested in faithful reproductions of Minecraft terrain and (as far as is permissible from a copyright standpoint) structure generation. It was produced by experimentation on unmodified Minecraft class files, a motley of unsystematic documentation in the shape of myriad pastes, write-ups, Yarn mappings, and the Minecraft issue tracker, and, in the case of procedurally generated structures, tracing the execution of Minecraft's structure generator classes and level accessor functions with various JVM execution tracing tools such as https://github.com/btraceio/btrace. The upshot being that it should generate terrain and biomes nearly or completely identical to Minecraft 1.20.4's, and structures at the same locations where they would exist in Minecraft, although their composition and layout may differ unless otherwise stated, and that I would consider any departures from this principle bugs.

Beyond compatibility with Minecraft, it is also technically superior to the built-in engine mapgens in several respects; it is a mostly asynchronous and deterministic two-stage mapgen with no overgeneration (so that it is unaffected by artifacts such as those in https://github.com/luanti-org/luanti/issues/9357, map generation will not produce multiple-second lag spikes when large decorations are encoutered, and decorations such as trees are not liable to be cut off at mapchunk boundaries), it replaces the engine's biome system with one which derives terrain height and biome coordinates from the same noises, so that terrain characteristics are reflected in biome selection, and it persists biome data in generated MapBlocks, which avoids ugly inconsistencies after upgrades that introduce new biomes. The generator also supports much larger structures than any other Minetest game is currently capable of, for they are positioned ahead of time and generated incrementally as intersecting MapChunks are produced.

This comes at the cost of hugely inflated memory consumption of up to 4 GiB per process with four emerge threads (+ whatever may be incurred by engine-created async environments), and generally worse throughput (which is mitigated by the ability to use multiple mapgen threads).

Below you will find a link to the Mineclonia branch where this map generator is being developed, and instructions for enabling and using it. I shall shortly be posting a series of screenshots of my world generator's output in this thread. Bon appetit!

https://codeberg.org/mineclonia/mineclo ... nt-5730269
cdb_6dcb4b04312d

Codiac
Member
Posts: 90
Joined: Sun Apr 23, 2023 03:04

Re: New Minecraft-compatible Mineclonia map generator

by Codiac » Post

Hi, this fails for me creating a new world using the single node mapgen, with the following log.

Code: Select all

2025-07-07 13:36:12: ACTION[ServerStart]: [mcl_levelgen]: Initializing level generation with seed 1898355437631565186 (Biome seed: 11192021825339980294)
2025-07-07 13:36:24: ACTION[ServerStart]: [mcl_villages]: World was upgraded or is pristine.
2025-07-07 13:36:29: ACTION[ServerStart]: [mcl_levelgen]: Preparing stronghold placement.  This may take a while.
2025-07-07 13:37:08: ACTION[ServerStart]: World at [/home/games/.minetest/worlds/test-mapgen]
2025-07-07 13:37:08: ACTION[ServerStart]: Server for gameid="mineclonia" listening on 127.0.0.1:63082.
2025-07-07 13:37:08: ACTION[Server]: Generating world spawn from (-24,-128,-537) to (24,127,-489)
2025-07-07 13:37:09: ACTION[Server]: Emerged 0/1216 MapBlocks; 0/256 MapBlocks regenerated
2025-07-07 13:37:12: ACTION[Server]: singleplayer [127.0.0.1] joins game. List of players: singleplayer
2025-07-07 13:37:12: WARNING[Server]: Server: Maximum lag peaked at 2.2202 (steplen=0.0166667)
2025-07-07 13:37:16: ACTION[Server]: Emerged 1/1216 MapBlocks; 0/256 MapBlocks regenerated
2025-07-07 13:37:17: ACTION[Server]: Emerged 10/1216 MapBlocks; 0/256 MapBlocks regenerated
2025-07-07 13:37:17: ERROR[Main]: ServerError: AsyncErr: Lua: Runtime error from mod 'mcl_levelgen' in callback <async>(): .../mineclonia/mods/MAPGEN/mcl_levelgen/post_processing.lua:1106: assertion failed!
2025-07-07 13:37:17: ERROR[Main]: stack traceback:
2025-07-07 13:37:17: ERROR[Main]: 	[C]: in function 'assert'
2025-07-07 13:37:17: ERROR[Main]: 	.../mineclonia/mods/MAPGEN/mcl_levelgen/post_processing.lua:1106: in function 'callback'
2025-07-07 13:37:17: ERROR[Main]: 	/usr/share/luanti/builtin/game/async.lua:7: in function </usr/share/luanti/builtin/game/async.lua:4>
2025-07-07 13:37:17: ACTION[ServerStop]: Server: Shutting down
The `shutting down` message is shown but the it never shuts down and has to be `kill -9`d.

Computer details

Code: Select all

$ tail -n4 ~/.minetest/minetest.conf 
num_emerge_threads = 4
active_block_range = 6
max_block_send_distance = 27
max_block_generate_distance = 28

$ free -h
               total        used        free      shared  buff/cache   available
Mem:            62Gi       6.9Gi        51Gi       134Mi       5.0Gi        55Gi

$ lscpu | grep -E '^Thread|^Core|^Socket|^CPU\('
CPU(s):                                  12
Thread(s) per core:                      2
Core(s) per socket:                      6
Socket(s):                               1

$ grep sec ~/.minetest/minetest.conf 
secure.trusted_mods = dbg

$ luanti --version
Luanti 5.12.0 (Linux)
Using LuaJIT 2.1.1744318430
Built by GCC 15.1
Running on Linux/6.15.4 x86_64
BUILD_TYPE=Release
RUN_IN_PLACE=0
USE_CURL=1
USE_GETTEXT=1
USE_SOUND=1
STATIC_SHAREDIR="/usr/share/luanti"
STATIC_LOCALEDIR="/usr/share/locale"
I tried it with and without the dbg mod, no differences in messages. No other mods were enabled.

repetitivestrain
Member
Posts: 138
Joined: Fri Aug 09, 2024 01:54

Re: New Minecraft-compatible Mineclonia map generator

by repetitivestrain » Post

Hmm, please uncomment the following commented line in post_processing.lua:

local function dbg (...)
-- print (string.format (...))
end

and post the debugging data printed to debug.txt (or stdout in your case). Btw, it would also be more productive to track bugs on the issue tracker.
cdb_6dcb4b04312d

repetitivestrain
Member
Posts: 138
Joined: Fri Aug 09, 2024 01:54

Re: New Minecraft-compatible Mineclonia map generator

by repetitivestrain » Post

Nevermind, should be fixed now.
cdb_6dcb4b04312d

Codiac
Member
Posts: 90
Joined: Sun Apr 23, 2023 03:04

Re: New Minecraft-compatible Mineclonia map generator

by Codiac » Post

repetitivestrain wrote:
Mon Jul 07, 2025 07:43
Nevermind, should be fixed now.
Yeah it's working for me now, thanks.

Codiac
Member
Posts: 90
Joined: Sun Apr 23, 2023 03:04

Re: New Minecraft-compatible Mineclonia map generator

by Codiac » Post

I've had some time to play with this and it struck me how a simple change to a minor thing can sometimes get an unexpectedly strong reaction.

Kelp. *^&*)%^& kelp! It's one of the things that has just annoyed me for ages, so much and so long that I had force my mind to bury any reaction to the seemingly unending streams of floating kelp.

I'd almost forgotten how much it annoyed me until I noticed it was staying were it should be!

Probably not a feature that most will find compelling, but there you go.

It seems reasonably fast for me. I don't think my rig is great, but it's not a potato either.

One difference I found interesting is that when fast flying and hitting the edge of the emerged area I don't hit an invisible wall, and can sail off in to the blackness. I used it to force larger areas to emerge when taking a break :D

repetitivestrain
Member
Posts: 138
Joined: Fri Aug 09, 2024 01:54

Re: New Minecraft-compatible Mineclonia map generator

by repetitivestrain » Post

Codiac wrote:
Tue Jul 08, 2025 11:55
I've had some time to play with this and it struck me how a simple change to a minor thing can sometimes get an unexpectedly strong reaction.

Kelp. *^&*)%^& kelp! It's one of the things that has just annoyed me for ages, so much and so long that I had force my mind to bury any reaction to the seemingly unending streams of floating kelp.

I'd almost forgotten how much it annoyed me until I noticed it was staying were it should be!

Probably not a feature that most will find compelling, but there you go.

It seems reasonably fast for me. I don't think my rig is great, but it's not a potato either.

One difference I found interesting is that when fast flying and hitting the edge of the emerged area I don't hit an invisible wall, and can sail off in to the blackness. I used it to force larger areas to emerge when taking a break :D
Are you sure you didn't simply enable noclip mode?

At any rate, I'm glad to see that kelp generation has improved in comparison to the engine map generators. It still isn't perfect, since Minetest has no conception of waterlogging and kelp columns are just single nodes with very tall nodeboxes.
cdb_6dcb4b04312d

Codiac
Member
Posts: 90
Joined: Sun Apr 23, 2023 03:04

Re: New Minecraft-compatible Mineclonia map generator

by Codiac » Post

repetitivestrain wrote:
Thu Jul 10, 2025 03:44
Are you sure you didn't simply enable noclip mode?
Bah! You are correct.

repetitivestrain
Member
Posts: 138
Joined: Fri Aug 09, 2024 01:54

Re: New Minecraft-compatible Mineclonia map generator

by repetitivestrain » Post

Some highlights produced by this level generator, as promised.

Image Image Image Image Image Image Image Image Image Image Image Image Image Image Image Image Image Image Image Image Image Image Image Image Image Image Image Image Image Image Image Image Image Image Image Image Image Image Image Image Image Image Image Image Image Image Image Image Image Image Image Image Image Image Image Image Image Image Image Image Image Image Image Image Image Image Image Image Image Image Image Image Image Image Image Image Image Image Image Image Image Image Image Image Image Image Image Image Image Image Image Image Image Image Image Image Image Image Image Image Image Image Image Image Image Image Image Image Image
cdb_6dcb4b04312d

repetitivestrain
Member
Posts: 138
Joined: Fri Aug 09, 2024 01:54

Re: New Minecraft-compatible Mineclonia map generator

by repetitivestrain » Post

And true Mushroom Islands, who could forget? My habitat of choice.

Image Image Image Image
cdb_6dcb4b04312d

Post Reply

Who is online

Users browsing this forum: No registered users and 0 guests