[Freeciv-Dev] [bug #19540] AI failing to cope with Shield2Gold?

2012-03-31 Thread David Fernandez
Follow-up Comment #7, bug #19540 (project freeciv):

There was a bug in previous freeciv version that caused different AI behavior
with each different gold_upkeep_style: bug #16413
http://gna.org/bugs/?16413. Since it was fixed I can't differentiate which
style is being used based on AI behavior. I mainly use gold_upkeep_style = 2
for my tests.

I understand it might be a waste of time to revise the code without a
reproducible case. I have catched a savegame with the problem I try to point,
even when I'm not sure if related to shield2gold or not.

I upload the modpack civ2-3 (the version shared in cazfi's web), with the only
change to give shield2gold to workers and settlers. If you load the savegame,
toggle AI mode, and then set timeout 10, the Kosovars are going to lose a
worker and a city wall due to low funds, even when the taxes are set to 60%.
If taxes were set to 80% (maximum under Republic) the bankrupt would be
avoided.

I see similar cases often while I watch AI games with gold upkeep, and I would
say those bankrupts stopped when I replaced shield2gold by uk_gold, but I'm
not sure, and I do not know how to verify it.

(file #15479, file #15480)
___

Additional Item Attachment:

File name: shield2gold_civ2-3.zip Size:61 KB
File name: shield2gold_kosovar.sav.bz2Size:59 KB


___

Reply to this item at:

  http://gna.org/bugs/?19540

___
  Mensaje enviado vía/por Gna!
  http://gna.org/


___
Freeciv-dev mailing list
Freeciv-dev@gna.org
https://mail.gna.org/listinfo/freeciv-dev


[Freeciv-Dev] [bug #19540] AI failing to cope with Shield2Gold?

2012-03-31 Thread David Fernandez
Follow-up Comment #8, bug #19540 (project freeciv):

Oh, I forgot to say I saved the game with official freeciv v2.3.1, and all
turns until the savegame where played in AI mode.

___

Reply to this item at:

  http://gna.org/bugs/?19540

___
  Mensaje enviado vía/por Gna!
  http://gna.org/


___
Freeciv-dev mailing list
Freeciv-dev@gna.org
https://mail.gna.org/listinfo/freeciv-dev


[Freeciv-Dev] [bug #19540] AI failing to cope with Shield2Gold?

2012-03-28 Thread Marko Lindqvist
Follow-up Comment #6, bug #19540 (project freeciv):

I've been reading the source code to understand how unit gold upkeep is
handled. I saw no obvious explanation why upkeep by uk_gold and by Shield2Gold
would cause different AI behavior. Anyway, everything is controlled by
gold_upkeep_style, so what upkeep style you have seen the problems with?

___

Reply to this item at:

  http://gna.org/bugs/?19540

___
  Message sent via/by Gna!
  http://gna.org/


___
Freeciv-dev mailing list
Freeciv-dev@gna.org
https://mail.gna.org/listinfo/freeciv-dev


[Freeciv-Dev] [bug #19540] AI failing to cope with Shield2Gold?

2012-03-11 Thread Jacob Nevins
URL:
  http://gna.org/bugs/?19540

 Summary: AI failing to cope with Shield2Gold?
 Project: Freeciv
Submitted by: jtn
Submitted on: Sun Mar 11 15:27:24 2012
Category: ai
Severity: 3 - Normal
Priority: 5 - Normal
  Status: None
 Assigned to: None
Originator Email: 
 Open/Closed: Open
 Release: 
 Discussion Lock: Any
Operating System: None
 Planned Release: 

___

Details:

David Fernandez (bardo) writes in bug #17726 (comment 11
http://gna.org/bugs/?17726#comment11):

I have been testing the AI with gold upkeep for some time (I find it very
important to enjoy this game), and I always thought that the AI does not
notice when his economy is breaking due to amount of units supported by gold.
When I use Shield2Gold rule, I see continually AIs that lose his buildings and
units due to low funds, when they could have avoided it by just increasing a
bit the tax rates. I have not checked the code, but it looks like if AI is
someway blind to bankrupt caused by Shield2Gold units.

As cazfi pointed, it is possible to get a similar behavior (units changing
from shield to gold upkeep under certain governments), by using uk_shield,
uk_gold and effects Unit_Upkeep_Free_Per_City and Upkeep_Factor, instead of
Shield2Gold.

And my surprise was that the AI seems to manage perfectly the economy with
units supported by gold when I use uk_gold instead of Shield2Gold.
I'd suggest to some coder to verify that units with uk_shield and Shield2Gold
are taken into account by the AI the same way than units with uk_gold.




___

Reply to this item at:

  http://gna.org/bugs/?19540

___
  Message sent via/by Gna!
  http://gna.org/


___
Freeciv-dev mailing list
Freeciv-dev@gna.org
https://mail.gna.org/listinfo/freeciv-dev


[Freeciv-Dev] [bug #19540] AI failing to cope with Shield2Gold?

2012-03-11 Thread Jacob Nevins
Follow-up Comment #1, bug #19540 (project freeciv):

(A disadvantage of using the base upkeeps in this way is that the built-in
help won't handle it very well, and it's hard to see how it could be upgraded
to.)

___

Reply to this item at:

  http://gna.org/bugs/?19540

___
  Message sent via/by Gna!
  http://gna.org/


___
Freeciv-dev mailing list
Freeciv-dev@gna.org
https://mail.gna.org/listinfo/freeciv-dev


[Freeciv-Dev] [bug #19540] AI failing to cope with Shield2Gold?

2012-03-11 Thread Jacob Nevins
Follow-up Comment #2, bug #19540 (project freeciv):

I was reminded by this by a suspicious comment in utype_upkeep_cost():


  /* switch shield upkeep to gold upkeep if
 - the effect 'EFT_SHIELD2GOLD_FACTOR' is non-zero (it gives the
   conversion factor in percent) and
 - the unit has the corresponding flag set (F_SHIELD2GOLD)
 FIXME: Should the ai know about this? */


___

Reply to this item at:

  http://gna.org/bugs/?19540

___
  Message sent via/by Gna!
  http://gna.org/


___
Freeciv-dev mailing list
Freeciv-dev@gna.org
https://mail.gna.org/listinfo/freeciv-dev


[Freeciv-Dev] [bug #19540] AI failing to cope with Shield2Gold?

2012-03-11 Thread David Fernandez
Follow-up Comment #3, bug #19540 (project freeciv):

In my tests, I notice an improvement in the economic management of the AI when
I replace Shield2gold by uk_gold, but it is hard to know for sure without
watching the code.

I agree the UI is a disadvantage because all units appear with upkeep = 1 gold
+ 1 shield, but Shield2gold is also confusing because it simply shows upkeep =
1 shield, and a text warning that it could change to gold under certain
circunstances.

Another disadvantage is that you can not set diferent upkeep types for each
unit. With Shield2gold it is possible, for example, to support the
workers/settler with shields and the military units with gold. But it is also
a limited feature because the units will be the same for every government.

If it were possible to use the unit name or unit flags as requisite for some
of these effects: Unit_Upkeep_Free_Per_City or Upkeep_Factor, I guess
Shield2Gold would not be needed, and there would be much more freedom to
design governments with diferent upkeep rules. For example:


[effect_upkeep_free_units_town_monarchy]
name= Unit_Upkeep_Free_Per_City
value   = 3
reqs=
{ type, name, range
  Gov, Monarchy, Player
  UnitFlag, NonMil, Local
}






___

Reply to this item at:

  http://gna.org/bugs/?19540

___
  Mensaje enviado vía/por Gna!
  http://gna.org/


___
Freeciv-dev mailing list
Freeciv-dev@gna.org
https://mail.gna.org/listinfo/freeciv-dev


[Freeciv-Dev] [bug #19540] AI failing to cope with Shield2Gold?

2012-03-11 Thread David Fernandez
Follow-up Comment #4, bug #19540 (project freeciv):

The example was not showed in previous post...


[effect_upkeep_free_units_monarchy]
name= Unit_Upkeep_Free_Per_City
value   = 3
reqs=
{ type, name, range
  Gov, Monarchy, Player
  UnitFlag, NonMil, Local
}


Note when I say Another disadvantage is that you can not set diferent upkeep
types for each unit, I mean if the upkeep is being switched from shield to
gold by using uk_gold and Upkeep_Factor rule.

___

Reply to this item at:

  http://gna.org/bugs/?19540

___
  Mensaje enviado vía/por Gna!
  http://gna.org/


___
Freeciv-dev mailing list
Freeciv-dev@gna.org
https://mail.gna.org/listinfo/freeciv-dev


[Freeciv-Dev] [bug #19540] AI failing to cope with Shield2Gold?

2012-03-11 Thread David Fernandez
Follow-up Comment #5, bug #19540 (project freeciv):

I think previous example could be hard to implement...
Maybe it is easier something like this:


[effect_upkeep_unit]
name= Upkeep_Factor
value   = 2
reqs=
{ type, name, range
  Gov, Monarchy, Player
  UnitFlag, NonMil, Local
}


___

Reply to this item at:

  http://gna.org/bugs/?19540

___
  Mensaje enviado vía/por Gna!
  http://gna.org/


___
Freeciv-dev mailing list
Freeciv-dev@gna.org
https://mail.gna.org/listinfo/freeciv-dev