Hi! I have printtok-002.c online. It is a way to print token-compressed strings using my SimpleIO libraries. It is at c65 additions - Manage /ui at SourceForge.net. It's pretty good but has two problems: 1. poor compression ratio (it helped a text adventure's text by a little over 25%) and 2. it requires manual compression. :( I want to improve it by adding support for compressing individual literals by using 5 bits per character for text containing just lowercase and certain punctuation, 6 bits if uppercase is also needed and 7 bits at worst, shortening extended token size after the escape sequence to no more than 6 bits and shortening RLE of spaces to just 4 bits for the length. What do you think? Until I'm ready to implement these, what other ways can I compress strings?
Bridged chat on:
Please support the defense of Ukraine.
Credit card, bank transfer
Bitcoin, Ethereum, Polkadot, USDT
via Unclutter App for Mac
Active forum topics
No Social Media.
All Content Locally Hosted.
Two Terabytes and Growing.
Built on Free Software.
We have complied with zero government requests for information.
It depends on the text that is being compressed. Is it words? Is it sentences? Can people add, change and delete the words and sentences, or is it read only? I try to get some heuristics from the text in my program. How many of various combinations are used? How important is it to compress text? Are there other things that could be removed first? It's good to think about optimizations for speed and size when creating data structures and code.
I rarely, if at all, use compression.
I am compressing the text for a text adventure. The text is mainly sentences the text adventure will reply to the user. The text adventure won't change the text, but I will likely change the text at code time. Right now, the printtok-002 code has two ways of compressing tokens: 32 tokens are mapped in the literals range from 0x80 to 0x9F and 52 more as a % followed by a letter. It also can compress spaces using RLE. I'm wondering if there are any other ways to compress text strings, something I can do before I apply literals compression and support for auromatic compression.
It is currently not essential that I compress the text, as the text adventure's main executable is <8k and the text file is <5k on a Commodore 64--a 64k system. I really like compression, though, and I want to create it for a system with little memory and make it available to other users. As it is a text adventure, I am optimizing for size.