We are the robots: The development of Spare Parts

Introduction:

I'm a big fan of the Forever party and its consistent focus on the 8-bit platforms as well as their 1K compos. Therefore I really wanted to do a production for this party. However with only about 1.5 months between Lovebyte 2023 and Forever demoparty and 1K being quite a bit of space to fill, I went to F#READY and asked if he was up for doing a co-op production between the two of us.

After many evenings of hard work and optimisation, we ended up with a 1K intro for the Atari XE/XL called Spare Parts:

All in all development took about 1.5 months of intense work with 2 persons working on it. In the end we managed to add 3 different types of effects, an executable graphics robot-face image, custom typography, music and progression intro a single (uncompressed) 1K production.

Design:

This intro takes elements from different projects and brought them together into a single, cohesive, production.

Here is the full list of 8 effects and intro-flow that we settled on at the start of the production:

1) Intro text + effect
2) Line select effect #1
3) Robotface effect #1 (gold face)
4) Line select effect #2
5) Title text + effect
6) Robotface effect #2 (blue face)
7) Line select effect #3
8) Final text + effect

The size for this intro was budgeted at about 50% for setup and the main visuals, 35% for typography and robotface graphics and 15% for the music and progression. So let's look into the different elements that made up this intro.

Precalculation:

At the intro startup, we will precalculate and setup a couple of things for use later in the intro:

* Display lists for the intro/text parts, line-selection effects and robotface effect
* Robotface graphics
* Source Graphics for 3 different line-select effects
* Line-select offset table
* Sine table of 256 bytes

And finally we had a few smaller data tables that contained the text-data and some minimal Pokey-chip sounddata.

Visuals - Intro/Title/Outro:

The code for this effect mostly contains of the cusomised font text drawing code, with a relative simple player-missile effect giving the intro-middle-outro parts.

The customised font plotting was done by storing the letters/text as a byte-offset in font-memory, in our case we picked $e100 which had byte-access to most of the capital-letters.

title_text:
dta 238, 238, 8*('S'-65),8*('P'-65),8*('A'-65),8*('R'-65),8*('E'-65), 238,238
dta 238, 238, 8*('P'-65),8*('A'-65),8*('R'-65),8*('T'-65),8*('S'-65), 238

Now to draw the text to screen, we've abused the SET_ADDR function by setting the value directly to a position that somewhat aligns to the middle of the escreen. From here we will draw a total of 16 lines of pixels covering 2 rows of text by directly reading from font memory in rom, transforming the data and plotting directly to pixel memory.

lda $e100,x
and #%10101010
sta (ADRESS),y

The player-missile effect is a sort of xor-walk effect that we change up in color and player-missile shape to be unique for each of the parts. This worked out nicely for our usecase since it is a relative small piece of code that doesnt interfere with the text-drawing process.

Visuals - The Robotface effect:

First of all, the robot-face graphics is precalculated and has its displaylist stored in memory beforehand. Depending on the effect number we'll either recolor it to have a gold or blue palette.


Designing a minimalistic robot face

We tried to design a robotface with a bare minimum amount of data/polygons that would still be recognisable. And towards the end of production we had to optimise the data a bit more to make sure everything would still fit in the size target.

Again, a player-missile effect is used to accompany the background graphics. Since the size-budget was slightly bigger for this part, we were able to create a more complex effect as well to complement the graphics.

Visuals - Line selectors:

These is the effects that took up most of the code in the intro, because the amount of displaylist setup and generated data they required.

At the start of the intro, we generate 3 small pieces of graphics of 256x64 pixels which will be used to determine the shape of the line-select effects, line-offset lookup-table and sinetable. Generating the 3 different shapes was done using some of the ROM-plot routines in 4-color mode using a 1D-dithering technique to make up the mirrored gradients.


Hete line-select aktie!

When the effect is running we'll start generating our custom-display list with offsets for each scanline. This is done by calculating final lineoffsets using sine-table lookups which end up in 0..63 range and then adding 0, 64 or 128 to the offset depending on the effect to access the different shapes. These values are then fed into the lineoffset table to generate the display list.

Music:

Given the scope of the intro, the different effects need of all the assets required, there wasn't a really big size-budget left for the music, so things had to be really tight.

The main idea was to keep the music data extremely tight (8 bytes for lead notes, 4 bytes for bass notes) and build a custom music replayer around this limited data.

The replayer then takes these data streams and reshuffles bits and pieces of them to get different music variations from the same datastream. Then overall channel masking is applied depending on the part of the intro.

Bringing everything together and Intro Progression:

It was a good idea to develop this intro in different steps and having dedicated size budgets For each of the elements that make up the intro. It was only towards the end when everything came together that we had to make slight adjustments or optimisations to the different parts.

To facilitate the handling of different parts different parts, we included 4 fixed tables of 8 values for each effect that contained:
* Effect subroutine high-byte
* Effect subroutine low-byte
* Playfield colors
* Player-Missile colors

So when it came to putting everything together I knew that the sum of its parts would at least end up somewhere within reach of the 1K size limit and we had a reliable way of switching between the different effects.

Conclusion:

It took us about 1.5 months of intense development with 2 people, but I think that we ended up with an intro that is a good mix between showcasing different effects, having custom typography, music and progression.

The intro ended up winning the 1K Atari Intro Competition at Forever 2023.

For more information, you can check out the all the releases from Forever 2023 party here

Return to blog overview