I kind of expected that gaining horses on the first contact won't be
accepted. :)
No problem, I can remove that behavior easily.

The problem with production was that original code:
List<GoodsType> goodsList = spec.getGoodsTypeList();
for (GoodsType g : goodsList) {
   addGoods(g.getStoredAs(), getTotalProductionOf(g));
}

was producing a heapload of horses each turn. Lower in the same method is
routine for breeding horses,
so this seems like a redundant point of operating on them. And yes, the fix:

List<GoodsType> goodsList = spec.getGoodsTypeList();
for (GoodsType g : goodsList) {
   //horses are goods but are bred, not grown. skip them
   if(g.toString().equals("model.goods.horses")){
     continue;
   }
   addGoods(g.getStoredAs(), getTotalProductionOf(g));
}

completely stops the horse production and only the breeding happens.

I'll try to dig into IndianSettlement code if I find some other way which
could cause the bug.
Probably some bad things in IndianSettlement.getTotalProductionOf(GoodsType
type) could be happening.

Regards,
Petr

2014-04-14 0:51 GMT+02:00 Michael T. Pope <mp...@computer.org>:

> On Sun, 13 Apr 2014 20:38:01 +0200
> Petr Fišer <pries...@gmail.com> wrote:
> > To mitigate the situation, I modified server controller the way
> > that every time there is FIRST contact of European
> > nation with natives, the natives gain two horses in their capital. Then
> the
> > breeding starts doing its job like I previously explained.
>
> I am not convinced this is the right approach.  The complaint is that the
> natives should *not* have horses at all, *unless* they acquire them
> directly from a European nation by trade or capture-in-combat.  Adding in
> an extra way for natives to gain horses does not fix this.
>
> What I think the problem is is that when I changed the specification such
> that horses consume grain rather than "food", they are now automatically
> produced even when there are no horses there.  This violates the
> requirement that autoproduced goods like horses can only be produced if
> there are at least breedingNumber of the goods present.  Therefore I
> conclude there is something wrong in the production code, most likely in
> IndianSettlement.java.
>
> With respect to the patch, I am quite concerned about this bit of code:
>
> @@ -240,6 +242,10 @@ public class ServerIndianSettlement extends
> IndianSettlement
>          // Produce goods.
>          List<GoodsType> goodsList = spec.getGoodsTypeList();
>          for (GoodsType g : goodsList) {
> +            //horses are goods but are bred, not grown. skip them
> +            if(g.toString().equals("model.goods.horses")){
> +                continue;
> +            }
>
> Surely this will completely suppress any horse production?  The 5 mounted
> units you saw might have been captured or traded.  Try going into debug
> mode, after which the popup menu for a native settlement should have an
> "Examine Settlement" entry --- this will show you the current goods levels
> inside.
>
> Cheers,
> Mike Pope
>
------------------------------------------------------------------------------
Learn Graph Databases - Download FREE O'Reilly Book
"Graph Databases" is the definitive new guide to graph databases and their
applications. Written by three acclaimed leaders in the field,
this first edition is now available. Download your free book today!
http://p.sf.net/sfu/NeoTech
_______________________________________________
Freecol-developers mailing list
Freecol-developers@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/freecol-developers

Reply via email to