I recently commented on John Twiddy’s designation of foreground in LN and LN2. I thought to share a couple of observations in support of my belief that is was a manual process and what will therefore be automated in Integrator 2012.
First thing first, a mistake
This is LN2, first level, first screen! In order to make it more evident I changed Armakuni’s colour to white:
The mistake consists in the fact that the “Z coordinate” (I will comment on what I mean with that in a separate post) of one of the objects is wrong so that when Armakuni walks in front of it he appears behind it. It only takes a single POKE in the right place to fix:
Secondly, how was foreground designated?
I will first show you what John used to define foreground in the first screen in LN2 level 1:
One might say that for small objects it all looks in good order (e.g. drums, trumpet). An obvious question is: what are bricks doing here?
The answer is quite obvious. Let’s focus on the red curtain and comment on that one first. The building block for the red curtain is quite small, where the building block for walls is bigger:
In order to define a homogeneous foreground area (i.e. without holes in it) it does not quite matter which blocks we use as all we want is to just mask certain parts of the background in order to make them foreground. In fact, we use blocks as masks while designating the foreground, so unless we have to stick to a particular shape (drum, trumpet, tree, box, etc), we can choose which blocks to use as mask. Which blocks do we choose then? That is simple: we use the largest ones so that we only have to use a few of them to designate a homogeneous area of foreground than it would take if we used smaller blocks. It does save precious memory on a 64k system 🙂
What about the huge wall at the lower right of the screen? Why is it there? Armakuni falls through the trapdoor when the latter is open, so that the wall serves as a mask to hide him while falling through.
In essence, the way the game sees the foreground designation for screen 1 is what we see in the image below, with the additional information about the “Z coordinate” of each masking object:
Some reader might appreciate the fact that the mask blocks used to hide Armakuni while falling through the trapdoor are 1 pixel too high (this is not about their position as objects can be moved around by multiples of 8 pixels only; the extra pixel is part of the bitmap itself). What this means is that when Armakuni is walking on the platform at the lower right, his sprites will always have more bits deleted than required (check missing sprite pixels where white rectangles are):
It is OK on the left:
Right, this is a further proof of the fact that the designation of foreground and the screen design were disjointed tasks requiring different skills.
More examples of foreground designation
A few more examples, just for fun and to test the engine in Integrator 2012 🙂
In screen 4 it also appears that the screen was changed after the foreground designation was completed as the latter does not match some of the elements in there (look at the bushes):