Construction Yields

Lib.Spi't

Overlord of the Wasteland
Joined
Feb 12, 2009
Messages
3,708
Location
UK
This thread is open to discuss the concept of building construction consuming multiple yields during construction, rather than at the time of completion.

NIghtinggale
Spoiler :

That gave me an idea. Currently we use lumber and hammers for all production. What if a building costs X hammers, Y bricks, Z tools and whatever and then we have a profession for applying each to the building. One thing, which bugs me is that the amount of extra yields are all taken at once without anybody applying them. The one building, which shows this in the extreme is the colony council (or whatever the name is) in RaR. It's a stone building and you build it with lumber only. Once it's done, you add 200 tools and some stone, but they didn't need the supply as they were building, they just apply them magically in one go. We use the same vanilla system with this flaw.

Imagine if we did have different professions for each yield, which needs to be applied and we add build icons like we add hammers right now. Carpenters could then automatically switch to bricklayers if no more hammers are needed and such to eliminate micro management, but in essence, you need multiple different experts to build something big as a castle as fast as possible.


Kailric
Spoiler :
Let's think through this some more, if we had separate building for each yield it may get a bit tedious to deal with, but if we had say one building that consumed each yield as it was being produced that may work better. You start out with Work Bench/Work Shops that only consume Lumber and Tools. Then instead of a Lumber Mill, we would have a Work Yard, Work Yards are allowed to consume Stone as well. So to build a Cathedral you will need a Work Yard and all the necessary materials on hand. Each turn it takes the needed materials from your stores, if you run out of anyone then production stops. You could go so far as to keep track of each Yields consumption separately but that may be unnecessary.


Fullerene
Spoiler :
I support the multiple yield hammer production idea 100%. It is bit silly that only wood parts are actually build, other materials are just dumbed in.
I don't think that all yields need to be enabled to produce hammer however.

Keeping World History mod dream in mind, maybe we could have 3 types of basic building materials: wood, stone and clay. Some buildings will require for example specially wood, but some could be build from any of these 3 materials.

Hmm, if you build things like cannons, you should also be able to produce hammers from ore.

And one note about tools: I think that the whole purpose that some buildings requires tools should be that people working there needs those tools. For example you need some tools in the weapon's smith shop to produce the swords etc. If it would be like that you could just "dumb in" the tools as they are used in the building not assembled into it during construction.

This easily becomes complicated to implement but I'd like to have various "hammer yields" and then building could also require extra yields that are just taken into building when it's completed.
Code:
<HammerYieldsCosts>
<HammerYieldCostsOr/>
<HammerYieldCostsAnd/>
</HammerYieldsCosts>
<ExtraYieldCosts/>

Lib! (He's so pretty!)
Spoiler :

Hopefully, with the AI Transports Overhaul, keeping up with all those yields won't be a problem.

I like both ideas, but I think Kailric's is the easier to implement, because you already have productions that require multiple yields, so it might not be much more to have variable multiple yields for construction depending on the buildings needs.

I do agree that it is strange that you just dump a pile of tools on a building when it is done!

I think the best way to make it would be something like this:

The Ingredient Yields of a Hammer becomes defined by the building xml file.

So you have say a Cathedral that requires Wood, Stone and Tools.

The building Xml would have a tag like:

<BuildYieldsReq>
<Yield>YIELD_WOOD</Yield>
<Yield>YIELD_STONE</Yield>
<Yield>YIELD_TOOLS</Yield>
</BuildYieldsReq>

Then the amount of each could either be equal (Easy) or each yield could have it's own quantity (more complicated).
For the equal version it would be the total amount of hammers. (I prefer this method for it's simplicity)

That way two buildings might require the same amount of hammers, but one would be harder and more complicated to build, because each hammer requires 2 or more resources which would double or triple the total resources needed to build it.

This would also future proof the design as you can put any yield and any number of yields into any building to have it built.

This allows for concepts like steel and glass construction, etc. in mods like WHM.
 
Fullerene said:
This easily becomes complicated to implement but I'd like to have various "hammer yields" and then building could also require extra yields that are just taken into building when it's completed.
Code:
<HammerYieldsCosts>
<HammerYieldCostsOr/>
<HammerYieldCostsAnd/>
</HammerYieldsCosts>
<ExtraYieldCosts/>
I was thinking more like using a yield array for remaining production cost (or some other data storage, that's not important right now).
Say we need 40 lumber and 10 tools.
Each hammer can then consume:
  1. one lumber and one tools
  2. one lumber
  3. one tools
When building the hammer, it will use this priority to decide what to build.

Maybe we should add the restriction that the yield with the highest requirement has to be used meaning #3 will not be possible. #2 will only be possible if lumber requirements is higher than tools requirements. If no tools are available, eventually it will need 10 of each and only #1 is possible.

This will give the option to use multiple yields without forcing a 1:1 usage. The required yields will be set in XML meaning it will be full freedom to the XML modder.

Alternatively XML could tell what each hammer should cost. That could be something like 2 lumber and 1 ore.... or whatever makes sense. In fact we can have both if the DLL gives the two options priority, meaning it's well defined which one is used if both are enabled in XML. If nothing is set in XML, then we can fall back to vanilla 1 lumber -> 1 hammer.

Note that while my example use two yields, the DLL should not set an upper limit. 10 different yields might not be ideal gameplay, but there is no technical reason why the DLL should prevent that and I don't like implementing artificial limitations. I just pray for XML modder sanity :please:
 
Nice work on the new thread Lib, looking nice. :goodjob:

The simplest thing to do would be for modders to keep the Materials cost the same, 50 Lumber, 50 Stone, etc. That way it would just use an easy 1 for 1. If you wanted to have a odd materials list then perhaps a system like Night suggested. Or something similar like if you had 50 lumber and 10 tools, it would do a 50/10 = 5 so every 5 lumber consumed would consume 1 tool as well. What if there is no Tools? What would happen in real life? More than likely production would be shut down while they waited on the required materials. So, all production shuts down until you get more tools.

This would certainly add more realism to the game and work well with WHM as through out history you can create all kinds of required materials. Each building would have its own set, then when you click to build it the code would convert to that set of materials. Each Civ could have its own style of construction for sure then. Some requiring Clay for buildings, others Lumber, others Steel and Concrete :)

This shouldn't become any more aggravating than what the current system is, and perhaps would be less aggravating. I am always attempting to build things and it will let me build them even if I don't have the Tools, which I totally forget about 20 turns later when my building is done, and I have used up all my Tools else where. So now I have to remember that I need tools. A few turns later my Ship arrives at a port and I think, hmm, what is this ship here for? Well, I can't remember (as there are no in game reminders that buildings need tools) so I'll just summon another Carpenter. A few turns later I finally remember I needed tools!!!:wallbash: Once again I send my ship out and hope this time I want forget! This scenario happens quite often, so a system that requires you to have all the Materials present may become less aggravating as even before I can start construction I need to make sure the City is stocked.
 
That has happened to me too so many times!

Also if we can get the ai transportation to recognise what building materials a town needs through the consumption system or feeder system, that would make this feature fun/logistically tough, without making it a micromanaging nightmare!

You have to make sure you are producing all the building materials somewhere, but your transports take care of where they need to be and when.

I do like Night's suggestion of being able to set quantity costs for '1 hammer' this would make it incredibly flexible. My riginal thought was if you had differing quantities you would define the total amount of each which I think would be a nightmare to code/implement. but defining it 'per hammer' would be a much neater and easier method I would imagine.

So the Tag would look like:
Spoiler :

<BuildYieldsReq>
<Yield>YIELD_WOOD</Yield>
<iQuantitiy>1<iQuantitiy>
<Yield>YIELD_STONE</Yield>
<iQuantitiy>2<iQuantitiy>
<Yield>YIELD_TOOLS</Yield>
<iQuantitiy>1<iQuantitiy>
</BuildYieldsReq>


That would allow for just about as much flexiblility as I could imagine anyone ever wanting.
Anymore I think would lead to a system so convoluted it would ruin the playing experience!
 
Reading though the ideas in this thread, I started wondering if we could come up with a plan for an implementation, which would contain clean code and easy to set up in XML.

I think it would work best if it ends up something like this:
XML tells how many yields will be needed of each type. Maybe we could remove the number of hammers needed and just assume it to be the same as the number of yields of the most demanding type.

The game calculates the cost of each hammer in floats and it accumulates. 0.2 tools mean every 5th hammer cost a tool.

Consumption multiplier assumes a hammer to cost 1 yield/turn if the cost is higher than 0. Not ideal, but it mean it will be fast and require minimal coding to implement and it will get rid of the micromanagement.
 
Reading though the ideas in this thread, I started wondering if we could come up with a plan for an implementation, which would contain clean code and easy to set up in XML.

I think it would work best if it ends up something like this:
XML tells how many yields will be needed of each type. Maybe we could remove the number of hammers needed and just assume it to be the same as the number of yields of the most demanding type.

The game calculates the cost of each hammer in floats and it accumulates. 0.2 tools mean every 5th hammer cost a tool.

Consumption multiplier assumes a hammer to cost 1 yield/turn if the cost is higher than 0. Not ideal, but it mean it will be fast and require minimal coding to implement and it will get rid of the micromanagement.

This sounds good to me. I may add a new option for reminders for needed tools(or what ever) if we don't do anything else. Like a popup that reminds you of a buildings needs, then your options are Ok(Which it will remind you again next turn), Remind me again in 5 turns, or Don't remind me again. We could have an option for Remind me in X turns with a spinwheel, so you get to select the turns.
 
hmm, sounds potentially cool, would this work for buildable Units that need Yields to construct as well? (ie ships, etc) :cool: I can't decide if it would be better or worse for the AI; potentially better if it can be made to percieve the ongoing Yield requirements and plan effectively with imports/production (or plotgroup supply). I wonder if Lumber could even be optional; and it could be set up like Techs requirements currently are, these can be set up to need either no yield, or any combination of yields you want, in order to produce one Bulb. Buildings and Units could need no Yields, or any combination of yields you specify, to produce one Hammer.

Would you have to have one different hammer-building and different hammer-profession for every possible combinations of yields-to-hammers, that sounds like it could get arduous; even today there are "Builders" who do multiple trades. It could be less painful to stay with a building chain (Master Builder; Builder's Hall, Builder's Yard, etc) that can produce Hammers, and the inputs vary depending on the yields you set up in xml. You can still have Buildings as a prereq for other Buildings if you want them to have certain infrastructure requirments.

IIRC vanilla Traits xml has a modifier to yields needed for buildingclasses, if moved to Civics xml you could use this to reduce or eliminate a yield requirement when you want :king:

IMO the most useful and least annoying type of reminder is the end-of-turn popup that alerts you for stuff you probably really don't want to do. It does already if a city will starve (negative projected food), or IIRC if you have citizens trying to do Research and can't make progress due to having no Yield for the research.
It would make sense to notify you there if you put citizens in city X trying to build and they can't make progress due to having no Yield.
 
would this work for buildable Units that need Yields to construct as well? (ie ships, etc) :cool:
Hopefully units and buildings can share code in this regard and they both adds to this feature.

I can't decide if it would be better or worse for the AI
I think the AI needs to learn how to use consumption multiplier first and it would possibly have to compare stocks and consumption demands when setting the value of each yield. That way if it can consume 20 each turn and has none, it will be more likely to produce it.

In other words it would likely be a good idea to write AI improvements before touching this AI breaking feature.

I wonder if Lumber could even be optional; and it could be set up like Techs requirements currently are, these can be set up to need either no yield, or any combination of yields you want, in order to produce one Bulb. Buildings and Units could need no Yields, or any combination of yields you specify, to produce one Hammer.
That's how I plan it. Hopefully lumber can go away from the DLL entirely and not have any hardcoding at all. It will just be a generic yield like most other yields grown on plots (like barley and cotton).

IIRC vanilla Traits xml has a modifier to yields needed for buildingclasses, if moved to Civics xml you could use this to reduce or eliminate a yield requirement when you want :king:
That's a very good point, which I haven't thought of yet. I think the code would be something like this (in this order):

- look up yield requirements from XML
- apply modifiers
- calculate yield requirements for each hammer
- some clever code here I haven't figured out yet :p

I have been thinking. we currently have yield requirements and hammers in XML. This mean this feature can be coded without touching the XML schema. That would reduce the coding time for this feature, though it will not affect how hard it is to code.
 
IMO the most useful and least annoying type of reminder is the end-of-turn popup .

When does this actually popup? At the end of the turn, you mean when you press "End Turn" it gets interrupted by a popup telling you something? Or, the popups at the start of the turn before you can do anything?
 
IIRC I think when you press End Turn, before ending it can check for certain situations (if you would make a city starve etc) and notify you asking if you really want to proceed to end the turn. (it's been awhile though so I may misremember!:blush:)

In general I think this is the best sort of reminder (if you use it for situations where you would really not want to do what you did: such as when you allocated someone to build/research and he didn't have Yields needed to make any progress). In any case where there could be no possible good reason to do what you did, only fair to warn and give you an opportunity to fix it.

I just noticed this playing Worlds of Magic, where it helpfully warns you if you didn't allocate enough gold or food income for unit upkeep :) but does not warn you if you didn't allocate enough mana for unit upkeep, making your magic units vanish when you couldve easily avoided it if you were warned :crazyeye::eek::mad:
 
Top Bottom