URL:
  <http://gna.org/bugs/?16717>

                 Summary: AI chooses new wonder city too often
                 Project: Freeciv
            Submitted by: kernigh
            Submitted on: Thursday 09/16/2010 at 23:52
                Category: ai
                Severity: 2 - Minor
                Priority: 5 - Normal
                  Status: None
             Assigned to: None
        Originator Email: 
             Open/Closed: Open
                 Release: S2_2
         Discussion Lock: Any
        Operating System: *BSD
         Planned Release: 

    _______________________________________________________

Details:

If the wonder city has +0 or more shield surplus (which is almost always
true), then AI will choose a wonder city. If it chooses a different city then
it stops building the wonder.

The cause is the inequality '0 <= wonder_city->surplus[O_SHIELD]' in
ai_manage_buildings() under ai/aicity.c. This inequality is almost always
true, so AI enters the code to choose a wonder city at almost every turn.
Unless AI chooses the same city, AI stops building the wonder.

I found the inequality while hunting for the cause of bug #13557 (AI stops
building wonders after game load), but this seems to be a different bug. The
inequality seems to be the reverse of the intended '0 >=
wonder_city->surplus[O_SHIELD]' or 'wonder_city->surplus[O_SHIELD] <= 0'.

----

I hacked my S2_2 server to log about AI wonder cities
(p22-log-ai-wonder-city.diff). I then started a game.

Glaukias of the Illyrians (an easy AI) chose Onchesmos as wonder city.
Onchesmos started building Pyramids. For several turns, Glaukias rejected
Onchesmos (because 0 <= shield surplus) but chose Onchesmos again.

At 1600 BC (T48), Glaukias chose Antigonea instead of Onchesmos. So Onchesmos
stopped building Pyramids and diverted its 52 shields to Settlers
(aiwonder-turn48.sav.bz2).



    _______________________________________________________

File Attachments:


-------------------------------------------------------
Date: Thursday 09/16/2010 at 23:52  Name: p22-log-ai-wonder-city.diff  Size:
3kB   By: kernigh
not a bug fix!
<http://gna.org/bugs/download.php?file_id=10375>
-------------------------------------------------------
Date: Thursday 09/16/2010 at 23:52  Name: aiwonder-turn48.sav.bz2  Size: 20kB
  By: kernigh
not a bug fix!
<http://gna.org/bugs/download.php?file_id=10376>

    _______________________________________________________

Reply to this item at:

  <http://gna.org/bugs/?16717>

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


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

Reply via email to