Post your mapgen questions here (modding or engine)

User avatar
ExeterDad
Member
Posts: 1717
Joined: Sun Jun 01, 2014 20:00
In-game: ExeterDad
Location: New Hampshire U.S.A

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

by ExeterDad » Post

I was dealing with this recently. I'm betting the flowers were there first. I think you need to add "force_place" to your lua table with nodes that will be placed no matter what. Without it, if there is something in the way, the tree trunk will be skipped to prevent overwriting existing nodes.

local T = {name = "default:aspen_tree", prob = 255, force_place = true}
This is a example from a aspen tree, see https://github.com/minetest-mods/savesc ... r/init.lua for more.

User avatar
taikedz
Member
Posts: 698
Joined: Sun May 15, 2016 11:11
GitHub: taikedz
IRC: DuCake
In-game: DuCake
Location: Scotland, UK
Contact:

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

by taikedz » Post

the_raven_262 wrote:I really need help with this one :P
I tried registering a new biome (using the biome api), but since i'm making a game without starting from the default minetest_game, i have no biomes defined already.So, when i register this new biome (two of them, one for land and one for ocean), i get two biomes that are covered only in the "node_stone" node.There are traces of the nodes i placed as "node_top" and "node_filler", but only in cave entrances.There is no water, and i get strange void lines that cut the terrain at random heights (45 and 125 i guess). I hope there is a solution here :D
You're going to have to post the code or a link to a github for us to help you here... not sure how you've defined things, so cannot help at all....

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

ExeterDad wrote:I was dealing with this recently. I'm betting the flowers were there first. I think you need to add "force_place" to your lua table with nodes that will be placed no matter what. Without it, if there is something in the way, the tree trunk will be skipped to prevent overwriting existing nodes.

local T = {name = "default:aspen_tree", prob = 255, force_place = true}
This is a example from a aspen tree, see https://github.com/minetest-mods/savesc ... r/init.lua for more.
Thanks, that also helps with the sapling issue. And now the trees are dug into the ground one node deep like the default trees.

But I have to find a solution to load the tree registration before the other decoration. Maybe I have an idea, but it's a lot of work

User avatar
taikedz
Member
Posts: 698
Joined: Sun May 15, 2016 11:11
GitHub: taikedz
IRC: DuCake
In-game: DuCake
Location: Scotland, UK
Contact:

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

by taikedz » Post

taikedz wrote:
Sergey wrote: When I saw aspen tree first time, I thought "wow, there are birches in the game!"
Again this interesting observation is not mapgen-related :-)
Second thought - would it be possible/desirable to split the trees into a "trees" mod within minetest_game, such that tree generation and ABMs could be overridden specifically, without needing to make a new subgme?

This means obviosuly that a tree-placement API spec needs defining, so that any new tree mod would be able to expose a compatible API.... maybe supply a base template in the distribution?

(on that note.... one wonders if the default game's mapgen should itself be a "mapgen" mod that can be overridden simply by defining an alternative "mapgen" mod ...?)

User avatar
the_raven_262
Member
Posts: 343
Joined: Mon Sep 22, 2014 09:30
GitHub: theraven262
IRC: [Discord unfortunately] corvus262

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

by the_raven_262 » Post

taikedz wrote:
the_raven_262 wrote:I really need help with this one :P
I tried registering a new biome (using the biome api), but since i'm making a game without starting from the default minetest_game, i have no biomes defined already.So, when i register this new biome (two of them, one for land and one for ocean), i get two biomes that are covered only in the "node_stone" node.There are traces of the nodes i placed as "node_top" and "node_filler", but only in cave entrances.There is no water, and i get strange void lines that cut the terrain at random heights (45 and 125 i guess). I hope there is a solution here :D
You're going to have to post the code or a link to a github for us to help you here... not sure how you've defined things, so cannot help at all....
Well then, here you are :D

Code: Select all

minetest.clear_registered_biomes()
minetest.clear_registered_decorations()

minetest.register_biome({
	name = "grassland",
	--node_dust = "",
	node_top = "base:dirt_with_grass",
	depth_top = 1,
	node_filler = "base:dirt",
	depth_filler = 3,
	node_stone = "base:stone",
	--node_water_top = "",
	--depth_water_top = ,
	--node_water = "",
	y_min = 5,
	y_max = 31000,
	heat_point = 50,
	humidity_point = 50,
})

minetest.register_biome({
	name = "grassland_ocean",
	--node_dust = "",
	node_top = "base:sand",
	depth_top = 2,
	node_filler = "base:sand",
	depth_filler = 2,
	node_stone = "base:stone",
	node_water_top = "base:water",
	depth_water_top = 1,
	node_water = "base:water",
	y_min = -31000,
	y_max = 4,
	heat_point = 50,
	humidity_point = 50,
})
This is everything that I have in code that is mapgen related, i don't know if I am missing something :P

User avatar
Sergey
Member
Posts: 784
Joined: Wed Jan 11, 2017 13:28
Location: Russia

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

by Sergey » Post

Very strange work of mapgen.

Snowy biome wedges into another using very strange way — by square blocks with explicit borders.

Image Image Image Image

User avatar
Sergey
Member
Posts: 784
Joined: Wed Jan 11, 2017 13:28
Location: Russia

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

by Sergey » Post

Is it normal to generate map with such explicit straight borders of biomes?

Image

User avatar
taikedz
Member
Posts: 698
Joined: Sun May 15, 2016 11:11
GitHub: taikedz
IRC: DuCake
In-game: DuCake
Location: Scotland, UK
Contact:

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

by taikedz » Post

the_raven_262 wrote:
Well then, here you are :D

Code: Select all

minetest.clear_registered_biomes()
minetest.clear_registered_decorations()

minetest.register_biome({
	name = "grassland",
	--node_dust = "",
	node_top = "base:dirt_with_grass",
	depth_top = 1,
	node_filler = "base:dirt",

<snip ...>
This is everything that I have in code that is mapgen related, i don't know if I am missing something :P
Replace all instances of "base:" with "default:"

;-)

User avatar
taikedz
Member
Posts: 698
Joined: Sun May 15, 2016 11:11
GitHub: taikedz
IRC: DuCake
In-game: DuCake
Location: Scotland, UK
Contact:

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

by taikedz » Post

Sergey wrote:Is it normal to generate map with such explicit straight borders of biomes?

Image
I personally would not expect that.... what seed + mapgen are you using?

(check in the worlds folder, name of your world, the map_meta.txt file for that world

User avatar
Sergey
Member
Posts: 784
Joined: Wed Jan 11, 2017 13:28
Location: Russia

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

by Sergey » Post

taikedz wrote:
Sergey wrote:Is it normal to generate map with such explicit straight borders of biomes?
I personally would not expect that.... what seed + mapgen are you using?

(check in the worlds folder, name of your world, the map_meta.txt file for that world
mapgen: valleys
seed: 3766931956736304717

User avatar
the_raven_262
Member
Posts: 343
Joined: Mon Sep 22, 2014 09:30
GitHub: theraven262
IRC: [Discord unfortunately] corvus262

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

by the_raven_262 » Post

taikedz wrote:
the_raven_262 wrote:
Well then, here you are :D

Code: Select all

minetest.clear_registered_biomes()
minetest.clear_registered_decorations()

minetest.register_biome({
	name = "grassland",
	--node_dust = "",
	node_top = "base:dirt_with_grass",
	depth_top = 1,
	node_filler = "base:dirt",

<snip ...>
This is everything that I have in code that is mapgen related, i don't know if I am missing something :P
Replace all instances of "base:" with "default:"

;-)
:D That would be the easiest solution ... if i had default mod in my game :/
And, no it wouldn't do anything.The nodes are registered properly i tested them each one.
any other ideas? Oo

User avatar
taikedz
Member
Posts: 698
Joined: Sun May 15, 2016 11:11
GitHub: taikedz
IRC: DuCake
In-game: DuCake
Location: Scotland, UK
Contact:

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

by taikedz » Post

Does the mod with your mapgen depend on the mod called base? That would be prerequisite... aside from that.... zip file/git url? :-p

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

Sergey, those straight-edged biomes are likely due to the change to the registered biomes in 0.4.15, see viewtopic.php?f=18&t=15939

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

burli,

> Works fine so far except that the trunk base is often removed by other decoration

See default/mapgen.lua, the taller decorations (trees, cacti, papyrus) are registered before the smaller (grass, flowers) to avoid this happening.

> But I have to find a solution to load the tree registration before the other decoration. Maybe I have an idea, but it's a lot of work

You can 'clear_registered_decorations' then copy-paste all of them into your mod and insert your new decorations at the right places.

User avatar
SuperPantsofDoom
Member
Posts: 37
Joined: Sun Dec 20, 2015 00:10
In-game: aslar

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

by SuperPantsofDoom » Post

I have a map gen question I'm making a minigame and i need a way to save the map and reference it at any point w/ another mod similar to capture the flag


if you now of a way to make this happen or if this exists and i don't know please respond thx
check out my subgame yentest viewtopic.php?f=50&t=16014

User avatar
Sergey
Member
Posts: 784
Joined: Wed Jan 11, 2017 13:28
Location: Russia

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

by Sergey » Post

paramat wrote:Sergey, those straight-edged biomes are likely due to the change to the registered biomes in 0.4.15, see viewtopic.php?f=18&t=15939
Can this map be fixed? Or it is irreversibly?

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

Sergey wrote:
paramat wrote:Sergey, those straight-edged biomes are likely due to the change to the registered biomes in 0.4.15, see viewtopic.php?f=18&t=15939
Can this map be fixed? Or it is irreversibly?
You can't reverse the process. You could load the old version of minetest to prevent any further changes.

It's possible to make a mod that replaces the nodes and decorations of one biome with another, assuming you want to replace all new chunks with old, or vice versa. That would leave you with everything looking one way or the other, after you revisited all the terrain. Making something that blends the biomes would be a lot harder, since there's no simple way to determine what chunks were generated before and after the biome change.
Believe in people and you don't need to believe anything else.

User avatar
the_raven_262
Member
Posts: 343
Joined: Mon Sep 22, 2014 09:30
GitHub: theraven262
IRC: [Discord unfortunately] corvus262

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

by the_raven_262 » Post

taikedz wrote:Does the mod with your mapgen depend on the mod called base? That would be prerequisite... aside from that.... zip file/git url? :-p
I have the "base" mod in the depends.txt it works, tested it and it contains all the needed nodes, which also work.
The problem is, that whichever node i set as the "node_top", doesn't get generated at all (except for those at cave entrances). The "node_stone" is generated normally as it should and has no problems, but anything else (like water nodes) doesn't work.

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

burli
Tree trunk nodes should be force-placed. Per-node force-place was actually added to schematics to allow tree trunks to replace leaves of other overlapping trees without leaves replacing the trunks of other overlapping trees.

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

the_raven_262
Have you set the mapgen aliases for the map generators? As here https://github.com/minetest/minetest_ga ... gen.lua#L5 set those to your subgame's nodes.

User avatar
the_raven_262
Member
Posts: 343
Joined: Mon Sep 22, 2014 09:30
GitHub: theraven262
IRC: [Discord unfortunately] corvus262

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

by the_raven_262 » Post

paramat wrote:the_raven_262
Have you set the mapgen aliases for the map generators? As here https://github.com/minetest/minetest_ga ... gen.lua#L5 set those to your subgame's nodes.
I thought those are only for v6 oO

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

Sergey

> Can this map be fixed? Or it is irreversibly?

You could revert the mapgen code in MTGame to how it was before (difficult), or, only use that world in MT / MTG 0.4.14. Then do /deleteblocks for the affected volume, that will re-generate the volume of world.
We're sorry for the biomes breakage but the set of biomes was not stable and needed improvement.
Last edited by paramat on Wed Feb 08, 2017 18:04, edited 1 time in total.

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

All mapgen use nodes like "mapgen_stone" so you need to alias your subgame nodes to those for the mapgen to use them.

User avatar
the_raven_262
Member
Posts: 343
Joined: Mon Sep 22, 2014 09:30
GitHub: theraven262
IRC: [Discord unfortunately] corvus262

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

by the_raven_262 » Post

paramat wrote:All mapgen use nodes like "mapgen_stone" so you need to alias your subgame nodes to those for the mapgen to use them.
Thanks a lot for your help, paramat :D

User avatar
Sergey
Member
Posts: 784
Joined: Wed Jan 11, 2017 13:28
Location: Russia

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

by Sergey » Post

paramat wrote:Sergey

> Can this map be fixed? Or it is irreversibly?

You could revert the mapgen code in MTGame to how it was before (difficult), or, only use that world in MT / MTG 0.4.14. Then do /deleteblocks for the affected volume, that will re-generate the volume of world.
We're sorry for the biomes breakage but the set of biomes was not stable and needed improvement.
I don't understand what blocks need to be regenerated.

Post Reply

Who is online

Users browsing this forum: No registered users and 5 guests