Complete.Org: Mailing Lists: Archives: freeciv-dev: November 2005:
[Freeciv-Dev] Re: (PR#14652) Patch proposal: resources cleanup
Home

[Freeciv-Dev] Re: (PR#14652) Patch proposal: resources cleanup

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
Subject: [Freeciv-Dev] Re: (PR#14652) Patch proposal: resources cleanup
From: "Jerome Plut" <Jerome.Plut@xxxxxx>
Date: Sat, 26 Nov 2005 08:53:52 -0800
Reply-to: bugs@xxxxxxxxxxx

<URL: http://bugs.freeciv.org/Ticket/Display.html?id=14652 >

OK, here are:
 - the rename patch (against SVN trunk) (most of it being done by sed,
   no code modifications; by the way, this includes some updates to
   comments that were already obsolete),
 - and the resource patch (against SVN trunk + rename patch). (I
   briefly recall that this separates specials into resources +
   modifications).

This includes a savegame format change:
 - "savefile.options" holds a list of the names of the modifications
   (in the order in which the bits of the bitvector are saved),
 - the actual modification bitvector is stored in map.modXX_YYY, where
   XX is the index of the half-byte and YYY is nat_y (so this includes
   modifications from 4 * XX to 4 * XX + 3).
 - as for the resources, they are saved via identifier in map.res.

This is still close enough to map.u, map.f, map.n and so on that
keeping compatibility was not too complicated, while at the same time
making the savefile "self-contained" enough if the available
infrastructure is changed or reordered (by the way, I'd like to
see such infrastructure as the Suez canal, solar panels in desert, or
even making offshore platforms infrastructure. And nuclear plants,
close to river/ocean).

(what did the 'u', 'f' and 'n' letters in the 'map.?' savegame indexes
stand for anyway?)

This depends on the "resources" savefile capability. If it is not set,
then default modification bit order is assumed, and an ad-hoc
workaround is used to build the resource from S_SPECIAL_1 and
S_SPECIAL_2. As far as I've tested, this preserves compatibility,
including of courses scenarios with river overlay.

Attachment: rename.diff.gz
Description: application/gunzip

Attachment: resources.diff.gz
Description: application/gunzip


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