Post your mapgen questions here (modding or engine)

User avatar
xeranas
Member
Posts: 162
Joined: Fri Feb 05, 2016 11:06

Re: Post your mapgen questions here (modding or engine)

by xeranas » Post

Trying to learn / understand basics of mapgen. Creating from scratch subgame with single biome (mapgen v7)

Code: Select all

minetest.register_biome({
	name = "land",
	node_dust = "air",
	node_top = "zelar_nodes:dirt_with_grass",
	depth_top = 1,
	node_filler = "zelar_nodes:dirt",
	depth_filler = 1,
	node_stone = "zelar_nodes:dirt",
	node_water_top = "zelar_nodes:ice",
	depth_water_top = "zelar_nodes:dirt",
	node_water = "zelar_nodes:ice",
	--node_river_water = "",
	--node_riverbed = "",
	--depth_riverbed = 2,
	y_min = 1,
	y_max = 1024,
	heat_point = 50,
	humidity_point = 35,
}) 
I still get plenty stones, seems like whole surface is based on stone. I do not wish any stone in my biome and seems node_filler parameter isn't enough. What do I missing?

Image

User avatar
paramat
Developer
Posts: 3700
Joined: Sun Oct 28, 2012 00:05
GitHub: paramat
IRC: paramat
Location: UK

Re: Post your mapgen questions here (modding or engine)

by paramat » Post

Your grass is only appearing in tunnel entrances, i've seen this happen before for a reason i have forgotten.
You don't need to define 'node dust' as air, just leave that commented-out as the default for that is air.
'depth water top' should be a number, it is the depth in nodes of 'node water top'.
I don't know where that stone is coming from.
What version of MT engine is this?
Last edited by paramat on Mon Jul 03, 2017 16:35, edited 1 time in total.

User avatar
paramat
Developer
Posts: 3700
Joined: Sun Oct 28, 2012 00:05
GitHub: paramat
IRC: paramat
Location: UK

Re: Post your mapgen questions here (modding or engine)

by paramat » Post

TumeniNodes,

> however, it also produces a mirrored river above in the sky, which then flows down

It was coded to work in the surface mapchunk only, so not surprisng, you need to work out how it works and alter it.

User avatar
TumeniNodes
Member
Posts: 2943
Joined: Fri Feb 26, 2016 19:49
GitHub: TumeniNodes
IRC: tumeninodes
In-game: TumeniNodes
Location: in the dark recesses of the mind
Contact:

Re: Post your mapgen questions here (modding or engine)

by TumeniNodes » Post

paramat wrote:TumeniNodes,

> however, it also produces a mirrored river above in the sky, which then flows down

It was coded to work in the surface mapchunk only, so not surprisng, you need to work out how it works and alter it.
I'll figure it out eventually. Thank you : )
A Wonderful World

User avatar
v-rob
Developer
Posts: 971
Joined: Thu Mar 24, 2016 03:19
GitHub: v-rob
IRC: v-rob
Location: Right behind you.

Re: Post your mapgen questions here (modding or engine)

by v-rob » Post

How do you remove and add dungeons? I am trying to remove deserts and add a granite biome, but I have no idea how to remove the dungeons that spawn where the deserts should be, or how to get the right dungeons in the granite biome.

It's not in mapgen.lua, so I have no idea where to look.
Core Developer | My Best Mods: Bridger - Slats - Stained Glass

User avatar
xeranas
Member
Posts: 162
Joined: Fri Feb 05, 2016 11:06

Re: Post your mapgen questions here (modding or engine)

by xeranas » Post

paramat wrote:What version of MT engine is this?
0.4.16

Seems like issue was:

Code: Select all

minetest.register_alias("mapgen_river_water_source", "air")
I thought that 'air' would be ok at subgame point where rivers aren't needed. Not sure if engine checks what kind of node defined for river_water_source but on my case different results was with: air (previous screenshot), zelar:stone (same as screenshot but no stone, dirt at top), zelar:water_source - desired results (no stone, grass at top).

User avatar
xeranas
Member
Posts: 162
Joined: Fri Feb 05, 2016 11:06

Re: Post your mapgen questions here (modding or engine)

by xeranas » Post

v-rob wrote:How do you remove and add dungeons?
I believe dungeons generated by default. Try set at minetest.conf

Code: Select all

mg_flags = nodungeons

User avatar
paramat
Developer
Posts: 3700
Joined: Sun Oct 28, 2012 00:05
GitHub: paramat
IRC: paramat
Location: UK

Re: Post your mapgen questions here (modding or engine)

by paramat » Post

mg_flags = caves,nodungeons,light,decorations

User avatar
paramat
Developer
Posts: 3700
Joined: Sun Oct 28, 2012 00:05
GitHub: paramat
IRC: paramat
Location: UK

Re: Post your mapgen questions here (modding or engine)

by paramat » Post

xeranas, that bug may even happen if river water is set to air in the biome registration:
node_river_water = "air",
if mapgen thinks that 'air' is river water that can possibly have strange effects.

User avatar
v-rob
Developer
Posts: 971
Joined: Thu Mar 24, 2016 03:19
GitHub: v-rob
IRC: v-rob
Location: Right behind you.

Re: Post your mapgen questions here (modding or engine)

by v-rob » Post

paramat wrote:mg_flags = caves,nodungeons,light,decorations
Not quite what I meant. I removed the desert biome and made a granite biome. Now, I have plain stone dungeons (used to be in the desert, but aren't anymore) that I have to remove, and I want granite brick dungeons in the granite biome instead of cobblestone dungeons.
Core Developer | My Best Mods: Bridger - Slats - Stained Glass

User avatar
paramat
Developer
Posts: 3700
Joined: Sun Oct 28, 2012 00:05
GitHub: paramat
IRC: paramat
Location: UK

Re: Post your mapgen questions here (modding or engine)

by paramat » Post

Ok it's hardcoded, if desert stone or sandstone is placed as the stone in a biome then those will be the dungeon material, otherwise it defaults to cobble.
Maybe i can make it automatically use the biome stone node, i'll consider.

User avatar
Wuzzy
Member
Posts: 4803
Joined: Mon Sep 24, 2012 15:01
GitHub: Wuzzy2
IRC: Wuzzy
In-game: Wuzzy
Contact:

Re: Post your mapgen questions here (modding or engine)

by Wuzzy » Post

How can I guarantee that a particular node in a schematic does NOT alter the existing world? It's not air, but simply a node which is not set?

Now here's the thing: I want an EASY way to create such a schematic, ideally with WorldEdit or a similar tool. And I want this to be useful for schematics of any size, not just trivial ones.
With WorldEdit I can already save schematics but I can't find any way to tell WorldEdit that a node should be ignored when placing the schematic. In table format this would be equivalent to prob=0. Currently, WorldEdit seems for force me to save all air nodes as well, so whenever I place the schematic, the air nodes destroy the world as well. This makes fine-tuning hard.

Editing tables by hand is also out of question.

User avatar
paramat
Developer
Posts: 3700
Joined: Sun Oct 28, 2012 00:05
GitHub: paramat
IRC: paramat
Location: UK

Re: Post your mapgen questions here (modding or engine)

by paramat » Post

v-rob,

> Maybe i can make it automatically use the biome stone node,

This is now done https://github.com/minetest/minetest/pull/6185 although it uses the defined biome 'node_stone'. it cannot use a brick variant because a mod or subgame may not have a brick version of the biome 'node_stone'.

Wuzzy,

> How can I guarantee that a particular node in a schematic does NOT alter the existing world? It's not air, but simply a node which is not set?

There is no such thng as a node not set in a schematic, it has to be something, even if it is "ignore".
2 ways: either set probability to zero (the nodename can be anyhting) or define that nodename as "ignore" (with any probability). The slightly more code-fast way is to define that node as "ignore".

> With WorldEdit I can already save schematics but I can't find any way to tell WorldEdit that a node should be ignored when placing the schematic.

Yes this is why the WE schematic saving feature needs improving, check out octacian's work he is working on a new mod to do this, enabling all per-node parameters to be set https://github.com/octacian/advschem not sure if it is finished or not, but seems well designed.

User avatar
Wuzzy
Member
Posts: 4803
Joined: Mon Sep 24, 2012 15:01
GitHub: Wuzzy2
IRC: Wuzzy
In-game: Wuzzy
Contact:

Re: Post your mapgen questions here (modding or engine)

by Wuzzy » Post

Advschem seems to have a promising future, but it is very WIP and the feature I wanted most, namely, setting probability for arbitrary nodes, is still buggy. Probably this mod is just unfinished.

Paramat, is the schematic file format (.mts) documented anywhere? If not, can you give a short definition? Maybe I want to use them in a hex editor or write some helper scripts.

Paramat, do you know of any other programs or mods which I can use to edit schematics, especially with regards to probability? Now I know:
- WorldEdit
- advschem

hajo
Member
Posts: 606
Joined: Thu Oct 13, 2016 10:45
Location: DE
Contact:

Re: Post your mapgen questions here (modding or engine)

by hajo » Post

Wuzzy wrote:is the schematic file format (.mts) documented anywhere? ..
other programs or mods .. to edit schematics - WorldEdit ..
rnd wrote some programs for his robots that can move/copy fairly large parts
of the map, more easily than WorldEdit (but they need admin-privs).
Options to alter the copy, eg. replace nodes - its only a lua-program...

He also wrote toy-programs that create large 3D-fractals
(like merger-sponge etc.), and L-systems.

Robots can use books to store data, so it should be possible
to fit these programs for your purposes.

To have a look: visit ROBOTS_SKYBLOCK, type "/sethome", then "/spawn",
and at the back of the tutorial-entrance, press button to go to the 'laboratory'.

User avatar
paramat
Developer
Posts: 3700
Joined: Sun Oct 28, 2012 00:05
GitHub: paramat
IRC: paramat
Location: UK

Re: Post your mapgen questions here (modding or engine)

by paramat » Post

File format is here https://github.com/minetest/minetest/bl ... atic.h#L37
Note it is very similar to map format in having a u16 content id, a u8 param1 and a u8 param2. The only difference is that param1 is now probability and per-node force-place, instead of light level.
I know of no other programs or mods.

User avatar
duane
Member
Posts: 1715
Joined: Wed Aug 19, 2015 19:11
GitHub: duane-r
Location: Oklahoma City
Contact:

Multiple Processors and Singlenode

by duane » Post

I have a problem in squaresville with trees showing up too close to each other, and I've been gnawing at it for days, finally tracing it to the fact that my on_generated function is being called four times for each map chunk produced. I can tell this by printing out the seed and coordinates of minp each time. Since I happen to have four processor threads on my computer, this makes me think that the game is trying to multiprocess my lua mapgen. This is spectacularly wasteful as I end up processing all of each chunk, four times, to (presumably) generate part of each chunk's actual data with each iteration.

If all of the above is true, the only fix is to make sure that all of my terrain, including decorations, generates exactly the same way every time (which still leaves it ironically slower on multiple-core machines than on single-core, but that's another issue). I can work on that, though it seems like a lot of wasted effort.

Am I correct in these assumptions? I should probably work my way through the game code, but I'm too tired at the moment, so I thought I'd ask.

If I am correct, is there any way to tell what portion of the data is being used from each iteration of my on_generated, so I don't waste time on unused data?

Edit: By the way, when I set num_emerge_threads = 1 in my minetest.conf, the on_generated still gets called twice (because each core has two threads?). So, no help there.

Edit: After further checking, I figured out that a bug in my code was calling generate twice, so when I set threads to one, the on_generated only gets called once now. Set it to two, and I'm back with multiple calls. I guess I could just tell people to leave it at 1...
Last edited by duane on Tue Aug 15, 2017 08:44, edited 1 time in total.
Believe in people and you don't need to believe anything else.

User avatar
Wuzzy
Member
Posts: 4803
Joined: Mon Sep 24, 2012 15:01
GitHub: Wuzzy2
IRC: Wuzzy
In-game: Wuzzy
Contact:

Re: Post your mapgen questions here (modding or engine)

by Wuzzy » Post

Thx paramat, I have now wikified this information:
http://dev.minetest.net/Minetest_Schematic_File_Format

Maybe this info should also be moved into a text file in the doc/ directory so it can actually be found.

User avatar
Wuzzy
Member
Posts: 4803
Joined: Mon Sep 24, 2012 15:01
GitHub: Wuzzy2
IRC: Wuzzy
In-game: Wuzzy
Contact:

Re: Post your mapgen questions here (modding or engine)

by Wuzzy » Post

How can I fix the lighting of multiple stacked realms, so that each realm acts like as if it were under direct sunlight, no matter how many realms are stacked above?

I know this must be possible because otherwise the v7 floatlands would cast shadows on the world surface. It is this behaviour I want to emulate.

Here's the deal: I've got a realm BELOW the default map (aka Overworld), but it is permanently in darkness because the default map casts a shadow.
The Overworld is “cut off” below a specified Y value, below that is a lot of emptiness, followed by the said realm.

How can I use VoxelManip or whatever to make sure this realm acts like as if it were under sunlight, meaning the Overworld does not cast a shadow on anything below?

I already tried to set propagate_shadow=false in all of the realm's chunks but it didn't do anything.
I also tried to set the lighting to values directly, but this also changed the solid nodes which now have full brightness everywhere (even below). And iterating through every single node to check whether it's solid or not sounds like a terrible solution.

User avatar
azekill_DIABLO
Member
Posts: 7507
Joined: Wed Oct 29, 2014 20:05
GitHub: azekillDIABLO
In-game: azekill_DIABLO
Location: OMICRON
Contact:

Re: Post your mapgen questions here (modding or engine)

by azekill_DIABLO » Post

what about voxelmanip as in mapfix mod? It fixes shadows cast by object in the skies.
Gone, but not dead. Contact me on discord: azekill_DIABLO#6565
DMs are always open if you want to get in touch!

User avatar
Wuzzy
Member
Posts: 4803
Joined: Mon Sep 24, 2012 15:01
GitHub: Wuzzy2
IRC: Wuzzy
In-game: Wuzzy
Contact:

Re: Post your mapgen questions here (modding or engine)

by Wuzzy » Post

I don't see how this mod solves my problem.

Follow-up questions:
- Do I have to call update_liquids before or after I call write_to_map?
- How to I make giant v5/v7 caverns more common? I want to make them so common that they hard to miss. With current default settings you often need a lot of time.

User avatar
duane
Member
Posts: 1715
Joined: Wed Aug 19, 2015 19:11
GitHub: duane-r
Location: Oklahoma City
Contact:

Re: Post your mapgen questions here (modding or engine)

by duane » Post

Wuzzy wrote:How can I fix the lighting of multiple stacked realms, so that each realm acts like as if it were under direct sunlight, no matter how many realms are stacked above?
As I recall, the game doesn't light anything below a certain altitude automatically. You can make lots of levels above altitude zero, and as long as they're far enough apart, shadow won't propagate. Even if they're close, it won't propagate until you generate enough chunks between them. I only started having problems with lighting in loud_walking when I deliberately fell to a lower level.

When I made ramoid, I cheated and put light-emitting air close to the ground (which wrapped around the walls and ceiling).
Believe in people and you don't need to believe anything else.

Sokomine
Member
Posts: 4290
Joined: Sun Sep 09, 2012 17:31
GitHub: Sokomine
IRC: Sokomine
In-game: Sokomine

Re: Post your mapgen questions here (modding or engine)

by Sokomine » Post

Wuzzy wrote: Paramat, do you know of any other programs or mods which I can use to edit schematics, especially with regards to probability? Now I know:
- WorldEdit
- advschem
There's also my handle_schematics mod in theory. It is more end-user-orientated (with the build chest) and of course needed for mg_villages. It does come with functions for reading and writing mts files but does not handle probability. handle_schematics.store_mts_file( path, data ) is similar to minetest.create_schematic except that the data is passed on as a table instead of as a section of the world defined by two positions - which doesn't really help if your goal is to edit .mts files regarding probability. The main problem with the probabilities is to offer a good interface to actually set them.
A list of my mods can be found here.

User avatar
Sergey
Member
Posts: 784
Joined: Wed Jan 11, 2017 13:28
Location: Russia

Re: Post your mapgen questions here (modding or engine)

by Sergey » Post

What's the difference between cave and dungeon?

User avatar
azekill_DIABLO
Member
Posts: 7507
Joined: Wed Oct 29, 2014 20:05
GitHub: azekillDIABLO
In-game: azekill_DIABLO
Location: OMICRON
Contact:

Re: Post your mapgen questions here (modding or engine)

by azekill_DIABLO » Post

cave is natural with ores inside... a dungeon is a kind of undergrond crypt or temple underground which is supposed to be old burried buildings.
Gone, but not dead. Contact me on discord: azekill_DIABLO#6565
DMs are always open if you want to get in touch!

Post Reply

Who is online

Users browsing this forum: rubenwardy and 15 guests