I'm back, for a short while.... at least...... I'm looking at ways to efficently store game level data.....
My Aquarius game iirc used about 190 bytes to store each level, and the grx are stored in 2x2 tiles.... so using 128 characters, and each block is 4 characters big.... so 1st tile is characters 0,1,2,3.. 2nd tile is characters 4,5,6,7... etc....This gives me 32 different tiles.... but some of the tile characters use 'similar' gfx or identical...
I'm looking to do some kind of Level Draw routine....... a bit etch a sketch style...
Notes so far below....... (uncompleted) but I'd appreciate some comments please...... its based on c64 graphics storage again (each character uses 8 bytes of memory and uses 4 colours) - 1 colour can change on the c64 but bbc can use any....
Cheers, Colin
#############
Tile compressor.....
You only get 32 Tiles of 2x2 Characters to use in the game......Made out of 127 different characters....Character 0, is blank and will NOT be plotted.... It gets ignored and 'does not clear' other gfx.....
Bit 7 of the TILE Number will be Flip GFX Vertically..... (won't work on native c64 but will do on BBC)
Bit 6 of the TILE Number will be flip GFX Horizontally..... (won't work on native c64 but will do on BBC)
Use a table of 128 bytes, to say which characters to use for each of the 32 2x2 tiles.... So we can use 'random' characters for each tile... and not multiples of 4 characters in blocks...
This saves GFX space for repeated characters used in each 2x2 Block..... so you may not need to use 128 8 byte characters (1k of C64).... you could use a lot less..... (but with an overhead of 128 bytes which equates to 16 x c64 single characters)
Bit 7 of the character will be special...... Not decided what to do with this yet - Maybe???
'''''''''''''''''''''''''''''''''''''''''''''''''
Tile Draw'er / Level Compresor.....
Each Level starts with Default Screen positiion offsets flags reset, and with default colours...
## 1st Byte is Tile position on Screen..... You get 240 2x2 Different positions, and this can be expanded... see below....
if 1st byte is 255, then screen position is reset.......( un sticks offsets)... Its default anyway...
if 1st byte is 254, then screen position is offset one char to the right.. and sticks in a flag...
if 1st byte is 253, then screen position is offset one line down.... and sticks in a flag....
if 1st byte is 252, then next byte is change colour 1
if 1st byte is 251, then next byte is change colour 2
if 1st byte is 250, then next byte is change colour 3
if 1st byte is 249, then next byte is change colour 4
This can be expanded....
## 2nd Byte is 'object' type to use..... IF NORMAL TILE
This will be 0 to 31.... You get 31 types of GFX objects to use for level design..... These may me just 2x2 or more complex !!
If 0-31.. then this is a single tile....
If bit 5.... Repeat the Graphic Tile The number of times by the 3rd byte.... eg 32-63
if Bit 6.... type = 0 ... We go Horizontal repeats , if 1 = we go Vertical .. eg 32-63 = horiz,
if bit 7.... if set.... Then ignore bits 5 and 6.... We use Special Tiles with their own rules.... we can have 128 special tiles.... but will probably use a LOT less...
If NOT NORMAL tile... then See above for Colour changes, etc.....
## 3rd Byte is 'object size' .... Used If bits 5,6,or 7 were set.... If not.... Then there is no 3rd byte used....!!!
#####################
To be continued.........

I'll be looking at 'very special' tiles... that have a start tile, a repeated middle tile, and an end tile..... But not sussed this out yet, lol !!!