villages [WIP]

User avatar
kidmondo
Member
Posts: 130
Joined: Sun May 11, 2014 07:56
IRC: kidmondo
In-game: kidmondo
Location: New Zealand

Re: villages [WIP]

by kidmondo » Post

Dose this mod spawn the town and can the town turn into a city?

MaxPower
Member
Posts: 30
Joined: Wed Sep 24, 2014 17:25

Re: villages [WIP]

by MaxPower » Post

kidmondo wrote:Dose this mod spawn the town and can the town turn into a city?
Sure, just build a cathedral ;)

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

Re: villages [WIP]

by Sokomine » Post

4aiman wrote: Hey, Sokomine, could you post a list of features, please?
I know we've discussed a lot within Ethereal topic, but how's business going?
You're right - the mod really needs its own topic soon. There was some bigger progress recently: Paramat has written some nice terrain blending code for individual houses. They can now be spawned and look quite natural. This is far better than the version I came up with :-) Paramat is a genius with mapgens.

Listing all the features and doing some screenshots will be quite a lot of work I'm afraid.
kidmondo wrote: Dose this mod spawn the town and can the town turn into a city?
That depends on what you consider to be a city. I call them villages because the..settlement...is not very structured. For each village type and each schematic, it's possible to declare how often this house ought to appear in relative and absolute terms. Real cities are a bit more structured than that. Plus you'd probably want other schematics for the houses of a town/city. The village type "canadian" consists of houses that might be found in a canadian town. Those where built by LadyMacBest and require a modpack from Mauvebic.
A list of my mods can be found here.

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

Re: villages [WIP]

by paramat » Post

Sokomine, the error is due to the 'mg villages grow a tree' function, you had too many variables being passed to 'default grow tree' / ' default grow jungletree'. Here's the code that works:

Code: Select all

mg_villages.grow_a_tree = function( pos, plant_id, minp, maxp, data, a, cid, pr )
	-- a normal tree; sometimes comes with apples
	if(     plant_id == cid.c_sapling and default.grow_tree ) then
		default.grow_tree(pos, math.random(1, 4) == 1)
		return true;
	-- a normal jungletree
	elseif( plant_id == cid.c_jsapling and default.grow_jungletree ) then
		default.grow_jungletree(pos)
		return true;
	-- a savannatree from the mg mod
	elseif( plant_id == cid.c_savannasapling and add_savannatree) then
		add_savannatree(         data, a, pos.x, pos.y, pos.z, minp, maxp, pr)
		return true;
	-- a pine tree from the mg mod
	elseif( plant_id == cid.c_pinesapling    and add_pinetree   ) then
		add_pinetree(            data, a, pos.x, pos.y, pos.z, minp, maxp, pr)
		return true;
	end
	return false;
end
I found some buildings away from the villages, adds a very nice touch to an already amazing mod.


Image

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

Re: villages [WIP]

by Sokomine » Post

paramat wrote: Sokomine, the error is due to the 'mg villages grow a tree' function, you had too many variables being passed to 'default grow tree' / ' default grow jungletree'. Here's the code that works:
I've used minetest_next during the development of the villages mod. Seems minetest_game is diffrent regarding the growing of trees. Unfortunately, the grow functions you mentioned cannot be used as well as the old one. There's a reason for why I passed those parameters on. The new function reads the map data, changes it (more or less as before) and writes it back. The only part that's needed for the villages is doing the actual changes to the data structure - a datastructure which has been read already. Perhaps the functions can be extended so that extra parameters are understood again. Else I'll probably have to copy that code over.
paramat wrote: I found some buildings away from the villages, adds a very nice touch to an already amazing mod.
Thanks! Those buildings look only so well-blended due to your code :-) The sand on top of it is deliberate. I'm not using any height limitations for it and just raise or lower whatever terrain will be at a place.
A list of my mods can be found here.

MTDad
Member
Posts: 53
Joined: Fri Aug 29, 2014 05:38

Re: villages [WIP]

by MTDad » Post

Sokomine, any suggestions on where to get MM2? I've had no luck locating it. My kids love mg_villages btw, daughter spent an hour just pilfering chests. Can't wait for actual villagers.

User avatar
cx384
Member
Posts: 655
Joined: Wed Apr 23, 2014 09:38
GitHub: cx384
IRC: cx384

Re: villages [WIP]

by cx384 » Post

Sokomine this mod will be awesome.
:D
Can your read this?

User avatar
Krock
Developer
Posts: 4650
Joined: Thu Oct 03, 2013 07:48
GitHub: SmallJoker
Location: Switzerland
Contact:

Re: villages [WIP]

by Krock » Post

It looks much better than some months ago.
The terrain is much smoother now. (Talking about the mg version mg_villages)
Look, I programmed a bug for you. >> Mod Search Engine << - Mods by Krock - DuckDuckGo mod search bang: !mtmod <keyword here>

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

Re: villages [WIP]

by Sokomine » Post

There's been some progress, but there's also a bug I'm still trying to hunt down and which prevents me from releasing the mg_villages mod. Single houses sometimes spawn inside villages or get otherwise placed in a broken fashion.
A list of my mods can be found here.

User avatar
Hybrid Dog
Member
Posts: 2834
Joined: Thu Nov 01, 2012 12:46
GitHub: HybridDog

Re: villages [WIP]

by Hybrid Dog » Post

Sokomine wrote:Single houses sometimes spawn inside villages or get otherwise placed in a broken fashion.
you're generating griefer houses

‮‪‮
‮‪‮
‮‪‮
‮‪‮
‮‪‮
‮‪‮
‮‪‮
‮‪‮
‮‪

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

Re: villages [WIP]

by Sokomine » Post

Hybrid Dog wrote: you're generating griefer houses
Almost :-) It looks more odd than griefed. Griefed is what you get when cavegen had a go at the houses. At least that damage is undone for the villages.
A list of my mods can be found here.

User avatar
Hybrid Dog
Member
Posts: 2834
Joined: Thu Nov 01, 2012 12:46
GitHub: HybridDog

Re: villages [WIP]

by Hybrid Dog » Post

Sokomine wrote:
Hybrid Dog wrote: you're generating griefer houses
Almost :-) It looks more odd than griefed. Griefed is what you get when cavegen had a go at the houses. At least that damage is undone for the villages.
This was the well built spawn of globis' server, it became griefed:
Image
it's more than just cave attack
the iron stonebrick was the roof of the entrance to the train station
Attachments
overview.png
overview.png (2.82 MiB) Viewed 732 times

‮‪‮
‮‪‮
‮‪‮
‮‪‮
‮‪‮
‮‪‮
‮‪‮
‮‪‮
‮‪

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

Re: villages [WIP]

by Sokomine » Post

Sad to see a picure of such a griefed server. I've heared a lot of good things about that server (while it lasted and wasn't griefed).

This is what I'm fighting against:
Image

...and this is a lumberjack village which has specialized on the new pine trees:
Image
A list of my mods can be found here.

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

Re: villages [WIP]

by paramat » Post

The pinewood houses look so good!

User avatar
Hybrid Dog
Member
Posts: 2834
Joined: Thu Nov 01, 2012 12:46
GitHub: HybridDog

Re: villages [WIP]

by Hybrid Dog » Post

Sokomine wrote:Sad to see a picure of such a griefed server. I've heared a lot of good things about that server (while it lasted and wasn't griefed).
glomie/globis accidentally removed the original server, as far as l know there are just some video(s) remaining. The new servers he begun didn't last long.

‮‪‮
‮‪‮
‮‪‮
‮‪‮
‮‪‮
‮‪‮
‮‪‮
‮‪‮
‮‪

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

Re: villages [WIP]

by paramat » Post

This is my suggestion for separating villages from houses.
In 'villages at point' change the 'noise1' threshold for villages to > 0.4, then place houses when noise1 < -0.4.
Increase 'VILLAGE_CHANCE' to compensate for the smaller area defined by the new noise threshold of > 0.4.
For a good separation noise1 should have 2 octaves, and persistence should be 0.4 for smooth variation.
If houses and villages are still too close increase the spread of noise1 (currently 256), but this will increase the average distance between villages.

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

Re: villages [WIP]

by Sokomine » Post

The villages are progressing. Even though I think that I've eliminated the error that lead to strange overlapping of single houses and villages, there's still a lot to do, especially code cleanup and oter issues.

Btw, this is how it looks if you use mg_villages with a singlenode mapgen:
Image
Attachments
screenshot_885619316.png
screenshot_885619316.png (1003.31 KiB) Viewed 732 times
A list of my mods can be found here.

User avatar
Don
Member
Posts: 1643
Joined: Sat May 17, 2014 18:40
GitHub: DonBatman
IRC: Batman
In-game: Batman

Re: villages [WIP]

by Don » Post

That looks cool!
Many of my mods are now a part of Minetest-mods. A place where you know they are maintained!

A list of my mods can be found here

blert2112
Member
Posts: 244
Joined: Sat Apr 25, 2015 04:05
GitHub: blert2112

Re: villages [WIP]

by blert2112 » Post

Sokomine!... Outstanding mod! Much props to you, Paramat, and anyone else whose fingers have been part of this. I am currently using the mg mapgen on my kid's server but this is going to replace it as mg is so slow and this mod is ultra fast. I have a couple of questions though...

INVERSE_HOUSE_DENSITY: according to the comments, 0 (zero) disables lone buildings outside of villages, default is 4 (four)... Increase or decrease the value to make less lone buildings? (INVERSE_ has confused me)

VILLAGE_CHANCE: is commented out. Is this option not functional? I am looking for a way to increase the rarity of villiages as there are too many being spawned for my taste. If it is functional what is the meaning of the value? (percentage out of 100?

I will play with these two values to see what happens but confirmation on what I find would be great.
Thanks for your time.

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

Re: villages [WIP]

by Sokomine » Post

blert2112 wrote: Sokomine!... Outstanding mod! Much props to you, Paramat, and anyone else whose fingers have been part of this. I am currently using the mg mapgen on my kid's server but this is going to replace it as mg is so slow and this mod is ultra fast. I have a couple of questions though...
In theory, mg ought to be as fast as mg_villages. I've done some optimizations and do more complicated landscape changes at other ends, but in general mg_villages is based on mg. It ought to work with almost any mapgen.
blert2112 wrote: INVERSE_HOUSE_DENSITY: according to the comments, 0 (zero) disables lone buildings outside of villages, default is 4 (four)... Increase or decrease the value to make less lone buildings? (INVERSE_ has confused me)
Increase the value in order to decrease the amount of lone houses (thus, inverse). Every 1/INVERSE_HOUSE_DENSITY th mapchunk (area of 80x80 nodes) receives a lone house, provided there's nothing that keeps it from spawning (like i.e. a village that is too close by).

Don't forget to add the other mods so that you'll get all possible village types. I really need to make a modpack so that it's easier to grab them all in one go...
blert2112 wrote: VILLAGE_CHANCE: is commented out. Is this option not functional? I am looking for a way to increase the rarity of villiages as there are too many being spawned for my taste. If it is functional what is the meaning of the value? (percentage out of 100?
It is set to 28 at another place in the config file. That was an experiment with diffrent values. Decrease the value in order to get less villages. A value between 1 and 400 ought to do. It may not boil down to percentages exactly as there's noise involved. In general, that part of the code is more or less still the same as the one in mg written by Nore.
blert2112 wrote: I will play with these two values to see what happens but confirmation on what I find would be great.
Playing with these values might be best. It's very difficult to decide how many villages and/or houses are enough. It also depends on factors such as walking speed (run or slow walk?) and amount of area you intend to explore.
A list of my mods can be found here.

blert2112
Member
Posts: 244
Joined: Sat Apr 25, 2015 04:05
GitHub: blert2112

Re: villages [WIP]

by blert2112 » Post

Sokomine wrote:In theory, mg ought to be as fast as mg_villages. I've done some optimizations and do more complicated landscape changes at other ends, but in general mg_villages is based on mg. It ought to work with almost any mapgen.
In theory, I don't doubt that at all. In practice, things are a bit different under certain conditions... for instance: Using mg on my server, if you log in and immediately run to a door and open it, it will literally take many many seconds for the door to open. Using mg_villages plus mgv6, do the same and the door opens right away. Since mgv6 is my preferred mapgen (I just don't need a dozen different multi-colored biomes) I see this as a huge performance improvement. Granted, though I just upgraded my server hardware, it is still relatively very old hardware.
Sokomine wrote:Increase the value in order to decrease the amount of lone houses (thus, inverse). Every 1/INVERSE_HOUSE_DENSITY th mapchunk (area of 80x80 nodes) receives a lone house, provided there's nothing that keeps it from spawning (like i.e. a village that is too close by).

Don't forget to add the other mods so that you'll get all possible village types. I really need to make a modpack so that it's easier to grab them all in one go...

It is set to 28 at another place in the config file. That was an experiment with diffrent values. Decrease the value in order to get less villages. A value between 1 and 400 ought to do. It may not boil down to percentages exactly as there's noise involved. In general, that part of the code is more or less still the same as the one in mg written by Nore.

Playing with these values might be best. It's very difficult to decide how many villages and/or houses are enough. It also depends on factors such as walking speed (run or slow walk?) and amount of area you intend to explore.
Pretty much what I found while messing with the values. I think I found some settings I like (8 and 20).
I have had the additional (extra materials and "blueprints") since the beginning. Again... Loving this mod.

Rochambeau
Member
Posts: 119
Joined: Tue Sep 23, 2014 11:37

Re: villages [WIP]

by Rochambeau » Post

Is there an option to decrease the number of villages and/or random buildings or increase the space between them?

I found mg_villages.VILLAGE_CHANCE in config.lua and it seems, increasing the value helped with the villages. But for my taste, there are still too many single houses on the map.

Can't walk 50 blocks without seeing another building. There is no more real wilderness without civilization. :-)

Anyway, i really love this mod!!

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

Re: villages [WIP]

by Sokomine » Post

Rochambeau wrote: Is there an option to decrease the number of villages and/or random buildings or increase the space between them?

I found mg_villages.VILLAGE_CHANCE in config.lua and it seems, increasing the value helped with the villages. But for my taste, there are still too many single houses on the map.
Just set mg_villages.INVERSE_HOUSE_DENSITY = 40 in order to decrease the amount of single houses by factor 10. The normal value is 4 - meaning on average one house per four mapchunks (80x80 blocks). The higher you set it, the less single houses there will be.
Rochambeau wrote: Can't walk 50 blocks without seeing another building. There is no more real wilderness without civilization. :-)
They're conquering the wilderness and bringing civilization :-) But you're right. Balancing the values so that the amount of houses feels right is not easy. For my testworlds, I tend to use values of 1 (maximum amount of single houses) so that they are more common and bugs become more obvious.
A list of my mods can be found here.

User avatar
Hybrid Dog
Member
Posts: 2834
Joined: Thu Nov 01, 2012 12:46
GitHub: HybridDog

Re: villages [WIP]

by Hybrid Dog » Post

l tried the mod (Aug. 2013) and didn't find a house.

‮‪‮
‮‪‮
‮‪‮
‮‪‮
‮‪‮
‮‪‮
‮‪‮
‮‪‮
‮‪

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

Re: villages [WIP]

by Sokomine » Post

Hybrid Dog wrote: l tried the mod (Aug. 2013) and didn't find a house.
The date suggests that you actually took my old villages mod - which is a pretty old version by now. In that old mod, villages had to be spawned using a special chat command.The thread has moved to cover mg_villages instead, which does spawn villages and single houses and is based on Nores villages code for Nores mg mapgen. I really ought to start a new thread for it...it's just that there's always a lot more that can be done and a lot of documentation to do, which frightens me a bit...
A list of my mods can be found here.

Post Reply

Who is online

Users browsing this forum: No registered users and 15 guests