Post your mapgen questions here (modding or engine)

Winter94
Member
 
Posts: 43
Joined: Sat Jan 11, 2020 17:15
In-game: Azrael Winter WintersKnight

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

by Winter94 » Sat Jan 11, 2020 17:30

So, I apologize in advance for my extreme level of ignorance, but I'm new to lua, and I taught myself a bit of C++ when modding Dwarf Fortress. I was working on a cool idea for a mod that adds realistic ores to the game, and I've fixed many errors, but I'm stuck. I have no idea what the error is telling me, really, and if someone could take a look at this and impart their wisdom, I would be greatly appreciative.
Link to my code:https://docs.google.com/document/d/1JcwB8mt_0APsDB3gdlgLon8N-ku6K2TCQOaD0cOR_Ww/edit?usp=sharing

Here's the error:

2020-01-11 11:08:00: ERROR[Main]: ModError: Failed to load and run script from C:\Users\XA-26483\Desktop\MINETEST\minetest-5.1.0-win64\bin\..\mods\realores\init.lua:
2020-01-11 11:08:00: ERROR[Main]: ...ST\minetest-5.1.0-win64\bin\..\builtin\game\register.lua:182: bad argument #7 to 'register_item_raw' (number expected, got string)
2020-01-11 11:08:00: ERROR[Main]: stack traceback:
2020-01-11 11:08:00: ERROR[Main]: [C]: in function 'register_item_raw'
2020-01-11 11:08:00: ERROR[Main]: ...ST\minetest-5.1.0-win64\bin\..\builtin\game\register.lua:182: in function 'register_item'
2020-01-11 11:08:00: ERROR[Main]: ...ST\minetest-5.1.0-win64\bin\..\builtin\game\register.lua:208: in function 'register_node'
2020-01-11 11:08:00: ERROR[Main]: ...ETEST\minetest-5.1.0-win64\bin\..\mods\realores\init.lua:1: in main chunk
2020-01-11 11:08:00: ERROR[Main]: Check debug.txt for details.
2020-01-11 11:08:00: ACTION[Main]: Server: Shutting down
2020-01-11 11:08:32: ERROR[Main]: Please choose a name!
 

Skamiz Kazzarch
Member
 
Posts: 121
Joined: Fri Mar 09, 2018 20:34
Location: la lojbaugag.
GitHub: Skamiz
In-game: Skamiz

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

by Skamiz Kazzarch » Sat Jan 11, 2020 18:03

What is causing your issue is this:
Code: Select all
    groups = {"cracky=3, stone=1"},

It should be without the ""
Code: Select all
    groups = {cracky=3, stone=1},


After you fix that for all your nodes the next error you will see is complaining about this:
Code: Select all
minetest.register_craftitem("chunk_bismuthinite",
etc...

because of the missing modname preffix. Correctly should be like so:
Code: Select all
minetest.register_craftitem("realores:chunk_bismuthinite",
etc...


and lastly as a mater of style,
Code: Select all
minetest.register_node("realores:Magnetite", {

this looks odd since it is the first time ever I have seen uppercase in a node id. Just to be clear, this string is usualy never seen by the player, instead when they hover over the item they see the string assigned to 'description'.
 

MitchellMarquez42
New member
 
Posts: 2
Joined: Mon Jan 13, 2020 00:10

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

by MitchellMarquez42 » Mon Jan 13, 2020 00:14

Hey,
Is there a way to make Biome dependent on the blocks generated/placed in a specific area, rather than the other way around? I'm new to coding but looking to make a 3d Terraria clone within Minetest.
 

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

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

by paramat » Wed Jan 15, 2020 01:40

MitchellMarquez42,

That is not possible using only the Biome API, however ...

You can generate core mapgen worlds with no biomes by setting 'nobiomes' in the mapgen flag setting called 'mg_flags' (This is either a MT 5.0.1 or 5.1.0 feature, not sure which). Then the core mapgen will create a world of stone and water only.
Then you can write a mod that adds biomes to that stone world in any way you want, with biomes dependent on terrain.
 

MitchellMarquez42
New member
 
Posts: 2
Joined: Mon Jan 13, 2020 00:10

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

by MitchellMarquez42 » Mon Jan 20, 2020 07:01

paramat wrote:MitchellMarquez42,

That is not possible using only the Biome API, however ...

You can generate core mapgen worlds with no biomes by setting 'nobiomes' in the mapgen flag setting called 'mg_flags' (This is either a MT 5.0.1 or 5.1.0 feature, not sure which). Then the core mapgen will create a world of stone and water only.
Then you can write a mod that adds biomes to that stone world in any way you want, with biomes dependent on terrain.

Thanks. Gotta try that...
 

Winter94
Member
 
Posts: 43
Joined: Sat Jan 11, 2020 17:15
In-game: Azrael Winter WintersKnight

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

by Winter94 » Fri Jan 24, 2020 21:02

Not sure if this is the right place to put this or not but it involves ores generating in the world, so... I'm using a custom version of the stone layers from underchallenge, and I'm trying to set up a table for ores/minerals. What have I done wrong with my table?
Code: Select all
underforge.minerals = {}

local mineral_table = { --name, desc, strata, rarity
   {"corundum",      "Corundum",         "gneiss",         10*10*10,},
   {"corundum",      "Corundum",         "mica",            10*10*10,},
   {"corundum",      "Corundum",         "schist",         10*10*10,},
   {"corundum",      "Corundum",         "pegmatite",      10*10*10,},
   {"tetrahedrite",   "Tetrahedrite",      "diorite",         10*10*10,},
   {"tetrahedrite",   "Tetrahedrite",      "pegmatite",      10*10*10,},
   {"tetrahedrite",   "Tetrahedrite",      "phyllite",         10*10*10,},
   {"cassiterite",      "Cassiterite",      "andesite",         10*10*10,},
   {"cassiterite",      "Cassiterite",      "basalt",         10*10*10,},
   {"cassiterite",      "Cassiterite",      "gabbro",         10*10*10,},
   {"sphalerite",      "Sphalerite",      "andesite",         10*10*10,},
   {"sphalerite",      "Sphalerite",      "dolomite",         10*10*10,},
   {"sphalerite",      "Sphalerite",      "gneiss",         10*10*10,},
   {"bismuthinite",   "Bismuthinite",      "diorite",         10*10*10,},
   {"bismuthinite",   "Bismuthinite",      "granite",         10*10*10,},
   {"bismuthinite",   "Bismuthinite",      "pegmatite",      10*10*10,},
   }

for i in ipairs (mineral_table) do
    local name      = mineral_table[i][1]
    local desc      = mineral_table[i][2]
    local strata   = mineral_table[i][3]
    local rarity   = mineral_table[i][4]

minetest.register_node("underforge:"..name){
   description   = desc,
   tiles      = '"strata..".png"^"ore_"..name..".png"',
   groups      = {cracky = 3, minerals = 1},
   drop      = "underforge:"..name.."_chunk",
   sounds      = default.node_sound_stone_defaults(),
   }

minetest.register_ore("underforge:"..name){
   ore_type      = "scatter",
   ore            = "underforge:"..name.."_in_"..strata,
   wherein         = "underforge:"..strata,
   clust_scarcity   = {rarity},
   clust_size      = 5,
   clust_num_ores   = 10,
   }

minetest.register_craftitem("underforge:"..name){
      description = S("Chunk of" ..desc ),
      groups = {rocks = 1, minerals = 2},
      inventory_image = "chunk_"..name..".png",
   }
end
 

User avatar
paramat
Developer
 
Posts: 3561
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 Jan 25, 2020 23:39

That is a general coding error, so offtopic here. You already have another thread for this, which also posts the error itself, so discussion should happen there.
 

Winter94
Member
 
Posts: 43
Joined: Sat Jan 11, 2020 17:15
In-game: Azrael Winter WintersKnight

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

by Winter94 » Sun Jan 26, 2020 13:58

My bad, I'll start keeping it confined to the 'Noob here, needing help...' thread that I made for this problem.
 

Army_bloodcore
Member
 
Posts: 74
Joined: Sat Sep 28, 2019 12:43
In-game: Army_bloodcore

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

by Army_bloodcore » Thu Jan 30, 2020 06:09

Hello again!
What about fix these parameters? I think, change scale of the heat from 0 to 10, 20, 30 or 40 will give a nessecary result...
Code: Select all
mg_biome_np_heat = {
    offset      = 100,
    scale       = 10 or 20 or 30 or 40,
}


paramat wrote:Army_bloodcore,
Add these lines to your minetest.conf file and start a new mgv7 world, using MTGame of course:

Code: Select all
mgv7_spflags = nomountains,ridges,nofloatlands,caverns
mg_biome_np_heat = {
    offset      = 100,
    scale       = 0,
    spread      = (1000, 1000, 1000),
    seed        = 5349,
    octaves     = 3,
    persistence = 0.5,
    lacunarity  = 2.0,
    flags       = eased
}
mg_biome_np_humidity = {
    offset      = 100,
    scale       = 0,
    spread      = (1000, 1000, 1000),
    seed        = 842,
    octaves     = 3,
    persistence = 0.5,
    lacunarity  = 2.0,
    flags       = eased
}
mgv7_np_terrain_base = {
    offset      = 1,
    scale       = 64,
    spread      = (600, 600, 600),
    seed        = 82341,
    octaves     = 5,
    persistence = 0.6,
    lacunarity  = 2.0,
    flags       = eased
}
mgv7_np_terrain_alt = {
    offset      = -16,
    scale       = 8,
    spread      = (600, 600, 600),
    seed        = 5934,
    octaves     = 5,
    persistence = 0.6,
    lacunarity  = 2.0,
    flags       = eased
}
mgv7_np_height_select = {
    offset      = 8,
    scale       = 0,
    spread      = (500, 500, 500),
    seed        = 4213,
    octaves     = 6,
    persistence = 0.7,
    lacunarity  = 2.0,
    flags       = eased
}

Seabed varies between y = -32 and y = 0.
Jungle hill islands cover half of the world area and have a (rare) maximum height of y = 129.
Rivers, no mountains.

If you need anything adjusting let me know, i can suggest alternative vlaues.
OneManArmy
 

User avatar
paramat
Developer
 
Posts: 3561
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 Feb 02, 2020 00:47

It is better to do what i described earlier:

Clear the registered biomes, decorations and ores (in a mod that depends on 'default', 'butterflies', 'fireflies, and 'flowers' mods), then reregister biomes, decorations and ores with the desired changes.
If you do that then you will no longer need to use custom heat and humidity noises.

The clearing code is:

minetest.clear_registered_biomes()
minetest.clear_registered_decorations()
minetest.clear_registered_ores()
 

Army_bloodcore
Member
 
Posts: 74
Joined: Sat Sep 28, 2019 12:43
In-game: Army_bloodcore

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

by Army_bloodcore » Sun Feb 02, 2020 15:10

paramat wrote:It is better to do what i described earlier:

Clear the registered biomes, decorations and ores (in a mod that depends on 'default', 'butterflies', 'fireflies, and 'flowers' mods), then reregister biomes, decorations and ores with the desired changes.
If you do that then you will no longer need to use custom heat and humidity noises.

The clearing code is:

minetest.clear_registered_biomes()
minetest.clear_registered_decorations()
minetest.clear_registered_ores()


Can you give to me some instructions, how to do this?
OneManArmy
 

User avatar
paramat
Developer
 
Posts: 3561
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 Feb 15, 2020 02:24

Copy-paste into the mod the biome, decoration and ore registrations from MTGame, and delete or edit them according to your needs.
 

qu4ntumrush
New member
 
Posts: 2
Joined: Sat Feb 15, 2020 07:44
GitHub: qu4ntumrush
In-game: qu4ntumrush

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

by qu4ntumrush » Sat Feb 15, 2020 10:20

I want to use open-mapgen (posting here because the official thread is dead) for a school project and I have large DEMs (20 km wide) of Florida as GeoTIFFs I want to convert into Minetest maps. I get errors no matter which DEM I use or the mod's parameters including scaling down. Recently every error says this:

Code: Select all
zerr: invalid or incomplete deflate data
ModError: Failed to load and run script from C:\Games\minetest-5.1.1-win64\bin\..\mods\geo-mapgen-master\init.lua:
decompressZlib: inflate failed
stack traceback:
   [C]: in function 'decompress'
   ...etest-5.1.1-win64\bin\..\mods\geo-mapgen-master\init.lua:121: in main chunk
Check debug.txt for details.


I often try using a land cover and I may have had slightly more luck getting a map to load without it (I've lost track), but when it does load, it's completely flat so it must not be reading the DEM as a height map.

Other error messages I have gotten:

First error message I got when it was installed on my desktop before moving to C:\Games\Minetest\mods\:
Code: Select all
2020-02-11 02:24:06: ERROR[Main]: ModError: Failed to load and run script from C:\Users\[Me]\Desktop\minetest-5.1.1-win64\bin\..\mods\geo-mapgen-master\init.lua:
2020-02-11 02:24:06: ERROR[Main]: ...etest-5.1.1-win64\bin\..\mods\geo-mapgen-master\init.lua:34: attempt to index local 'str' (a nil value)
2020-02-11 02:24:06: ERROR[Main]: stack traceback:
2020-02-11 02:24:06: ERROR[Main]:    ...etest-5.1.1-win64\bin\..\mods\geo-mapgen-master\init.lua:34: in function 'parse'
2020-02-11 02:24:06: ERROR[Main]:    ...etest-5.1.1-win64\bin\..\mods\geo-mapgen-master\init.lua:105: in main chunk
2020-02-11 02:24:06: ERROR[Main]: Check debug.txt for details.


Once I ran the converter w/o land cover, the world opened but crashed:
Code: Select all
AsyncErr: Lua: finishGenRuntime error from mod 'geo_mapgen' in callback environment_OnGenerated(): decompressZlib: inflate failed
stack traceback:
   [C]: in function 'decompress'
   ...etest-5.1.1-win64\bin\..\mods\geo-mapgen-master\init.lua:81: in function '__index'
   ...etest-5.1.1-win64\bin\..\mods\geo-mapgen-master\init.lua:192: in function 'value'
   ...etest-5.1.1-win64\bin\..\mods\geo-mapgen-master\init.lua:231: in function <...etest-5.1.1-win64\bin\..\mods\geo-mapgen-master\init.lua:195>
   ...es\minetest-5.1.1-win64\bin\..\builtin\game\register.lua:429: in function <...es\minetest-5.1.1-win64\bin\..\builtin\game\register.lua:413>


I know nothing about Lua scripts and only basic Python knowledge (pip install, QGIS, etc.), so all I can understand from "invalid or incomplete deflate data" is that something is wrong with the compression or file format. Well it works perfectly fine in QGIS (I've used it to make hillshade and slope rasters, and I've even added height maps to Worldpainter but without land cover classes), but it also won't open in MicroDEM because "not acceptable DEM." If you must know, I downloaded from the NOAA Data Access Viewer and if the proper data is chosen, it should be multiple TIFF files with multiple world files and an index sheet shapefile. I don't know why open-mapgen and MicroDEM consider it corrupted whereas every other program can use it. This has driven me insane for three days now and ideally I would like to contact the original programmer (Gail de Sailly) directly, but I welcome any Lua experts for help.
 

User avatar
duane
Member
 
Posts: 1611
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 Feb 15, 2020 22:52

qu4ntumrush wrote:I want to use open-mapgen (posting here because the official thread is dead) for a school project


I think you'd have better luck posting to the project thread, anyway. Gael de Sailly is more likely to monitor his own posts; but don't expect an immediate response, as he may not be working on minetest much these days. I don't have any experience with topographical maps, but I've worked closely with Gael de Sailly's code in the past. It usually looks straight-forward, but the principles can be insanely difficult.

You might want to make sure that the format for those maps hasn't changed in the last year or so. They might be using a different compression method.
Believe in people and you don't need to believe anything else.
 

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

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

by paramat » Mon Feb 17, 2020 22:41

Yes, best also post in the dedicated thread, then it will not be 'dead' =)
That mod is beyond my understanding.
 

User avatar
CBugDCoder
Member
 
Posts: 17
Joined: Tue Jul 31, 2018 12:13
Location: Home
GitHub: CBugDCoder
IRC: CBugDCoder
In-game: CalebDavis

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

by CBugDCoder » Tue Feb 18, 2020 14:52

I am trying to generate wallmounted vines on the underside of floating islands. My inital plan was to use decorations and minetest.get_mapgen_object("gennotify") but the gennotify mapgen object does not include decorations placed in the VM. How would I get the locations of the vines without having to sort through all the nodes again?
My Mods: Mob AI
 

User avatar
CBugDCoder
Member
 
Posts: 17
Joined: Tue Jul 31, 2018 12:13
Location: Home
GitHub: CBugDCoder
IRC: CBugDCoder
In-game: CalebDavis

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

by CBugDCoder » Tue Feb 18, 2020 15:41

I was able to find them by only searching through the x and z axis and using the terrain noise values. But if anyone has a better solution I am open to them.
My Mods: Mob AI
 

User avatar
CBugDCoder
Member
 
Posts: 17
Joined: Tue Jul 31, 2018 12:13
Location: Home
GitHub: CBugDCoder
IRC: CBugDCoder
In-game: CalebDavis
 

User avatar
firefox
Member
 
Posts: 1528
Joined: Wed Jan 14, 2015 07:34
Location: Xanadu
In-game: Red_Fox

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

by firefox » Wed Feb 19, 2020 12:00

i read somewhere that it was possible to add x-z-limits to biomes.
but how would i do that?

according to the given y_min, y_max and vertical_blend, i tried x_min, x_max and horizontal_blend but nothing happened.
the mapgen still generates the biome all over the world, even though i set it to generate only on the +x side and another biome on the -x side.

i can't seem to find what i have read in the search either. but i clearly remember that it came with a screenshot and examples...
building inspiration: viewtopic.php?f=3&t=15550 --- my game: viewtopic.php?f=49&t=15860 --- =(^.^)= nyan~
 

User avatar
paramat
Developer
 
Posts: 3561
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 Feb 20, 2020 02:27

https://github.com/minetest/minetest/blob/e8a8185d24897ccf964327017effae81aa1c9d40/doc/lua_api.txt#L7181

Did you search through the documentation?
If using XYZ biome limits you must use the 'min_pos', 'max_pos' format.
Also, there is no 'horizontal blend'.
 

twoelk
Member
 
Posts: 1346
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 » Thu Feb 20, 2020 13:13

if only we could do this with mapgenerators as well :D

like in a different mapgen for every quadrant or maybe some 1000 meter wide mg5 blob in the center surrounded by mg7 terrain and in a strip of maybe 2000 m width along the map edges mg-valleys.

if only ...
 

Previous

Return to Modding Discussion



Who is online

Users browsing this forum: No registered users and 8 guests