Complete.Org: Mailing Lists: Archives: freeciv-dev: January 2003:
[Freeciv-Dev] Re: (PR#2682) introducing roadstyle and fill_road_rail_spr
Home

[Freeciv-Dev] Re: (PR#2682) introducing roadstyle and fill_road_rail_spr

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: undisclosed-recipients:;
Subject: [Freeciv-Dev] Re: (PR#2682) introducing roadstyle and fill_road_rail_sprite_array
From: "Jason Short via RT" <rt@xxxxxxxxxxxxxx>
Date: Tue, 31 Dec 2002 22:44:03 -0800
Reply-to: rt@xxxxxxxxxxxxxx

On Tue, 2002-12-31 at 05:58, Anthony J. Stuckey via RT wrote:
> On Mon, Dec 30, 2002 at 03:49:12PM -0800, Jason Short via RT wrote:
> > In non-isometric view, there are 16 "cardinal" and 16 "diagonal" road
> > sprites.
> [...]
> > As a side note, there is another possible roadstyle: where we have 256
> > different road sprites, each providing the sprite for the tile providing
> > for all 2^8=256 possibilities of connections in all directions.  Now we
> > have 16x more sprites than in style 1, and the drawing itself is up to
> > 2x faster.
> 
>       How much memory do these sprites take?  16x16 x 256 == 64k?  Or are
> they larger?  I just don't want a megabytes footprint explosion.

It depends on color depth and tileset size.  And some GUIs may compress
the sprites (since they are mostly transparent).  But the approximation
is, naturally, (# of sprites) x (pixels/sprite) x (bytes/pixel).

With a 16bit color depth and 64x32 tileset (equivalent to isotrident;
isotrident is smaller), this would be something like 256 x 64x32 x 2 = 1
Mb of memory (for roads only; rails is another 1 Mb).

Compare that to currently: 32 x 64x32 x 2 = 128k of memory for style 1
(non-iso) or 9 x 64x32 x 2 = 36k for style 0 (non-iso) sprites (again,
roads only).  (Note that style 0 sprites can be additionally compressed
using Daniel's "make sprites smaller" change.  This will also speed up
drawing considerably.)

The idea is to give tileset authors (and users) the choice of which
drawing system to use.  Supporting style 2 will only take a few extra
lines of code, and will potentially allow much better road and rail
drawing.  And eventually (once some other hurdles have been overcome)
there will be the option of using civ3-compatible graphics.

Rafal has pointed out that the civ3 drawing system is, overall, a huge
memory hog.  There are nearly 2000 128x64 sprites, which would take many
megabytes of RAM.  But this is certainly not infeasible - just
undesirable for some users.  And compared to most modern commercial
games these requirements are low.

jason




[Prev in Thread] Current Thread [Next in Thread]
  • [Freeciv-Dev] Re: (PR#2682) introducing roadstyle and fill_road_rail_sprite_array, Jason Short via RT <=