Complete.Org: Mailing Lists: Archives: freeciv-dev: August 2004:
[Freeciv-Dev] Re: (PR#436) Bug: game state not totally preserved in save
Home

[Freeciv-Dev] Re: (PR#436) Bug: game state not totally preserved in save

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: caz@xxxxxxxxxxxxxxxx
Subject: [Freeciv-Dev] Re: (PR#436) Bug: game state not totally preserved in savegames
From: "Marko Lindqvist" <marko.lindqvist@xxxxxxxxxxx>
Date: Sun, 22 Aug 2004 11:12:53 -0700
Reply-to: rt@xxxxxxxxxxx

<URL: http://rt.freeciv.org/Ticket/Display.html?id=436 >

M.Lindqvist wrote:
> [jdorje - Mon Jun 28 17:58:48 2004]:
>>However the city ID's seem to be reordered when the game is loaded.
 >
>  But they are saved!

  I looked into if their order would remain same in genlists. Cities 
work perfectly well in this respect too. They are saved player by 
player, in order they appear in player.cities city_list. Loading is made 
player by player as well and each loaded city is appended to end of 
player.cities list.
  Same goes for unit loading concerning player.units, BUT units appear 
in several other genlists as well and units are appended to these lists 
at the same time. So unit order in them is same as in player.units, and 
further; units of first player are first.
  1) Cities list supported units (ie units that have this city as their 
home city).
  2) Each tile lists units standing on them.

  I can't point out exact code locations which first one affects, but 
I'm 98% certain that such things exist in AI code at least.
  Second affects at least defender selection, from equally good 
defenders first (or last?) one is selected. This has tiny fairness 
implication as well. I'm afraid that if equally good defenders from two 
allied players are in same tile, unit from player with lower player id 
is always selected to defend after save game is loaded and units have 
not yet moved around. ... Considering it a bit more, I think that 
there's more serious problems here how defender selection currently 
fallbacks to unit_list_iterate order, but that's not related to this ticket.


  But what is the best way to fix this?


  - Caz




[Prev in Thread] Current Thread [Next in Thread]