Post your mapgen questions here (modding or engine)

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

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

by paramat » Thu Dec 21, 2017 20:32

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

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

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

by ChimneySwift » Fri Dec 22, 2017 02:12

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 :)
"You have to be a pretty sad person to quote yourself" ~ ChimneySwift
 

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

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

by hajo » Fri Dec 22, 2017 04:19

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
GreenDimond
Member
 
Posts: 1141
Joined: Wed Oct 28, 2015 01:26
Location: {x=0,y=0,z=0}
GitHub: GreenXenith
IRC: GreenDimond
In-game: GreenDimond

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

by GreenDimond » Fri Dec 22, 2017 04:43

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.
My YuTube channel | I moderate the HOMETOWN Server. | Click here to see my (6) mods! ~Using gradient signatures since 2017. ✂️- - - - -
 

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

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

by burli » Fri Dec 22, 2017 05:23

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

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

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

by Linuxdirk » Fri Dec 22, 2017 07:33

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: 1605
Joined: Fri Apr 10, 2015 13:18

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

by burli » Fri Dec 22, 2017 08:05

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

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

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

by Linuxdirk » Fri Dec 22, 2017 08:09

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
GreenDimond
Member
 
Posts: 1141
Joined: Wed Oct 28, 2015 01:26
Location: {x=0,y=0,z=0}
GitHub: GreenXenith
IRC: GreenDimond
In-game: GreenDimond

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

by GreenDimond » Fri Dec 22, 2017 08:14

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).
My YuTube channel | I moderate the HOMETOWN Server. | Click here to see my (6) mods! ~Using gradient signatures since 2017. ✂️- - - - -
 

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

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

by burli » Fri Dec 22, 2017 08:19

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: 1238
Joined: Fri Apr 19, 2013 16:19
Location: northern Germany
GitHub: twoelk
IRC: twoelk
In-game: twoelk

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

by twoelk » Fri Dec 22, 2017 15:04

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

+ to design a
 

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

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

by paramat » Sun Dec 24, 2017 16:58

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: 263
Joined: Fri Sep 22, 2017 06:46
Location: 127.0.0.1
GitHub: ChimneySwift
IRC: ChimneySwift
In-game: ChimneySwift

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

by ChimneySwift » Mon Dec 25, 2017 10:37

Ahh thank you folks :)

Much appreciated, I will investigate all avenues :)
"You have to be a pretty sad person to quote yourself" ~ ChimneySwift
 

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

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

by MusaFuchs » Wed Feb 28, 2018 19:50

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: 3166
Joined: Sun Oct 28, 2012 00:05
Location: UK
GitHub: paramat
IRC: paramat

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

by paramat » Thu Mar 01, 2018 08:28

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/blob/e7f16119913f7b2c98059398085d410684c9d8c0/doc/lua_api.txt#L5087
https://github.com/minetest/minetest/blob/e7f16119913f7b2c98059398085d410684c9d8c0/doc/lua_api.txt#L5128
 

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

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

by MusaFuchs » Thu Mar 01, 2018 16:41

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: 123
Joined: Sat Jan 21, 2017 02:31
GitHub: CoderForTheBetter
In-game: devy

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

by Devy » Thu Mar 01, 2018 17:03

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: 3166
Joined: Sun Oct 28, 2012 00:05
Location: UK
GitHub: paramat
IRC: paramat

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

by paramat » Sat Mar 03, 2018 16:37

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: 11
Joined: Wed Feb 28, 2018 15:44

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

by MusaFuchs » Mon Mar 05, 2018 02:42

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: 3166
Joined: Sun Oct 28, 2012 00:05
Location: UK
GitHub: paramat
IRC: paramat

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

by paramat » Sun Mar 11, 2018 22:21

here https://github.com/paramat/watershed/blob/9ed70192aaf51f65a779ebdba9858474e7e07a03/init.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 » Thu Apr 12, 2018 12:35

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

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

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

by Cross_over » Fri Apr 20, 2018 15:39

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
Member
 
Posts: 526
Joined: Thu Mar 24, 2016 03:19
GitHub: v-rob

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

by v-rob » Fri Apr 20, 2018 22:40

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.
 

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

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

by paramat » Fri May 04, 2018 00:36

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: 1260
Joined: Wed Aug 19, 2015 19:11
Location: Oklahoma City
GitHub: duane-r

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

by duane » Sun May 27, 2018 23:27

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.
 

PreviousNext

Return to Modding Discussion



Who is online

Users browsing this forum: No registered users and 1 guest