New games every week!
JSE - Compressing the Sprite - Part Two Blog
15th April 2021
Bow Wow, Platdude Bob!!!!000!!!

-=-=-



Symbol 1,"0__0,II0!II0!I0!B,0.B0B0B0?W0!W0W0?W0W";


That there is the symbol data for a standing Platdude!
The first character, 0, tells the engine that the Symbol is only 8x8 in size.
There's also 1 for a 16x16 sprite and 2 for a 32x32 sprite.

The next two characters are held in reserve for future tweaks, because I mentioned earlier that it'd otherwise be impossible to tweak the data format. With those values at the ready, I can easily rejig it later, and have it recognise older formatted data.
*phew*
That means, at a later date, I can do as Alan suggested in the comments of the earlier post, and start to look into LZW, or other such techniques. I can enhance the compressor whenever I find a better method, bump up the "symbol format" value, and .. bingo.. A better format!

For now, there's not a whole lot of compression. It's a simple "3 of", "4 of", etc type of thing, so any repetitions are reduced.
But it's working, at least.

The symbol is read from the code and loaded into the editor, where you can edit it, then close the editor, and the chunk of symbol code will be overwritten with the new data.
It, of course, requires that all your symbol data is in one place.
Because of this, it currently isn't easy to add comments between symbols or anything like that.
I'm not 100% sure on the best way to allow for that.
Views 83, Upvotes 12  
Jse , Sprites
New games every week!
Site credits : Jayenkai
(c) Jayenkai 2023 and onwards, RSS feed

Blog - JSE - Compressing the Sprite - Part Two - AGameAWeek