[Freeciv-Dev] [bug #16597] Client assumes perfect knowledge of foreign capital locations

2010-08-30 Thread Jordi Negrevernis i Font

Follow-up Comment #3, bug #16597 (project freeciv):


> I think there are places in the code where the client assumes it
> knows where foreign capitals are. Since it works this out via
> find_palace(), which iterates over the cities known to it
> looking for palaces, I think it can be inaccurate in the
> presence of fog-of-war. 

This is a left over from the time when the client saw all the map (or at
least a lot!). There used to be people with modified versions of the client
which could see the units of enemy cities before making an attack...

Then, some folk volunteered to make the modifications as to make the server
send only the right information to the client.


___

Reply to this item at:

  

___
  Message sent via/by Gna!
  http://gna.org/


___
Freeciv-dev mailing list
Freeciv-dev@gna.org
https://mail.gna.org/listinfo/freeciv-dev


[Freeciv-Dev] [bug #16597] Client assumes perfect knowledge of foreign capital locations

2010-08-30 Thread Jacob Nevins

Follow-up Comment #2, bug #16597 (project freeciv):

(Oops, the comment about testing was a lie; as you can see from the savegame,
I did test it after all.)

Making find_palace(), and possibly is_capital(), use that information instead
would be a nice solution; I think it's reasonable to always know the name of
someone's capital if you have diplomatic contact with them.

However, I don't think there's anything that forces EFT_CAPITAL_CITY to be
associated with a small wonder. (Although all the alternatives I can think of
would expose shortcomings of the effect system, I suspect; for example, I'm
guessing that a unique unit that you could move between your cities wouldn't
update corruption across the empire whenever it moved. So perhaps we could
just document that it should be a small wonder for now.)

You'd still to able to see multiple apparent Palaces, as in the savegame, but
the capital flagging I suggest in bug #16596 would take care of that.

___

Reply to this item at:

  

___
  Message sent via/by Gna!
  http://gna.org/


___
Freeciv-dev mailing list
Freeciv-dev@gna.org
https://mail.gna.org/listinfo/freeciv-dev


[Freeciv-Dev] [bug #16597] Client assumes perfect knowledge of foreign capital locations

2010-08-30 Thread pepeto

Follow-up Comment #1, bug #16597 (project freeciv):

> I think there are places in the code where the client assumes it
> knows where foreign capitals are. Since it works this out via
> find_palace(), which iterates over the cities known to it
> looking for palaces, I think it can be inaccurate in the
> presence of fog-of-war.
>
> (I haven't tested either of these yet, so I could be wrong, but
> I couldn't see any special case in the code which would keep
> clients apprised of capital location regardless of FoW.)

I don't know how the client checks currently the capitals, but I can point to
you the client can know what is the capital of a player, even if the city is
fogged: player::wonders[improvement_index(palace)]) is the a city id.


___

Reply to this item at:

  

___
  Message posté via/par Gna!
  http://gna.org/


___
Freeciv-dev mailing list
Freeciv-dev@gna.org
https://mail.gna.org/listinfo/freeciv-dev


[Freeciv-Dev] [bug #16597] Client assumes perfect knowledge of foreign capital locations

2010-08-30 Thread Jacob Nevins

Additional Item Attachment, bug #16597 (project freeciv):

File name: new-palaces-2.sav.bz2  Size:16 KB


___

Reply to this item at:

  

___
  Message sent via/by Gna!
  http://gna.org/


___
Freeciv-dev mailing list
Freeciv-dev@gna.org
https://mail.gna.org/listinfo/freeciv-dev


[Freeciv-Dev] [bug #16597] Client assumes perfect knowledge of foreign capital locations

2010-08-30 Thread Jacob Nevins

URL:
  

 Summary: Client assumes perfect knowledge of foreign capital
locations
 Project: Freeciv
Submitted by: jtn
Submitted on: Monday 08/30/10 at 16:42
Category: None
Severity: 2 - Minor
Priority: 1 - Later
  Status: None
 Assigned to: None
Originator Email: 
 Open/Closed: Open
 Release: 
 Discussion Lock: Any
Operating System: None
 Planned Release: 

___

Details:

I think there are places in the code where the client assumes it knows where
foreign capitals are. Since it works this out via find_palace(), which
iterates over the cities known to it looking for palaces, I think it can be
inaccurate in the presence of fog-of-war.

 (I haven't tested either of these yet, so I could be wrong, but I couldn't
see any special case in the code which would keep clients apprised of capital
location regardless of FoW.)

The one consequence of this I've found is minor. In the diplomacy dialog,
foreign capitals are calculated by calling find_palace(), which returns the
first city it finds which is_capital(). However, a nation could have built a
new Palace in a city you've seen recently, but you could also think there's
still a Palace in a city you haven't seen recently; in this case the client
will choose one of the two randomly. find_palace() should probably count the
number of "capitals" and return NULL if it finds more than one.
The attached (contrived) savegame illustrates this: on my machine, when I
reloaded the save, the Burmese view of the Hungarian capital is correct, but
the Hungarian view of the Burmese capital is wrong.
(It generally seems a bit awkward that this part of the diplomacy dialog
displays potentially-stale information, whereas everything else you can see
there is guaranteed to be up-to-date if you can see it at all.)

(There's another place where find_palace() is used, in city_waste() which is
in common. It turns out that this is only ever used in the client by the CMA
at the moment, which only ever works on your empire and thus has perfect
knowledge; I think investigating a foreign city uses server-supplied values
for corruption etc. This design is skirting close to the edge of a bug, but I
don't have any suggestions for doing anything about it; the CMA presumably
needs to be able to do the calculations on the fly on the client side.)




___

Reply to this item at:

  

___
  Message sent via/by Gna!
  http://gna.org/


___
Freeciv-dev mailing list
Freeciv-dev@gna.org
https://mail.gna.org/listinfo/freeciv-dev