Assets: Chunks

Chunks are sections of a bitmap that have been cropped and saved into binary files. They are loaded in-game to animate these sections of the screen (see for example the 8bit-Goblin tech demo).

To start with, produce images with modified sections and convert them for the target platforms. In the example below, the left image is saved as full bitmap, whereas the right image is used to produce chunks.

Bitmap FileChunks File

Next, use a text editor to create a chunk definition file. It is a list of chunk names and location, in the format: ‘input file’, ‘output file’, [x,y,w,h]

Here is an example of chunk definition file:

‘chunks1-apple.png’, ‘chunk0.dat’, [ 14, 50, 21, 46] # Notable animation
‘chunks1-apple.png’, ‘chunk1.dat’, [ 91, 50, 14, 20] # Old men animation
‘chunks1-apple.png’, ‘chunk2.dat’, [112, 58, 7, 18] # Bottle removed
‘chunks1-apple.png’, ‘chunk3.dat’, [ 28, 50, 7, 18] # Sausage removed

Please note that some restrictions apply to the coordinates of chunks, depending on the target system. Please refer to the table below:

X/W restrictions Y/H restrictions
Apple//eMultiple of 7 (e.g. 0,7,14…)N/A
Atari XL/XEMultiple of 4 (e.g. 0,4,8…)N/A
C64 Multiple of 4 (e.g. 0,4,8…) Multiple of 8 (e.g. 0,8,16…)
Atari Lynx Multiple of 2 (e.g. 0,2,4…) N/A
Oric 1/Atmos Multiple of 3 (e.g. 0,3,6…) Multiple of 2 (e.g. 0,2,4…)

Finally, remember to enter the chunk definition file in the relevant entry of the project builder.