Complete.Org: Mailing Lists: Archives: freeciv-dev: August 1999:
Re: [Freeciv-Dev] terrain ruleset implementation
Home

Re: [Freeciv-Dev] terrain ruleset implementation

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: freeciv-dev@xxxxxxxxxxx
Subject: Re: [Freeciv-Dev] terrain ruleset implementation
From: Tatu Rissanen <trident@xxxxxxxxx>
Date: Sun, 1 Aug 1999 14:22:39 +0200 (EET DST)

> David Pfitzner wrote:

> Now maybe that compatibility break could better be used to move 
> to a more flexible system.  (Though its hard to see how to 
> future-proof against the above problem of effectively requiring
> additional graphics to work properly.)  When the --tiles option
> was first implemented, it was proposed to have a ruleset-like 
> 'spec' file for each tileset, telling the filenames, tile 
> geometries, etc.  But that hasn't been implemented so far.  
> And its still complicated how to coordinate with the 
> units/terrain.ruleset to specify which graphic is used for 
> a given unit/terrain.

Here are some thoughts I had. (probably going to the wish list)
Implementing these would require major changes to graphics loader 
and renderer modules. The 'spec' file would require a parser, too. 

The 'spec' file could look like this:

[gfx_arctic_ne]
file=classic/terrain.xpm
geometry=30x30+150+30
offset=+0+0

[gfx_arctic_ews]
file=classic/terrain.xpm
geometry=30x30+180+30
offset=+0+0

[gfx_farmland]
file=trident/miscellaneous.xpm
geometry=30x30+120+0
offset=+0+0

First there is a tag identifying the graphics element. Ruleset 
files could refer to a specific graphics element using those tags.
Then there should be the name of the file and exact location and 
size of the graphics within the file. The offset tells where to 
render the graphics relative to the square.

Should there also be layer information? Grassland and ocean 
would be the bottom layer on which terrain graphics is rendered. 
Above terrain is improvements, then specials, etc.

The geometry and offset information can be used to squeeze out
some 'air' from graphics files and also to reuse some graphics 
like city size indicators and the current grassland tiles. 

If the byte size of graphics files has to be reduced, the graphics 
could be allowed to be constructed from several pieces. The acrtic 
north-east element could be a combination of arctic north and arctic 
east. 

When a new game starts the server could send the graphics element 
tags needed during the game to clients. (at least non-standard tags)
This way clients could determinate whether they are capable of 
presenting the game with the current tileset. If the client fails 
then another tileset should be selected.


-- 
Tatu Rissanen
tatu.rissanen@xxxxxx

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