[Freeciv-Dev] (PR#4615) generic_city_refresh should be in the server
[Top] [All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
<URL: http://rt.freeciv.org/Ticket/Display.html?id=4615 >
Well, generic_city_refresh is used in the client now. In fact it has to
be, since it's called by the CM code. So I will morph this ticket into
a separate discussion ;-).
Currently generic_city_refresh calculates a lot of "cached" values for
the city. pcity->shield_prod, pcity->surplus[O_FOOD], etc., etc.
Because of CM we've recently had to fix things so generic_city_refresh
is always called at the client side for any owned city. Yet the network
packet still sends half or more of these cached values to the client
(the others are not sent, and are part of the reason
generic_city_refresh must be called). City traffic is a big part of net
traffic, and I think delta cannot optimize arrays so this data (like
surplus[O_MAX]) is always sent.
As I see it, the current situation gets the worst of both worlds. We
have to spend some extra bandwidth sending this data that is usually
recalculated anyway. We almost always have to have the extra trouble of
calling generic_city_refresh at the client. And when a bug does happen
and generic_city_refresh isn't called, most of the time it doesn't hurt
since the cached data was sent anyway.
We can improve it in one of two ways:
- Send all cached data to the client. This would include another 30
bytes of data per city. The advantage is generic_city_refresh wouldn't
have to be called immediately when the data was received.
- Send no cached data to the client. This would mean 32 bytes of
current data could simply be cut from the packet. However then we need
to be even more rigorous about calling generic_city_refresh at the
client. And this may not even be possible for enemy cities that we're
investigating...
-jason
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Freeciv-Dev] (PR#4615) generic_city_refresh should be in the server,
Jason Short <=
|
|