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

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

Added by Jacob Nevins almost 2 years ago. Updated almost 2 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.)


Related issues

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

<a title="Actions" class="icon-only icon-actions js-contextmenu" href="#">Actions</a>

History

#1 Updated by Marko Lindqvist almost 2 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..."

#2 Updated by Jacob Nevins almost 2 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.

#3 Updated by Jacob Nevins almost 2 years ago

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

#4 Updated by Jacob Nevins almost 2 years ago

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

#6 Updated by Marko Lindqvist almost 2 years ago

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

Also available in: Atom PDF