[Mod] Villages for Minetest [mg_villages]

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

[Mod] Villages for Minetest [mg_villages]

by Sokomine » Mon Nov 16, 2015 02:27

The villages for minetest are finally documented, and I think it's time to release them. If you want villages (and/or some lone houses) in your worlds, use this mod. It is a complex mod, and it does contain errors. The code may not exactly act as an example for good code in many areas. Yet the mod is useful. It reaches its full potential in combination with a variety of other mods (cottages, mobf_trader, moresnow, bell, ...).

If you want an easy to use modpack that already includes the most important mods this mod interacts with, get my villages modpack. It'll give you a *lot* more diffrent village types, snow on roofs, traders spawning in the village, and the handle_schematics mod this one depends on. You can combine the modpack with your favorite game.

Image
Extensive documentation can be found in the Wiki.

Download: https://github.com/Sokomine/mg_villages ... master.zip
Browse code: https://github.com/Sokomine/mg_villages
Version: 0.1
Licence: GPLv3
Depends on: handle_schematics, farming, wool and stairs (default)
Recommmends: cottages, moretrees, RealTest, forest, dryplants, cavestuff, moresnow, darkage, ethereal, moreblocks, bell, mobf_trader, docfarming (including farming plusplus), mccompat.

This mod would not have been possible without the works of nore, paramat, hmmm and many others.
Last edited by Sokomine on Sun Jul 01, 2018 17:52, edited 3 times in total.
A list of my mods can be found here.
 

User avatar
benrob0329
Member
 
Posts: 1233
Joined: Thu Aug 06, 2015 22:39
GitHub: Benrob0329
In-game: benrob03
 

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

Re: villages for Minetest [mg_villages]

by Don » Mon Nov 16, 2015 13:28

Awesome!
I will try this out today.
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
 

twoelk
Member
 
Posts: 1238
Joined: Fri Apr 19, 2013 16:19
Location: northern Germany
GitHub: twoelk
IRC: twoelk
In-game: twoelk
 

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

Re: villages for Minetest [mg_villages]

by Krock » Mon Nov 16, 2015 17:23

Great. This project was long time hidden from most players but now you finally decided to post it here.
Thank you!
Mod Search Engine - Mods by Krock - DuckDuckGo mod search bang: !mtmod <keyword here>
 

KCoombes
Member
 
Posts: 397
Joined: Thu Jun 11, 2015 23:19
Location: SW Florida, USA
In-game: Knatt

Re: villages for Minetest [mg_villages]

by KCoombes » Mon Nov 16, 2015 18:01

Is there a way to reduce how close villages spawn to each other?
 

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

Re: [Mod] villages for Minetest [mg_villages]

by Sokomine » Mon Nov 16, 2015 18:57

KCoombes wrote:Is there a way to reduce how close villages spawn to each other?

You can set mg_villages.VILLAGE_CHANCE in mg_villages/config.lua to a lower value (default: 28; minimum: 1; maximum: 400). It's pretty much at the end of the config file. Perhaps I ought to put it in a more prominent place.

Setting mg_villages.INVERSE_HOUSE_DENSITY to a high value (default: 4) reduces the amount of lone houses spawned.
A list of my mods can be found here.
 

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

Re: [Mod] Villages for Minetest [mg_villages]

by paramat » Tue Nov 17, 2015 05:42

Excellent work, i'm impressed with the amount of time and effort put into this.
 

User avatar
maikerumine
Member
 
Posts: 1339
Joined: Mon Aug 04, 2014 14:27
GitHub: maikerumine
In-game: maikerumine

Re: [Mod] Villages for Minetest [mg_villages]

by maikerumine » Tue Nov 17, 2015 15:07

Thank you for all your time, effort, and patience with creating this, Sokomine. This has been, by far, one of my favourite mods ever created for MT. I have been using this mod for over a year now and find it to be a staple in all of my games, it is a MUST HAVE for Minetest!!!

KUDOS!!!
 

User avatar
maikerumine
Member
 
Posts: 1339
Joined: Mon Aug 04, 2014 14:27
GitHub: maikerumine
In-game: maikerumine

Re: [Mod] Villages for Minetest [mg_villages]

by maikerumine » Fri Nov 20, 2015 16:29

I found a weird bug:

2015-11-20 11:13:57: ERROR[Main]: mod "village_canadian" has unsatisfied dependencies: "hdb" "nbu"
RESOLVED....
Also, having moreblocks installed created this:
Image


So I removed moreblocks and this popped up, from the army mod:
Image

And it keeps doing this with other mods.

Where in villages is it grabbing a random block and placing it on the ground?

EDIT:

it may be in this:

Code: Select all
               -- the flattened land around the village where wheat, cotton, trees or grass may be grown (depending on village type)
               elseif( vn <= 80 ) then -- see mg_villages.inside_village_area
                  village_area[ x ][ z ] = { village_nr, 1};


Code: Select all
mg_villages.village_area_mark_inside_village_area = function( village_area, villages, village_noise, minp, maxp )
   -- mark the rest ( inside_village but not part of an actual building) as well      
   for x = minp.x, maxp.x do
      if( not( village_area[ x ] )) then
         village_area[ x ] = {};
      end
      for z = minp.z, maxp.z do
         if( not( village_area[ x ][ z ] )) then
            village_area[ x ][ z ] = { 0, 0 };

            local n_rawnoise = village_noise:get2d({x = x, y = z}) -- create new blended terrain
            for village_nr, village in ipairs(villages) do
               local vn = mg_villages.get_vn(x, z, n_rawnoise, village);
               if(     village.is_single_house ) then
                  -- do nothing here; the village area will be specificly marked later on

               -- the village core; this is where the houses stand (but there's no house or road at this particular spot)
               elseif( vn <= 40 ) then -- see mg_villages.inside_village
                  village_area[ x ][ z ] = { village_nr, 6};

               -- the flattened land around the village where wheat, cotton, trees or grass may be grown (depending on village type)
               elseif( vn <= 80 ) then -- see mg_villages.inside_village_area
                  village_area[ x ][ z ] = { village_nr, 1};

               -- terrain blending for the flattened land
               elseif( vn <= 160 and mg_villages.ENABLE_TERRAIN_BLEND) then -- see mg_villages.inside_village_terrain_blend_area
                  if n_rawnoise > -0.5 then -- leave some cliffs unblended
                     local blend = (( vn - 80) / 80) ^ 2 -- 0 at village edge, 1 at normal terrain
                     -- assign a negative value to terrain that needs to be adjusted in height
                     village_area[ x ][ z ] = { village_nr, -1 * blend};
                  else
                     -- no height adjustments for this terrain; the terrain is not considered to be part of the village
                     village_area[ x ][ z ] = { village_nr, 0};
                  end
               end
            end
         end
      end
   end


For some strange reason this fixed itself after I deleted the mg_all_villages.data file Unexplainable.

Image

Maybe my map is somewhat broken???

The village is fixed now.
Attachments
screenshot_20151120_120457.png
(291.59 KiB) Not downloaded yet
screenshot_20151120_112311.jpg
(332.4 KiB) Not downloaded yet
screenshot_20151120_111456.png
(829.93 KiB) Not downloaded yet
 

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

Re: [Mod] Villages for Minetest [mg_villages]

by Sokomine » Fri Nov 20, 2015 19:09

maikerumine wrote:2015-11-20 11:13:57: ERROR[Main]: mod "village_canadian" has unsatisfied dependencies: "hdb" "nbu"
RESOLVED....

Yes, that's right. The village type canadian consists of very special houses that needs mods from Mauvebic in order to be able to spawn. I considered adding alternative nodes for it, but that wouldn't do the buildings any justice. They're best viewed with Mauvebic's mm2 modpack.

maikerumine wrote:For some strange reason this fixed itself after I deleted the mg_all_villages.data file Unexplainable.

Do you have default:snow in your world? Some randomly selected villages do get a snow cover. If you deleted mg_all_villages.data and recreated the map with the same seed, the village still ought to be mostly the same - except for the snow cover which is selected randomly for some villages and which is not deterministic.
A list of my mods can be found here.
 

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

Re: [Mod] Villages for Minetest [mg_villages]

by Sokomine » Fri Nov 20, 2015 19:20

Another node (probably more likely) that might be missing would be farming:wheat_8. That's what the medieval villages grow on their fields.
A list of my mods can be found here.
 

User avatar
BBmine
Member
 
Posts: 3410
Joined: Sun Jul 12, 2015 22:51
Location: USA
IRC: BBmine
In-game: Baggins

Re: [Mod] Villages for Minetest [mg_villages]

by BBmine » Mon Dec 07, 2015 20:02

I really like this mod! Thanks.

The only problem is that the chests are all empty. Did I forget to enable a mod?
 

User avatar
maikerumine
Member
 
Posts: 1339
Joined: Mon Aug 04, 2014 14:27
GitHub: maikerumine
In-game: maikerumine

Re: [Mod] Villages for Minetest [mg_villages]

by maikerumine » Tue Dec 08, 2015 14:59

BBmine wrote:I really like this mod! Thanks.

The only problem is that the chests are all empty. Did I forget to enable a mod?

Copy and paste the following code in the fill chests lua, over writing the existing code...
Try this:
Code: Select all
--the code that works
-- adapted from the Mines mod

local chest_stuff = {
   {name="default:apple", max = 3},
   {name="farming:bread", max = 3},
   {name="default:steel_ingot", max = 2},
   {name="default:gold_ingot", max = 2},
   {name="default:axe_steel", max = 1},
   --{name="default:emerald", max = 5},
   {name="default:pick_steel", max = 1},
   {name="default:shovel_steel", max = 1},
   {name="default:book", max = 3},
   {name="default:torch", max = 13},
   {name="default:stick", max = 7},
   {name="default:coal_lump", max = 4},
   {name="bucket:bucket_empty", max = 1},
   {name="default:ladder", max = 10},
   {name="default:mese_crystal_fragment", max = 2},
   {name="vessels:glass_bottle", max = 1},
   {name="wool:white", max = 11},
   --{name="carpet:white", max = 11},
   --{name="quartz:quartz_crystal", max = 5},
   --{name="shears:shears", max = 1},
   --{name="crops:melon_seed", max = 18},
   --{name="mobs:saddle", max = 3},
   {name="farming:carrot", max = 3},
   {name="farming:corn", max = 3},
   {name="farming:melon_slice", max = 3},
   {name="farming:potato", max = 3},
   {name="farming:raspberries", max = 3},
   {name="farming:rhubarb", max = 3},
   {name="farming:sugar", max = 3},
   {name="farming:tomato", max = 3},
   {name="farming:seed_wheat", max = 3},
   {name="farming:cucumber", max = 3},
   {name="farming:grapes", max = 3},
}

-- get some random content for a chest
mg_villages.fill_chest_random = function( pos, pr, building_nr, building_typ )
   local meta = minetest.get_meta( pos )
   local inv  = meta:get_inventory()
   inv:set_size("main", 8*4)
   for i=0,pr:next(1,6),1 do
      local stuff = chest_stuff[pr:next(1,#chest_stuff)]
      local stack = {name=stuff.name, count = pr:next(1,stuff.max)}
      if not inv:contains_item("main", stack) then
         inv:set_stack("main", pr:next(1,32), stack)
      end
   end
end


I use it to fill all the chests on the servers. If you dont have tenplus1's farming installed, you can replace the other items if you like.
 

User avatar
StepDevelop
Member
 
Posts: 75
Joined: Mon May 02, 2016 21:11
GitHub: StepDevelop

Re: [Mod] Villages for Minetest [mg_villages]

by StepDevelop » Tue May 17, 2016 23:16

OMG O.o Great mod! For my server is very useful! Thanks, you're a great modder!
 

cimbakahn
Member
 
Posts: 38
Joined: Sat Aug 29, 2015 20:03
IRC: cimbakahn
In-game: cimbakahn

Re: [Mod] Villages for Minetest [mg_villages]

by cimbakahn » Wed May 18, 2016 19:57

I personally don't think that problem is resolved yet. I don't even have that file mg_all_villages.data and i have the message: ERROR[Main]: mod "village_canadian" has unsatisfied dependencies: "hdb" "nbu"

I have 3 files that mentions that file, but that is it:
/home/cimbakahn/.minetest/mods/villages-for-minetest-modpack/mg_villages/buildings.lua
/home/cimbakahn/.minetest/mods/villages-for-minetest-modpack/mg_villages/init.lua
/home/cimbakahn/.minetest/mods/villages-for-minetest-modpack/mg_villages/mapgen.lua

What do you suggest i do?
 

User avatar
philipbenr
Member
 
Posts: 1688
Joined: Fri Jun 14, 2013 01:56
Location: United States
GitHub: philipbenr
IRC: philipbenr
In-game: robinspi

Re: [Mod] Villages for Minetest [mg_villages]

by philipbenr » Wed May 18, 2016 22:58

I'll give it a shot. Thanks for all your hard work Sokomine.
 

cimbakahn
Member
 
Posts: 38
Joined: Sat Aug 29, 2015 20:03
IRC: cimbakahn
In-game: cimbakahn

Re: [Mod] Villages for Minetest [mg_villages]

by cimbakahn » Fri May 20, 2016 19:45

As to this message:
ERROR[Main]: mod "village_canadian" has unsatisfied dependencies: "hdb" "nbu"
I have scoured google trying to find these mods. I can find nbu at viewtopic.php?f=13&t=2750
Problem is there is no mod to download on the page. And i couldn't find anything at all on hdb.
 

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

Re: [Mod] Villages for Minetest [mg_villages]

by Sokomine » Fri May 20, 2016 19:56

cimbakahn wrote:ERROR[Main]: mod "village_canadian" has unsatisfied dependencies: "hdb" "nbu"
I have scoured google trying to find these mods. I can find nbu at viewtopic.php?f=13&t=2750
Problem is there is no mod to download on the page. And i couldn't find anything at all on hdb.

That's right. hdb and nbu are no longer easily available for download. If you don't have an old copy (and some experience), you ought to not use village_canadian. There are plenty of village types that are easier to use. You can even create your own if you want to.
A list of my mods can be found here.
 

cimbakahn
Member
 
Posts: 38
Joined: Sat Aug 29, 2015 20:03
IRC: cimbakahn
In-game: cimbakahn

Re: [Mod] Villages for Minetest [mg_villages]

by cimbakahn » Fri May 20, 2016 22:07

It might help if i knew what the letters stood for in hdb and nbu. And which page to find the download. I take nbu stands for nodebox utility, but what does hdb stand for. Is this all some sort of secret or something?
 

cimbakahn
Member
 
Posts: 38
Joined: Sat Aug 29, 2015 20:03
IRC: cimbakahn
In-game: cimbakahn
 

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

Re: [Mod] Villages for Minetest [mg_villages]

by Sokomine » Sat May 21, 2016 01:33

cimbakahn wrote:It might help if i knew what the letters stood for in hdb and nbu. And which page to find the download. I take nbu stands for nodebox utility, but what does hdb stand for. Is this all some sort of secret or something?

I don't know either. Those mods where created by Mauvebic. He is no longer participating in Minetest and deleted some of his mods some time ago and then couldn't find a backup.
A list of my mods can be found here.
 

User avatar
BrandonReese
Member
 
Posts: 839
Joined: Wed Sep 12, 2012 00:44
Location: USA
GitHub: bremaweb
IRC: BrandonReese
In-game: BrandonReese

Re: [Mod] Villages for Minetest [mg_villages]

by BrandonReese » Tue Aug 30, 2016 16:21

I pointed this out in another forum so I thought I should post it here. I don't know if this is a known bug or if my copy of mg_villages is screwed up.

I seem to have discovered if you have mg_villages.ENABLE_TERRAIN_BLEND = true; all villages spawn at y=1 or y=2. If you make that false it seems like they spawn at different heights that correspond better to the terrain, but there are also other bugs associated with ENABLE_TERRAIN_BLEND = false such as villages floating on water (you'll have 1 or 2 layers of dirt but then you can swim under the village) and in the mountains I've seen a few villages where the building heights vary and some of the buildings are floating.
 

User avatar
azekill_DIABLO
Member
 
Posts: 7386
Joined: Wed Oct 29, 2014 20:05
Location: Under my desk (but I can't see my monitor now X'[ )
GitHub: azekillDIABLO
In-game: azekill_DIABLO

Re: [Mod] Villages for Minetest [mg_villages]

by azekill_DIABLO » Wed Aug 31, 2016 10:40

i've also seen a big house on a 40 blocks high stone tower, flotin over a layer of snow
【OMICRON】 ; 【MILA】 update ; 【BB,HD】 update ; 【▶ Youtube】 Redstone will be added in 20 months ago. -wuzzy
 

User avatar
TheReaperKing
Member
 
Posts: 516
Joined: Sun Nov 22, 2015 21:36

Re: [Mod] Villages for Minetest [mg_villages]

by TheReaperKing » Sun Sep 18, 2016 19:47

Great villages!!! One thing I noticed is the license isn't in the git repo. Seems like it might be a good idea to have in there.
Resources on happiness and life management - http://MikesHappyPlace.com
Project Lead of the Doom 3 Mod Last Man Standing - http://Doom3Coop.com
Project Lead of Platinum Arts Sandbox Free 3D Game Maker - http://SandboxGameMaker.com
Youtube Channel - https://www.youtube.com/user/PlatinumArtsKids
 

Next

Return to Mod Releases



Who is online

Users browsing this forum: No registered users and 14 guests