CharPad Glaze User Manual - Subchrist Software, 2020.

What is CharPad Glaze?


CharPad Glaze is a graphics data creation/visualization/proofing tool that takes two CharPad projects as input and combines and transforms their data to produce a new set of data suitable for use by a double-layer map renderer.

Examples of double-layer rendering can be seen in the Commodore 64 games Hawkeye (Thalamus, 1988) and Flimbo's Quest (System 3, 1990).

The current version of the software supports horizontally scrolling, untiled maps.


Double-Layer Map Rendering...

The basic idea is quite simple, two separate character maps are used, a foreground map and a background map, the character images referenced by the maps will be contained in a single character set (containing up to 256 images).

The renderer draws the visible part of the foreground map to the screen until a particular character image designated as 'transparent' is encountered...

when this happens, the 'transparent' character image is ignored and a character image from the background map is drawn at that location instead.

This produces a transparency effect where areas of the foreground map designated as transparent allow us to see through into the background map.

Each map can have it's own 'camera position', so if scrolling is to be performed, the maps do not have to scroll at the same speed and if the background map is scrolled at a slower speed than the foreground map then we can create a "parallax effect" where the background map appears to be further away.


Smooth Scrolling...

The Commodore 64's graphics chip (the VIC-II) supports single pixel (smooth) scrolling when in character mode, the (character) screen contents can be visibly shifted by single pixel increments, vertically and/or horizontally, by 0 to 7 pixels.

Smooth scrolling on the VIC-II is an "all or nothing" process, there is no hardware support for map layers and the VIC-II only sees one layer, ie. whatever character images are currently visible on the screen.

So a little bit of illusion becomes necessary if we want to use hardware pixel scrolling and have the foreground and background layers move at different speeds or directions, or for one layer to be kept stationary while the other moves.

The illusion is enabled by creating a four-stage animation out of the entire character set (resulting in four character sets) and using char-set switching to flick between the sets.

The character images used in the foreground map will remain unchanged in each set, but those used in the background map must be animated to give the impression that they can be hardware pixel-scrolled.

An animation must be made of each background character image scrolling by two pixels (per frame) whilst pulling in pixel data from the image next to it.

If an image happens to appear on the very edge of the map (opposite to the scroll direction) then only blank data is 'pulled in' as it scrolls.

The end result will be four character sets, flicking between them it will be seen that the foreground images remain identical in each set and the background images appear to pixel scroll horizontally (by two, four or six pixels).

It may not look like much but we now have the ability to hardware-fine-scroll the entire scene and the ability to software-fine(ish)-scroll the background layer.

nb. The reason for having only four stages to the animation is simply because if, ideally, we had eight stages, the character sets (eight of them) would occupy the entire 16KB video bank leaving no room for sprite images or the video matrix itself.

nb. A single character set of 256 images occupies 2KB, so the effect requires 8KB (1024 images max).


Selecting Projects...

You will need to select two existing CharPad projects whose data you want to combine/convert.

One of the projects will be used as the background map layer, the other as the foreground layer, these can be selected using the menu items or toolbar buttons.

Both projects should be untiled and use per-char colouring.

Areas of the foreground map that you want to appear transparent should be filled with char-image zero (0).


Building...

When two suitable projects have been chosen, select Build from the menu or toolbar.

The character sets from the two projects will be combined/converted into a set of four (quite similar looking) character sets.

If the process is successful, the maps will be displayed and each layer can be independently scrolled for inspection by using the scroll bars at the bottom of the window.

All of the generated data (four character image sets + image attribute data + two maps) can be exported by choosing the export option from the menu.


Notes...

A good way to visualize the animation technique is to imagine the four character sets as a stack of four sheets, the animations (of the background images pixel scrolling) can be thought of as occurring vertically between the sheets rather than within them.

CharPadGlaze permits more than 256 character images per set, the Commodore 64 does not, it is therefore important that the required image quantity be checked for usability before export.

ie. Make sure the results of the build results in 256 character images or fewer per-set.


Credits

Running on Linux using Mono