Login [Register]
Don't have an account? Register now to chat, post, use our tools, and much more.
I have been working on another game, titled 'EnchWood'. This game will be a rouguelike, and written in ICE.
I have made numerous optimizations to the game's sprite data, which I will explain below, in the hopes that I'm not the only one to make use of this method.

I am not 100% decided on a storyline. (not even 10% Razz )
The engine concepts are done, but not the actual engine.

<explanation>
An 8x8 pixel sprite on the TI-84+CE (in ICE, Asm, and C) is 66 bytes.
I have managed to compress this down into aproximately 1/11th of this size Very Happy
Using this method, it is possible to fit 256 sprites (8x8 pixels each), a size of 16896 bytes, into only 1536 bytes! Very Happy Very Happy Very Happy

This method is possible due to palletizing the data, and a bit of randomization (which is perfect for a rouguelike!)

So I'll start with the compressed data (written in binary), and decompress it, step by step.

The first two bytes are meta, broken into sets of 4 bits
0000 0001 0010 0011

The second four bytes are broken into sets of 2 bits (each set is one pixel)
00 00 00 00
00 10 01 00
00 11 10 00
00 00 00 00

Those dibits (2 bits each) are used as 'weights' for randomizing areas of the end product: an 8x8 sprite.
The higher the dibit, the higher the result is likely to be.
The result of this is used to get one of the 'meta' nibbles, and the resulting nibble is used to get a color from the current palette.
The randomization is done for each pixel of the resulting sprite.
The resulting sprite varies due to the randomness.
Possible result (in pallete indexes):
0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0
0 0 2 1 0 1 0 0
0 0 1 2 1 0 0 0
0 0 1 3 1 2 0 0
0 0 2 1 2 1 0 0
0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0

This result is then used as an index for an 8bpp (xlib) palette, and can finally be displayed.
(The sprites can be decompressed at runtime, for speed)
</explanation>
Yes, I know that this method is nothing new, but it might be new for some people.
Do you have to have a modified xlibc palette for these to make sense visually because there’s no difference between high values and low values except for the blue component?
Hi beckadamtheinventor,
I really like roguelike games and i really hope you will arrive to follow your idea to arrive on a complete game version to share with our community.
Concerning your compressing method 1/11 is a very very good rate !
I saw a lot of zero in your sprites data, i think you have already thinked to use a kind of "radius" value to specify for your decompressor where it can add 0. (outside the radius)
Good luck
johnbchron wrote:
Do you have to have a modified xlibc palette for these to make sense visually because there’s no difference between high values and low values except for the blue component?

The final resulting sprite is a set of palette indexes.
The palette varies by area, allowing for more color customization.
I have a couple palettes at the moment, but I plan for at least 4.
some thing like this?
https://static.makeuseof.com/wp-content/uploads/2014/06/coffeebreak-roguelikes-intro1-670x335.jpg
Also how are you the tile map?
How does you movement work?
  
Register to Join the Conversation
Have your own thoughts to add to this or any other topic? Want to ask a question, offer a suggestion, share your own programs and projects, upload a file to the file archives, get help with calculator and computer programming, or simply chat with like-minded coders and tech and calculator enthusiasts via the site-wide AJAX SAX widget? Registration for a free Cemetech account only takes a minute.

» Go to Registration page
Page 1 of 1
» All times are GMT - 5 Hours
 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum

 

Advertisement