On 23.02.2013 10:35, Michael Vehrs wrote: > I have been trying to improve support for generalized production. As > usual, things turn out to be more complicated than I had anticipated, > much like in real life. In particular, I don't know how to handle this > situation: > > <production> > <input goods-type="wood" amount="3"/> > <input goods-type="ore" amount="2"/> > <output goods-type="hammers" amount="2"/> > <output goods-type="tools" amount="1"/> > </production> > > Now let's assume a 50% production modifier for hammers, due to expert > units or other circumstances. Do we increase the production of tools as > well? If not, we could just ignore the modifier, which would further > complicate the production code, however. What if there is a hammers > expert and a tools expert in the building? Do we have to calculate the > maximum production for each output type independently and then scale > both input and output goods accordingly? > > Say the building could produce 7 hammers and 4 tools. That would imply a > factor of 3.5 for hammers and 4.0 for tools. Since we are limited by the > lower value, we would produce 7 hammers and 3 (3.5) tools, consuming 11 > (10.5) wood and 7 ore. Does that sound right? > > Of course, before scaling the production, we would have to consider the > amount of input goods. So, if only 9 units of wood were available, the > scale would drop to 3, resulting in a production of 6 hammers and 3 > tools from 9 wood and 6 ore. > > Now assume that we only have room for 3 hammers and that the building > avoids excess production, reducing the production scale to 1.5. Do we > reduce the production of tools accordingly? If not, how much input do we > consume? > > > Regards > > Michael >
Well, I have implemented most of that now. Of course, it turns out there is yet another problem which I did not see immediately, namely the "unattended production" of work places such as the town hall and the church. The usual production is <production> <output goods-type="bells" amount="3"/> </production> <modifier id="bells" value="1"/> So, if there are no units present, we will produce one bell, which leads to a ratio of 1/3. And that is wrong. How do we distinguish these cases? Any suggestions? Regards Michael ------------------------------------------------------------------------------ Everyone hates slow websites. So do we. Make your web apps faster with AppDynamics Download AppDynamics Lite for free today: http://p.sf.net/sfu/appdyn_d2d_feb _______________________________________________ Freecol-developers mailing list Freecol-developers@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/freecol-developers