Currently what I would like some feedback on is assigning laborers to more specific tasks, in this case, peasants/laborers/builders.
In the original Majesty peasants spawned from the castle and were generic builders, constructing each building. I had many issues with this:
1)Priorities: Peasants seems to build stuff based on the oldest available build commands. Sometimes I am more concerned about some buildings than others.
2)Range: Range was infinite. Peasants were not limited by distance. Peasants, and other units like tax collectors, would crisscross the map to do stuff. Even if you had an outpost on one side and a castle on the other they would travel to the other settlement to build.
In my current implementation all behaviors tend to have a range. Its possible that units will move passed the range, if they are far from home when they finish a building they will use that new point as a base.
I have a few different ideas, although one major one sparked this post.
First I considered setting their location for the search to always be their owning structure. In my case they spawn from houses and live there, rather than the castle or outpost as in Majesty. Once they have a list, they will then check range from themselves and go to the closest structure.
My second idea was to have both general and assigned builders. So when you spawn a peasant it is set to operate from its house. But you click have a button on a Guild or Order that would recruit that unit solely to build for that group. It would then base out of the building that recruited it and only build stuff under control of that building. Either healing that building, or healing any child buildings. This comes with a few considerations. It may or may not always be optimal to assign builders and recruit new ones if they die. I had considered having a cost. So to recruit a unit a building group would have to pay out some cash. Maybe 100-200 gold. Creating a unit from a house costs 50, for reference.
My third option was to use the "Construction Guild" to spawn builders rather than the house building. The guild could then contract laborers, via the same kind of recruit a builder button, for a price. This price would probably be continuous. Maybe a certain amount of gold per hammer stroke, or maybe by the month. This option is more specific towards my actual game, while the other two would be more engine based, and would be more useful in a variety of games.