Re: [Freeciv-Dev] (PR#39543) Cities compete over Small Wonders

2008-06-21 Thread Marko Lindqvist

URL: http://bugs.freeciv.org/Ticket/Display.html?id=39543 

2007/8/12 Marko Lindqvist [EMAIL PROTECTED]:
 On 12/08/07, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote:

 My suggestion for the AI code...  If a Nation already has a Small
 Wonder, don't rebuild it anywhere else, that's the easy fix, and it'll
 prolly be right 99% of the time.

  Attached patch should do just that. Untested.

 Updated against current svn.


 - ML

diff -Nurd -X.diff_ignore freeciv/ai/aicity.c freeciv/ai/aicity.c
--- freeciv/ai/aicity.c	2008-03-28 09:26:55.0 +0200
+++ freeciv/ai/aicity.c	2008-06-21 16:47:01.0 +0300
@@ -230,7 +230,9 @@
 return 0; /* Nothing to calculate here. */
   }
 
-  if (!can_city_build_improvement_now(pcity, pimprove)) {
+  if (!can_city_build_improvement_now(pcity, pimprove)
+  || (is_small_wonder(pimprove)
+   find_city_from_small_wonder(pplayer, pimprove))) {
 return 0;
   }
 
___
Freeciv-dev mailing list
Freeciv-dev@gna.org
https://mail.gna.org/listinfo/freeciv-dev


[Freeciv-Dev] (PR#39543) Cities compete over Small Wonders

2007-08-12 Thread [EMAIL PROTECTED]

URL: http://bugs.freeciv.org/Ticket/Display.html?id=39543 

Hi

rndCiv uses Small Wonders, for things like Colleges of Magic
that can produce Magicians etc.  Often these units are Unique.

What ive found is that the AI will build a Small Wonder, build
the specialty unit, and then other cities in the same nation
will start building that Small Wonder, If they succeed the new
Small Wonder destroys the old one.

What often ends up happening is that many cities spend huge amounts
of resources rebuilding the Small Wonder, that they a) never really
build anything else, and b) the units that the Small Wonder allows
never have a chance to get built.

My suggestion for the AI code...  If a Nation already has a Small
Wonder, don't rebuild it anywhere else, that's the easy fix, and it'll
prolly be right 99% of the time.

-billy



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


Re: [Freeciv-Dev] (PR#39543) Cities compete over Small Wonders

2007-08-12 Thread Marko Lindqvist

URL: http://bugs.freeciv.org/Ticket/Display.html?id=39543 

On 12/08/07, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote:

 My suggestion for the AI code...  If a Nation already has a Small
 Wonder, don't rebuild it anywhere else, that's the easy fix, and it'll
 prolly be right 99% of the time.

 Attached patch should do just that. Untested.

 This of course prevents moving palace in default ruleset. I don't
know how good decisions AI has been doing about moving palace. If it
has been random thing, this patch would actually be improvement for
default ruleset too...
 Per?


 - ML

diff -Nurd -X.diff_ignore freeciv/ai/aicity.c freeciv/ai/aicity.c
--- freeciv/ai/aicity.c	2007-08-11 00:20:33.0 +0300
+++ freeciv/ai/aicity.c	2007-08-12 16:44:12.0 +0300
@@ -219,7 +219,8 @@
 return 0; /* Nothing to calculate here. */
   }
 
-  if (!can_build_improvement(pcity, id)) {
+  if (!can_build_improvement(pcity, id)
+  || (is_small_wonder(id)  find_city_from_small_wonder(pplayer, id))) {
 return 0;
   }
 
___
Freeciv-dev mailing list
Freeciv-dev@gna.org
https://mail.gna.org/listinfo/freeciv-dev