Character set

From MZXWiki
(Redirected from Character Set)
Jump to navigation Jump to search

Many limitations in Megazeux have been expanded and removed over the course of its development, but one of the long standing limits that is unlikely to be removed any time soon is that only 256 characters are available for use in a game at any one time. In order to manage complex artwork across a large game, it is almost always necessary to maintain multiple character sets and import them with the load char set "charset.chr" command during gameplay. This was added to MZX in version 2.00

In the beginning, character sets were always exported and loaded as complete, 256 character blocks. This strongly tied character sets to boards, since it made most sense to load new sets on board transitions. Minor artwork changes were generally handled using char edit commands, since it didn't make sense to keep an entire 3.5KB (8x14x256 bits = 3584 bytes = 3.5 KB) file for just one change.

Exophase was the first person to realize the possibility and usefulness of partial character sets, which have been usable in a limited fashion since character sets could be loaded. While tooling around with C, trying to learn it by writing a small utility to generate character sets, a coding error produced incorrectly sized sets. On a whim, he loaded one in MZX and discovered that it only overwrote part of the set. Partial char sets were first put to use in Soul Excursion during the Winter 2000 Day of Zeux, saved with the extension .ch2 to distinguish them from normal sets.

The discovery of this undocumented feature meant that it now made at least some sense to use character sets to hold individual, smaller pieces of artwork. While it still makes sense to associate boards or artistically similar sections of a game with complete sets, artwork for dynamic elements like enemies or other game actors can be loaded separately depending upon the needs of a given board. This didn't become truly powerful until MZX version 2.65, however, when Exophase added syntax to the load char set command to support loading to an offset, and the editor was updated to allow saving them easily. Partial sets can be loaded to an offset using load char set "@###partial.chr", where ### is a decimal number (and can thus be easily interpolated). They do not wrap around if there are more characters in the set than space after the offset.

Since the port, many features have been added to the editor to make manipulating character sets easier, including the ability to edit multiple characters at a time in a large block, the ability to export a series of partial sets from the current set as an animation, and a protected character set used for displaying editor dialogs so that the font characters can be more easily overwritten and used for other things.