LN2 foreground definition

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:

An obvious overlapping mistake in LN2 by Luigi Di Fraia

An obvious overlapping mistake in LN2

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:

Fixed screen in LN2 by Luigi Di Fraia

Fixed screen in LN2

Secondly, how was foreground designated?

I will first show you what John used to define foreground in the first screen in LN2 level 1:

Foreground designation for screen 1 in LN2 level 1 by Luigi Di Fraia

Foreground designation for screen 1 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:

Two building blocks in LN2 level 1 by Luigi Di Fraia

Two building blocks in LN2 level 1

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:

Foreground mask for LN2 level 1 screen 1 by Luigi Di Fraia

Foreground mask for LN2 level 1 screen 1

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):

Foreground is one pixel off on the right by Luigi Di Fraia

Foreground is one pixel off on the right

It is OK on the left:

No pixel off by Luigi Di Fraia

No pixel off

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 🙂

Foreground designation in screen 2 LN2 level 1 by Luigi Di Fraia

Foreground designation in screen 2 LN2 level 1

Foreground designation in screen 3 LN2 level 1 by Luigi Di Fraia

Foreground designation in screen 3 LN2 level 1

Foreground designation in screen 4 LN2 level 1 by Luigi Di Fraia

Foreground designation in screen 4 LN2 level 1

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):

LN2 level 1 screen 4 by Luigi Di Fraia

LN2 level 1 screen 4

This entry was posted in Retrocomputing, Technical and tagged , , , , , , , . Bookmark the permalink.

One Response to LN2 foreground definition

  1. Pingback: One day I’ll get them all fixed and release an updated version | Luigi Di Fraia's e-Footsteps

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s