A downloadable game

LIFE RAFT RESCUE TEASER ART

Roman Werner submitted a game called Life Raft Rescue to the 2021 10 Liner competition. On February 4th, 2021 he tweeted a full screen teaser image https://twitter.com/romwer/status/1357430676396646407 to “give the feeling for the setting of the game.” I replied asking if he was planning on trying to also make the image into a 10 line submission to the contest. He said he had not considered it, but thought maybe it was worth a try.

For some reason I kept thinking about it and due to the number of characters and colors thought maybe some loops and compressed data could work. I tried many different methods and kept coming up 150-200 bytes too long for an 80 character/line entry. After much frustration I thought maybe I could break the image into different types of routines;

repetitive characters and detailed petscii. The sky and water was the bulk of the image and used very few characters and very few colors. This could be done with compressed data and a couple loops and then maybe there would be space to print petscii color and graphics for the ship, helicopter and life raft.

This concept ended up working for this image. I printed screen code characters as compressed data, then read it back into arrays. I then uncompressed and poked the data in a couple loops to draw the sky and sea. There was just enough space remaining to print the ship, helicopter and life raft.

COMPRESSION

Each byte of data for sky and sea is split into 4 bit pieces. The high nibble represents the character and the low nibble is the number of iterations of the character, so 16 possible characters and 16 possible iterations. Character 0 is reserved as color flags, so any number under 16 will change the color variable and then read the next byte of data.

It took 254 bytes to encode the sky and sea. I printed this data as petcsii to the screen and then ran a loop to read the data into an array. I chose the most used characters of the sky and sea to be in the character array which was 15 characters plus the empty slot for the color flag.

Thanks to Roman for the wonderful image with some historical meaning (check his game info page, Life Raft Rescue, for a link to the history) and for giving me his blessing to submit this in the competition in the LOOK category.

GENERAL CODE DESCRIPTION

Lines 0-3 - printed petscii data

Line 4 - end of petscii data, dimension arrays and load data into arrays

Line 5 - Main loop start, check color flag, petscii for ship as data statement

Line 6 - Iteration loop, poke color and character to screen, check for end of data flag

Line 7 - Read ship data as strings and print, print helicopter blades and upper section

Line 8 - Print most of the rest of the helicopter

Line 9 - Print last of helicopter and then life raft, wait for keyboard input, clear screen


DETAILED CODE DESCRIPTION

Lines 0-3 - Print data
Line 4 Print last few data characters
dId(254),h(254) - Dimension data and character arrays
s=1023 - screen location variable minus 1
fOi=1to254 - loop to read data from screen
d(i)=pE(s+i) - data array from first 254 characters on screen
h(i)=pE(1277+i) - character array from 16 characters on screen
nE - end of loop
?”{clr} - clear screen (don’t need end quote if last thing on line)
Line 5 a=a+1 - counter for pulling data from data array
ifd(a)<16tHc=d(a) - color flag - changes the color variable if data is less than 16
gO5 - go back and increment the counter to get next data if color flag occurred
dA”...” - ship data strings
Line 6 fOj=1to1+(d(a)aN15) - loop for iterations based on low nibble of data (AND15)
s=s+1 - increment screen location variable
pO54272+s,c - poke color into screen ram
pOs,h(d(a)/16+1) - poke character to screen (upper nibble, decimals ignored)
nE - end of iteration loop
on-(d(a+1)<>2)gO5 - check for end of data flag and go back if not 2
Line 7 rEa$,b$ - read in ship strings
?sP33)a$sP26)b$ - print ship strings
?sP5)”...” - print helicopter blade
?”...” - print helicopter tail
Line 8 print rest of helicopter and life raft
Line 9 More helicopter and life raft
wA198,1 - wait for key press before continuing
?”{clr}{lt blue}” - clear screen and change cursor to light blue

Download

Download
LIFE RAFT RESCUE TEASER ART.pdf 33 kB
Download
lrr teaser art.d64 170 kB

Leave a comment

Log in with itch.io to leave a comment.