Post your mapgen questions here (modding or engine)

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

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

by Wuzzy » Fri Aug 23, 2019 07:26

Doesn't work. I have no idea what I do wrong.

I use get_2d, not get_2d_map. Is this difference important?

Code: Select all
temperature = mgv6_perlin_biome:get_2d({x=player_pos.x + mgv6_np_biome.spread.x*0.6, y=player_pos.z + mgv6_np_biome.spread.y*0.2})


Is there an easy and reliable way to check if my mgv6_perlin_biome outputs correct values? Maybe the bug is somewhere else …

Is PerlinNoise compatible with PerlinNoiseMap or do they output different noises?

It's very difficult to reproduce the core mapgen noise. I have to do everything right perfectly. A single mistake and I get complete garbage data, with no way to debug (or is there?). :-(
My creations. I gladly accept bitcoins: 17fsUywHxeMHKG41UFfu34F1rAxZcrVoqH
 

User avatar
paramat
Developer
 
Posts: 3412
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 Aug 25, 2019 17:11

Here's the point noise code i used in an earlier version of Meru https://github.com/paramat/meru/blob/56dd643d38f48bd5125a998583064df66d98198c/init.lua#L96 Maybe try '+ 150' '+ 50' to see if that works (with default mgv6 parameters)?
Note that is old code so uses the old noise parameters (SEEDDIFF, OCTAVES, PERSISTENCE, SCALE).

Code: Select all
         np_biome.spread.x = np_biome.spread.x * (csize + 2 * MAP_BLOCKSIZE)
         np_biome.spread.y = np_biome.spread.y * (csize + 2 * MAP_BLOCKSIZE)

Why multiply spread? It should be unchanged and in nodes.
 

sirrobzeroone
Member
 
Posts: 101
Joined: Mon Jul 16, 2018 07:56

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

by sirrobzeroone » Mon Aug 26, 2019 11:54

Still struggling with rivers, they are painful when you don;t particularly want them to be placed to randomly.

Hopefully quick question - On generation I perform some cleanup on my river so it doesn't spill over the edges etc (codes not complete yet but close). However I can find any block thats more negative than the current block I'm replacing usually for reference. However I can't see a way of finding a block more positive before the whole on_generated has run.

At the moment what I'm trying to do is backwards replace a node as I have some basic mirroring going on so if for example I need to remove block x=1 y=1 z=1 and assuming river bed is currently centered on 0 I know I also need to remove x=1 y=1 z=-2. Currently I tried doing this using minetest.set_node({x=x, y=y, z=z-2}, {name="default:sand"}). I attempt to do this while currently setting the data object for x=1 y=1 z=1. So this very fragmented block of code below:

Code: Select all
            data[a:index(x, y, z)] = c_ice   -- expanded that for clarity         
            minetest.set_node({x=x, y=y, z=z-2}, {name="default:sand"})


essentially backwards overwriting the required block while setting the current block...except it dosent work. I think this is because the voxelmanip doesn't update until the end and update the whole so essentially my "node" dosen;t yet truly exist until the chunk is updated. So is there an easy way to essentially go back and replace a specific node when the chunk is mid generation?

I do have a workaround store the x,y,z for the required nodes in a table then after chunk generation ends then call set node and run it across all coords in the table...This just seems more untidy to me, but maybe it is the best way.

Appreciate the help and advice, I'm very close to having a river I'm happy with just trying to iron out some noise overlay issues.
 

sirrobzeroone
Member
 
Posts: 101
Joined: Mon Jul 16, 2018 07:56

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

by sirrobzeroone » Mon Aug 26, 2019 12:09

Sigh, think i worked this out now but about to sleep would this work?

Code: Select all

data[a:index(x, y, z)] = c_ice
data[a:index(x, y, z-2)] = c_sand



edit: yep that worked, I should have clicked as the generation of the chunk is really just a big table using x,y,z as key....
Last edited by sirrobzeroone on Mon Aug 26, 2019 21:01, edited 1 time in total.
 

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

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

by Wuzzy » Mon Aug 26, 2019 20:07

Ooff! I finally managed to find the problem in my v6 biome detection. Basically I did set the correct offset, but only for the HUD display. When I recalculated the noise to calculate the actual biome, it still used the old non-offset. So yeah, that last problem was totally my fault. :D
But thanks for pointing out the sneaky offset, that one was really important.

And of course, the silly spread offset was also another bug in my code, but I already noticed it on my own and removed it in the meantime. I already had huge doubts when I added this; I was getting desparate. xD

Here's the fruit of your help:
viewtopic.php?f=9&t=23158
viewtopic.php?f=9&t=23138
My creations. I gladly accept bitcoins: 17fsUywHxeMHKG41UFfu34F1rAxZcrVoqH
 

User avatar
StarNinjas
Member
 
Posts: 283
Joined: Wed Mar 14, 2018 00:32
Location: aincrad
GitHub: starninjas
IRC: StarNinjas
In-game: J1
 

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

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

by duane » Fri Aug 30, 2019 06:06

StarNinjas wrote:Are biome temperatures Celsius?


Biome temperatures are officially undefined. However, they bear a stronger resemblance to Fahrenheit than to Celsius.
Believe in people and you don't need to believe anything else.
 

User avatar
paramat
Developer
 
Posts: 3412
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 Aug 30, 2019 17:47

Biome heat and humidity are both abstract values.
With the default heat and humidity noise parameters, both heat and humidity have average values of 50, and vary from -37.5 to 137.5, although the extreme values are very rare.

Image

Horizontal - Heat
Vertical - Humidity

ICE Icesheet
TAI Taiga
COF Coniferous forest
DEF Deciduous forest
RAF Rainforest

TUN Tundra
SGR Snowy grassland
GRA Grassland
SAV Savanna

CDE Cold desert
SDE Sandstone desert
DES Desert

In the MTG biome system, the freeze line (0 degrees Celcius) is at heat = 35.
 

User avatar
StarNinjas
Member
 
Posts: 283
Joined: Wed Mar 14, 2018 00:32
Location: aincrad
GitHub: starninjas
IRC: StarNinjas
In-game: J1
 

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

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

by Wuzzy » Fri Sep 06, 2019 13:21

How do I reliably (!) spawn entities as part of the map generation process? For example, when I want to spawn a minecart on a rail in an abandoned mineshaft, or I want to spawn a villager in a village. These entities have to spawn during mapgen. Right?
Currently, spawning entities in this phase often fails, and this is probably due to <https://github.com/minetest/minetest/issues/4759>, i.e. entity spawning is like the lottery and completely unreliable.

So my question is: How do I work around issue 4759? Or do I have to wait for a bugfix?
My creations. I gladly accept bitcoins: 17fsUywHxeMHKG41UFfu34F1rAxZcrVoqH
 

Termos
Member
 
Posts: 133
Joined: Sun Dec 16, 2018 12:50

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

by Termos » Fri Sep 06, 2019 13:54

Wuzzy wrote:These entities have to spawn during mapgen. Right?
Currently, spawning entities in this phase often fails

Maybe has something to do with entities being active only within active_objects_send_range_blocks, and mapgen happening usually outside that radius.

Honestly I wouldn't think of placing entities mapgen time, instead maybe place a special node with a timer or abm, so an entity is spawned and the node removed whenever a player gets in range?
 

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

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

by Wuzzy » Fri Sep 06, 2019 14:30

Yeah, that may or may not work. I need to test this. It sucks I have to regularily poll for players, but yeah. What really annoys me that even then, I have no 100% chance the entity will spawn, and I don't know if it failed. So just trying to spawn the entity until it actually spawns will not work. I basically only have one try for an entity spawn.

Another question:
In MT 5.0.0, the mapgen order was changed to dungeons > ores > decorations.
Now what is the recommended way to generate ores in decorations nonetheless?
For example, when I have a crystal spike spawned on the surface as decoration, and I also want some ore generated inside the crystal nodes (for example, the uber rare shiny crystal ore). The crystal spike is made out of nodes that don't not appear anywhere else.

Because of the new mapgen order, I can no longer use the ore system to generate ores in the crystal spike (this worked in previous versions, I checked). Right? Because decorations now generate after ores, not the other way round.
My creations. I gladly accept bitcoins: 17fsUywHxeMHKG41UFfu34F1rAxZcrVoqH
 

Termos
Member
 
Posts: 133
Joined: Sun Dec 16, 2018 12:50

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

by Termos » Fri Sep 06, 2019 14:38

Wuzzy wrote:It sucks I have to regularily poll for players, but yeah.

Not necessarily, If I'm not mistaken, abms and maybe timers too only fire within active_block_range, so setup one that fires immediately and the engine will do the rest, no polling.
 

twoelk
Member
 
Posts: 1324
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 Sep 06, 2019 14:39

maybe
if ore found surrounded by certain amount of air then decorate it?
 

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

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

by duane » Fri Sep 06, 2019 14:58

Wuzzy wrote:Now what is the recommended way to generate ores in decorations nonetheless?


Why not just put the ore in the schematic?
Believe in people and you don't need to believe anything else.
 

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

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

by Wuzzy » Fri Sep 06, 2019 16:20

Why not just put the ore in the schematic?

But then it would not be random and always be at the same spot. That's not how ores are supposed to work.
My creations. I gladly accept bitcoins: 17fsUywHxeMHKG41UFfu34F1rAxZcrVoqH
 

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

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

by duane » Sat Sep 07, 2019 03:50

Wuzzy wrote:
Why not just put the ore in the schematic?

But then it would not be random and always be at the same spot. That's not how ores are supposed to work.


I mean, make multiple layers with random chances of showing up, like trees. The only drawback I can see is that the items wouldn't always be the same height, which might be a good thing in some cases.
Believe in people and you don't need to believe anything else.
 

User avatar
paramat
Developer
 
Posts: 3412
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 Sep 12, 2019 00:32

> Now what is the recommended way to generate ores in decorations nonetheless?

There isn't one because it's not possible anymore =) The order change caused improvements that outweigh the rare usage you desire.
https://github.com/minetest/minetest/pull/7656
 

Previous

Return to Modding Discussion



Who is online

Users browsing this forum: No registered users and 3 guests