[Mod] Settlements [settlements]

User avatar
FreeGamers
Member
Posts: 650
Joined: Sat May 25, 2019 00:15
GitHub: is proprietary I use NotABug
Location: United States
Contact:

Re: [Mod] Settlements [settlements]

by FreeGamers » Post

It is now happening consistently so this is fix is much welcomed, thanks.
FreeGamers.org has moved to MeseCraft.net | FreeGamers on this forum is now MeseCraft

FaceDeer
Member
Posts: 506
Joined: Sat Aug 29, 2015 19:01
GitHub: FaceDeer

Re: [Mod] Settlements [settlements]

by FaceDeer » Post

I just pulled the trigger on splitting this mod into two separate repositories:
  • settlements, the core API library mod
  • settlements_fantasy, a modpack containing the various example/default settlements that were previously bundled with the core API.
I didn't change any code or rename any mods in the process of doing this, so if you've got an existing world then just dropping settlements_fantasy into your mods folder should let everything continue functioning as before when you update. I generated a test map and everything seems to be in order.

User avatar
texmex
Member
Posts: 1753
Joined: Mon Jul 11, 2016 21:08
GitHub: tacotexmex
In-game: tacotexmex

Re: [Mod] Settlements [settlements]

by texmex » Post

Good stuff, FaceDeer! Now if only I can tweak it to become fully reproducibly procedural… =)

MoNTE48
Member
Posts: 323
Joined: Sat Apr 06, 2013 11:58
GitHub: MoNTE48
In-game: MoNTE48
Location: Internet

Re: [Mod] Settlements [settlements]

by MoNTE48 » Post

Many thanks from me! Now for those games that need only an API, the use of this mod has been greatly simplified.
What about moving the API to the https://github.com/minetest-mods repository?

FaceDeer
Member
Posts: 506
Joined: Sat Aug 29, 2015 19:01
GitHub: FaceDeer

Re: [Mod] Settlements [settlements]

by FaceDeer » Post

Moving it to minetest-mods is the plan, but I just spammed that project with six other mods last night so I figured I'd get those sorted before this.

The minetest-mods project guidelines say "The original author of the Mod should be the one submitting it to the minetest-mods project. Under circumstances (abandoned, author not responsive etc.) we will consider forks." What I'm working on is technically a fork (twice over - originally it was a thing by BlockMen, then by Rochambeau), though at this point I've reworked it so much that very little code is shared with the original. So I also wanted to make sure it's okay to transfer it first, and not seem like I'm trying to bundle it up with all those other mods I just submitted for approval.
Last edited by FaceDeer on Sat Feb 08, 2020 01:56, edited 1 time in total.

FaceDeer
Member
Posts: 506
Joined: Sat Aug 29, 2015 19:01
GitHub: FaceDeer

Re: [Mod] Settlements [settlements]

by FaceDeer » Post

texmex wrote:Good stuff, FaceDeer! Now if only I can tweak it to become fully reproducibly procedural… =)
Well, good luck. :) Making the layout of individual buildings within a chunk deterministic is straightforward enough, as discussed previously. I made a conscious decision not to do that right now so that a server admin can see a settlement, go "don't like that, let's try again" and regenerate it with a different layout. Since a settlement is contained entirely within a single map chunk it's safe to do it this way, you don't get half-buildings left at the boundaries. But maybe I could add a seed parameter to an admin command or something, to let them choose which way to go.

For the layout of the settlements in the world, on the other hand, it remains a difficult problem to approach in principle. Not every map chunk can host a settlement, whether it can or not can't be determined until the map chunk is generated, and settlements are spaced out a certain minimum distance from each other so part of that determination depends on what's already been generated.

One possibility that comes to mind would be to pre-generate a Poisson disc sample set for the entire possible map area (it's only 64kmx64km so that's not really that big a set given a reasonable spacing) and then accept that there will be a "hole" in the distribution of settlements if it just so happens that the map chunk that's flagged as being the right place to put a settlement has unacceptable terrain when the time comes to generate it. I haven't actually gathered data on the likelihood that a random map chunk will be suitable for a settlement or not, it would depend on the mapgen. If 90% of map chunks are okay for settlements then something like this would work okay, but if only 10% are suitable you might end up with a bad distribution.

User avatar
texmex
Member
Posts: 1753
Joined: Mon Jul 11, 2016 21:08
GitHub: tacotexmex
In-game: tacotexmex

Re: [Mod] Settlements [settlements]

by texmex » Post

Ah, the Poisson disk sampling seems very apt for this situation. This is the approach I’d use. As for uneven or low settlement distribution because of some seed generating settlement unfriendly topography I think that would be part of the experience: some seeds are better than others.

User avatar
daret
Member
Posts: 136
Joined: Tue Nov 12, 2019 20:36
GitHub: daretmavi
In-game: Daretmavi

Re: [Mod] Settlements [settlements]

by daret » Post

FaceDeer wrote:
Fri Feb 07, 2020 20:17
I just pulled the trigger on splitting this mod into two separate repositories:
  • settlements, the core API library mod
  • settlements_fantasy, a modpack containing the various example/default settlements that were previously bundled with the core API.
Hi FaceDeer,

is this mod still developed?

Those "villagers" (viewtopic.php?p=391216#p391216) seems to be interesting. May be they could be generated in the villages.

User avatar
freshreplicant
Member
Posts: 228
Joined: Sun Aug 09, 2020 10:37
In-game: freshreplicant

Re: [Mod] Settlements [settlements]

by freshreplicant » Post

daret wrote:
Mon Mar 15, 2021 08:26
FaceDeer wrote:
Fri Feb 07, 2020 20:17
I just pulled the trigger on splitting this mod into two separate repositories:
  • settlements, the core API library mod
  • settlements_fantasy, a modpack containing the various example/default settlements that were previously bundled with the core API.
Hi FaceDeer,

is this mod still developed?

Those "villagers" (viewtopic.php?p=391216#p391216) seems to be interesting. May be they could be generated in the villages.
I'm currently using FaceDeer's version of the Settlements mod, quite enjoy it. At the moment I am using the NPC mod with it, but it's good to always be able to swap out. I don't think NPCs should be directly integrated into Settlements, but rather that ideally NPC mod makers should figure out how to recognise settlements and have people spawn there. It seems to be possible anyhow. The People mod is very feature packed and of a very specific style, so it's probably not everyone's cup of tea. Alternatively, maybe the creator of that mod could create their own village mod? They appear quite prolific.

User avatar
daret
Member
Posts: 136
Joined: Tue Nov 12, 2019 20:36
GitHub: daretmavi
In-game: Daretmavi

Re: [Mod] Settlements [settlements]

by daret » Post

freshreplicant wrote:
Mon Mar 15, 2021 10:05
I'm currently using FaceDeer's version of the Settlements mod, quite enjoy it. At the moment I am using the NPC mod with it, but it's good to always be able to swap out. I don't think NPCs should be directly integrated into Settlements, but rather that ideally NPC mod makers should figure out how to recognise settlements and have people spawn there. It seems to be possible anyhow. The People mod is very feature packed and of a very specific style, so it's probably not everyone's cup of tea. Alternatively, maybe the creator of that mod could create their own village mod? They appear quite prolific.
The implementation on NPCs should be optional of course. Maybe even behind some mode setting.

I'm not sure what is better/easier. To implement the NPC support in Settlements mod, or add support to NPC modes like people.
Searching for Settlements may be tricky, but Settlements can/could have some sort of API for it.

Which NPC mode do you use?

User avatar
freshreplicant
Member
Posts: 228
Joined: Sun Aug 09, 2020 10:37
In-game: freshreplicant

Re: [Mod] Settlements [settlements]

by freshreplicant » Post

daret wrote:
Mon Mar 15, 2021 10:51
freshreplicant wrote:
Mon Mar 15, 2021 10:05
I'm currently using FaceDeer's version of the Settlements mod, quite enjoy it. At the moment I am using the NPC mod with it, but it's good to always be able to swap out. I don't think NPCs should be directly integrated into Settlements, but rather that ideally NPC mod makers should figure out how to recognise settlements and have people spawn there. It seems to be possible anyhow. The People mod is very feature packed and of a very specific style, so it's probably not everyone's cup of tea. Alternatively, maybe the creator of that mod could create their own village mod? They appear quite prolific.
The implementation on NPCs should be optional of course. Maybe even behind some mode setting.

I'm not sure what is better/easier. To implement the NPC support in Settlements mod, or add support to NPC modes like people.
Searching for Settlements may be tricky, but Settlements can/could have some sort of API for it.

Which NPC mode do you use?
I don't think it's necessary to bake NPCs into this Settlements mod, even behind an optional setting. The mod serves to create spawnable settlements, not add NPCs. If NPC mods want to populate villages or settlements, that's for them to implement*.

The base 'Settlements' mod is an API already I believe, while packs like 'Medieval' or 'Fantasy' are specific versions of Settlements.

I am using TenPlus1's NPC mod. It does not come built into Settlements, but it still does something to make these mobs spawn in the Settlements.

I'm guessing it might be this part:

Code: Select all

mobs:spawn({
	name = "mobs_npc:npc",
	nodes = {"default:brick"},
	neighbors = {"default:grass_3"},
	min_light = 10,
	chance = 10000,
	active_object_count = 1,
	min_height = 0,
	day_toggle = true,
})
I think it means that the NPCs will spawn on brick when it's near grass and bright enough. Not sure if this can be used for all Mobs based mods, but I am sure something similar can be done for the People mod without changing anything on the Settlements side.

*Alternatively, it may also be possible for people like Lili (I believe that's the person behind People) to create a separate version of Settlements uniquely for their mod and ship it with their NPC mod, like Mineclone 2 did for their villages (it's based on Settlements, to my knowledge).

User avatar
daret
Member
Posts: 136
Joined: Tue Nov 12, 2019 20:36
GitHub: daretmavi
In-game: Daretmavi

Re: [Mod] Settlements [settlements]

by daret » Post

freshreplicant wrote:
Mon Mar 15, 2021 11:14

I don't think it's necessary to bake NPCs into this Settlements mod, even behind an optional setting. The mod serves to create spawnable settlements, not add NPCs. If NPC mods want to populate villages or settlements, that's for them to implement*.
I don't mean " to bake NPCs into", but more something like an interoperability functions.
E.g:
get_settlements could return all generated settlements with house/door/bet positions, house types, ...

Other mods could generate corresponding NPCs, or something on defined places with defined functions, ...

AwesomeDragon97
Member
Posts: 14
Joined: Sat Nov 12, 2022 23:53

Re: [Mod] Settlements [settlements]

by AwesomeDragon97 » Post

This mod is very interesting and unique. I made a few buildings hoping to make a mod that could generate villages, and this seems to be the best village API that I could find.

are there any plans to put this mod on ContentDB so that it can be more accessible?

User avatar
snoopy
Member
Posts: 263
Joined: Thu Oct 20, 2016 16:49
Location: DE, European Union

Re: [Mod] Settlements [settlements]

by snoopy » Post

Hi,

This mod is very interesting and unique, indeed. I would hope for further development and ContentDB availability too.
AwesomeDragon97 wrote:
Wed Jan 25, 2023 18:40
This mod is very interesting and unique. I made a few buildings hoping to make a mod that could generate villages, and this seems to be the best village API that I could find.

are there any plans to put this mod on ContentDB so that it can be more accessible?
There is only a link to this topic marked "Settlements [WIP] [Old] [settlements] by Rochambeau" found at ContentDB. This seems to be rather unfortunate.
FaceDeer wrote:
Fri Feb 07, 2020 23:23
texmex wrote:Good stuff, FaceDeer! Now if only I can tweak it to become fully reproducibly procedural… =)
Well, good luck. :) Making the layout of individual buildings within a chunk deterministic is straightforward enough, as discussed previously. I made a conscious decision not to do that right now so that a server admin can see a settlement, go "don't like that, let's try again" and regenerate it with a different layout. Since a settlement is contained entirely within a single map chunk it's safe to do it this way, you don't get half-buildings left at the boundaries. But maybe I could add a seed parameter to an admin command or something, to let them choose which way to go.
@FaceDeer - THX this mod and its last iteration by you is a very good work. The reasonable approach sees to be very valid.

You have been active at GitHub in recent weeks again. Any plans for this mod and ContentDB in the near future?

No hurries, but I would highly appreciate a distribution of this mod over ContentDB as soon as possible.

Good luck!

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

Re: [Mod] Settlements [settlements]

by Teen_Miner » Post

I got these errors when trying to use the settlements mods in 5.7.0:

ModError: Failed to load and run script from /home/nissiel/.minetest/mods/settlements_fantasy/settlements_ruins/init.lua:
...test/mods/settlements_fantasy/settlements_ruins/init.lua:67: attempt to call field 'register_settlement' (a nil value)
stack traceback:
...test/mods/settlements_fantasy/settlements_ruins/init.lua:67: in main chunk
Check debug.txt for details.


ModError: Failed to load and run script from /home/nissiel/.minetest/mods/settlements/init.lua:
Unknown node: flowers:rose
stack traceback:
[C]: in function '__index'
/usr/share/minetest/builtin/common/item_s.lua:201: in function 'get_content_id'
/home/nissiel/.minetest/mods/settlements/utils.lua:14: in main chunk
[C]: in function 'dofile'
/home/nissiel/.minetest/mods/settlements/init.lua:15: in main chunk
Check debug.txt for details.

These are two separate errors, the first was when I had few to no other mods enabled and the second was when I did have other mods enabled.
cdb_yuId0gpEgnYo

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

Re: [Mod] Settlements [settlements]

by Sokomine » Post

Teen_Miner wrote: get_content_id
Seems to be the same error that also caught at least my moresnow mod and probably others. In the past, minetest.get_content_id(some_node) returned nil if some_node wasn't defined. Some mods relied on this behaviour. Sadly it was changed so that the game now deliberately crashes when some_node does not exist.

Easiest way might be to get flowers:rose (usually from minetest_game/flowers) as a node.

Long-term solution is to adjust the mod to the changed API.
A list of my mods can be found here.

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

Re: [Mod] Settlements [settlements]

by MirceaKitsune » Post

I'm curious if this mod is still being maintained. Good village generator mods are hard to come by, especially one with roads or support for large structures: Been waiting to see that improve and noticed this one, but like a lot such mods they appear to be discontinued after a while.

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

Re: [Mod] Settlements [settlements]

by Sokomine » Post

MirceaKitsune wrote: I'm curious if this mod is still being maintained. Good village generator mods are hard to come by, especially one with roads or support for large structures: Been waiting to see that improve and noticed this one, but like a lot such mods they appear to be discontinued after a while.
I've downloaded FaceDeers' version, and it worked very well. Medival and desert settlements were easy to find. I havn't located any of the others yet.

The mod IMHO still has a few shortcommings (but then - which mod hasn't?): The gravel paths between the houses require jumping (ok, that's something for players to fix in their worlds; too tricky for an algorithm), there's sometimes a tower placed inside a hole/lower part of the village (breaks immersion), and there are sometimes several structures inside a settlement where more than one doesn't really fit into such a small settlement (more than one church, several towers close to each other). On the long run, the amount of diffrent buildings is a bit limited. So it's not perfect - but definitely well enough.

And that might be the reason for no further development here: The mod does its job quite well. Unless some clever ideas come up how to handle more, there isn't really that much to do.

The mod also has its limits. Those are inherent to the approach taken - after all this *is* limited to one mapblock (80x80x80m). It's good for small settlements. Large structures won't fit into this small space - especially not when trying to change the map as few as possible. For larger structures, best use my mg_villages mod.

Roads...yes, we're all wishing for them. There are paths in this mod, but...not really walkable most of the time - you have to jump often. And walk around houses to find the front door. Real roads between villages are tricky. If anyone has a good approach to implement those, please by all means tell us!

It'd be great if FaceDeer could get this mod onto ContentDB. Perhaps with the settlements mod renamed to settlements_lib to avoid naming conflicts? Most players by now seem to discover and install mods via ContentDB. That'd also be an easy way to add dependencies and other recommended mods so that players can install all a lot easier.

I'm still planning to add something smaller - like such settlements - to mg_villages so that players and mobs can have something smaller, easier to overview. Most of my time has been taken up recently by yl_speak_up. Talking to NPC is important.

NPC are also a major issue and something we all need help with I'm afraid. Sure, there are mods. But mobs_redo/mobs_npc - while in general beeing a nice mod - has its shortcommings when acting as a base for villagers. They're good at fighting and some basic feeling of "beeing there" (which isn't bad at all!) - but they're not prepared to act as halfway believable villagers. They roam the world randomly and seldom end up where they are needed. I tried to place some on my ships_on_mapgen mods' ships - but soon had them all standing on the ships' railing, staring onto the water, sometimes falling down into it or jumping down due to miscalculation/slipping.

Villagers that can roam around in their village, sometimes take an intrest in other villages (go to them), definitely show intrest in players (a visitor! news! perhaps even trade goods! really can't ignore something *that* exciting!), also loose intrest in players after a while (novelity wears off), pretend to do some farming, go into houses at night, perhaps sleep, go to places inside their town that intrest them...that'd be great. Perhaps socerykid can help us here (definitely wrote about very important basics for such mobs and implemented them at least once), or AiTechEye, the creator of AliveAi. The villagers don't have to be perfect. Just...sufficiently believable, with "behaviour" that we, the players, can interprete sense into (even if there is none).
A list of my mods can be found here.

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

Re: [Mod] Settlements [settlements]

by Sokomine » Post

MineClonia seems to have solved the problem with the paths: It uses stairs where needed. If that improved path building algorithm could be included into the general settlements mod here (especially FaceDeers' fork), that'd be great!
A list of my mods can be found here.

Post Reply

Who is online

Users browsing this forum: Bing [Bot] and 17 guests