Regularizing id strings

Bron Campbell Nelson (
Tue, 23 Aug 94 13:21:45 -0700

Is there some way to distinguish what "type" of unit something is
based on its id string? Clearly, for some things this is possible:
provinces are always letter-letter-number-number, and is appears
nothing else is. Similarly, factions are letter-letter-number,
and player nobles are letter-number-letter. But pretty much
everything else seems to be letter-letter-number-letter, without
any noticable pattern to the names (ok, cities all seem to start
with the letter "a").

I would argue in favor of regularizing the names so that the order
scanner could be made a lot smarter when checking for errors on
the input orders. For example, I was quite annoyed to find that
at one point I issued the order:
claim gold 100
and although obviously wrong, this was accepted without error by
the order scanner (and of course, ultimately rejected when it was

Now clearly I screwed up, and have no one to blame but myself. But
I was inspired to try and write a lex/yacc parser to check the syntax
of my orders to reduce this sort of screwup in the future. Clearly, a
lot can be done along these lines, and in particular my bogus CLAIM order
is easy to catch. But there is one impediment to doing a good job: you
cannot syntactically distinguish what a letter-letter-number-letter
identifier is, and so must make a very liberal judgement about whether
the order is legal for that identifier. For example, if I wanted to
REPAIR my ship, but I spelled the unit id wrong, right now this would
be accepted without comment, and then fail when executed. If ships
and structures had identifiers of a particular syntax, then there
is a good chance my mis-spelled id could not possibly be something
REPAIRable, and the order scanner could flag it for me.

Of course, this would not catch all possible errors, but I think it
would help. Particularly for new players during those first few
confusing turns. I think one could make sharper distinctions, and so
catch more errors, if you could tell by its name whether something was
a ship, or a monster, or an artifact, or whatever. I am unaware of any
game problems such a naming scheme would cause as long as the scanner
operated purely syntactically (e.g. it would not try to decide if the
thing you wanted to REPAIR existed in your location, it would just try
to decide if the id string was the sort of name that a ship or structure
could possibly have).

Bron Campbell Nelson  or possibly  uunet!!bron
These statements are my own, not those of Silicon Graphics.

Main Index  |  Olympia  |  Arena  |  PBM FAQ  |  Links