I'm just posting this here because you don't have a mg_villages topic.
That's ok. I was mostly explaining this to other readers who might not be aware that there are two similar mods, one still under construction :-)
My edited version had a problem, the spawner nodes were placed at chunk centres, since ABM range is 32 nodes by default players often could not get close enough to trigger the spawners and generate the village because there is a huge vertical wall there at the chunk border. This is why it only worked with 'active block range' increased to 3+ in minetest.conf.
Now solved by using 4 spawner nodes per mapchunk, placed at each mapchunk corner, no need for a non-default active block range. I have also added a basic WIP terrain blend. My version is found here stored in my wieldhand repo https://github.com/paramat/wieldhandsam2
All edited or added code is marked between '-- PM v' and '-- PM ^', there are 4 spawner nodes in nodes.lua and i have edited and added various functions in mapgen.lua.
Thank you! I've downloaded your version some time ago and taken a short look, eventually even figured out the meaning of the -- PM comments. Perhaps it might be possible to work with one spawner node instead of 4. There's param2 which is also easy enough to access inside the abm. But that's not the most urgent for now.
Your terrain blend is also very nice and will improve the villages immensly.
Currently, the main problem I'm facing before I may integrate your code is the problem of how to determine village height. Very large villages work well with a low random value or even 0 or 1 as they cover enough terrain to hit some ocean or lake somewhere. The smaller the village, the more odd such a low height may look. I've written a small function to analyze the height of the terrain at the border of the village (the inside is of no intrest), but there I'm facing a major problem: The current chunk may hold only a tiny fraction of the village border, and each chunk will arrive at a diffrent conclusion at which height might be optimal.
Interesting but your villages mod has the same problem:
I've no idea why windows builds have trouble reading that particular file. As those buildings concerned will only work with Mauvebics mm2 modpack (which you're not particulary likely to have installed), just comment out all "canadian" buildings in the list of buildings in buildings.lua