[messages] [Developers] Re: tile cache test build

Joel Uckelman uckelman at nomic.net
Sun Oct 24 05:54:14 MST 2010


Thus spake george973:
> I'm not sure how you handling zooms etc in your cache but would it be an
> idea to tile the map images when they are loaded in the editor and save
> the tiles in the module (instead of the whole image) at zoom = 1.0.

I'm making tiles for each scale fator 1/2^n, for all n >= 0, until some
dimension of the tile would be less than 1 pixel. There are two reasons for
making a full image pyramid beforehand: 

1) High-quality scaling isn't very fast. I don't see that it can be made
much faster---it's the most-optimized part of VASSAL there is.

2) The further you zoom out, the more pixel data goes into each tile,
which means that zooming out on the fly becomes more memory intensive 
as you go. Having most of the work done beforehand means that you can
take the nearest level in the image pyramid and scale from that instead.

> You could then serve the tiles from the module or if that is too slow
> extract the tiles at startup or just save each tile locally after the
> first use.

I had thought about that, but it would more than double the size of 
modules if they had to carry around all that tile data. Disk space
is cheap and plentiful these days; bandwidth, not so much.
 
> This would avoid filling the user disk with vast numbers of
> tiles/directories from different games and fix any naming problems (the
> tile files could be named image0tile0x0, image0tile0x1 and so on.
> Downside would be needing to keep tile objects (but not the image part)
> for every active map in memory all the time and user would need to
> reconstruct map image to edit it (if he didn't keep a copy). Imagesaver
> could do that with an empty map of the board required

I'm fixing naming problems through filename munging. This should't be
a problem.

Storing only tiles in modules will be inconvenient for module designers.
There is already a tool for reassembling tiles into complete images, but
I was hoping that nobody would need to use it.

-- 
J.


More information about the messages mailing list