Noxico


Counter Creep

In modern Megazeux, the developers added a whole lot of neat new functions to the Robotic scripting system, such as file I/O, substring manipulation and various new display methods. Adding those was probably a good idea. What wasn’t is the way they did so. Here’s an excerpt from the Robotics manual in MZX 2.83:

RID (read-only)
ROBOT_ID_ (read-only)

Both of these give the robot_id number of the given named
Robot. In the case of multiple robots with the same name, the
ID number corresponds to only one of them (the one with the
largest robot_id). If no robots have the name, or if the name
in question only belongs to the global Robot, -1 is given.

BEWARE: The existence of this counter makes it impossible to
use words which start with "rid" as counters. The port will NOT
fall through and give the values of any counter that starts
with "rid"; instead, it ends at -1 (since the Robot the counter
is trying to find, like "dles" (for "riddles"), will most
likely not exist). Older games will allow this, but only for
compatibility reasons.

It’s the “riddles” example that really shows what a dumb idea this actually was, and why this post is titled “Counter Creep”. The more counters with special effects they add, the less counters you can use yourself, and they had to add a special compatibility mode just to allow the use of reserved counter names.

For double the facepalm, they could’ve just removed the “RIDx” variant and kept “ROBOT_ID_x”.

And don’t get me started on how to open a file. If you can tell the difference between old and new games, why not break the original limit on the number of actual commands (256) and free up all those counters?

[ ]

Leave a Reply

Your email address will not be published. Required fields are marked *