Wednesday, June 13, 2012

ghost busting with spr2png.pl

No matter how much I improved SEDS, I still can't "optimize" my spriteset below 1024 tiles without messing up something. So I had to admit a disturbing possibility: maybe my tileset is *really* corrupted, and has been so unnoticed for some times ... maybe I'm suffering the equivalent of infamous cross clusters.

Let's recap: in .spr files, you find BLCK section that provides you the tile number for each block (logical entity) on that page. Then, you'll find one FREE section per "ram type" (block, sprite, streamed animations and drafts) telling you which tiles could be reused because you deleted its content. Good so far... except when they disagree.


Corriger ce spriteset de la school zone s'avère décidément plus complexe que prévu. Après une nouvelle série de corrections apportées à SEDS, toujours pas moyen d'avoir les bonnes images. En tentant de "rétrécir" les images, je me retrouve avec plusieurs sprites qui partagent les même données. Un vrai méli-mélo (in)digne du système de fichier FAT sur lequel tout celà est sauvé.

Permettez que je vous passe les détails techniques: il y a deux marquages des tiles occupés dans un fichier .spr (disons "vertical" et "horizontal"), et là, ils ne sont plus d'accord. Une stupide erreur au moment de sauver les sections 'FREE' des différents types de graphismes.

I already had modified spr2png.pl tool with a --cleanup mode that renders horizontal stripes accross tiles that weren't listed in any BLCK section earlier in the week, and now I've just added vertical stripes on tiles that are listed in the FREE section. We should thus see only solid sprites or 'dotted' tiles. But that's not exactly what happens: instead, I've got quite a lot of sprites with vertical stripes, that are thus supposed to be kept, but that could be erased as soon as I'll start editing new stuff.

My first mission, should I choose to accept it, will be to fix the .spr file so that all tiles stay safe. Then will come the hard stuff. Where in the code is the ghost maker... Have I forgot to adjust free lists when copying things around between spritesets?

Hopefully, not. It seems to be simpler than this: I have 3 FREE sections for the 'sprite' tileset. My bet is that I failed to set the proper spriteram identifier and have all "sprite, draft and streamanims free tiles" applied on the sprite tileset ^^"

No comments: