[Mod] Settlements [settlements]

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

[Mod] Settlements [settlements]

by Rochambeau » Sat Jul 07, 2018 12:18

Settlements

Image

Image

Description
This mod adds small settlements (7 - 20 buildings) during world generation. The small huts contain chests with random stuff.
If mobs_redos NPCs are available, there will be some life inside the buildings (they spawn on default:junglewood, maybe I'll register a special node for themthey spawn on a special node with junglewood looks). Still testing.

Buildings by now:
    townhall (as center of settlement)
    well
    hut
    tower
    church
    garden
    blacksmith
    lamp

Notes
Settlements can be played with Minetest 0.4.16 or above.

Depends on default
Optional:
- mobs_npc (as inhabitants)
- farming (some vegetables as chest content)

List of features
Buildings are rather smalls to fit in almost every terrain.

Bug reports and suggestions
You can report bugs or suggest ideas on GitLab.

Links
Source
Download
How to install

License
WTFPL
Attachments
screenshot_2_small.png
(587.94 KiB) Not downloaded yet
screenshot_small.png
(671.04 KiB) Not downloaded yet
Last edited by Rochambeau on Fri Jul 13, 2018 07:34, edited 2 times in total.
 

User avatar
Stix
Member
 
Posts: 1049
Joined: Fri Aug 04, 2017 14:19
Location: USA
IRC: Stix + Stix_
In-game: Stix

Re: [Mod] Settlements [settlements]

by Stix » Sat Jul 07, 2018 12:46

Nice! Ive been waiting for a good villages mod that places schematics according to the terrain instead of flattening the ground. The only thing this is missing is gravel roads and more natural/realistic farms :3.
The harder you think the more you'll achieve --Caleb #Hi-five for no good reason --Caleb
Need to know something? "Google it" --GreenDimond
Next release of your favorite game? "Bugfixes" --Wuzzy
[OLD]The new Minetest-offtopic can be found here: https://minetestoftopic.createaforum.com/index.php
 

User avatar
TenPlus1
Member
 
Posts: 2281
Joined: Mon Jul 29, 2013 13:38
GitHub: tenplus1

Re: [Mod] Settlements [settlements]

by TenPlus1 » Sat Jul 07, 2018 13:39

Nice mod, was surprised to see 8 npc's sharing a tiny house though :)

Note: you could speed up generation using swap_nodes for foundations, also furnace has no formspec attached to it.
 

hajo
Member
 
Posts: 586
Joined: Thu Oct 13, 2016 10:45
Location: DE

Re: [Mod] Settlements [settlements]

by hajo » Sat Jul 07, 2018 13:57

Rochambeau wrote:adds small settlements (7 - 20 buildings) during world generation.

Would it be possible to also have 'village-spawn-eggs',
ie. to make it easy to place such settlements manually ?
 

User avatar
Stix
Member
 
Posts: 1049
Joined: Fri Aug 04, 2017 14:19
Location: USA
IRC: Stix + Stix_
In-game: Stix

Re: [Mod] Settlements [settlements]

by Stix » Sat Jul 07, 2018 14:01

hajo wrote:
Rochambeau wrote:adds small settlements (7 - 20 buildings) during world generation.

Would it be possible to also have 'village-spawn-eggs',
ie. to make it easy to place such settlements manually ?

Yeah that would be nice.
The harder you think the more you'll achieve --Caleb #Hi-five for no good reason --Caleb
Need to know something? "Google it" --GreenDimond
Next release of your favorite game? "Bugfixes" --Wuzzy
[OLD]The new Minetest-offtopic can be found here: https://minetestoftopic.createaforum.com/index.php
 

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

R-One
Member
 
Posts: 71
Joined: Wed Dec 20, 2017 23:06

Re: [Mod] Settlements [settlements]

by R-One » Sat Jul 07, 2018 16:23

hello, an oversight in init.lua on gitlab ?

package.cpath = package.cpath .. "; /usr/share/lua/5.2 / ?. so"
package.path = package.path .. "; / usr / share / zbstudio / lualibs / mobdebug / ?. lua"
require ( 'mobdebug'). start ()
 

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

Re: [Mod] Settlements [settlements]

by Rochambeau » Sat Jul 07, 2018 18:05

hello, an oversight in init.lua on gitlab ?


It's necessary when debugging with Zerobrane Studio. I forgot to remove it.

Would it be possible to also have 'village-spawn-eggs',
ie. to make it easy to place such settlements manually ?

Code: Select all
/giveme settlements:tool


leftclick: one building is generated, hardcoded
rightclick: attempting to build a settlement. Currently only works when in the "right area". Buildings can only be built when finding these surface materials:
Code: Select all
  "default:dirt_with_grass",
  "default:dirt_with_snow",
  "default:dirt_with_dry_grass",
  "default:dirt_with_coniferous_litter",
  "default:sand",


Note: you could speed up generation using swap_nodes for foundations, also furnace has no formspec attached to it.


Repaired the furnace. Furnaces don't have meta data, so won't work as expected. Same as chests. Meta is added by on_construct.
The only thing this is missing is gravel roads and more natural/realistic farms :3.


Gravel roads would be nice indeed. I tried to avoid them by claiming "it's only a settlement, not a village or town". ;-) Maybe in the distant future. As for the realistic farms: I designed the gardens after those in Minecraft. Yeah, that's bad. But I'm not that creative. If you point to a better looking farm, I see what I can do.
 

Sokomine
Member
 
Posts: 3563
Joined: Sun Sep 09, 2012 17:31
GitHub: Sokomine

Re: [Mod] Settlements [settlements]

by Sokomine » Sun Jul 08, 2018 00:03

Stix wrote:Nice! Ive been waiting for a good villages mod that places schematics according to the terrain instead of flattening the ground.

The vast majority of human players on a server isn't capable of adjusting their building style to the sourrounding terrain.

Stix wrote:The only thing this is missing is gravel roads and more natural/realistic farms :3.

:-/ Such demands is what you get if you promise "placed without adjusting the land" :-)

TenPlus1 wrote:Nice mod, was surprised to see 8 npc's sharing a tiny house though :)

There was heavy overpopulation in my test worlds as well. It's possible that they breed so much in order to get at least some people through the next night when aggressive monsters (sometimes called players) will appear.

Rochambeau wrote:"default:dirt_with_coniferous_litter",

That's something I'll have to teach mg_villages/handle_schematics as well.

Rochambeau wrote:Gravel roads would be nice indeed. I tried to avoid them by claiming "it's only a settlement, not a village or town". ;-) Maybe in the distant future.

Very understandable :-) MT's terrain is very tricky in that regard.

Rochambeau wrote:As for the realistic farms: I designed the gardens after those in Minecraft. Yeah, that's bad. But I'm not that creative. If you point to a better looking farm, I see what I can do.

Hm, yes, I don't overly like standard MC houses/villages. They seem so...tiny and stretched too much in height. At least the forge is pretty nice, and the huts as such aren't too bad either. The church looks much too cramped.

Overall, the settlements generated look quite good. In detail, there are points where much imporvement is needed. For example it feels wrong to have the tower at almost the lowest place of the village, where you can hop on top of it from the mountain it's partly embedded in. Many huts end up mostly embedded in a hill as well. It's partly acommodated for by the house having overhanging roofs. Thus the paths to the front door are usually free. Other houses end up on visible platforms. That's hard to avoid. I had that in my random_buildings mod as well (though with some randomness added to the platforms/pillars).

In one test world, the houses where cut off at an absolute height of 30.

A settlement inside a dense rainforrest isn't optimal either. The trees ought to be cut down in such a case.

Holes inside the village area are problematic. If all those poor mobs spawning inside the houses ever manage to get out of the door, they'll surely fall into all these deep holes and stay there forever. That can't be!

My handle_schematics mod has a cheap function for analyzing the hightmap and for finding places with equal height:
Code: Select all
local heightmap = minetest.get_mapgen_object('heightmap');
local res = handle_schematics.find_flat_land_get_candidates_fast( heightmap, minp, maxp, sizex, sizez, minheight, maxheight );

sizex and sizez are the dimensions of the flat area you're looking for. minheight and maxheight can limit where it can be placed (i.e. most houses don't want to be placed below water level; ships on mountains are uncommon). Returns res.places_x and res.places_z (for houses rotated by either 90 or 180 degrees; sizex and sizez are swapped). Those tables are arrays that contain all the indices relative to heightmap that are flat enough for a house of said dimensions. Places choosen for a house can be marked as occupied so that they won't get offered in subsequent runs of handle_schematics.find_flat_land_get_candidates_fast.

The circular way the mod places its houses looks very convincing. That'd be a very suitable arrangement of houses for the village type grasshut in my villages modpack as well.

Nice to see replacements used so that the houses look diffrent. Seems to work very well.

I hope that the mod will be developped further.
A list of my mods can be found here.
 

Cartmic
New member
 
Posts: 2
Joined: Thu Jul 12, 2018 18:03

Re: [Mod] Settlements [settlements]

by Cartmic » Thu Jul 12, 2018 19:20

Hello,

I have a question about your licence file, I note that you have a copyright in there but below you provide a public domain licence and a link to it, so tell me is your code (c) Copyright Rochambeau (2018) or licenced under the the licence you refer to?
 

User avatar
rubenwardy
Moderator
 
Posts: 5364
Joined: Tue Jun 12, 2012 18:11
Location: United Kingdom
GitHub: rubenwardy
IRC: rubenwardy
In-game: rubenwardy

Re: [Mod] Settlements [settlements]

by rubenwardy » Thu Jul 12, 2018 20:10

Both.

Copyright doesn't mean that you can't use it, it just means that that person owns the copyright. All works will have a copyright, open or not. Copyright is automatic

You're mixing up copyright with "all rights reserved"
Core Developer | Donate | My Twitter | Mods | Mods 4 Android | Node Box Editor | Minetest Modding Book

Hello profile reader

LgiOxMFYXOqtqVqMPhbw1Bn3oNRvEC7j
 

Cartmic
New member
 
Posts: 2
Joined: Thu Jul 12, 2018 18:03

Re: [Mod] Settlements [settlements]

by Cartmic » Thu Jul 12, 2018 20:33

rubenwardy wrote:Both.

Copyright doesn't mean that you can't use it, it just means that that person owns the copyright. All works will have a copyright, open or not. Copyright is automatic

You're mixing up copyright with "all rights reserved"


Sorry I came across as quite abrasive there.
Thanks for that clarification.
 

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

Re: [Mod] Settlements [settlements]

by Rochambeau » Fri Jul 13, 2018 07:32

@ those who looked a the sources and know what the mod is doing at the current state:

would the use of voxelmanip bring any advantages in performance?


The next thing I'm trying to do is find better places for building a settlement. Thanks @Sokomine for bringing 'heightmap' to my attention.
To minimize the use of visible platforms the mod could determine the highest and lowest y in the area and if the difference is not too big -> settlement. That will dramatically decrease the number of suitable spots, but the remaining settlements might look more natural.
 

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

Re: [Mod] Settlements [settlements]

by Rochambeau » Fri Jul 13, 2018 19:13

Added simple height detection. Settlements are only created, when the height difference is 10 or less. So no hardcore mountain settlements anymore.
Still heavy WIP.
 

Sokomine
Member
 
Posts: 3563
Joined: Sun Sep 09, 2012 17:31
GitHub: Sokomine

Re: [Mod] Settlements [settlements]

by Sokomine » Sat Jul 14, 2018 21:34

Rochambeau wrote:To minimize the use of visible platforms the mod could determine the highest and lowest y in the area and if the difference is not too big -> settlement. That will dramatically decrease the number of suitable spots, but the remaining settlements might look more natural.

My handle_schematics/basic_houses mod is already capable of detecting sufficiently large flat areas for building individual houses. Combined with your intresting circular arrangement that could produce good results. You'd still have to search through the list of possible places in order to find the one closest to the location on the circle you aim for with that particular building.

I've also made some progress with the detection of hills (= local to the mapchunk; can be removed for more flat surface area without affecting the overall landscape) and holes (= suitable for highlandpools or for filling up and thus creating more flat space).
A list of my mods can be found here.
 

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

Re: [Mod] Settlements [settlements]

by Rochambeau » Tue Jul 17, 2018 08:28

Found a way to create some gravel paths:
Image

Still in early stage and much space for improvement. But it works.
Attachments
screenshot.png
(894.22 KiB) Not downloaded yet
 

User avatar
Hume2
Member
 
Posts: 72
Joined: Tue Jun 19, 2018 08:24
GitHub: Hume2
In-game: Hume2

Re: [Mod] Settlements [settlements]

by Hume2 » Tue Jul 17, 2018 09:27

Nice mod. I'm now testing it. It works but it might also throw this error:
Code: Select all
2018-07-17 11:14:21: ERROR[Main]: ServerError: AsyncErr: Lua: finishGenRuntime error from mod 'settlements' in callback environment_OnGenerated(): ...k1asw/blb/minetest/bin/../mods/settlements/utils.lua:35: attempt to index a nil value
2018-07-17 11:14:21: ERROR[Main]: stack traceback:
2018-07-17 11:14:21: ERROR[Main]:    ...k1asw/blb/minetest/bin/../mods/settlements/utils.lua:35: in function 'find_surface'
2018-07-17 11:14:21: ERROR[Main]:    ...k1asw/blb/minetest/bin/../mods/settlements/utils.lua:220: in function 'determine_heightmap'
2018-07-17 11:14:21: ERROR[Main]:    ...ok1asw/blb/minetest/bin/../mods/settlements/init.lua:77: in function '?'
2018-07-17 11:14:21: ERROR[Main]:    ...ok1asw/blb/minetest/bin/../builtin/game/register.lua:419: in function <...ok1asw/blb/minetest/bin/../builtin/game/register.lua:399>


Edit: I found another bug. When the farming redo mod is disabled but the MTG's farming is on, it might still generate stuff from farming redo like melon slices or corn in chests.
If you lack the reality, go on a trip or find a job.
 

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

Re: [Mod] Settlements [settlements]

by texmex » Tue Jul 17, 2018 10:45

Rochambeau wrote:Found a way to create some gravel paths:
Image

Still in early stage and much space for improvement. But it works.

I's already beautiful!
 

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

Re: [Mod] Settlements [settlements]

by Rochambeau » Tue Jul 17, 2018 11:00

Hume2 wrote:Nice mod. I'm now testing it. It works but it might also throw this error:
Code: Select all
2018-07-17 11:14:21: ERROR[Main]: ServerError: AsyncErr: Lua: finishGenRuntime error from mod 'settlements' in callback environment_OnGenerated(): ...k1asw/blb/minetest/bin/../mods/settlements/utils.lua:35: attempt to index a nil value
2018-07-17 11:14:21: ERROR[Main]: stack traceback:
2018-07-17 11:14:21: ERROR[Main]:    ...k1asw/blb/minetest/bin/../mods/settlements/utils.lua:35: in function 'find_surface'
2018-07-17 11:14:21: ERROR[Main]:    ...k1asw/blb/minetest/bin/../mods/settlements/utils.lua:220: in function 'determine_heightmap'
2018-07-17 11:14:21: ERROR[Main]:    ...ok1asw/blb/minetest/bin/../mods/settlements/init.lua:77: in function '?'
2018-07-17 11:14:21: ERROR[Main]:    ...ok1asw/blb/minetest/bin/../builtin/game/register.lua:419: in function <...ok1asw/blb/minetest/bin/../builtin/game/register.lua:399>


Edit: I found another bug. When the farming redo mod is disabled but the MTG's farming is on, it might still generate stuff from farming redo like melon slices or corn in chests.


Thank you for testing. I fixed both bugs with the latest commits.
 

User avatar
Hume2
Member
 
Posts: 72
Joined: Tue Jun 19, 2018 08:24
GitHub: Hume2
In-game: Hume2

Re: [Mod] Settlements [settlements]

by Hume2 » Tue Jul 17, 2018 15:13

Now it works fine. I have another screenshot for your collection :)
Image
Attachments
screenshot_20180717_144209.jpg
(115.32 KiB) Not downloaded yet
If you lack the reality, go on a trip or find a job.
 


Return to WIP Mods



Who is online

Users browsing this forum: Majestic-12 [Bot] and 2 guests