Post your mapgen questions here (modding or engine)

User avatar
paramat
Developer
 
Posts: 3088
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.
 

ChimneySwift
Member
 
Posts: 147
Joined: Fri Sep 22, 2017 06:46
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 :)
With great power comes great electricity bill.
 

hajo
Member
 
Posts: 551
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: 1072
Joined: Wed Oct 28, 2015 01:26
Location: Yes.
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: 1386
Joined: Wed Sep 17, 2014 11:21
Location: Germany
GitHub: 4w
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: 1386
Joined: Wed Sep 17, 2014 11:21
Location: Germany
GitHub: 4w
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: 1072
Joined: Wed Oct 28, 2015 01:26
Location: Yes.
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: 1202
Joined: Fri Apr 19, 2013 16:19
Location: northern Germany

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: 3088
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.
 

ChimneySwift
Member
 
Posts: 147
Joined: Fri Sep 22, 2017 06:46
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 :)
With great power comes great electricity bill.
 

MusaFuchs
Member
 
Posts: 10
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: 3088
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: 10
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: 114
Joined: Sat Jan 21, 2017 02:31
In-game: Pyro

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: 3088
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: 10
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: 3088
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

Hello,


I have a layer of custom nodes which are placed in some areas (ground levels) of my singlenode map (by a third-party Python library called python-minetest, big thanks to LeMagnesium for developing it).

I want them to trigger an underground generation ( place stone for instance from custom node y, down to y=0 ).
In order to do this, first I made an LBM filter and used set_node. It was very slow and consuming.
Then I tried LBM + LVM, it also appeared to be a slow combination.

Then I tried to use on_generated and voxelmanip mapgen_object. When it was triggered, it iterated through nodes between minp and maxp,
and if it found the custom node type it did a "for" loop:

Code: Select all
for n = area:position(i).y, math.max(0,minp.y), -1 do
   data[area:index(area:position(i).x, n, area:position(i).z)] = c_stone
end


As the mapgen is loading chunk by chunk so that means that my underground will be constructed from that custom node down to y=minp.y (and the minp.y of the chunk is often higher than 0).
So after running the mod, I would find some areas with an underground going from the custom node down to y=0, and other areas down to y > 0 (down to y=minp.y).

So finally I tried to use on_generated with LVM (not the mapgen one but the classic voxelmanip), and each chunk was loaded with minp.y equal to 0 (to force the voxelmanip to load the underground area in each chunk)
It worked, but the problem is that some areas seemed to be untouched by on_generated. So the majority of the map had underground, but some areas still had that custom node layer without underground (which has to be replaced).

I've managed to trigger on_generated on "untriggered" areas (areas where no underground was created and where custom node is still there) with /deleteblocks here 1, but as a consequence it deleted nodes on the specified radius (but, nodes around that deleted chunk had triggered on_generated and got proper underground).
I've tried to force that same behaviour without deleting, with forceload_block and emerge_area on the custom node layers with LBMs but it didn't react to it.

So, my question is : do you have any ideas on how I could manage to create that underground?
Maybe it's a bit unclear, tell me what you didn't understand.

Also, maybe you're thinking why I want to do this. It is because I'm generating maps using my own software (I can't use Lua mapgen on the entire map), and writing them using Python-minetest map writing library. The thing is, writing undergrounds directly with that library is making the generations too slow (too much blocks added). That's why I'm just placing custom node layers (instead of full-fledged underground) at ground levels, to be replaced with proper underground.

If you have any map writing library which is faster (I didn't find any lib yet, but it was on a TODO list somewhere on Minetest wiki), feel free to tell me!


Thanks
 

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?
 

v-rob
Member
 
Posts: 455
Joined: Thu Mar 24, 2016 03:19

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: 3088
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.
 

Previous

Return to Modding Discussion



Who is online

Users browsing this forum: KCoombes and 2 guests