Complete.Org: Mailing Lists: Archives: freeciv-dev: April 2004:
[Freeciv-Dev] Re: (PR#8584) remove dio_[put|get]_city_map
Home

[Freeciv-Dev] Re: (PR#8584) remove dio_[put|get]_city_map

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: undisclosed-recipients: ;
Subject: [Freeciv-Dev] Re: (PR#8584) remove dio_[put|get]_city_map
From: "Jason Short" <jdorje@xxxxxxxxxxxxxxxxxxxxx>
Date: Sun, 25 Apr 2004 14:11:57 -0700
Reply-to: rt@xxxxxxxxxxx

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

Raimar Falke wrote:

>>Raimar Falke wrote:
>>
>>
>>>   BIT_STRING improvements[B_LAST+1];
>>>-  CITY_MAP city_map[CITY_MAP_SIZE*CITY_MAP_SIZE+1];
>>>+  CITY_MAP city_map[CITY_MAP_SIZE * CITY_MAP_SIZE];
>>>
>>>You can do better here. Send the number of elements of the array. From
>>>this the client can decide what the citymap positions are. I.e. you do
>>>the old solution with an extra level of indirection.
>>
>>I don't get it.  Isn't the number of elements of the array CITY_MAP_SIZE 
>>* CITY_MAP_SIZE, or very close?
> 
> 
> AFAIK this code change is a preparation for variable
> sized-citymaps.

Partially, yes.

> What do you think the packet will looks like if these
> are in place. IMHO it will look like:
> 
>   int city_map_elements;
>   CITY_MAP city_map[MAX_CITY_MAP_SIZE * MAX_CITY_MAP_SIZE];
> 
> So we can start working on this format now. If we even know
> MAX_CITY_MAP_SIZE now we don't have to change the packet format later.

This will take more changes, and I don't know if it's worth it.  Since 
the extra values are always 0, does this mean delta won't send them 
multiple times?

Alternately, we should reorder the indices to follow an outward order. 
This means the indices being sent are always the ones at the beginning. 
  So if the city expands the existing values don't change but new ones 
are added.

Question: does delta do diffs of arrays?  I'm guessing not, right?

jason




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