[Freeciv-Dev] [bug #16717] AI chooses new wonder city too often

2010-11-01 Thread pepeto

Update of bug #16717 (project freeciv):

  Status:  Ready For Test = Fixed  
 Open/Closed:Open = Closed 


___

Reply to this item at:

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

___
  Message posté via/par Gna!
  http://gna.org/


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


[Freeciv-Dev] [bug #16717] AI chooses new wonder city too often

2010-10-29 Thread pepeto

Update of bug #16717 (project freeciv):

  Status: In Progress = Ready For Test 


___

Reply to this item at:

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

___
  Message posté via/par Gna!
  http://gna.org/


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


[Freeciv-Dev] [bug #16717] AI chooses new wonder city too often

2010-10-27 Thread pepeto

Update of bug #16717 (project freeciv):

 Assigned to:None = pepeto 


___

Reply to this item at:

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

___
  Message posté via/par Gna!
  http://gna.org/


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


[Freeciv-Dev] [bug #16717] AI chooses new wonder city too often

2010-10-13 Thread George Koehler

Follow-up Comment #5, bug #16717 (project freeciv):

Uploading -v2 patches. They delete that FIXME comment, and also delete the
'redundant test?' comment, two lines down.

The test '!is_wonder(wonder_city-production.value.building)' is not
redundant, because city might build Barracks instead of wonder when AI has no
tech for wonder.

(file #10770, file #10771)
___

Additional Item Attachment:

File name: p22-keep-wonder-city-v2.diff   Size:0 KB
File name: ptrunk-keep-wonder-city-v2.diff Size:0 KB


___

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


[Freeciv-Dev] [bug #16717] AI chooses new wonder city too often

2010-10-08 Thread pepeto

Follow-up Comment #4, bug #16717 (project freeciv):

The FIXME comment must be removed, because it is pointing about an invalid
comprehension of the code, added with the sign mistake in the same patch.


___

Reply to this item at:

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

___
  Message posté via/par Gna!
  http://gna.org/


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


[Freeciv-Dev] [bug #16717] AI chooses new wonder city too often

2010-10-07 Thread George Koehler

Follow-up Comment #3, bug #16717 (project freeciv):

Attaching patches.
* p22-keep-wonder-city.diff for S2_2
* ptrunk-keep-wonder-city.diff for trunk

(file #10653, file #10654)
___

Additional Item Attachment:

File name: p22-keep-wonder-city.diff  Size:0 KB
File name: ptrunk-keep-wonder-city.diff   Size:0 KB


___

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


[Freeciv-Dev] [bug #16717] AI chooses new wonder city too often

2010-10-05 Thread George Koehler

Follow-up Comment #1, bug #16717 (project freeciv):

AI tries to pick a wonder city and build a wonder there. Today, the logic to
stay with a wonder city is broken, only because the code has '=' instead of
'=' at one place, so AI will never finish a wonder unless by luck AI chooses
this same city for every turn until this wonder is complete.

At ai_manage_buildings() under ai/aicity.c, I tried to change



from
0 = wonder_city-surplus[O_SHIELD]

to
0 = wonder_city-surplus[O_SHIELD]



and tried a game. I observed that the AI stayed with its wonder city, except
when this wonder city was not building a wonder (perhaps because the AI had
no technology for a wonder). So change from '=' to '=' seems to be good
idea.

I can create patch after I delete my logging code. I need to keep my logging
code while I study bug #13557.

___

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


[Freeciv-Dev] [bug #16717] AI chooses new wonder city too often

2010-10-05 Thread pepeto

Update of bug #16717 (project freeciv):

  Status:None = In Progress
 Planned Release: = 2.2.4, 2.3.0   

___

Follow-up Comment #2:

Effectively, this appears to be the cause of the bug. It has been added by
mistake in PR#39553 (revision #13297) when inverting a condition: !(a  b)
- (!a || !b).

Patch is needed for trunk and S2_2 (note that this code has been moved into
server/advbuilding.c in trunk).


___

Reply to this item at:

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

___
  Message posté via/par Gna!
  http://gna.org/


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


[Freeciv-Dev] [bug #16717] AI chooses new wonder city too often

2010-09-16 Thread George Koehler

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