Here is a first draft of what I might do. My next engine will come with a converter which reads BDCFF and convert them into a memory saving C64 format.
- There will be the long demanded level feature.
- cavesize will probably remain constant for performance reasons. Intermissions may be 40x22 or 20x12 in the BDCFF file.
- All is subject to change, as this really is just an initial draft.
Code: Select all
Each cave will begin with a standardized structure of mandatory parameters:
Offset (hex), size (dec), meaning:
0000 10 time to solve for each level
000a 10 diamonds needed for each level
0014 1 diamond value
0015 1 bonus diamond value
0016 ln border color (c64 only)
0016 hn background color
0017 ln color 1
0017 hn color 2
0018 ln color 3
0018 hn amoeba color (atari and C64dtv only)
0019 1 bit 2=activeguyscan
bit 3=activeguyisfirst
bit 4=instantlife
bit 5=rewardlife
bit 6=is intermission
bit 7=no scroll
001a 5 Frametime ms +50 for each frame
001f object codes
object codes:
00-7f=regular object code or optional cave parameter
81-9e=level(s) on which the following instruction is executed (bit 0-4=level bits), not supported for variable length objects
ff=level end+animation bits
animations:
bit 0=firefly
bit 1=butterfly
bit 2=amoeba
bit 3=slime
bit 4=biter
bit 5=bubble
bit 6=amoeba_color (atari only)
00: random fill generic
param byte 1: initial fill
param byte 2: top left row
param byte 3: top left column
param byte 4: height-1
param byte 5: width-1
param byte 6: probability 1
param byte 7: probability 2
param byte 8: probability 3
param byte 9: probability 4
param byte 10: element 1
param byte 11: element 2
param byte 12: element 3
param byte 13: element 4
param byte 14: element to draw on ($ff = all)
param byte 15-19: seed for each level
01: random fill economy
param byte 1: probability 1
param byte 2: probability 2
param byte 3: probability 3
param byte 4: probability 4
param byte 5: element 1
param byte 6: element 2
param byte 7: element 3
param byte 8: element 4
param byte 9-13: seed for each level
02: draw a line of an object
param byte 1: object to draw
param byte 2: begin row
param byte 3: begin column
param byte 4: end row
param byte 5: end column
03: draw a single object
param byte 1: object to draw
param byte 2: row
param byte 3: column
04: draw a rectangle of an object, filled with a second object
param byte 1: object to draw
param byte 2: top left row
param byte 3: top left column
param byte 4: height-1
param byte 5: width-1
param byte 6: object to fill with ($ff=don't draw)
Planned after the first alpha release:
##: draw a raster pattern of an object
param byte 1: object to draw
param byte 2: top left row
param byte 3: top left column
param byte 4: amount of rows
param byte 5: amount of columns
param byte 6: distance between rows
param byte 7: distance between columns
##: draw a map of an object (bf=escape byte, value, count)
param byte 1: object to draw
param byte 2: top left row
param byte 3: top left column
param byte 4: amount of rows (must be mod 8 to keep the code simple)
param byte 5: amount of columns
param byte 6 onwards: the map description with LSBs drawn first
##: add an object relative to another (economy)
param byte 1: existing object
param byte 2: object to draw
param byte 3: distance to the right; if the end of the row is reached, the next row is used.
##: add an object relative to another (generic)
Distances are singed bytes.
param byte 1: existing object
param byte 2: object to draw
param byte 3: object to replace
param byte 4: distance x
param byte 5: distance y
##: true random fill
param byte 1: top left row
param byte 2: top left column
param byte 3: amount of rows
param byte 4: amount of columns
param byte 5: element 1
param byte 6: probability 1
param byte 7: element 2
param byte 8: probability 2
param byte 9: element 3
param byte 10: probability 3
param byte 11: element 4
param byte 12: probability 4
param byte 13: element to overdraw ($ff = all)
##: maze with seed
param byte 1: top left row
param byte 2: top left column
param byte 3: amount of rows
param byte 4: amount of columns
param byte 5: wall thickness
param byte 6: path thickness
param byte 7: wall element (ff=don't draw)
param byte 8: path element (ff=don't draw)
param byte 9: type 0=perfect, 1=braid, 2=unicursal (not sure about those, yet)
param byte 10-14: seed for each level
##: true random maze
param byte 1: top left row
param byte 2: top left column
param byte 3: amount of rows
param byte 4: amount of columns
param byte 5: wall thickness
param byte 6: path thickness
param byte 7: wall element (ff=don't draw)
param byte 8: path element (ff=don't draw)
param byte 9: type 0=perfect, 1=braid, 2=unicursal, 3=cavern, 4=crack (not sure about the types 1 to 4, yet)
##: enable diagonal movements
no parameters
##: disable diagonal movements
no parameters
##: amoeba
param byte 1,2:
bit 0-11=time
bit 14=waits for hatching
bit 15=timer starts immediately
param byte 3,4: max size
param byte 5: slow grow speed
param byte 6: fast grow speed
##: amoeba2
param byte 1,2:
bit 0-11=time
bit 13=explode when amoeba 1 is touched
bit 14=waits for hatching
bit 15=timer starts immediately
param byte 3,4: max size
param byte 5: slow grow speed
param byte 6: fast grow speed
##: magic wall
param byte 1, 2:
bit 0-11=time
bit 13=emulates bd1
bit 14=converts amoeba
bit 15=waits for hatching
##: enemydirection
param byte 1, 2:
bit 0-11=time
bit 13=enable autochanges
bit 14=change at hatching
bit 15=start backwards
##: biter properties
param byte 1: delay (0)
param byte 2: element to eat (dirt)
##: bladder properties
param byte 1: collides with (Mrs. Rockford)
##: BonusTime
param byte 1: time
##: BorderProperties
param byte 1:
bit 0=scan on border (true)
bit 6=effects on border (true)
bit 7=wraparound (true)
(using Prof. Knibbles wrapcode, imperfect and with lineshifting for performance reasons)
##: DummyProperties
param byte 1:
bit 0=diamondcollector (false)
bit 6=penalty (false)
bit 7=destructable (true)
##: Effect
param byte 1: element to replace
param byte 2: replacement element
##: use short explosions
no parameters
##: use long explosions
no parameters
##: penalty time
param byte 1: time
##: SlimePermeabilityC64
param byte 1: bit pattern
param byte 2: seed (only effective if used after all maze and random placements)
##: HatchingDelay
param byte 1: framecount (0 means using the traditional 2-seconds-delay)
##: draw a RLE compressed PLCK map (bf=escape byte, value, count)
param byte 1: top left row
param byte 2: top left column
param byte 3: amount of rows (must be mod 2 to keep the code simple)
param byte 4: amount of columns
param byte 5 onwards: the map description
##: draw a RLE compressed CrLi map (bf=escape byte, value, count)
param byte 1: top left row
param byte 2: top left column
param byte 3: amount of rows
param byte 4: amount of columns
param byte 5 onwards: the map description
##: Floodfill (not sure about implementing this, as this really might slow on a C64)
param byte 1: row
param byte 2: column
param byte 3: object to draw
param byte 4: object to replace (ff=pick object at row/column)
##: Boundaryfill (not sure about implementing this, as this really might slow on a C64)
param byte 1: row
param byte 2: column
param byte 3: object to draw
param byte 4: boundary object
All unspecified bits are reserved for future extension and should be set to 0.
I might add some more tweaks to make it most compatible to BD1, BD2, PLCK, 1stB and CrLi.
So what do you think? Any suggestions? Though keep in mind the limited capabilities of a C64.