[Mod] Villages for Minetest [mg_villages]

Ignaramico
Member
Posts: 78
Joined: Fri Sep 04, 2020 21:23
GitHub: ignaramico

Re: [Mod] Villages for Minetest [mg_villages]

by Ignaramico » Post

Good day,
all the villages in my game are named "@1", so when i buy a plot of land in any of them, it counts for all the villages, is this intended or is an issue/bug?

zadocallen
Member
Posts: 16
Joined: Thu Nov 12, 2020 16:47
In-game: Leuden

Re: [Mod] Villages for Minetest [mg_villages]

by zadocallen » Post

If it contains errors why did you post it?
Take it down correct it and repost
so you wont frustrate people like me
who don't know how to code.

zadocallen
Member
Posts: 16
Joined: Thu Nov 12, 2020 16:47
In-game: Leuden

Re: [Mod] Villages for Minetest [mg_villages]

by zadocallen » Post

This is Probably the error you left in the code could you tell me, in Noobinian
how to fix it?

AsyncErr: Lua: finishGenRuntime error from mod 'mg_villages' in callback environment_OnGenerated(): Unknown node: cottages:feldweg
stack traceback:
[C]: in function 'get_content_id'
...\minetest-5.3.0-win64\bin\..\mods\mg_villages/mapgen.lua:918: in function 'place_villages_via_voxelmanip'
...\minetest-5.3.0-win64\bin\..\mods\mg_villages/mapgen.lua:1112: in function <...\minetest-5.3.0-win64\bin\..\mods\mg_villages/mapgen.lua:1067>
...es\minetest-5.3.0-win64\bin\..\builtin\game\register.lua:429: in function <...es\minetest-5.3.0-win64\bin\..\builtin\game\register.lua:413>

Teen_Miner
Member
Posts: 46
Joined: Fri Jun 03, 2016 18:21
GitHub: LapisWolf
IRC: LapisWolf
In-game: LapisWolf

Re: [Mod] Villages for Minetest [mg_villages]

by Teen_Miner » Post

Can you tell me where I can find the code for the amount and types of items found in village chests? Every chest seems to be filled with as many items as can possibly fit in the box.
cdb_yuId0gpEgnYo

Teen_Miner
Member
Posts: 46
Joined: Fri Jun 03, 2016 18:21
GitHub: LapisWolf
IRC: LapisWolf
In-game: LapisWolf

Re: [Mod] Villages for Minetest [mg_villages]

by Teen_Miner » Post

I got this error:

AsyncErr: Lua: finishGenRuntime error from mod 'mg_villages' in callback environment_OnGenerated(): /home/user/.minetest/mods/village_sandcity/init.lua:13: attempt to call field 'replace_tree_trunk' (a nil value)
stack traceback:
/home/user/.minetest/mods/village_sandcity/init.lua:13: in function 'replacement_function'
/home/user/.minetest/mods/mg_villages/replacements.lua:284: in function 'get_replacement_list'
/home/user/.minetest/mods/mg_villages/replacements.lua:727: in function 'get_replacement_table'
/home/user/.minetest/mods/mg_villages/villages.lua:693: in function 'generate_village'
/home/user/.minetest/mods/mg_villages/mapgen.lua:798: in function 'place_villages_via_voxelmanip'
/home/user/.minetest/mods/mg_villages/mapgen.lua:1112: in function </home/user/.minetest/mods/mg_villages/mapgen.lua:1067>
/usr/share/minetest/builtin/game/register.lua:429: in function </usr/share/minetest/builtin/game/register.lua:413>
cdb_yuId0gpEgnYo

User avatar
uwu666
Member
Posts: 45
Joined: Mon May 04, 2020 05:20
Location: Latinoamerica

Re: [Mod] Villages for Minetest [mg_villages]

by uwu666 » Post

hi, how can i modify the items that appear in chests?
UPDATE:
I've found it, is in handle_schematics/fill_chest.lua
cdb_71b6f99a808c

User avatar
TenPlus1
Member
Posts: 3715
Joined: Mon Jul 29, 2013 13:38
In-game: TenPlus1
Contact:

Quick Bugfix Update:

by TenPlus1 » Post

I've added a pull request to fix the minetest.get_content_id() issue with villages so that it will run on Minetest 5.3 and above, but for those who want a fixed version it is included here for quickness.
Attachments
mg_villages.zip
(273.39 KiB) Downloaded 148 times

User avatar
luizsab
Member
Posts: 41
Joined: Mon Jan 16, 2017 13:49

Re: [Mod] Villages for Minetest [mg_villages]

by luizsab » Post

How can I do to buy the properties? I can't understand
Luiz
[luizsab]
cdb_20c854aafd61

Diablosxm
Member
Posts: 20
Joined: Sat May 07, 2022 16:13
GitHub: Diablosxm
IRC: Diablosxm
In-game: Diablosxm
Contact:

Re: [Mod] Villages for Minetest [mg_villages]

by Diablosxm » Post

Hi ,
Great mods, works well with last .zip
why it is not in contentDB minetest ?

br

never mine , i saw it

Diablosxm
Member
Posts: 20
Joined: Sat May 07, 2022 16:13
GitHub: Diablosxm
IRC: Diablosxm
In-game: Diablosxm
Contact:

Re: [Mod] Villages for Minetest [mg_villages]

by Diablosxm » Post

Hi ,
It is really great mod, but villager sleeping all day.

br

Marc
Attachments
screenshot_20230321_223925.png
screenshot_20230321_223925.png (909.32 KiB) Viewed 3443 times
screenshot_20230321_223841.png
screenshot_20230321_223841.png (568.56 KiB) Viewed 3443 times
screenshot_20230321_223802.png
screenshot_20230321_223802.png (688.03 KiB) Viewed 3443 times

Diablosxm
Member
Posts: 20
Joined: Sat May 07, 2022 16:13
GitHub: Diablosxm
IRC: Diablosxm
In-game: Diablosxm
Contact:

Re: [Mod] Villages for Minetest [mg_villages]

by Diablosxm » Post

Hi ,
It is possible for admin to buy all plot ?
My villagers still sleeping all day , to.

crash the server when reset the building from the plot.
AsyncErr: Lua: Runtime error from mod '' in callback on_playerReceiveFields(): ...t-master/bin/../mods/mg_villages/plotmarker_formspec.lua:178: attempt to call field 'place_building_from_file' (a nil value)
stack traceback:
...t-master/bin/../mods/mg_villages/plotmarker_formspec.lua:178: in function 'plotmarker_formspec'
...t-master/bin/../mods/mg_villages/plotmarker_formspec.lua:539: in function <...t-master/bin/../mods/mg_villages/plotmarker_formspec.lua:367>
...inetest/minetest-master/bin/../builtin/game/register.lua:446: in function <...inetest/minetest-master/bin/../builtin/game/register.lua:432>

i disable line 147 to 192 from plotmaker_formspec.lua

br

Marc

User avatar
MirceaKitsune
Member
Posts: 924
Joined: Sat May 21, 2011 22:31
GitHub: MirceaKitsune
IRC: Taoki
In-game: MirceaKitsune
Location: Romania, Bucharest

Re: [Mod] Villages for Minetest [mg_villages]

by MirceaKitsune » Post

Given my ancient town mod wasn't a success, I've been thinking of using this for a game / project I may still do eventually, given it supports roads and spawning villages over any mapgen and other features I'd want. Problem is I haven't seen any Git updates since 2020, is this abandoned and no longer under development? Does it work just as well with latest Minetest Git Master, is it expected to remain fully compatible in the future?

Also I was wondering if the API is available separately please. I probably don't want any of the default nodes and buildings, just to system to create and define my own buildings and villages for custom biomes. Thanks.

Sokomine
Member
Posts: 4276
Joined: Sun Sep 09, 2012 17:31
GitHub: Sokomine
IRC: Sokomine
In-game: Sokomine

Re: [Mod] Villages for Minetest [mg_villages]

by Sokomine » Post

MirceaKitsune wrote: Given my ancient town mod wasn't a success,
The buildings from your old town mod still form the village type "taoki". If you don't install my cottages mod, only villages of type "nore" (from nores' original mg mod, on which mg_villages is based) and "taoki" will spawn. You can force a specific village type for the first village:

Code: Select all

mg_villages.FIRST_VILLAGE_TYPE = 'taoki'
The houses in that village type are those that you have built originally. The seperate floors you had build to make the houses higher do not exist though. mg_villages doesn't really have a mechanism for inserting floors, and too high buildings wouldn't fit into villages.
MirceaKitsune wrote: I've been thinking of using this for a game / project I may still do eventually, given it supports roads and spawning villages over any mapgen and other features I'd want.
Roads so far only inside the villages, not connecting villages. And very tiny villages may not have a road. Any mapgen - yes, more or less. Even works in singlenode (creates floating city islands there). However, there are some limitations. Mapgens that create extreme terrain may receive a village just where they wanted to place a mountain. So...it ought to work, but if it looks good depends on your mapgen. mg_villages tries its best. In general, I prefer v6, though that mapgen seems to have a problem right now.
MirceaKitsune wrote: Problem is I haven't seen any Git updates since 2020, is this abandoned and no longer under development?
Did I say today already how "much" I like 2FA? :-/ Updating on github has become a pain. I can still log in but tend to forget the passphrase for my secret key for actually updating my mods.

The last thing I was working on regarding mg_villages is still adding smaller villages, based on heightmap. I'm not yet satisfied with that. Players seem to think that it's so easy to add a village. But I want it to look good, fitting to the terrain. And that's something at least half of the players can't manage either. Perhaps I need to learn more about the noise functions and how they can be used.

A large project - "talking" to NPC in an RPG-like style - came inbetween. But even that project isn't entirely unrelated to the villages - to the contrary. In the end the villages need more life, villagers roaming about, willing to talk to players. What they'll learn with that mod is just talking. All the walking around, doing jobs etc. needs to be done by another mod. And this single GUI for programming NPC to talk took quite a while. But it's worth it I hope.
MirceaKitsune wrote: Does it work just as well with latest Minetest Git Master, is it expected to remain fully compatible in the future?
It works with latest git with the following limitations: If you don't install my cottages mod, you might need to change the "cottages:feldweg" in mapgen.lua to some node you actually have. minetest.get_content_id seems to crash when the node isn't registered. Also, I had crashes with latest git of MT when choosing mapgen v6, even with no other mods than minetest_game.
MirceaKitsune wrote: Also I was wondering if the API is available separately please. I probably don't want any of the default nodes and buildings, just to system to create and define my own buildings and villages for custom biomes. Thanks.
The mod is designed for easily adding new village types. Please take a look at the various examples of village_* mods on my github account.

Getting rid of the village types I added directly to the mod is doable. I mostly added those villages so that players will have something to start with. However, you do need to have at least one working village type when starting a new world.

I need to do some small adjustments to get the mod back up to date (mod.conf, few deprecated functions etc). Hopefully will be able to do so soon. Largest pain will be updating github.
A list of my mods can be found here.

User avatar
MirceaKitsune
Member
Posts: 924
Joined: Sat May 21, 2011 22:31
GitHub: MirceaKitsune
IRC: Taoki
In-game: MirceaKitsune
Location: Romania, Bucharest

Re: [Mod] Villages for Minetest [mg_villages]

by MirceaKitsune » Post

Thanks for the clarification! We can at least expect fixes if something in Minetest core breaks compatibility right? I've been thinking how to design my own villages mod from scratch in a simpler form, but probably not worth the effort any more... especially since I can't figure out a good way to work with chunks, so that buildings appear before the chunk is generated which is hard as you need to handle structures that touch multiple chunks using the on_generated event of each one for both placement and terrain detection.

I forgot you added my structure schematics to it, thanks for that! I was wondering: Does this mod also suffer from issues with buildings being spawned incompletely especially large ones? I take it they are spawned on the VoxelManip object of the mapgen rather than after generation, I believe that's the correct way now. I used to have problems with structures getting cut off due to being spawned either before or after the mapgen finished producing terrain or caves.

NPC's you can talk to with other RPG mechanics are a game idea I was just thinking of myself! If that will be a generic API I might happily use it! I presume it would work with the mobs mod which seems to be the most mainstream and where all of the existing default mobs are implemented.

Sokomine
Member
Posts: 4276
Joined: Sun Sep 09, 2012 17:31
GitHub: Sokomine
IRC: Sokomine
In-game: Sokomine

Re: [Mod] Villages for Minetest [mg_villages]

by Sokomine » Post

MirceaKitsune wrote: Thanks for the clarification! We can at least expect fixes if something in Minetest core breaks compatibility right?
That's right. I still value that mod very highly and plan to get smaller villages working after the rpg talking mod is finished. Then I'll undertake the battle with github to get a new key registered (and hopefully remember the passphrase this time).
MirceaKitsune wrote: especially since I can't figure out a good way to work with chunks, so that buildings appear before the chunk is generated which is hard as you need to handle structures that touch multiple chunks using the on_generated event of each one for both placement and terrain detection.
The way nores' mg mod did it and mg_villages still does it is to use a noise function to decide where the villages will be. Then the layout of the village is planned - streets, and which house goes where. When MT reports a new mapchunk beeing generated mg_villages can thus check if there's a village in that mapchunk - and if so what needs to be placed.
MirceaKitsune wrote: I forgot you added my structure schematics to it, thanks for that! I was wondering: Does this mod also suffer from issues with buildings being spawned incompletely especially large ones? I take it they are spawned on the VoxelManip object of the mapgen rather than after generation, I believe that's the correct way now. I used to have problems with structures getting cut off due to being spawned either before or after the mapgen finished producing terrain or caves.
There are a lot of traps for mods that want to spawn houses and not just decorative structures. In theory it'd work all well if all of the house were made entirely of blocks that have is_ground_content = true set. Cavegen doesn't munch through these. But then - stone is a very legitimate building object, as are other blocks that are usually ground_content. Creating a copy of all of them didn't seem a good way. And it wouldn't help with cavegen creating a big cave below the house so that the house immune to it would float in air.

I talked with paramat and hmmm some years ago when starting my mod, and they helped me understand how mapgen works. In particular a mapchunk doesn't only contain the new chunk (usually 80x80x80 nodes) - it also has a shell of 16 nodes at each side that overlaps with either already generated or not-yet-existing mapchunks. This is so that terrain can be adjusted and caves not be limited to the current mapchunk. mg_villages is aware of this and just re-generates its structure in the outer shell so that villages are complete.

This will also be helpful for smaller villages which may be limited to one mapchunk. My plan there is to make use of the heightmap - which is only available for the current mapchunk.
MirceaKitsune wrote: NPC's you can talk to with other RPG mechanics are a game idea I was just thinking of myself! If that will be a generic API I might happily use it! I presume it would work with the mobs mod which seems to be the most mainstream and where all of the existing default mobs are implemented.
Yes, the intention is having a generic api. When I started work on that mod, I was told that the server Your Land already had "talking" NPC. So I joined, and the creator of the mod (also admin of the server) was happy to let me take over development of said mod. It has come a long way since then and is now running on the server, kind of in the last test phase. There's still a bit of work to do though - the definition of the entities needs to go out of the main mod (we need to migrate the existing old entities on the server), and the quest interface is still awaiting implementation. That is: You can create quests, but it's not as easy and convenient as I'd like it to be.
A list of my mods can be found here.

User avatar
MirceaKitsune
Member
Posts: 924
Joined: Sat May 21, 2011 22:31
GitHub: MirceaKitsune
IRC: Taoki
In-game: MirceaKitsune
Location: Romania, Bucharest

Re: [Mod] Villages for Minetest [mg_villages]

by MirceaKitsune » Post

Thanks again. When you get back to dealing with Github, could you separate the API and default villages into separate mods please, with the villages containing only the schematics and their definitions? This will make it a lot easier to install in your own games without having to separate the mod yourself to remove extra data you won't use: Right now everything seems to be clumped together and difficult to tell apart.

Also may I ask why Handle Schematics is defined as a hard dependency? It's also a great mod I actually plan on using if it's also being updated! But it would be nice if Villages didn't require it as a dependency if that can be helped, seems ideal to be able to use one without the other.

Code: Select all

2023-07-10 15:59:53: ERROR[Main]: ServerError: AsyncErr: Lua: Runtime error from mod 'mg_villages' in callback environment_OnGenerated(): Unknown node: cottages:feldweg
2023-07-10 15:59:53: ERROR[Main]: stack traceback:
2023-07-10 15:59:53: ERROR[Main]:       [C]: in function '__index'
2023-07-10 15:59:53: ERROR[Main]:       /usr/share/minetest/builtin/common/item_s.lua:201: in function 'get_content_id'
2023-07-10 15:59:53: ERROR[Main]:       /home/mircea/.minetest/mods/mg_villages/mapgen.lua:918: in function 'place_villages_via_voxelmanip'
2023-07-10 15:59:53: ERROR[Main]:       /home/mircea/.minetest/mods/mg_villages/mapgen.lua:1112: in function </home/mircea/.minetest/mods/mg_villages/mapgen.lua:1067>
2023-07-10 15:59:53: ERROR[Main]:       /usr/share/minetest/builtin/game/register.lua:446: in function </usr/share/minetest/builtin/game/register.lua:432>
2023-07-10 15:59:53: ERROR[Main]: Irrlicht: Invalid size of image for texture.
Seems the mod is presently unusable with latest Minetest: I crash to the main menu with this error whenever starting a new world. Will wait until you can fix Git and push any necessary changes before trying again.

Otherwise this is the important technical aspect after having looked at the problem myself: Do you use "minetest.place_schematic" directly, or "minetest.place_schematic_on_vmanip" with the VoxelManip object retrieved from minetest.get_mapgen_object("voxelmanip") in the "on_generate" function? The later seems to be the correct method, ensuring the data of buildings is added between the moments the chunk finishes generating internally and when it's shown to the player, which improves performance and prevents players from first seeing the empty terrain first then the house popping into existence.

The challenge is ensuring the first chunk that touches a house generates it: Houses can span multiple chunks if they touch the edges of the 80x80x80 divides, and the player may be coming from any direction so chunks can load in any order. The first chunk should give the signal to spawn the schematic, other chunks shouldn't attempt to spawn it again but discover that data when their time to generate comes. All this should happen before any chunk encompassing the structure finishes generating, which brings the challenge of knowing the terrain height and required biomes / nodes since on_generate typically needs to finish for each chunk before you have access to node data: Someone suggested you can scan the mapgen noise parameters to detect height / biome / humidity without having to search for nodes in the area, which would further improve performance and prevent needing any post-generate detection.

Sokomine
Member
Posts: 4276
Joined: Sun Sep 09, 2012 17:31
GitHub: Sokomine
IRC: Sokomine
In-game: Sokomine

Re: [Mod] Villages for Minetest [mg_villages]

by Sokomine » Post

MirceaKitsune wrote: Thanks again. When you get back to dealing with Github, could you separate the API and default villages into separate mods please, with the villages containing only the schematics and their definitions? This will make it a lot easier to install in your own games without having to separate the mod yourself to remove extra data you won't use: Right now everything seems to be clumped together and difficult to tell apart.
It can be seperated relatively easily if you know how to, but - it's a lot easier to do for me of course as I know the code. I'm just a bit reluctant to seperate it in general as users would then have to add a third mod. In the long run offering a modpack a bit like I did with the .zip file years ago might be best. Until then...perhaps a diffrent branch? Until I get github to cooperate again I might perhaps use a Your Land git repository.
MirceaKitsune wrote: Also may I ask why Handle Schematics is defined as a hard dependency? It's also a great mod I actually plan on using if it's also being updated! But it would be nice if Villages didn't require it as a dependency if that can be helped, seems ideal to be able to use one without the other.
Sorry. That can't really be changed unless I duplicate code. Handle schematics provides functionality that is essential. On top of it provides its spawn chest and a special scaffolding node, but - its core functionalities are needed. More explanation a bit later on in the posting.

It could perhaps be split into a library and node definitions, but...I don't think that'd gain much. There aren't that many nodes defined...one is the build chest, and the other three are intended for building the schem block by block by players or NPC.
MirceaKitsune wrote: Seems the mod is presently unusable with latest Minetest: I crash to the main menu with this error whenever starting a new world. Will wait until you can fix Git and push any necessary changes before trying again.
I'm not sure which version you're using and getting that error. I downloaded the latest version from github as well but have since fixed an error (though at another place?): minetest.get_content_id has a problem if the node isn't registered. The bug that was in MT itself and had to do with it crashing when generating a v6 world has been fixed yesterday by sfan5. So latest git of MT is recommended.
MirceaKitsune wrote: Otherwise this is the important technical aspect after having looked at the problem myself: Do you use "minetest.place_schematic" directly, or "minetest.place_schematic_on_vmanip" with the VoxelManip object retrieved from minetest.get_mapgen_object("voxelmanip") in the "on_generate" function?
I use neither. It's done in handle_schematics, and that's why that is so essential. The reason why I don't use existing functions is because they're insufficient in many ways. I talked to some core devs about this mutliple times. They (almost) perceive using those functions for placing houses as abuse and do not intend to do the necessary changes. Which makes sense from their point of view - mapgen and decorations have to be fast, while buildings have very special needs that are unique to them.

At least for a long time (don't know current state) rotating blocks like stairs didn't work with the place_schematics functions from the api. Decorations usually use full blocks and thus don't need rotation. Buildings are diffrent there.

Another factor are replacements. They're supported as such - but cached. Once you spawned a schematic that way with certain replacements, you can't spawn it again with *other* replacements. That's not very useful for creating houses out of varying materials.

Chests and other nodes that need to be initialized are not in a usable state when you use the *place_schematic* functions provided by the api. Decorations like trees or stone formations usually don't need that.

Another factor is that houses do not necessarily align to mapchunks, especially not with the shell that needs to be considered. It's not uncommon at all that a house needs to be partially spawned (only that part that is relevant and part of the voxelmanip area).

Last but not least there's adjustment of terrain and other changes. There needs to be room for the village to be. That is done via voxelmanip already. So adding the houses that way isn't too much of an overhead.

In general, when dealing with mapgen, a mod has to be prepared to *reproducably* produce any mapchunk mapgen asks for - with only the data it gets from voxelmanip.
MirceaKitsune wrote: Someone suggested you can scan the mapgen noise parameters to detect height / biome / humidity without having to search for nodes in the area, which would further improve performance and prevent needing any post-generate detection.
Height detection and height adjustment (flattening the land for the village while preserving the surface node, removing/moving trees up/down etc) is all already done in mg_villages via voxelmanip data provided by the mapgen.

Mapchunks that don't contain villages or single houses are not changed.
A list of my mods can be found here.

User avatar
MirceaKitsune
Member
Posts: 924
Joined: Sat May 21, 2011 22:31
GitHub: MirceaKitsune
IRC: Taoki
In-game: MirceaKitsune
Location: Romania, Bucharest

Re: [Mod] Villages for Minetest [mg_villages]

by MirceaKitsune » Post

Oh: I'm using latest Git of everything. Minetest itself which I compile locally, Minetest Game is also up to date, and also the mod from its Github (last commit from 2020). Linux in case that might make a difference and the code interprets Lua or some file paths differently based on platform. Is there perhaps a newer version somewhere that I missed? On the content page it also says 16-10-2020.

So the Handle Schematics mod takes care of spawning houses: I can see why it's essential then, initially I thought it's an addition for players to design their own homes and spawn them in a desired area. I'd need a schematic editor that can export my own designs to mts to make them appear in villages, so of course it's great for that as well.

Still curious if it adds the schematic data before the chunk finishes generating and is shown, to prevent performance loss and the player seeing the house pop in after the terrain. But that's a technicality that matters less long as the result is good, clearly you designed it as ideally as possible based on other devs mentions. Will be happy to try it out and see once I find the working version!

And yes: One thing I was hoping to avoid if I made a village generator myself is flattening out the whole area. I'd love to see villages where houses appear at varying heights, terrain unmodified as roads follow its surface. Should of course be a village option as for some it might be better flat, but if in the future it can be updated to support placing houses on existing terrain I'm sure the result will be even more beautiful!

User avatar
Blockhead
Member
Posts: 1622
Joined: Wed Jul 17, 2019 10:14
GitHub: Montandalar
IRC: Blockhead256
In-game: Blockhead Blockhead256
Location: Land Down Under
Contact:

Re: [Mod] Villages for Minetest [mg_villages]

by Blockhead » Post

MirceaKitsune wrote:
Mon Jul 10, 2023 22:23
On the content page it also says 16-10-2020.
No, it says 2020-10-16 because it's polite to use international date formats to not confuse people from around the globe, even if the 16th of the month is unambiguous in this case.
MirceaKitsune wrote:
Mon Jul 10, 2023 22:23
And yes: One thing I was hoping to avoid if I made a village generator myself is flattening out the whole area. I'd love to see villages where houses appear at varying heights, terrain unmodified as roads follow its surface. Should of course be a village option as for some it might be better flat, but if in the future it can be updated to support placing houses on existing terrain I'm sure the result will be even more beautiful!
I like the idea. If you want a flat village, you should try to have it appear in a relatively flat area. Though at the scale of the single house, it's inevitable that a good-looking implementation will need to add stilts, earthworks or stone foundations under the house if it's above the terrain, and probably something else if it intersects a cliff, like choosing not to add the backyard. Otherwise if all you're looking for is a lot of flat land, it feels like you may as well use noisegrid or something (of course, mg_villages is probably not compatible with that). Now to get a lot of flat areas without using custom mapgen, you can use settings like my carpathian settings (with the caveat that there are not many large bodies of water with those settings).
/˳˳_˳˳]_[˳˳_˳˳]_[˳˳_˳˳\ Advtrains enthusiast | My map: Noah's Railyard | My Content on ContentDB ✝️♂

Sokomine
Member
Posts: 4276
Joined: Sun Sep 09, 2012 17:31
GitHub: Sokomine
IRC: Sokomine
In-game: Sokomine

Re: [Mod] Villages for Minetest [mg_villages]

by Sokomine » Post

It seems really time to provide a version that works with lates MT. As I still struggle with github, I've placed it here:
https://gitea.your-land.de/Sokomine/mg_villages
There are also repositories for some village types which had slight adjustments to a change in the replacement functionality I had done in the meantime.
MirceaKitsune wrote: initially I thought it's an addition for players to design their own homes and spawn them in a desired area
It provides both. Plus a building mechanism for players and NPC that isn't used yet.
MirceaKitsune wrote: Still curious if it adds the schematic data before the chunk finishes generating and is shown, to prevent performance loss and the player seeing the house pop in after the terrain. But that's a technicality that matters less long as the result is good, clearly you designed it as ideally as possible based on other devs mentions. Will be happy to try it out and see once I find the working version!
Technically, mg_villages is a lua mapgen. Except that it doesn't provide its own map but is rather constructed in a way that it takes what an existing mapgen creates and drops its villages in there once a new mapchunk has been created. This all happens on register_on_generated via VoxelManip. You can see what is inserted if you choose singlenode mapgen.
MirceaKitsune wrote: And yes: One thing I was hoping to avoid if I made a village generator myself is flattening out the whole area. I'd love to see villages where houses appear at varying heights, terrain unmodified as roads follow its surface. Should of course be a village option as for some it might be better flat, but if in the future it can be updated to support placing houses on existing terrain I'm sure the result will be even more beautiful!
Sure it would be more beautiful. But IIRC I explained in the very first posting of this thread why I didn't do that. In short: It is extremly difficult. And the majority of players on a server can't do it well. If you manage to develop an algorithm for that....
Blockhead wrote: I like the idea. If you want a flat village, you should try to have it appear in a relatively flat area.
Oh, who doesn't. But mg_villages has no control over which mapgen it is combined with.
Blockhead wrote: Though at the scale of the single house, it's inevitable that a good-looking implementation will need to add stilts, earthworks or stone foundations under the house if it's above the terrain, and probably something else if it intersects a cliff, like choosing not to add the backyard.
Yes. Stepping out of your door and immediately falling down a cliff or bumping into a stone wall isn't particulary popular. There needs to be some room around the houses. Which makes the plots larger and integration more difficult. Most other approaches add plattforms, but...those IMHO look far too ugly. And in most villages there's just a one block wide strip of land free between two houses where height adjustments can be done. This value can be adjusted, but then the village gets even larger...
Blockhead wrote: Otherwise if all you're looking for is a lot of flat land, it feels like you may as well use noisegrid or something (of course, mg_villages is probably not compatible with that). Now to get a lot of flat areas without using custom mapgen, you can use settings like my carpathian settings (with the caveat that there are not many large bodies of water with those settings).
I like carpathien mapgen. But providing settings wouldn't fit to the idea of beeing able to adjust to diffrent mapgens.

I'm planning on building small hamlets/settlements like in the settlements mod. But I'm not at all satisfied with the result yet. For a single mapchunk, the heightmap is available and makes things much easier in theory.

On a side node: You can now disable default villages in mg_villages by changing init.lua this way:

Code: Select all

--dofile(mg_villages.modpath.."/add_default_village_types.lua")
mg_villages.INVERSE_HOUSE_DENSITY = 0
Don't forget to add at least one village type! Else it will crash. You can find some village types on https://gitea.your-land.de/Sokomine/ as well, and some others on github.
A list of my mods can be found here.

User avatar
Blockhead
Member
Posts: 1622
Joined: Wed Jul 17, 2019 10:14
GitHub: Montandalar
IRC: Blockhead256
In-game: Blockhead Blockhead256
Location: Land Down Under
Contact:

Re: [Mod] Villages for Minetest [mg_villages]

by Blockhead » Post

Sokomine wrote:
Tue Jul 11, 2023 23:41
Blockhead wrote: I like the idea. If you want a flat village, you should try to have it appear in a relatively flat area.
Oh, who doesn't. But mg_villages has no control over which mapgen it is combined with.
Right, but to get the most out of a mod sometimes it's better to use it with more helpful settings rather than settings that are going to cause bad outputs. Of course the ideal mod can deal with any reasonable input.
Sokomine wrote:
Tue Jul 11, 2023 23:41
On a side node: You can now disable default villages in mg_villages by changing init.lua this way:

Code: Select all

--dofile(mg_villages.modpath.."/add_default_village_types.lua")
mg_villages.INVERSE_HOUSE_DENSITY = 0
Don't forget to add at least one village type! Else it will crash. You can find some village types on https://gitea.your-land.de/Sokomine/ as well, and some others on github.
minetest.settings > init.lua every time. I want my git checkouts to be clean with I deploy to a server, and my configuration separated from the source code. I know it takes you a few minutes less to do it this way though..
/˳˳_˳˳]_[˳˳_˳˳]_[˳˳_˳˳\ Advtrains enthusiast | My map: Noah's Railyard | My Content on ContentDB ✝️♂

Sokomine
Member
Posts: 4276
Joined: Sun Sep 09, 2012 17:31
GitHub: Sokomine
IRC: Sokomine
In-game: Sokomine

Re: [Mod] Villages for Minetest [mg_villages]

by Sokomine » Post

Blockhead wrote: minetest.settings > init.lua every time. I want my git checkouts to be clean with I deploy to a server, and my configuration separated from the source code. I know it takes you a few minutes less to do it this way though..
Understandable. I kind of never did the transition from config.lua files to minetest.settings but plan to when I get the time. In general, my mods are configurable by changing values from config.lua from inside your own settings-mod.
A list of my mods can be found here.

User avatar
Miniontoby
Member
Posts: 616
Joined: Fri Mar 01, 2019 19:25
GitHub: Miniontoby
IRC: Miniontoby
In-game: Miniontoby
Location: The Netherlands

Re: [Mod] Villages for Minetest [mg_villages]

by Miniontoby » Post

Blockhead,

But if you change it every time, then why not make a pull request with the changes?

Then Sokomine doesnt have to update his code himself and you dont have to change the code always
Working on mtctl ---- Check my mod "Doorbell" -- Stay safe

isaiah658
Member
Posts: 168
Joined: Sun Jan 24, 2016 14:58
Contact:

Re: [Mod] Villages for Minetest [mg_villages]

by isaiah658 » Post

Hello Sokomine. I had sent you a message about two bugs in your villages mod, but I didn't get a response. Since I don't have a GitHub account to submit a bug report, I'm going to submit them here.

The first bug is in the plotmarker_formspec.lua file on line 408:

Code: Select all

fields.plot_nr = tonumber( fields.plot_nr or "0");
Your code is adding a new value to the field table, but there is no check to make sure that the form being submitted is for your formspec before the value is added. So when a formspec from a different mod is submitted, the modified field table is sent to it. You'll either want to make a local copy of the field table before modifying it or confirm that the formname is for your mod. This is causing some issues when using the villages mod with one of my mods.

The second bug is also in the plotmarker_formspec.lua file on line 383. The word "send" is spelled wrong resulting in a crash.

Code: Select all

minetest.chat_sned_player( pname, S("Sorry. You do not have the teleport privilege."));

wbtd
New member
Posts: 5
Joined: Mon Feb 13, 2017 17:45

Re: [Mod] Villages for Minetest [mg_villages]

by wbtd » Post

Dear Sokomine,

If I am seeing various errors all of which trace back to

Code: Select all

attempt to index field 'all_villages' (a nil value)
does that mean, as I fear, that the mg_all_villages.data file is corrupt?

Many thanks,

---WBTD.

Post Reply

Who is online

Users browsing this forum: Bombuzal and 24 guests