Complete.Org: Mailing Lists: Archives: freeciv-dev: August 2002:
[Freeciv-Dev] Re: normalize_map_pos and invalid map positions

[Freeciv-Dev] Re: normalize_map_pos and invalid map positions

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
Cc: freeciv-dev@xxxxxxxxxxx
Subject: [Freeciv-Dev] Re: normalize_map_pos and invalid map positions
From: Jason Short <jdorje@xxxxxxxxxxxxxxxxxxxxx>
Date: Wed, 14 Aug 2002 01:27:18 -0500

Ross W. Wetmore wrote:
At 01:25 PM 02/08/09 -0500, Mike Kaufman wrote:

>>example: a unit at (0,0) is ordered to move "northwest" by:
>>a) the server (by proxy of the ai)
>>b) a remote client.
>>What should ideally happen in a general topological framework?

Jason, Ross, could we have a consensus on this particular point, devoid of
any other considerations? If other considerations, what do they need to be?

1) Normalization is a "soft" condition that can be defined locally
   within a module. Different modules can have different concepts of
   normalization. Normalize_map_pos() should be used at portal points
   between such logical regimes to trap errors and do any conversions.

Usually this is correct, but it does not generalize completely. If we say (-1,-1) is a special value, then that value must be preserved between modules. The easy solution is that (-1,-1) should not be chosen as a normal value for any module. The "correct" solution IMO would be to add a flag to coordinates passed in this way to represent these special values. This does generalize well, and will avoid having (-1,-1) mean one special case while (-2,-2) means something else.

2) (-1,-1) is a "special" value in the code. It *cannot* be assumed to be a coordinate except in context. Changing this is both hard and
   probably not worthwhile given 1). Finding a replacement is equally

Mostly correct. (-1,-1) is not just a special value in the code, but in the network interface as well right now.

Note, though, that using capabilities it is easy to change the internal representation while preserving backwards compatability. Doing so would require a fair amount of code change, but is probably the easier solution in the long run - making fixes like the vnotify_conn_ex one all over the code is not a good long-term solution.


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