[Mod] Villagers for Minetest [villagers][v0.17]

daddaaddaaad
New member
Posts: 4
Joined: Tue Jul 24, 2018 11:24

Re: [Mod] Villagers for Minetest [villagers][v0.17]

by daddaaddaaad » Post

Sokomine wrote: Maybe they don't want to freeze their feet ,-)
You're probably right :D

User avatar
Diamond knight
Member
Posts: 475
Joined: Sun Apr 19, 2015 19:50
GitHub: Diamondknight
In-game: Ferrumprinceps
Location: Chilling in Constantinople
Contact:

Re: [Mod] Villagers for Minetest [villagers][v0.17]

by Diamond knight » Post

Is this mod still being developed? I would hate to see one of the few quality villager mods die.

trungus
Member
Posts: 10
Joined: Thu Apr 19, 2018 18:14
In-game: Trungus

Re: [Mod] Villagers for Minetest [villagers][v0.17]

by trungus » Post

Hi Guy

I first place I want to thanks to ErrorNull, this mod is great! I'm testing it for a small home server and I like it a lot.
I have a question, anybody knows any way to lower the quantity of villagers?, the machine used as a server is quite old so if I have too many entities the lag rise up fast.
So far I check the code of villagers and villages looking for a way to do it, without success, I only understand that villagers come to live with a kind of spawner but I couldn't find any that register it o control it.
Mi machine run on a bare Debian Stretch, 1GB Ram with a compiled version of Minetest 0.4.17.1 with LuaJit.

Best Regards and Thank you in advance.
Trungus

User avatar
ErrorNull
Member
Posts: 271
Joined: Thu Mar 03, 2016 00:43
GitHub: ErrorNull0

Re: [Mod] Villagers for Minetest [villagers][v0.17]

by ErrorNull » Post

hey guys, thanks for the kind words. it's been a while for sure.. and glad to see my mod is still being poked and prodded around here. i've just been busy with real life stuff. since it appears there's still mild interest in this mod, i'll plan to continue improving my villagers mod soon.
trungus wrote:I have a question, anybody knows any way to lower the quantity of villagers?, the machine used as a server is quite old so if I have too many entities the lag rise up fast. So far I check the code of villagers and villages looking for a way to do it, without success, I only understand that villagers come to live with a kind of spawner but I couldn't find any that register it o control it.
Trungus

the quantity of villagers is automatically determined by Sokomine's villages mod, in which a predetermined number of beds are installed within each spawned building. The quantity of my villagers simply matches the number of beds. i could possibly introduce an option that reduce the 100% bed-correspondence to say 80% or 50%. I'll look into it once i jump back into this...

trungus
Member
Posts: 10
Joined: Thu Apr 19, 2018 18:14
In-game: Trungus

Re: [Mod] Villagers for Minetest [villagers][v0.17]

by trungus » Post

ErrorNull wrote:hey guys, thanks for the kind words. it's been a while for sure.. and glad to see my mod is still being poked and prodded around here. i've just been busy with real life stuff. since it appears there's still mild interest in this mod, i'll plan to continue improving my villagers mod soon.
trungus wrote:I have a question, anybody knows any way to lower the quantity of villagers?, the machine used as a server is quite old so if I have too many entities the lag rise up fast. So far I check the code of villagers and villages looking for a way to do it, without success, I only understand that villagers come to live with a kind of spawner but I couldn't find any that register it o control it.
Trungus

the quantity of villagers is automatically determined by Sokomine's villages mod, in which a predetermined number of beds are installed within each spawned building. The quantity of my villagers simply matches the number of beds. i could possibly introduce an option that reduce the 100% bed-correspondence to say 80% or 50%. I'll look into it once i jump back into this...
You are joking? ... your work is great, I fly around the village and I can see plenty of life if the server, if you found some way to help me to reduce the numbers of villagers, will be great.

About "real life stuff", I know exactly what you say, this is the third time that I working with my childs to assembly a server, is not easy man, I hope your life should be a bit easiers now, we need a time for fun, just fot the sake of the fun.

Best Regards and Thanks again

Meaty
New member
Posts: 4
Joined: Wed May 15, 2019 03:37

Re: [Mod] Villagers for Minetest [villagers][v0.17]

by Meaty » Post

Hello and thank you for the awesome mod!

I have, perhaps silly, question: when I enable only mg_villlages, handle_schematics, and villagers on 5.0.1, all works fine except the fact that villagers do not move. They stand still near the buildings, turn around every 3-4 seconds but does not walk. The /villagers list shows Walked 0 for each of them. All mods are taken from the GitHub and have the latest versions.
Is there any way to debug such behavior? What sort of logs should I check in order to troubleshoot that?
Thanks!

User avatar
ErrorNull
Member
Posts: 271
Joined: Thu Mar 03, 2016 00:43
GitHub: ErrorNull0

Re: [Mod] Villagers for Minetest [villagers][v0.17]

by ErrorNull » Post

Meaty wrote:Hello and thank you for the awesome mod!

I have, perhaps silly, question: when I enable only mg_villlages, handle_schematics, and villagers on 5.0.1, all works fine except the fact that villagers do not move. They stand still near the buildings, turn around every 3-4 seconds but does not walk. The /villagers list shows Walked 0 for each of them. All mods are taken from the GitHub and have the latest versions.
Is there any way to debug such behavior? What sort of logs should I check in order to troubleshoot that?
Thanks!

Hi Meaty,

I would look into the 'functions.lua' and 'actions.lua' as this is where i defined the code the villager movement. i haven't looked into my code for a while, but suspect that with the latest minetest version, may have something to do with how villagers are [failing] verifying if a node in front of them is clear or not for walking forward. hope that helps.

User avatar
MyordasMineTest
Member
Posts: 17
Joined: Sat Dec 14, 2019 05:57
Location: Bataan Province, Philippines

Re: [Mod] Villagers for Minetest [villagers][v0.17]

by MyordasMineTest » Post

Can you add marrying/loving a villager?

MattCommish
New member
Posts: 8
Joined: Thu Jun 14, 2018 07:33

Re: [Mod] Villagers for Minetest [villagers][v0.17]

by MattCommish » Post

Hi!
I am a teacher running a class for elementary school kids in Minetest. I am not very tech savvy. I have installed your villagers mod. For the curriculum I am trying to do, I'd like to try to spawn villagers in towns that the kids are designing and building? Is that possible to do? If you could let me know how, it would be a huge help!
Thanks so much,
Matt

User avatar
Devy
Member
Posts: 133
Joined: Sat Jan 21, 2017 02:31
GitHub: DevyHeavy
In-game: devy

Re: [Mod] Villagers for Minetest [villagers][v0.17]

by Devy » Post

MattCommish wrote:Hi!
I am a teacher running a class for elementary school kids in Minetest. I am not very tech savvy. I have installed your villagers mod. For the curriculum I am trying to do, I'd like to try to spawn villagers in towns that the kids are designing and building? Is that possible to do? If you could let me know how, it would be a huge help!
Thanks so much,
Matt
Hi, I looked at the Github here: https://github.com/ErrorNull0/villagers ... s.lua#L150 and doing

Code: Select all

/villagers list
should do something. I have not tested it.

WyomingWill
Member
Posts: 22
Joined: Sun Aug 16, 2020 05:41

Re: [Mod] Villagers for Minetest [villagers][v0.17]

by WyomingWill » Post

Does Villagers work for the newer Minetests like Version 5.3?
I've included only the mods: cottages, handle_schematics, mg_villages, and villagers.

The villagers appear, but they only "turn" and "stand". They do converse and
one can trade with them.

But they do not walk around or budge from their initial spots.

The code appears to imply that they CAN walk around, but I'm unable to get
that behavior no matter what I do to modify the code. Sometimes I've been able
to get a little "leg jitter" from the traders, but that's it.

I found the following video, which indicates that the villagers could walk in the past?

https://www.youtube.com/watch?v=Q7RXlWu3IrA

I do see that "Meaty" asked about this in 2019. Has there been any resolution? If not, I'll poke around some more.

This is a really terrific mod and I appreciate all the work you have done with it. I'm going to introduce this to my grandson this weekend. ;-)

Thanks, Bill

User avatar
Hagrid669
New member
Posts: 4
Joined: Sun Mar 29, 2020 19:32

Re: [Mod] Villagers for Minetest [villagers][v0.17]

by Hagrid669 » Post

It's really a very, very good mod for villagers in mg_village. Unfortunately, with recent minetest updates somethings should have changed (I think) about how position and collision box are determined, and so villagers no longer move themselves from site.
As suggested by the author I'm going to look, as soon as I can, into the 'functions.lua' and 'actions.lua' where the movement code is defined. The suspect that may have something to do with how villagers are [failing] verifying if a node in front of them is clear helped me a lot: if I clear one block below NPC feet they start moving, infact!

Thanks for this great mod!
I'm gonna let you know if I can correct the code to fit Minetest version 5.1.1. I have.

WyomingWill
Member
Posts: 22
Joined: Sun Aug 16, 2020 05:41

Re: [Mod] Villagers for Minetest [villagers][v0.17]

by WyomingWill » Post

I have made a few changes to the code to get the villagers moving. Unfortunately they now can walk over water and in the air, but perhaps this will help people get a start.... at least my grandson was amused by things and it was good enough. Walking over the water was sort of fun, actually, as villagers escaped their little islands.

In actions.lua:

I replaced:
-- if not minetest.registered_nodes[nodenames[1]].walkable then
with:
if false then

Also, I replaced:
-- if not minetest.registered_nodes[nodenames[1]].walkable then
with:
if not nodenames[1] == "air" then

and, I replaced:
-- if tNodeDrawtype == "airlike" or tNodeDrawtype == "signlike" or tNodeDrawtype == "torchlike" then
with:
if tNodeDrawtype == "airlike" or tNodeDrawtype == "signlike" or tNodeDrawtype == "torchlike" or tNodeDrawtype == "normal" then

Please note that these are TOTAL hacks, done in desperation and confusion, as I poked around in the code trying to understand it and they are clearly not the right way to do things.

But, as I said, it might help someone figure the right way to do it, and I've love to hear about that.

I made other small mods to prevent crashes due to "nil" items, but I believe the three changes above made villagers start moving.

stefapi
New member
Posts: 3
Joined: Mon Apr 05, 2021 20:49

Re: [Mod] Villagers for Minetest [villagers][v0.17]

by stefapi » Post

A bug fix for the code of villagers.

In actions.lua :

@@ -11,7 +11,7 @@
--check vertical pos at villager's lowerbody
+ nodenames = villagers.getNodeName({x=pos.x, y=pos.y+1, z=pos.z})
- nodenames = villagers.getNodeName({x=pos.x, y=pos.y, z=pos.z})

@@ -21,7 +21,7 @@
--check vertical pos at villager's upperbody
+ nodenames = villagers.getNodeName({x=pos.x, y=pos.y+2, z=pos.z})
- nodenames = villagers.getNodeName({x=pos.x, y=pos.y+1, z=pos.z})

@@ -31,7 +31,7 @@
--check vertical pos below villager's feet
+ nodenames = villagers.getNodeName({x=pos.x, y=pos.y, z=pos.z})
- nodenames = villagers.getNodeName({x=pos.x, y=pos.y-1, z=pos.z})
local nodename = nodenames[2]

@@ -434,7 +434,7 @@
-- air, ladders/signs, and torches
+ if tNodeDrawtype == "normal" or tNodeDrawtype == "airlike" or tNodeDrawtype == "signlike" or tNodeDrawtype == "torchlike" then
- if tNodeDrawtype == "airlike" or tNodeDrawtype == "signlike" or tNodeDrawtype == "torchlike" then

This seems to work great and Mobs are no more falling in water.

Tested with Minetest version 5.3
Last edited by stefapi on Sun Nov 21, 2021 18:00, edited 1 time in total.

ShadMOrdre
Member
Posts: 1118
Joined: Mon Dec 29, 2014 08:07
Location: USA

Re: [Mod] Villagers for Minetest [villagers][v0.17]

by ShadMOrdre » Post

I'm not sure that either of those are the correct fixes to this issue. While reviewing the code, I came across many deprecated calls, which to seem to have an impact. My main updates were getting those calls updated, adding a nametag, updating the character.b3d model to the one included in the most recent MTG release, (specifically adding a models folder and placing the model in that folder inside the villlagers mod folder, so that it grabbed the correct model, instead of one that might still be randomly lurking in the mod soup.)

I am actively working on both villagers and advanced_npc, and both seem to play well enough with each other that I can run both simultaneously. The advanced_npcs have custom villages, while these villagers spawn in the standard mg_villages villages.

As soon as I ensure that the code does not depend on any custom mods or other customizations that would prevent working with MTG, I'll post a release.

Image

Image


Shad
Attachments
screenshot_20210916_090808.jpg
screenshot_20210916_090808.jpg (198.01 KiB) Viewed 1474 times
screenshot_20210916_090716.jpg
screenshot_20210916_090716.jpg (150.8 KiB) Viewed 1474 times

Jackknife
Member
Posts: 189
Joined: Fri Sep 25, 2020 20:07

Re: [Mod] Villagers for Minetest [villagers][v0.17]

by Jackknife » Post

I used to be able to get mg_villages to work on older versions of Minetest but it doesn’t work in the latest version.
A bunch of errors showed up and I had no idea what was wrong with it.
I can figure out how to fix some coding errors but I’m very limited in what I know.
Because the villages didn’t show up neither did the villagers, it gave me some coins
But that was about it.

mcaygerhard
Member
Posts: 129
Joined: Tue Mar 05, 2019 17:37
GitHub: mckaygerhard
IRC: mckaygerhard
In-game: mckaygerhard

Re: [Mod] Villagers for Minetest [villagers][v0.17]

by mcaygerhard » Post

Devy wrote:
Mon Apr 13, 2020 04:44
Hi, I looked at the Github here: https://github.com/ErrorNull0/villagers ... s.lua#L150 and doing

Code: Select all

/villagers list
should do something. I have not tested it.
the mobf_traders already have "/trader <type>" .. cos when i try to command "/villagers list" the server crash

User avatar
ErrorNull
Member
Posts: 271
Joined: Thu Mar 03, 2016 00:43
GitHub: ErrorNull0

Re: [Mod] Villagers for Minetest [villagers][v0.17]

by ErrorNull » Post

hi everyone. happy to see the lingering interest in this mod. but, i'm back to minetest modding. currently learning how to create custom meshes in blender.

i do plan to update this villagers mod eventually, but that will be much later down the road. i'm working on a full game mod for minetest, and once the core features are developed, like new terrain blocks, inventory items, player attributes, survival mechanisms, procedurally spawning buildings, mobs, etc. ...these NPC's may resurface again. i'll have a new forum post about it in the WIP Games section when ready.

Post Reply

Who is online

Users browsing this forum: No registered users and 11 guests