Cuberite Forum
Thoughts on Village Management - Printable Version

+- Cuberite Forum (https://forum.cuberite.org)
+-- Forum: Cuberite (https://forum.cuberite.org/forum-4.html)
+--- Forum: Development (https://forum.cuberite.org/forum-13.html)
+--- Thread: Thoughts on Village Management (/thread-1282.html)



Thoughts on Village Management - SamJBarney - 12-17-2013

So, as part of the AI rebuild, I have been thinking a lot about how villagers and villages should work. Here's a couple of ideas that I had:

First off, villages are divided into plots (A plot is a volume X by Y by Z big). Each plot is either owned or unowned by a villager or a player. Owned plots can house one adult villager, but if there are no available houses then they can hold up to two adult villagers. Baby villagers are not counted towards housing limit.

A plot is where a house is built. For a house to be valid, it must be a closed container within the bounds of the plot (thus why a plot contains a Y range). It must also have a wooden door on the outside of the building.

Its just an idea I had to get rid of the villager farming exploit.

How feasible do y'all think this is?


RE: Thoughts on Village Management - SamJBarney - 12-17-2013

Along with that, I'm thinking of improving how villages grow.

One idea is allow certain plots to be marked as "Farm" plots. Each farming villager can be responsible for a specific number of "farms". We then figure out how much each farm is producing, and then use that number to determine how many villagers the village can support.

Villagers consume food (something I'm thinking of for the AI build), so the closer the consumption rate comes to the food output, the less likely of a chance that a new villager will be born.

I'm also thinking of improving how Iron Golems are handled.

Instead of having them just spawn in the village when there are enough villagers, I'm thinking of adding a new villager type cMechanicVillager. He would be responsible for creating and maintaining Iron Golems. Each Mechanic could handle up to 3 or 4 Iron Golems, and they must be provided the blocks to create them. Along with that, they can repair Iron Golems by using Iron Bars.

NOTE: Just so everyone knows, these are just ideas that I have had; I'm not going to implement anything that everyone disagrees with.


RE: Thoughts on Village Management - tigerw - 12-17-2013

That sounds like a great idea!

However, I think if functionality for each individual villager is implemented, it is best to split them how they are officially named. So, the Mechanic would just be a Blacksmith, otherwise it can get confusing, and will make it seem a mod.


RE: Thoughts on Village Management - SamJBarney - 12-17-2013

True. That might just be a better way to do it. Maybe blacksmiths just can't make them until there are at least two blacksmiths, or something like that.


RE: Thoughts on Village Management - tigerw - 12-17-2013

Maybe, just document it somewhere, unless the advanced AI is totally obvious to see. Smile

Do you wanna commit your new code? Is it much faster and improved?


RE: Thoughts on Village Management - SamJBarney - 12-17-2013

Faster compared to what?

I am definitely doing my best to make it better, but it will take a few iterations and help from other people to get it to where I think it needs to be.

I'll commit my code as soon as I can; I'm swamped at work and I have a few things I want to get done before I hand it out to be critiqued.


RE: Thoughts on Village Management - xoft - 12-17-2013

I'm a bit skeptical about the new AI differing too much from the vanilla AI. People expect the server to be a replacement for vanilla, so it should work very similar, if not the same.
As for the villages, no problem there, calculate them in whatever way you need. But the iron golems' spawning should remain. The spawning algorithm may be too random when it decides villager types, there may be no blacksmith in a village and then there's no golem, ever? Too bad.


RE: Thoughts on Village Management - SamJBarney - 12-18-2013

Ok, well if the goal is to make it similar to vanilla, then the AI should be completely finished within the month. I'll just stop thinking of way to make it better right now then.


RE: Thoughts on Village Management - tigerw - 12-18-2013

Completely finished within the month! I daresay MCS is going forth in leaps and boundsBig Grin


RE: Thoughts on Village Management - SamJBarney - 12-27-2013

Also, villager spawning would be handled by the village/villagers. So we could write the algorithm in such a way as to make certain a village would have at least 2 blacksmiths once it reaches a certain size.