bugFreeciv - Bugs: bug #21415, AI city want for buildings not...

 
 
Show feedback again

bug #21415: AI city want for buildings not evaluated for alliance- and world-ranged effects?

Submitted by:  Jacob Nevins <jtn>
Submitted on:  Thu 02 Jan 2014 01:27:18 PM UTC  
 
Category: aiSeverity: 3 - Normal
Priority: 5 - NormalStatus: Fixed
Assigned to: Marko Lindqvist <cazfi>Open/Closed: Closed
Release: trunk r23973Operating System: None
Planned Release: 2.6.0, 3.0.0

Add a New Comment (Rich MarkupRich Markup):
   

You are not logged in

Please log in, so followups can be emailed to you.

 

(Jump to the original submission Jump to the original submission)

Sun 01 Feb 2015 07:05:58 AM UTC, SVN revision 27925:

AI considers building effects that also affect allies. It still ignores world-range
effects out of fear that they then benefit enemies more than itself.

Requested by Jacob Nevins

See bug #21415

(Browse SVN revision 27925)

Marko Lindqvist <cazfi>
Project AdministratorIn charge of this item.
Sun 01 Feb 2015 07:05:51 AM UTC, SVN revision 27924:

AI considers building effects that also affect allies. It still ignores world-range
effects out of fear that they then benefit enemies more than itself.

Requested by Jacob Nevins

See bug #21415

(Browse SVN revision 27924)

Marko Lindqvist <cazfi>
Project AdministratorIn charge of this item.
Thu 29 Jan 2015 06:25:18 AM UTC, comment #4:

Patch

(file #23664)

Marko Lindqvist <cazfi>
Project AdministratorIn charge of this item.
Thu 29 Jan 2015 06:22:06 AM UTC, comment #3:

> I'd add ranges Alliance and Team as then it benefits only
> friends, but leave World out.


These don't exist in 2.5 -> dropping from targets.

It also already considers REQ_RANGE_TRADEROUTE even when the traderoute is international.

Marko Lindqvist <cazfi>
Project AdministratorIn charge of this item.
Sun 04 Jan 2015 06:46:47 AM UTC, comment #2:

I'd add ranges Alliance and Team as then it benefits only friends, but leave World out.

Marko Lindqvist <cazfi>
Project AdministratorIn charge of this item.
Sun 05 Oct 2014 01:43:47 PM UTC, comment #1:

Anyone got an opinion on the simple fix?:
Currently AI doesn't consider building things if they might also benefit anyone else (even if only allies). Fix would be for AI to blindly consider their benefits like other buildings, and ignore the strategic implications of benefiting other players.

Jacob Nevins <jtn>
Project Administrator
Thu 02 Jan 2014 01:27:18 PM UTC, original submission:

aicity.c:base_want() invokes city_range_iterate() ("Iterate over cities within a certain range around a given city (city_here) that exist within a given city list") to get votes from each city about the usefulness of a building.

This takes account of REQ_RANGE_LOCAL/CITY/CONTINENT/PLAYER, but will never fire for ALLIANCE or WORLD, so I don't think any buildings which have (city-benefiting) effects with these ranges will be considered. (I don't know if empire-benefiting or strategic effects are considered elsewhere.)

It would be easy to add these to city_range_iterate(). However, these buildings potentially have a negative impact since they benefit other players, so perhaps the AI needs to somehow evaluate the impact of building things which benefit other players. Don't know if this is important enough to not apply the simple fix in the meantime.

(For buildings with effects at multiple ranges, only the "widest" range is considered, so a building which had one effect on the local player and a different effect worldwide would fall in this category.)

Jacob Nevins <jtn>
Project Administrator

 

(Note: upload size limit is set to 1024 kB, after insertion of the required escape characters.)

Attach File(s):
   
   
Comment:
   

Attached Files
file #23664:  AlliedBenefits.patch added by cazfi (1kB - text/x-diff)

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -unavailable- added by cazfi (Posted a comment)
  • -unavailable- added by jtn (Submitted the item)
  •  

    Do you think this task is very important?
    If so, you can click here to add your encouragement to it.
    This task has 0 encouragements so far.

    Only logged-in users can vote.

     

    Please enter the title of George Orwell's famous dystopian book (it's a date):

     

     

    Follow 7 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Sun 01 Feb 2015 07:06:11 AM UTCcazfiStatusReady For Test=>Fixed
      Assigned toNone=>cazfi
      Open/ClosedOpen=>Closed
    Thu 29 Jan 2015 06:25:18 AM UTCcazfiAttached File-=>Added AlliedBenefits.patch, #23664
      StatusNone=>Ready For Test
    Thu 29 Jan 2015 06:22:06 AM UTCcazfiPlanned Release2.5.0,2.6.0=>2.6.0, 3.0.0
    Fri 03 Jan 2014 05:24:18 AM UTCjtnPlanned Release=>2.5.0,2.6.0
    Show feedback again

    Back to the top


    Powered by Savane 3.1-cleanup