Post your mapgen questions here (modding or engine)

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

Yes use minetest.emerge_area, i doubt forceload_block actually generates the area.

User avatar
ChimneySwift
Member
Posts: 320
Joined: Fri Sep 22, 2017 06:46
GitHub: ChimneySwift
IRC: ChimneySwift
In-game: ChimneySwift
Location: 127.0.0.1

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

by ChimneySwift » Post

Is there a way to get a completely flat (no holes) grass-only mapgen (no grass, trees, bushes, just dirt with grass) I don't mind what happens under the ground, I'd just like a cleaner testing environment for mods :)
A spoon is basically a tiny bowl with a stick on it

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

ChimneySwift wrote:Is there a way to get a completely flat (no holes) grass-only mapgen
Maybe use spawnbuilder as a starting point,
and change stone to grass ?

User avatar
GreenXenith
Member
Posts: 1356
Joined: Wed Oct 28, 2015 01:26
GitHub: GreenXenith
Location: UTC-8:00
Contact:

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

by GreenXenith » Post

ChimneySwift wrote:Is there a way to get a completely flat (no holes) grass-only mapgen (no grass, trees, bushes, just dirt with grass) I don't mind what happens under the ground, I'd just like a cleaner testing environment for mods :)
Select "flat" from the mapgen list. You can also edit the generation file to disable caves.
YouTube | Mods | Patreon | Minetest Discord @greenxenith

You should not be able to read this message.

User avatar
burli
Member
Posts: 1643
Joined: Fri Apr 10, 2015 13:18

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

by burli » Post

The flat mapgen always generates biomes. The ground nodes will change. He wants grass only

User avatar
Linuxdirk
Member
Posts: 3217
Joined: Wed Sep 17, 2014 11:21
In-game: Linuxdirk
Location: Germany
Contact:

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

by Linuxdirk » Post

burli wrote:The flat mapgen always generates biomes.
And trees.

Actually in 8/10 test worlds I spawn in the middle of a gigantic forest :(

User avatar
burli
Member
Posts: 1643
Joined: Fri Apr 10, 2015 13:18

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

by burli » Post

You can disable trees with "nodecoration", but you always have biomes.

User avatar
Linuxdirk
Member
Posts: 3217
Joined: Wed Sep 17, 2014 11:21
In-game: Linuxdirk
Location: Germany
Contact:

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

by Linuxdirk » Post

burli wrote:You can disable trees with "nodecoration", but you always have biomes.
I am absolutely fine with decorations (bushes, grass, occasional trees, etc.) but I wouldn't call giant forests as "flat".

User avatar
GreenXenith
Member
Posts: 1356
Joined: Wed Oct 28, 2015 01:26
GitHub: GreenXenith
Location: UTC-8:00
Contact:

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

by GreenXenith » Post

burli wrote:The flat mapgen always generates biomes. The ground nodes will change. He wants grass only
Alright, singlenode has a flag for the nodetype, right? (I think I read that somewhere).
YouTube | Mods | Patreon | Minetest Discord @greenxenith

You should not be able to read this message.

User avatar
burli
Member
Posts: 1643
Joined: Fri Apr 10, 2015 13:18

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

by burli » Post

Linuxdirk wrote: I am absolutely fine with decorations (bushes, grass, occasional trees, etc.) but I wouldn't call giant forests as "flat".
Could be done as mod or subgame. You can write a mod that overrides MTG biomes and replaced them with a single grassland with rare decoration.

That's the problem with the current mapgen and biome implementation. Mostly everything is possible, but the setup is far from user friendly

twoelk
Member
Posts: 1482
Joined: Fri Apr 19, 2013 16:19
GitHub: twoelk
IRC: twoelk
In-game: twoelk
Location: northern Germany

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

by twoelk » Post

ChimneySwift wrote:Is there a way to get a completely flat (no holes) grass-only mapgen (no grass, trees, bushes, just dirt with grass) I don't mind what happens under the ground, I'd just like a cleaner testing environment for mods :)
as mentioned only a little earlier in this thread, do try these mods

superflat
or
flatgen
Spoiler
very flat map made of layers that you can define.]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

ChimneySwift wrote:Is there a way to get a completely flat (no holes) grass-only mapgen (no grass, trees, bushes, just dirt with grass) I don't mind what happens under the ground, I'd just like a cleaner testing environment for mods :)
In .conf add the line: 'mg_flags = nocaves,nodungeons,light,nodecorations' or set those mapgen flags in advanced settings menu.

Select 'flat' core mapgen and create a new world.

Use a mod that depends on 'default' that clears the MTGame biomes and defines it's own grass biome, code is:

Code: Select all

minetest.clear_registered_biomes()
minetest.clear_registered_ores()
minetest.clear_registered_decorations()


	minetest.register_biome({
		name = "grassland",
		--node_dust = "",
		node_top = "default:dirt_with_grass",
		depth_top = 1,
		node_filler = "default:dirt",
		depth_filler = 1,
		--node_stone = "",
		--node_water_top = "",
		--depth_water_top = ,
		--node_water = "",
		--node_river_water = "",
		--node_riverbed = ,
		--depth_riverbed = ,
		y_min = -31000,
		y_max = 31000,
		heat_point = 50,
		humidity_point = 50,
	})
The Biome API is fairly user-friendly, it can't be simpler without losing most of the possibilities and making engine code very complex.

User avatar
ChimneySwift
Member
Posts: 320
Joined: Fri Sep 22, 2017 06:46
GitHub: ChimneySwift
IRC: ChimneySwift
In-game: ChimneySwift
Location: 127.0.0.1

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

by ChimneySwift » Post

Ahh thank you folks :)

Much appreciated, I will investigate all avenues :)
A spoon is basically a tiny bowl with a stick on it

MusaFuchs
Member
Posts: 17
Joined: Wed Feb 28, 2018 15:44

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

by MusaFuchs » Post

Where's a good place to get started writing biomes?

I've read through the contents of \games\minetest_game\mods\default\mapgen.lua, but the parameters there seem rather limited. How is terrain noise changed from biome to biome, for example to differentiate a large flat field from a hilly field?

I'm also having trouble seeing where plant/decoration gen is controlled, like how to control density of a plant's generation and which biomes it will generate in.

Sorry for so many questions at once. I'm coming over from Minecraft, most things in Minetest are a *lot* easier to access and modify, but biomes/terraingen is looking harder to break into.

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

in Minetest a basic 'stone and water' terrain is created first by the engine, then afterwards biomes are added according to definitions in mods or games (like MTGame), so biomes cannot affect terrain shape. However biomes have y-limits so you can limit a biome to a suitable altitude.

See the decoration registrations, density is either fixed and specified by 'fill_ratio', or more often specified by a perlin noise defined in 'noise_params'. I have written or linked to some explanation of noise params in a post earlier in this thread, it's well worth reading through the whole thread there's lots of helpful information.

Make sure to read the docs:
https://github.com/minetest/minetest/bl ... .txt#L5087
https://github.com/minetest/minetest/bl ... .txt#L5128

MusaFuchs
Member
Posts: 17
Joined: Wed Feb 28, 2018 15:44

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

by MusaFuchs » Post

Are there any mods or third-party APIs out there that would let me alter terrain shape per-biome, or ways to get a similar affect? It's a pretty important feature for the mod I'd like to build. I've read through the docs, but didn't see anything that did this, apparently because it doesn't exist in-engine yet! Oh well.

Thanks, those are useful posts. I'll give the whole thread a read through today.

User avatar
Devy
Member
Posts: 133
Joined: Sat Jan 21, 2017 02:31
GitHub: DevyHeavy
In-game: devy

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

by Devy » Post

You can mass read/write the map using the LUA voxel manipulator: https://github.com/minetest/minetest/bl ... .txt#L4017

Be warned though, if your operations take too long you will slow down your game.

There is an example at the bottom of this page: http://dev.minetest.net/VoxelManip

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

MusaFuchs if you want a particularly custom mapgen you can create one in a Lua mod, then you can do anything you want, however you need to code it.
I have written many Lua mapgens, see my mod threads in this forum, and see the code for example code.
This one is complex but has good code https://github.com/paramat/watershed

MusaFuchs
Member
Posts: 17
Joined: Wed Feb 28, 2018 15:44

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

by MusaFuchs » Post

paramat wrote:MusaFuchs if you want a particularly custom mapgen you can create one in a Lua mod, then you can do anything you want, however you need to code it.
I have written many Lua mapgens, see my mod threads in this forum, and see the code for example code.
This one is complex but has good code https://github.com/paramat/watershed
Some of this looks like the kind of parameters and control I need, but I'm not seeing where biomes are coming into play in this mod.

I see the --3dnoises section where noises are generated for temperature/humidity/etc, and I see --Mapchunk generation function where it looks like blocks are being defined for different local variables and the different 3dnoises are being generated. What I don't see is where parameters are defined to set blocktypes to the different humidity/temperature/etc parameters?


------------------
On a side note, I see on the wiki that mapgenv6 can have biomes influence terrain to some extent, but I can't find an API specific to v6 that shows how to use this feature.

I also see that this mod here seems to link terrain-gen and biome/surfacenode types, but again I'm not quite catching where the two are linked.

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

here https://github.com/paramat/watershed/bl ... t.lua#L348

> I see on the wiki that mapgenv6 can have biomes influence terrain to some extent, but I can't find an API specific to v6 that shows how to use this feature

In mgv6 biomes don't affect terrain much at all, maybe a little, but mgv6 is older and different to the other mapgens, it doesn't use the Biome API and it's biomes are hardcoded.

The '30 biomes' mod doesn't have biomes affecting terrain shape, that's just a use of the Biome API with certain biomes limited to certain y ranges.

siva
New member
Posts: 1
Joined: Thu Apr 12, 2018 10:22

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

by siva » Post

-
Last edited by siva on Fri Jun 22, 2018 08:55, edited 2 times in total.

User avatar
Cross_over
Member
Posts: 11
Joined: Fri Nov 10, 2017 18:28
In-game: Cross_over

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

by Cross_over » Post

Hi all, i'm trying to generate a mainly water map with mapgen, changing the water level to 10 generates more islands and bigger seas as i want, but trees still appear underwater so i got some kind of diluvian world, how could i change the other parameters to generate bigger oceans?

User avatar
v-rob
Developer
Posts: 970
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

Cross_over wrote:Hi all, i'm trying to generate a mainly water map with mapgen, changing the water level to 10 generates more islands and bigger seas as i want, but trees still appear underwater so i got some kind of diluvian world, how could i change the other parameters to generate bigger oceans?
You will have to change the biome Y min and max values in the code. I think that it should automatically change depending on the sea level by getting the value of the setting and adding/subtracting the necessary numbers to get the correct height, but it doesn't.
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

Yes changing 'water_level' doesn't have the expected result. We considered making all biomes relative to 'water_level' but it caused too much complexity and too many problems.
You *could* use a mod that clears all biome, ore and decoration registrations and re-registers them with altered y-limits to be suitable for your changed 'water_level', but this is a lot of work.
Instead the simplest method is to lower the terrain instead by altering the noise parameters of a mapgen, however this is not easy. If you let me know what mapgen and the desired vertical shift in nodes i can post noise parameters here.

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

paramat wrote:> What is on_mapgen_init and why isn't it documented in lua_api.txt?

It's deprecated now and not needed around minetest.set_mapgen_setting().
Sorry to chime in so late, but I see one reason left to use register_on_mapgen_init. As far as I can tell, there is no other way for a lua mapgen mod to force the mapgen setting to singlenode. Setting it in initialization doesn't work. This requires the mod user to set it manually -- not a big deal, unless you're new and don't understand why Valleys lua is making a mess of everything.

Of course you could disable the mod if singlenode isn't already selected, but that might also be confusing.

Maybe there's some other method I'm missing. The documentation is a bit sparse.

Edit: Well, never mind. I figured out that the parameter name has changed. After fixing that, it works fine.
Believe in people and you don't need to believe anything else.

Post Reply

Who is online

Users browsing this forum: No registered users and 6 guests