<URL: http://bugs.freeciv.org/Ticket/Display.html?id=39845 >

Per I. Mathisen wrote:
> I would suggest that before you change it, at least post the design
> you have come up with here for discussion.
That's what this RFE thread is for....  In pseudo-code:

iterate players
   iterate cities
     set cultural influence (probably game.turn - turn_built)
     iterate circle
       determine distance factors
       if factor(this) > factor(existing->source)
         replace owner and source

Simple.  No need to transfer ownership between closer cities.  That
happens automatically by distance factor.  Replaces loops 1, 2 & 4.

This algorithm will be much better at importing older versions and other
saved games.  It's easy to tailor to civ1/2/3 behavior.

Removing ownership should happen in the destroy city code at the same
place that vision is updated.  At turn end, this algorithm may replace
any unclaimed tiles with the next best owner.  One of the problems with
loop 3 is that there's no visual confirmation at the time of city owner
change -- it currently doesn't happen until the next turn!

Another idea is to use the same *vision_base and algorithm for fortresses
and airports (and future civ3-like radar outposts or what-have-you).

One constraint is the tile owner in handle_tile_info(); for compatibility
with existing clients, nothing more sophisticated is allowed.  This meets
that constraint.

Freeciv-dev mailing list

Reply via email to