Complete.Org: Mailing Lists: Archives: freeciv-dev: August 2001:
[Freeciv-Dev] Corecleanup patch update with alternate map topologies
Home

[Freeciv-Dev] Corecleanup patch update with alternate map topologies

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: Gaute B Strokkenes <gs234@xxxxxxxxx>
Cc: freeciv-dev@xxxxxxxxxxx
Subject: [Freeciv-Dev] Corecleanup patch update with alternate map topologies
From: "Ross W. Wetmore" <rwetmore@xxxxxxxxxxxx>
Date: Mon, 13 Aug 2001 00:46:13 -0400

At 02:36 AM 01/08/11 -0400, Ross W. Wetmore wrote:
[,,,]
>>Can you make another patch that incorporates these suggestion?
>
>Will work on it over the weekend as a (number of) patches to 1.12.0.
>
>>-- 
>>Big Gaute                               http://www.srcf.ucam.org/~gs234/
>>Yow!  I'm having a quadraphonic sensation of two winos
>> alone in a steel mill!

The set of patches has been dropped into incoming on ftp.freeciv.org. Here is
a Readme to explain what is there.

Cheers,
RossW
=====
                                                               August 12, 2001

An update to the coreclenaup patch has been put into ftp.freeeciv.org
incoming.

There are 5 parts to the patch which should be applied in the following
order. 

-rw-r--r--  1 rww    users   26419 Aug 12 23:43 corecleanup_05a-1_12_0.gz
-rw-r--r--  1 rww    users   18663 Aug 12 22:26 corecleanup_05b-1_12_0.gz
-rw-r--r--  1 rww    users    1523 Aug 12 22:25
corecleanup_05civworld-1_12_0.gz
-rw-r--r--  1 rww    users   33261 Aug 12 23:49 corecleanup_05mapgen-1_12_0.gz
-rw-r--r--  1 rww    users     666 Aug 12 22:56 corecleanup_05rivers-1_12_0.gz

The first two are mandatory and are separated into generic corecleanups plus
extensive map.c, map.h updates. The civworld patch is required if you want
to use civworld after applying the first two. The mapgen patch is strongly
recommended as the 1.12.0 mapgen has *not* been extensively reworked to
handle non-WRAPX (the default) topologies, nor fix all its map_adjust_*
accesses which will be caught by the fault traps. The rivers patch makes
some of the inland lake systems much more accessible to ships, but is
completely optional. It is trivial enough to even work with 1.11.4.

The primary changes have been to the map macro environment in map.h to add
support for 4 rectangular based map topologies. These are Flat-Earth, standard
(WrapX), Alt-standard (WrapY) and Donut-World (Torus). These can be set from
the server console or config files by setting the "maptype" parameter in the 
range (0-3) - the current default is "1" or WrapX.

There are also extensive corecleanups to convert explicit for-loops and
validity checking, into map macros and iteration loops. While by no means
an exhaustive check, the ability to run autogames to conclusion in a number
of different map topologies from the same binary suggests that much of the 
core code is now "clean" and standardized. But I expect you will tell me
differently in short order :-).

While map generation respects the topological boundaries, there has been no
attempt to rework such things as the "polar" landwall in an Alt-standard
map. Naval vessels must disembark cargoes and physically move them across
the ice to the otherside of the world. Because the client doesn't really
scroll the map correctly in "Y" or truncate in "X" the left and right edges
are obvious only when continents flatten out against them, and the "Y"
connectivity is *not* obvious.

The main area for further work appears to be the client GUI. A number of 
changes were "hacked" to prevent GUI crashes. But there appears to now be a 
need to make a similar GUI-cleanup. This is not so much a standardization 
update as reworking some of the algorithms to take into account the variable
topologies. There is a lot of old explicit standard WrapX code that probably
now needs to be generalized.

To this end, an extensive set of map coordinate macros have been added in 
map.h. These include explicit truncation and wrap operations, plus improved 
docs on just what the existing macros actually mean. It is likely that many 
GUI problems are simply hand coding errors or misuse of existing macros - 
now there are varied explicit flavours for most required operations.

The block_iteration macros may also be useful to traverse or window an 
arbitrary rectangle into real map coordinates. i.e.

  block_xy_iterate2(xy,x,y,x0,y0,x1,y1) {
    <loops over "normalized" x,y and xy values, for the block defined
     by the arbitrary points (x0,y0) and (x1,y1)>
  } block_xy_iterate2_end
  
As a note, assert-like traps are present in many forms in the current code.
Many can now be turned on/off from map.h if the load gets too high.

Finally, the performance stats are not significantly different than for 
earlier hard coded versions and should improve when some of the debug code,
asserts and such are tuned down.

Enjoy
RossW
=====

Not a direct comparison as the map and game evolution are different.

1.11.10

real    15m34.977s
user    2m3.620s
sys     0m0.430s

corecleanup_02 (profiled)

real    16m25.436s
user    3m28.380s
sys     0m0.680s

corecleanup_02 

real    14m53.926s
user    1m27.970s
sys     0m0.250s

corecleanup_03debug

real    15m22.872s
user    1m49.620s
sys     0m0.460s

WRAPY world, generic topology fixes

real    15m30.375s
user    2m3.380s
sys 0m0.370s

Donut world, generic topology fixes

real    15m40.701s
user    2m22.100s
sys 0m0.570s




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