Project

Profile

Help

HostedRedmine.com has moved to the Planio platform. All logins and passwords remained the same. All users will be able to login and use Redmine just as before. Read more...

Bug #854301

closed

AI stops looking too close to its cities when considering want for Migration_Pct effect

Added by Jacob Nevins over 3 years ago. Updated over 3 years ago.

Status:
Closed
Priority:
Normal
Category:
AI
Sprint/Milestone:
Start date:
Due date:
% Done:

0%

Estimated time:

Description

When considering EFT_MIGRATION_PCT, dai_effect_value() looks for cities near its own which are candidates for inbound migration as follows:

iterate_outward(city_tile(pcity), game.server.mgr_distance + 1, ptile) {
  /* ...look for other players' cities... */
} iterate_outward_end;

However, it should take into account pcity's city radius; see check_city_migrations_player().

I think the only supplied ruleset this affects is 'experimental', which has Migration_Pct effects on governments; the AI will fail to take these into account when thinking about the relative values of governments (dai_gov_value(), adv_best_government()). I don't know exactly what this will affect.

The AI want was added with the Migration_Pct effect in Jul 2009, gna bug #13637, r15795 / commit 734691be95.

mgr_distance was later changed to be relative to the city radius in Mar 2010, gna patch #1232, r17164 / commit f58f12792a; but the AI was not updated.

(I don't have a patch in progress for this ticket; feel free to take it.)


Files


Related issues

Related to Freeciv - Bug #854305: mgr_distance setting is misleading about which city it applies toClosedJacob Nevins

Actions
Actions #1

Updated by Marko Lindqvist over 3 years ago

By 'inbound migration' you mean that pcity is the migration destination? From mgr_distance documentation ('/explain mgr_distance') it seems that it's source city's radius which counts:
"...for a suitable migration destination when deciding which city to migrate to. The value is added to the current city radius..."

Actions #2

Updated by Jacob Nevins over 3 years ago

By 'inbound migration' you mean that pcity is the migration destination?

Yes.

The documentation is a bit misleading -- it is the destination which counts.

I actually ended up down this rabbit hole by following up this complaint about the docs: http://forum.freeciv.org/f/viewtopic.php?f=9&t=91051&p=100459 -- I have a patch in progress for that too.

Actions #3

Updated by Jacob Nevins over 3 years ago

  • Related to Bug #854305: mgr_distance setting is misleading about which city it applies to added
Actions #4

Updated by Jacob Nevins over 3 years ago

Looking at modpack server, for variant2 this might affect wonder Eiffel Tower (alliance-ranged) as well as Republic/Democracy govs.

Actions #6

Updated by Marko Lindqvist over 3 years ago

  • Status changed from Resolved to Closed
  • Assignee set to Marko Lindqvist

Also available in: Atom PDF