| Posted By
Harry Potter on 2022-01-06 15:17:04
| Help wanted optimizing text adventure code
Hi! As you probably already know, I wrote some code for a text adventure for the Vic20 and the 16k C16 called AdvSkelVic65. It is the bare bones for a text adventure and was written to be as small as possible. You can find it at https://sourceforge.net/projects/cc65extra/files/game/. I'm asking for help to optimize it further. Any ideas?
|
|
Posted By
Mad on 2022-01-08 12:39:07
| Re: Help wanted optimizing text adventure code
Hi! I just looked briefly over the code some days ago. I just found some c files and some s files. I am not so into text adventures but some technique I used for a project of ours is to just use bitstreams instead of bytes. So if you know that for instance a switch only needs one bit you could encode it as one bit already. Or if you just have lower case letters in your texts you could encode them as 5 bit values. I know you already did your project so this suggestion is senseless for you, but I found it to be a great improvement in the amount of memory used in our case. (maybe you do that or other text optimizations already, too.) Good luck with your project.
|
|
Posted By
Harry Potter on 2022-01-08 12:55:37
| Re: Help wanted optimizing text adventure code
I thank you for your advice, but the problem with your technique is that I'm also using uppercase and control characters. I could use my own rendition of ZX0, a compression technique about which somebody on an Atari forum told me. It does a little better than the original. Right now, it is not worth it, as I am only using a little RAM, but, as I'm using a system's extra memory in an upcoming version of this code, I can compress the text files and decompress them upon loading. It would cost more RAM but can save space on a disk image for large text adventures.
|
|
Posted By
Harry Potter on 2022-01-09 07:34:28
| Re: Help wanted optimizing text adventure code
Codey on the Lemon64 forum told me that I can tokenize often-used words or phrases to one byte. That is a good idea. Now, how can I optimize the code as it stands?
|
|
| |
Copyright © Plus/4 World Team, 2001-2024. Support Plus/4 World on Patreon |