Post your mapgen questions here (modding or engine)

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

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

by burli » Sun Aug 28, 2016 21:48

Thanks for explaining. I know that my example is not perfect. It is just an experiment. And I have the problem that mountains are cut at y=47. Don't know why until now
 

User avatar
duane
Member
 
Posts: 776
Joined: Wed Aug 19, 2015 19:11
GitHub: duane-r

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

by duane » Mon Aug 29, 2016 02:22

paramat wrote:Also, the 'csize' used in 'get perlinmap' should have it's z component set to 1, otherwise you can end up using 80 times more data.
Perhaps i need to write another super-simple example mapgen.


Set to one or set to nil?
 

paramat
Member
 
Posts: 2662
Joined: Sun Oct 28, 2012 00:05
GitHub: paramat

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

by paramat » Mon Aug 29, 2016 03:20

1 according to hmmmm a while back, however i seem to remember the noise code is now more robust so nil is probably fine.
 

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

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

by burli » Mon Aug 29, 2016 14:17

How is the VoxelManip data array organized? Where is the start corner? In which axis does it move if I add 1? Does it include the overgrow area?

Edit: I think I got it. Index 0 of the array starts at minp - 16 (for x, y and z), aka emin. It grows in +X direction. Next row starts at emin.y + 1. Index for minp is 202513
 

paramat
Member
 
Posts: 2662
Joined: Sun Oct 28, 2012 00:05
GitHub: paramat

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

by paramat » Tue Aug 30, 2016 00:54

Correct. The lua voxelmanip always also contains a mapblock-deep 'shell' around the mapchunk, whatever size the mapchunk is.
Along the x row, then through x rows stacked above progressing in the y direction, then through the x-y planes progressing in the z direction.
 

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

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

by burli » Tue Aug 30, 2016 04:18

Is it always necessary to load the the full shell? A lot of mods only need the actual chunk.

A chunk has 512000 nodes, with shell it is 1,4 million. Nearly three times

Wouldn't it speed up a lot of mods if they only had to deal with the current chunk size? Optional of course
 

paramat
Member
 
Posts: 2662
Joined: Sun Oct 28, 2012 00:05
GitHub: paramat

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

by paramat » Tue Aug 30, 2016 06:18

The 'mapgen object voxelmanip' is actually the core mapgen's own voxel manipulator in the state immediately after core mapgen finishes, so there's no reading of the map involved and not necessarily any disadvantage in having the whole volume passed to the lua voxelmanip. Trimming off the shell might even slow things down. A smaller LVM might save on lua memory though.
 

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

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

by burli » Tue Aug 30, 2016 06:49

paramat wrote:Trimming off the shell might even slow things down.

The question is, how much and does it save time at light and liquid update

paramat wrote:A smaller LVM might save on lua memory though.

Maybe another reason to think about that
 

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

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

by burli » Tue Aug 30, 2016 19:18

Found a nice video that explains perlin noise with lacunarity and persistence

https://youtu.be/wbpMiKiSKm8
 

User avatar
BrandonReese
Member
 
Posts: 836
Joined: Wed Sep 12, 2012 00:44
GitHub: bremaweb
IRC: BrandonReese
In-game: BrandonReese

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

by BrandonReese » Tue Sep 06, 2016 00:17

Mapgen V7 Parameters

I use mgv7 and I really like it, I have adjusted the noise params because I want large biomes and tall mountains. Despite having no real idea what the numbers mean I have somewhat achieved that but I wonder if anybody who knows what the numbers mean could help me tweak it. The biomes are pretty well large enough for me, and the mountains will get above 300 nodes tall although it's quite rare. But the mountains tend to be pretty narrow in either the x or z direction. So you may have a mountain 100 or 150 nodes wide in one direction and half that at the base in the other direction. I didn't know if anything could be done about that to make more natural feeling mountains.

Here are some screenshots http://imgur.com/a/82iMk

These are my current parameters.

Your phone or window isn't wide enough to display the code box. If it's a phone, try rotating it to landscape mode.
Code: Select all
mgv7_np_terrain_base = 4, 70, (600, 600, 600), 82341, 5, 0.6, 2.0
mgv7_np_terrain_alt = 4, 25, (600, 600, 600), 5934, 5, 0.6, 2.0
mgv7_np_terrain_persist = 0.6, 0.12, (2000, 2000, 2000), 539, 3, 0.5, 2.0
mgv7_np_height_select = -12, 24, (500, 500, 500), 4213, 6, 0.69, 2.0
mgv7_np_filler_depth = 0, 1.2, (150, 150, 150), 261, 4, 0.7, 2.0
mgv7_np_mount_height = 675, 350, (3000, 2000, 3000), 72449, 3, 0.5, 2.0
mgv7_np_ridge_uwater = 0, 1, (1000, 1000, 1000), 85039, 5, 0.6, 2.0
mgv7_np_mountain = -0.6, 1, (850, 1450, 850), 5333, 5, 0.68, 2.0
mgv7_np_ridge = 0, 1, (100, 100, 100), 6467, 4, 0.75, 2.0
mgv7_np_cave1 = 0, 12, (100, 100, 100), 52534, 4, 0.5, 2.0
mgv7_np_cave2 = 0, 12, (100, 100, 100), 10325, 4, 0.5, 2.0
 

paramat
Member
 
Posts: 2662
Joined: Sun Oct 28, 2012 00:05
GitHub: paramat

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

by paramat » Tue Sep 06, 2016 04:14

mgv7_np_mountain = -0.6, 1, (850, 1450, 850), 5333, 5, 0.68, 2.0

Mountain noise is a 3D noise, the scale of the structures is controlled and stretched by the 'spread' numbers:
(850, 1450, 850)
You can see that the y scale is much larger than the x, z scales, so the shapes are stretched upwards, this is intentional in mgv7 but you should try increasing the x and z spreads.
(1450, 1450, 1450) Will create wider unstretched shapes.
For fewer floaty bits reduce 'persistence' (0.68) to around 0.6 or 0.5.
 

User avatar
BrandonReese
Member
 
Posts: 836
Joined: Wed Sep 12, 2012 00:44
GitHub: bremaweb
IRC: BrandonReese
In-game: BrandonReese

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

by BrandonReese » Tue Sep 06, 2016 17:55

That helps thanks.
 

User avatar
demon_boy
Member
 
Posts: 30
Joined: Thu Apr 09, 2015 10:53
GitHub: vlapsley
In-game: demon_boy

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

by demon_boy » Tue Sep 13, 2016 11:51

burli wrote:Another question. I want to make realistic lakes/ponds. Any idea how to make them?

Image


I've spent a few months refactoring my Australia mod and I'm not far from completion.

I've used a combination of some plantlife mods, Valleys Mapgen plants API and some of DuaneR code to get something close to what you are might call realistic.

What I have managed to achieve is a riparian zone. I have trees and plants following rivers. Some only spawn by rivers. Note the bare landscape away from the river.
Image


Also, I've got green grass growing near rivers, reeds and juncus on the banks. A few lillies nearby.
Image
 

User avatar
TumeniNodes
Member
 
Posts: 1335
Joined: Fri Feb 26, 2016 19:49
GitHub: TumeniNodes

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

by TumeniNodes » Tue Sep 13, 2016 17:17

Really nice work demon_boy. Much attention to details
Flick?... Flick who?
 

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

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

by burli » Tue Sep 13, 2016 18:39

Looks really nice. But I also mean lakes/ponds with an more or less natural shape. But I think with the current mapgens it is impossible
 

User avatar
Serh Arien
Member
 
Posts: 66
Joined: Tue Nov 03, 2015 19:53

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

by Serh Arien » Thu Oct 06, 2016 19:17

burli wrote:Maybe someone find this useful. This is the most simple Lua mapgen. Just generates stone and water

And maybe someone can replace the example in the get_perlin_map Wiki page. It does not work. I need a while until I found that get2dMap_flat doesn't want 3d coordinates

Your phone or window isn't wide enough to display the code box. If it's a phone, try rotating it to landscape mode.
Code: Select all
minetest.set_mapgen_params({mgname="singlenode"})

minetest.register_on_generated(function(minp, maxp, seed)

   local c_stone = minetest.get_content_id("default:stone")
   local c_water = minetest.get_content_id("default:water_source")
   local c_air = minetest.get_content_id("air")
   local c_ignore = minetest.get_content_id("ignore")

   local vm, emin, emax = minetest.get_mapgen_object("voxelmanip")
   local data = vm:get_data()
   local a = VoxelArea:new({MinEdge = emin, MaxEdge = emax})
   local csize = vector.add(vector.subtract(maxp, minp), 1)

   local write = false

   local noise_1 = minetest.get_perlin_map({offset = 5,
                                      scale = 15,
                                      seed = 1234,
                                      spread = {x = 250, y = 250, z = 250},
                                      octaves = 5,
                                      persist = 0.6,
                                      lacunarity = 2,
                                      flags = "defaults"},
                                      csize):get2dMap_flat({x=minp.x, y=minp.z})   
   local index2d = 0
   for z = minp.z, maxp.z do
   for y = minp.y, maxp.y do
   for x = minp.x, maxp.x do
         
      index2d = (z - minp.z) * csize.x + (x - minp.x) + 1   
      local ivm = a:index(x, y, z)

      if y < noise_1[index2d] then
         data[ivm] = c_stone
         write = true
      elseif y > noise_1[index2d] and y < 1 then
         data[ivm] = c_water
         write = true
      end
   end
   end
   end

   if write then
      vm:set_data(data)
      vm:set_lighting({day = 0, night = 0})
      vm:calc_lighting()
      vm:update_liquids()
      vm:write_to_map()
   end

end


Image


Hi i need to make a big ocean as burly made but without stone above the water (sand would be better )
How am i suppose to do?
Or do anyone know a mod to get the all map a ocean?
Thx
 

paramat
Member
 
Posts: 2662
Joined: Sun Oct 28, 2012 00:05
GitHub: paramat

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

by paramat » Fri Oct 07, 2016 19:12

Mgv7 can do that, disable mountains and 'ridges' (rivers), and use custom noise parameters to lower the 2 smooth terrains below water_level. See an earlier post in this thread explaining the mgv7 noise parameters.
 

Fixerol
Member
 
Posts: 633
Joined: Sun Jul 31, 2011 11:23
IRC: Fixer
In-game: Fixer

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

by Fixerol » Sun Oct 09, 2016 23:52

I would like to see some kind of FAQ topic about at least v7 mapgen, about basic stuff with basic questions, like:
+ how to shift terrain down/up? (changing water level)
+ how to stretch terrain horizontally/vertically?
+ how to make single biome world?
+ how to make biomes bigger/smaller?
+ how to shift general climate to colder/hotter?
+ how to shift humidity to arid/humid?
+ how to make ocean world?
+ how to make desert world?
+ how to turn off caves/rivers/hills
+ how to make hills bigger and oceans deeper?
+ how to make big hills with low slopes?
+ how to make slightly hilly world?
 

BirgitLachner
Member
 
Posts: 135
Joined: Thu May 05, 2016 10:18
In-game: Bibs

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

by BirgitLachner » Mon Oct 10, 2016 05:55

demon_boy wrote:
I've spent a few months refactoring my Australia mod and I'm not far from completion.

I've used a combination of some plantlife mods, Valleys Mapgen plants API and some of DuaneR code to get something close to what you are might call realistic.

What I have managed to achieve is a riparian zone. I have trees and plants following rivers. Some only spawn by rivers. Note the bare landscape away from the river.
Image

Also, I've got green grass growing near rivers, reeds and juncus on the banks. A few lillies nearby.
Image


This looks nice ... it is in my opinion a good idea to have changes for the water in some of the biomes. And specially for the dry bioms there should be green plants close to the water like on your second picture. There should be an oasis if there is a bigger amount of water in the dessert.

The problem will be of cause that in dry areas there should be less water. But therefore you need to have smaller rivers oder a lower water level. But changing/deleting the blocks is a Problem, isn't it?
 

paramat
Member
 
Posts: 2662
Joined: Sun Oct 28, 2012 00:05
GitHub: paramat

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

by paramat » Thu Oct 20, 2016 06:52

To save you some frustration, here is how to use the new 'minetest.set_mapgen_setting_noiseparams()' to set noise params in a mod. Hmmmm's intention is to move the setting of noise params out of .conf and into lua mods.
The documentation on this is confusing as it suggests the use of 'override_meta = true' as the 3rd argument, whereas it is simply 'true' or 'false'.

Your phone or window isn't wide enough to display the code box. If it's a phone, try rotating it to landscape mode.
Code: Select all
minetest.set_mapgen_setting_noiseparams(
   "mg_biome_np_heat",
   {
      offset = 50,
      scale = 50,
      spread = {x = 1000, y = 1000, z = 1000},
      seed = 5349,
      octaves = 3,
      persistence = 0.5,
      lacunarity = 2.0,
      flags = "defaults"
   },
   true
)
 

paramat
Member
 
Posts: 2662
Joined: Sun Oct 28, 2012 00:05
GitHub: paramat

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

by paramat » Fri Oct 21, 2016 00:54

Update on the use of the 'override_meta' bool.

The biome heat / humidity noise parameters are written to map_meta.txt on new world creation in main menu, but the noise parameters for the individual mapgens (mgv5, v6. v7, valleys etc.) are written when leaving a newly-generated world.
So, 'override meta' must be true when setting biome heat / humidity noise parameters for a newly created world.
'Override_meta' can be left as the default of false when setting individual mapgen noise parameters for a newly created world.

Also of course overriding meta allows you to change any noise parameters for an existing world.
 

User avatar
duane
Member
 
Posts: 776
Joined: Wed Aug 19, 2015 19:11
GitHub: duane-r

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

by duane » Fri Oct 21, 2016 03:03

paramat wrote:To save you some frustration, here is how to use the new 'minetest.set_mapgen_setting_noiseparams()' to set noise params in a mod. Hmmmm's intention is to move the setting of noise params out of .conf and into lua mods.
The documentation on this is confusing as it suggests the use of 'override_meta = true' as the 3rd argument, whereas it is simply 'true' or 'false'.

Your phone or window isn't wide enough to display the code box. If it's a phone, try rotating it to landscape mode.
Code: Select all
minetest.set_mapgen_setting_noiseparams(
   "mg_biome_np_heat",
   {
      offset = 50,
      scale = 50,
      spread = {x = 1000, y = 1000, z = 1000},
      seed = 5349,
      octaves = 3,
      persistence = 0.5,
      lacunarity = 2.0,
      flags = "defaults"
   },
   true
)


Is this going to be the only way to change noises? It's hard enough explaining how to modify them in minetest.conf. A lot of people won't bother if they have to write a mod just to make mountains higher.
 

User avatar
azekill_DIABLO
Member
 
Posts: 3458
Joined: Wed Oct 29, 2014 20:05
GitHub: azekillDIABLO
In-game: azekill_DIABLO

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

by azekill_DIABLO » Fri Oct 21, 2016 20:02

....
Your phone or window isn't wide enough to display the code box. If it's a phone, try rotating it to landscape mode.
Code: Select all
Hi, my username is azekill_DIABLO and i'm an exelent bug-maker(yeah...i know...i have a bad reputation)

azekill_DIABLO said: Mineyoshi+ABJ+Baggins= TOPIC HIJACKED.
My Mods and Stuff | Voxellar | VoxBox on GITHUB | M.I.L.A Monster engine
WEIRD MODDING CONTEST !!!
 

paramat
Member
 
Posts: 2662
Joined: Sun Oct 28, 2012 00:05
GitHub: paramat

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

by paramat » Sat Oct 22, 2016 23:43

No, one of three ways, sorry my use of 'move' was unclear, i mean hmmmm prefers noises to be set in mods since .conf is so cluttered. There is also .conf and advanced settings, no plans to deprecate setting noise in those.

However, advanced settings and single-line noise parameters in .conf cannot set noise flags (eaeed noise, absolute-octave noise). To set noise flags in .conf requires a noise table like the above to be added, so putting the noise table in a mod is barely any more complex. It's more convenient to do this in a mod than in .conf, you can just enable / disable the mod instead of adding / deleting lines in .conf. Also mods can be published and shared.
 

User avatar
pithy
Member
 
Posts: 252
Joined: Wed Apr 13, 2016 17:34
GitHub: pithydon

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

by pithy » Mon Nov 21, 2016 17:49

How does yslice_prob work?
If I want to make a trunk have a 50% chance of being 2 nodes 25% being 3 nodes and 25% being 1 node what would I do?
 

paramat
Member
 
Posts: 2662
Joined: Sun Oct 28, 2012 00:05
GitHub: paramat

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

by paramat » Mon Nov 21, 2016 23:26

Yslice is counted from 0 from schematic base to top.
The schematic is added to the world in y slices from base to top, the yslice_prob decides whether each slice is included or skipped. The lowest slice is always at ground level so is like a 1 node 'root'.
I think that yslices 2 and 3 with prob 127 (50% chance) would do it, as you have 4 possibilities, 2 of which result in a 2 node high trunk.
 

User avatar
pithy
Member
 
Posts: 252
Joined: Wed Apr 13, 2016 17:34
GitHub: pithydon

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

by pithy » Tue Nov 22, 2016 01:08

Maybe I'm thick headed.
I still don't understand how the odds work.
I read the manual to.
What odds would the following code give me?
Your phone or window isn't wide enough to display the code box. If it's a phone, try rotating it to landscape mode.
Code: Select all
yslice_prob = {
    {ypos = 1, prob = 127},
    {ypos = 2, prob = 63}
}
 

paramat
Member
 
Posts: 2662
Joined: Sun Oct 28, 2012 00:05
GitHub: paramat

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

by paramat » Tue Nov 22, 2016 06:03

Probability is out of 255, so 127 is 50%, 63 is 25%.
 

User avatar
pithy
Member
 
Posts: 252
Joined: Wed Apr 13, 2016 17:34
GitHub: pithydon

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

by pithy » Tue Nov 22, 2016 15:45

What would happen if I did...
Your phone or window isn't wide enough to display the code box. If it's a phone, try rotating it to landscape mode.
Code: Select all
yslice_prob = {
    {ypos = 1, prob = 255},
    {ypos = 2, prob = 255}
}
 

User avatar
pithy
Member
 
Posts: 252
Joined: Wed Apr 13, 2016 17:34
GitHub: pithydon

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

by pithy » Tue Nov 22, 2016 18:03

And how do I make a biome rare?
 

PreviousNext

Return to Modding Discussion

Who is online

Users browsing this forum: No registered users and 68 guests

cron