Home
  Introduction
  Odiesoft demos
  Odiesoft games
  CPC Party pictures
  Downloads
Anime
Party pictures
Guestbook
Links
Contact

The Amstrad CPC Keyboard Clash

 

As some of the regular CPC users may know, sometimes when you type very fast additional characters are printed on the screen. Characters whose keys you didn't press. For example when you type "MODE" it sometimes happens that the word "MODKE" is being printed on the screen.

Amstrad CPC Keymapping matrix
The Amstrad CPC keymapping matrix
This is due to the way how the CPC checks the keyboard for pressed keys. The keys are all mapped to a matrix with 10 columns and 8 rows. The CPC then goes through each columns and each row and checks where key-presses were detected. The problem is that when three keys are pressed at the same time, where the first key shares the same row with the second and the same column with the third, the computer incorrectly identifies a key press on the key that shares the same column with the second and the same row with the third key. That is the key which would lie on the corner that is diagonally to the first key in a rectangle on the table where key one, two and three would be the other three corners (see Example 1).

It not only sounds complicated, it is also complicated and it creates a very troublesome problem for multiplayer games, because both joysticks are also mapped to this keyboard table and thus are no exception to this rule. When you play a two player game on an original CPC (this error is nonexistent in CPC emulators) you can easily see the result of this error when both player for example press up and left at the same time and just one player presses the fire button, then both player will shoot, even though just one pressed the trigger! Another example is when both player fire and one walks up and the other walks up and right both player will fire and walk diagonally up and right.

This can become a lethal flaw in some games. I remember that it was a very annoying problem in the otherwise great war game Ikari Warriors. My cousin and I often played this game together and it was great fun when one was driving a tank and the other was shooting away with his machine gun. But often the tank driver would accidentally kill the other player when this error made the tank shoot into the direction where the other player was walking.

MODKE error
Example 1: How the "MODKE" error arises
In Zap't'Balls Elmsoft tried to avoid this error by selecting very strange keys for the second player, so that the incidence of this error was drastically minimized since there were just few if any situations where the pressed keys/ joystick directions would collide with one another in the fashion explained above.

For Megablasters I chose a different method to avoid this unresolvable problem: Psychology (which was going to become my future profession - but not because of this keyboard problem ...)

Now, what can Psychology do to solve a CPC hardware problem?

In the early Mode 1 version of the battle mode I was made aware of an issue about controlling he characters (besides the keyboard problem). Taking a turn with your character at a junction wasn't easy, since you had to hit the exact position of the crossing path in order to enter it. This meant you had to be very skilled at using your joystick/ keyboard controls or you had to press diagonal directions, so that you could enter the path as soon as your character has moved closely enough to the turning point.

Pressing diagonal directions meant that two keys (e.g. up and left) had to be pressed at the same time, which in turn would increase the probability of the keyboard error to occur. To prevent this from happening I introduced the slide-around-block technique, that is if you wanted to enter a crossing path you didn't have to move directly into the path, you just had to press into the according direction and your character would slide around the block in front of it into the pressed direction.

Sliding around blocks
Example 2: Sliding around blocks.
So if you wanted to go up and had a block in front of you, one of three things could happen: (1) if you were a little left of the block, your character would move to the left until it was completely in the vertical path and then move upwards. (2) if you stood a little to the right of a block, your character would move to the right and upwards as soon as it entered the vertical path completely. (3) if you stood directly in front of the block, your character wouldn't move at all (see Example 2).

This scheme inhibited the use of diagonal directions by the means of "Extinction" (from instrumental conditioning) of the undesired response: That is pressing diagonal directions simply wasn't rewarded anymore with a quicker entry into crossing paths, conventional pressing of individual directions accomplished the same goal with less effort! Therefore the more complicated behavior (pressing diagonal directions on the joystick or pressing two keys at the same time) was inhibited and thus the easy behavior was promoted.

But this was just half the battle. Even using this sliding routine still a lot of keyboard errors did occur like suddenly moving into directions that were not pressed or standing still when the computer detected a simultaneous keypress in opposite directions. This often happened when you were moving and dropping bombs at the same time (which meant pressing two keys simultaneously). Yet another Psychological construct was going to help remedy this problem: Gestalt Psychology. In specific, a variation of the Gestalt Law of Good Continuation.

Gestalt Law of Good Continuation
Example 3: Gestalt Law of Good Continuation
Normally if in a multiplayer game the keyboard suddenly detected the keys for opposite directions for one player, this player would stand still (since moving up and down or left and right at the same time cancels each other movement out). To prevent this from happening the computer stores the past movements of each player and every time an opposing movement was detected the program would look up these past movements and have the player continue to move into the direction he had moved in his last steps. Here's an example: if Bart was moving left and suddenly an additional right keypress was detected Bart would continue to move to the left, due to this special subroutine. (You can easily try that out on an original CPC (it doesn't work on Emulators, since no one really cared to emulate this keyboard error as well) by playing a single player level, move into one direction and then press the key for the opposite direction as well. Your character will continue to move into the original direction (see Example 3)).

These two methods helped to obliterate the keyboard errors almost completely. I write almost, because even with these ideas I still couldn't completely eradicate the keyboard errors. With some specific keyboard definitions and in certain four player situations there can still be some movement artifacts like moving into orthogonal directions when your press one direction and fire at the same time or dropping bombs when you just move into one direction and all the other players move and bomb at the same time. But these problems occurred a lot less frequently than without these remedy routines and thus were bearable in my opinion. (Besides that I wouldn't have known how to fix that as well).
 

Go back to Megablasters Battle Mode page

 

last updated on Thursday, November 13. 2003 by Odiesoft

Legal disclaimer under which this service is provided to you.