Complete.Org: Mailing Lists: Archives: freeciv-dev: March 2006:
[Freeciv-Dev] (PR#15929) Variable specials
Home

[Freeciv-Dev] (PR#15929) Variable specials

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
Subject: [Freeciv-Dev] (PR#15929) Variable specials
From: "Jerome Plut" <Jerome.Plut@xxxxxx>
Date: Thu, 16 Mar 2006 05:13:31 -0800
Reply-to: bugs@xxxxxxxxxxx

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

The following is an attempt at a patch that allows the user to define
the tile specials. This is a work in progress: the patch attached
compiles and runs well, but is yet a cross-breed between constant
specials and variable specials. The design is as follows:
 * of the specials, four remain constant: S_HUT, S_RIVER, S_POLLUTION
   and S_FALLOUT. But the general syntax applies to them, so that the
   spec-file author has only one syntax to fill in eg. helptext.
 * this of course poses the problem of unit activities, as
   ACTIVITY_ROAD would have to guess which special is a Road. So I
   added two values to enum unit_activity:
   (think CtP here, though this is built by Worker/Settler units)
    - ACTIVITY_INFRASTRUCTURE builds a given special,
    - ACTIVITY_TERRAIN changes the terrain to a set terrain.
   (as a special case, ACTIVITY_INFRASTRUCTURE with argument
   S_POLLUTION or S_FALLOUT *deletes* its argument, of course).
 * The specials have special flags describing how they behave; see
   common/terrain.h .
 * The specials have dependencies/exclusion relationships. For
   instance
[special_farmland]
requires = "Irrigation"
excludes = "Mine"

The attached patch uses nasty workarounds to keep code compatible:
#define S_ROAD (get_special_by_name ("Road"))
etc.

I plan to first drive tose out of server-land by making a 'translation
layer' in packet-handling and savegame-loading that change
ACTIVITY_ROAD (and so on) to new values with appropriate arguments;
and only then changing the client, as this will obviously be much
longer and harder. I'm starting this part right now.

Also, this changes things a lot in drawing; the quality of road and
rail drawing with the current patch is _not_ acceptable, so I do not
propose to apply it 'as is', but rather as a basis that can be
improved. If anybody wants to contribute to this part for example,
I'll of course welcome any help; else I'll try writing it eventually,
but I'm not that familiar to tilespec code.

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


[Prev in Thread] Current Thread [Next in Thread]
  • [Freeciv-Dev] (PR#15929) Variable specials, Jerome Plut <=