[Freeciv-Dev] Re: the directional system
[Top] [All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
Raimar Falke wrote:
> I still don't understand it. DIR_DX2 is only used in one method. Why
> not just convert this and be fine (at least as an immediate step) with
> one system. Why to switch all over to the DIR_DX2 system? Why is the
> DIR_DX2 inferior to the DIR_DX system (not the naming but the
> ordering)?
The problem is the DIR_DX2 "rotational" system is superior to the DIR_DX
"vertical" system: easier to code with, more efficient for most
algorithms, and all-around more understandable. (For a more detailed
explanation ask Ross.)
Thus, it would be desirable to convert the DIR_DX arrays and ALL FreeCiv
code to use the "rotational" system. But, this isn't possible to do
immediately because there is a huge amount of code that may or may not
assume it's using the current "vertical" system.
So, our goal is to whittle down this huge amount of code. First we will
find all of the obvious spots where "magic" code is used. Then we will
do some hard-core testing and close reviews of existing code. Finally
the switch may be made.
My plan was/is to wait until we can convert all code at once. Thus, one
of the first steps is to get rid of the DIR_DX2 arrays entirely so that
there's just one system. Ross thinks it would be more efficient to
convert a piece at a time, so as part of his "corecleanup" patches he
has converted almost all of the core code to use the DIR_DX2 arrays
(with "rotational" system) while leaving the GUI and perhaps other code
with the DIR_DX arrays (with "vertical" system). The biggest problem I
see with this is that it's very difficult to tell when code overlaps
because "dir" is passed around so frequently in function calls. I also
think it duplicates work because you have to reintroduce the "magic"
code to the regions that still use the old system. Ross, on the other
hand, believes that by doing it piece-by-piece you are better able to
isolate the changes for testing/review, and you can go ahead and start
getting the benefits of the new directional system right away.
In summary, we all want to use the "rotational" system but disagree as
to how to best do the conversion.
The DIR_DX2 system, by the way, was recently introduced to FreeCiv by
(IIRC) Thue. But, he didn't get very far in converting FreeCiv over to
its use: it's only used in one place.
jason
- [Freeciv-Dev] Re: the directional system, (continued)
- [Freeciv-Dev] Re: the directional system, Raimar Falke, 2001/09/07
- [Freeciv-Dev] Re: the directional system, Ross W. Wetmore, 2001/09/07
- [Freeciv-Dev] Re: the directional system, Jason Dorje Short, 2001/09/08
- [Freeciv-Dev] Re: the directional system, Raimar Falke, 2001/09/09
- [Freeciv-Dev] Re: the directional system,
Jason Dorje Short <=
- [Freeciv-Dev] Re: the directional system, Raimar Falke, 2001/09/09
- [Freeciv-Dev] Re: the directional system, Jason Dorje Short, 2001/09/09
- [Freeciv-Dev] Re: the directional system, Raimar Falke, 2001/09/09
- [Freeciv-Dev] Re: the directional system, Jason Dorje Short, 2001/09/09
- [Freeciv-Dev] Re: the directional system, Raimar Falke, 2001/09/09
- [Freeciv-Dev] Re: the directional system, Thue, 2001/09/09
- [Freeciv-Dev] Re: the directional system, Ross W. Wetmore, 2001/09/10
- [Freeciv-Dev] Re: the directional system, Thue, 2001/09/09
- [Freeciv-Dev] Re: the directional system, Raimar Falke, 2001/09/09
- [Freeciv-Dev] Re: the directional system, Thue, 2001/09/09
|
|