so right now i'm working on a game the I'd say is something like Dwarf Fortress, but is considerably dumbed down. Right now i've terrain generation that gives me terrain height, temperature and the resources that correlate from those two variables. namely food, wood, stone and ore. thats all stored in 3 matrices. i was wondering if there was a more efficient method because the matrices really eat up my memory
If the data is all integers from 0 to 255, you can use the asm tool DataString and that will compress a list to 1/9 of the size (and can be used to decompress it as needed). Otherwise, I am not too knowledgeable about BASIC methods of compression, but if they are just integer values, I know of a way to compress and decompress the data as you need in BASIC. The problem is that it is relatively slow and can cause a slowed loading time.
47%? Take a look and try to imagine how cool 100% will be. This has won zContest 2011 and made news on TICalc. This compromise between Assembly and BASIC parses like BASIC and is fast like assembly. Grammer 2
Could you post some of your code on terrain generation? I'm really interested as to how that works.
"Give a man a fish and he will eat for a day; teach a man to fish and he will eat for a lifetime; give a man religion and he will die praying for a fish." - Anonymous
I was actually struggling with a nearly identical problem here, but I never arrived at a solution.
You could store an entire matrix with static size as a list by doing something like:
for the matrix(2)
Every three entries corresponds to a new row. The only problem is that you need to know the size of the matrix ahead of time (if that is indeed a problem).
Also, I'm not sure if that actually takes up less room.