- EnchWood (RougueLike, TI-84+CE) (paused)
- 14 Nov 2018 11:12:13 pm
- Last edited by beckadamtheinventor on 26 Nov 2018 11:29:52 am; edited 1 time in total
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% )
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
Using this method, it is possible to fit 256 sprites (8x8 pixels each), a size of 16896 bytes, into only 1536 bytes!
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.
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% )
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
Using this method, it is possible to fit 256 sprites (8x8 pixels each), a size of 16896 bytes, into only 1536 bytes!
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.