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: 



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


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!
Date: Thursday 09/16/2010 at 23:52  Name: aiwonder-turn48.sav.bz2  Size: 20kB
  By: kernigh
not a bug fix!


Reply to this item at:


  Message sent via/by Gna!

Freeciv-dev mailing list

Reply via email to