[Mod] Villages for Minetest [mg_villages]

User avatar
ErrorNull
Member
 
Posts: 94
Joined: Thu Mar 03, 2016 00:43

Re: [Mod] Villages for Minetest [mg_villages]

by ErrorNull » Thu Mar 09, 2017 15:31

Hi Sokomine - I'm working on a villagers mod that spawns into your beautiful villages. I'm doing this by hooking directly into your API function "mg_villages.part_of_village_spawned = function( village, minp, maxp, data, param2_data, a, cid )"

I'm making good progress. Each villager now spawns next to their building (except for roads) standing on an open area and with the following random characteristics: gender, height, eye color, clothing based on gender, names based on gender, upper body and lower body clothing, shoes/boots, and clothing type and color.

The next feature I want to add is for the villager's clothing to correspond to the village/town's climate. I already have the code implemented in my mod where I can give a parameter (eg. hot, cold, normal) and the villagers clothing matches that climate.

All I'm wondering now is if your mg_villages mod has a variable or parameter available that tracks the climate of the region where that village/town is generated. I would like to pass that parameter to my mod so my villagers can wear long-sleeved clothing and jackets for snowy towns and shorts and sleeveless tops for desert towns!

screenshot.PNG
screenshot.PNG (673.03 KiB) Viewed 902 times
 

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

Re: [Mod] Villages for Minetest [mg_villages]

by Sokomine » Wed Mar 15, 2017 01:55

ErrorNull wrote:Hi Sokomine - I'm working on a villagers mod that spawns into your beautiful villages. I'm doing this by hooking directly into your API function "mg_villages.part_of_village_spawned = function( village, minp, maxp, data, param2_data, a, cid )"

I'm glad that the funcion is of use.

ErrorNull wrote:I'm making good progress. Each villager now spawns next to their building (except for roads) standing on an open area and with the following random characteristics: gender, height, eye color, clothing based on gender, names based on gender, upper body and lower body clothing, shoes/boots, and clothing type and color.

That sounds excellent! My mobf_traders are far too boring with the few skins they have - and i'm not good at creating skins. Mixing them up and giving each villager individual clothing and appearance sounds very fine. I'm looking forward to see it in action.

ErrorNull wrote:The next feature I want to add is for the villager's clothing to correspond to the village/town's climate. I already have the code implemented in my mod where I can give a parameter (eg. hot, cold, normal) and the villagers clothing matches that climate.

Ahh. Mobs with fitting clothes. That's a very good idea! But I'm afraid you'll mostly have to invent your own climates or try to derive them from mapgen/biomes. mg_villages is built so that it can deal with almost any mapgen. It has no idea about the climate in the region. It just keeps the ground the way it was before.

There are only few exceptions: Some random villages are covered with snow. Those have mg_villages.all_villages[ village_id ].artificial_snow set to true. Another exception are villages of the type sandcity - those are desert villages (they never get artificial snow covers). Most other village types are set somewhere in temperate climate. The types medieval and charachoal stand for medieval european/German villages and sourroundings (definitely temperate climate). lumberjack and logcabin may be slightly more modern (settlement of the USA?). The wood has to come from somewhere, so it's probably neither a desert nor permafrost. Type grasshut will probably be seen very rarely as it requires further mods. The climate there would be savannah or similar. Villages of the type taoki grow cotton, so they'll probably sit in a suitable climate. Claytrader, tent, nore (that's the type shown in the screenshot), gambit, modern houses, ruins and towntest could be anywhere.

ErrorNull wrote:All I'm wondering now is if your mg_villages mod has a variable or parameter available that tracks the climate of the region where that village/town is generated. I would like to pass that parameter to my mod so my villagers can wear long-sleeved clothing and jackets for snowy towns and shorts and sleeveless tops for desert towns!

Very nice :-) Hope your mod will be available soon. And as long as all of the villagers of one settlement wear one type of clothing, it ought to be convincing enough. There might be a desert next to a glacier behind the next hill anyway.
A list of my mods can be found here.
 

User avatar
ErrorNull
Member
 
Posts: 94
Joined: Thu Mar 03, 2016 00:43

Re: [Mod] Villages for Minetest [mg_villages]

by ErrorNull » Tue Mar 21, 2017 22:19

thanks for the clarification Sokomine. i'm not familiar with how to work with biomes at this time. so I will have my villager's clothing types be chosen based on your village types - grasshut, lumberjack, tent, medieval, etc.

my clothing types are only very basic, like for cold weather, hot weather, 'normal' weather. which means in cold weather the villagers have long sleeves and jackets and boots and hot weather they have on shorts, skirts and sandals, and 'normal' is combination. villager's skin color is also variable, where hot weather tend to have darker skinned villagers.

i have now updated my mod to look for your artificial_snow parameter.. and when it is value of '1' my mod will show villagers' clothing for cold climate. but i have found a strange behavior with your 'moresnow' mod. i am using your latest version from december 2016.

when i try to dig farming crops in the villages that have the artificial snow, the adjacent snow nodes suddenly show as snow drops for a split second then it disappears, then the entire row of crops disappear! i notice that all the crops have the node 'moresnow:snow_top' inside them.. so when i aim at the crops, it is this 'snow_top' node i'm actually hitting. is this a glitch that is known and can something be done to fix it? i had TenPlus1 farming redo mod installed, so when i removed it, the strange behavior is still there. Refer to images below. thank you!

UPDATE: actually i realized that only server admin can dig the village crops. so during normal gameplay, regular players will not have that privilege to dig them so i suppose this issue would not occur.

Image
Image
Image
Attachments
03.png
03.png (525.59 KiB) Viewed 902 times
02.png
02.png (557.33 KiB) Viewed 902 times
01.png
01.png (563.12 KiB) Viewed 902 times
 

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

Re: [Mod] Villages for Minetest [mg_villages]

by FaceDeer » Mon Mar 27, 2017 01:20

If anyone's still interested in the villages-in-caves idea, I just recently did some work on another mod that might be of use here. I wanted to make my own version of Caverealms with different cave decor and in the process of pulling Caverealms apart to get the useful pieces out of it I created the utility mod Subterrane.

It provides an API that might allow for village buildings to be added in the giant caverns it produces. I haven't looked at Village's code so I'm not sure how it goes about deciding where to position stuff, though, so I make no guarantees. I'm still pretty new at the mapgen side of Minetest modding so Subterrane is likely to need some refinement.

Edit: Just skimmed through Villages' massive mapgen.lua. Yow. :) Hooking Subterrane up to this directly will likely be a lot of trouble, but maybe I can steal some ideas and add a simplified building-placement function for the caverns that could cobble together some villages. I'll have the advantage that no real-life villages were ever built in an environment like that, so I can use workarounds to make things easier and pretend that that's just how cave-dwellers build their villages.
 

zorman2000
Member
 
Posts: 19
Joined: Tue Jul 26, 2016 18:18
GitHub: hkzorman
In-game: zorman2000

Re: [Mod] Villages for Minetest [mg_villages]

by zorman2000 » Tue Mar 28, 2017 21:38

Sokomine wrote:Bookshelves are now filled with (empty) books.

The function mg_villages.fill_one_chest_random is used for filling chests, shelves, bookshelves etc. with content and can be exchanged/overwritten by other mods if there is any need.


Hello Sokomine! Thanks for your very comprehensive answer; it's very appreciated. And also, thanks for pointing me out to this, really helpful!

I found an issue with mod security as well, I will let you know when I have fixed it... And yes, will soon create a thread!
 

Previous

Return to WIP Mods

Who is online

Users browsing this forum: No registered users and 5 guests

cron