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: Ready For Test
Assigned to: NoneOpen/Closed: Open
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.


Thu 29 Jan 2015 06:25:18 AM UTC, comment #4:


(file #23664)

Marko Lindqvist <cazfi>
Project Administrator
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 Administrator
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 Administrator
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):

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 4 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    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