9

This was originally going to be an question but I found the game I was looking for!

I played Tau Ceti when I was a kid and I remember being amazed by how it would accept spelling mistakes in the typed commands. For example, if you type LUNCH it launches the skimmer. If a word was too different from any keywords it would say NOT UNDERSTOOD.

What method does it use to spell-check the user's commands? Is it the Levenshtein Distance or something else?

Tau Ceti screenshot

It's not a Soundex because LOOD and LOAK both do LOOK, and LAD does PAD. Swapping two letters in a four letter command always results in NOT UNDERSTOOD, but any one missing letter or an extra letter still allows the command to be understood. NEWPANDA does NEWPAD but NEWTPANDA is too different and is NOT UNDERSTOOD.

Scan of original manual (cassette tape cover)

  • 2
    I can't speak for this game but I know that a common technique was to just match the first couple of letters. So in your example LAUNCH is the only command starting with L and having a U in it, so LUNCH matches. – Chenmunka Jul 30 '16 at 14:10
  • The screenshot doesn't make it obvious, but LU is not close enough to match. UNCH is NOT UNDERSTOOD but UANCH (L missing, A and U the wrong way around) launches the skimmer. – CJ Dennis Jul 31 '16 at 5:02
5

There's another version I found online, but it's the DOS version. In that version, it only used the first three letters.

Typing JOYOUS CELEBRATION would be understood as JOYSTICK.

The DOS version, however, is different than the CPC version.

While the source needs to be analyzed to get the actual algorithm (I think they rolled their own), it is possible to analyze the behaviors to get a better understanding. (Clicking the pause button in the lower left brings up something. I haven't been able to actually get anything meaningful from it however.)

[A]ny one missing letter or an extra letter still allows the command to be understood

This isn't 100% true. When the command is five letters or less, it will refuse to recognize the command when the first letter is replaced with the second. In other words, QQUIP fails to be recognized as EQUIP. The command would still be recognized if any other character is substituted instead. If the command is six letters or longer, it will recognize the command either way (AAUNCH is recognized as LAUNCH).

This strange behavior can be triggered in longer words if there is another mistake. For example XTATU is fine, but TTATU fails.

A similar thing happens with the last and second to last characters. When the second to last character is substituted with the last character, the command fails. PDD and HEPP are not recognized, but POD and HEMP are fine. Interestingly enough, this does not affect 5 letter words, since EQUPP is accepted.

(I suspect these two anomalies are bugs, but they do give insight into how it works.)

Longer words can usually be recognized even when more than one character is wrong, but only in some circumstances. IIGHTS OND is recognized, but GTHS ON fails. SSIGHTSOND is recognized too.

Working from your image, I found that PUSS, and PUS pause the game. It seems that it is possible to omit two characters from a word of 5 or more letters if no extra characters are added, and each letter is no more than 1 place away from its original position.

Again, the behavior of longer words shows that letters that are slightly misplaced are more often understood than random letters. For example, E=ACTOR is understood, but MMACTOR is not.

Another strange fact is that leading spaces are ignored, but trailing (and inter-word) spaces are not. When they are not ignored, they are counted as any other wrong character is. That means ␠␠␠␠␠␠␠PAD is recognized, but PAD␠␠ and P␠A␠D are not. Like POD, P␠D will pass. Omitting a space (in SIGHTS ON or SIGHTS OFF) counts as a wrong character.

It is interesting to note that SIGHTS and SIGHTS␠ are accepted, but SIGHTS␠␠ is not.

Periods are strange; . is understood as HELP, L. is understood as LAUNCH. I think . is like a wildcard, and the list seems to be scanned left to right top to bottom (RODS before REACTOR). Note that it ignores anything after the first .; .MAP is the same as HELP.

Another interesting thing I noticed is that SIGHTS ONF,SIGHTS O, and SIGHTS OF are accepted as commands. I think they all may map to SIGHTS ON, but I have no clue how to check that.

  • Thanks for that! I tried QQUIP and you are correct, it is not recognised. So then I tried QUIP and it quit the game! However, replacing the first letter with anything other than a Q still executes the EQUIP command. I've also discovered that the MAP has the same functionality: you can search for any location even if you misspell it slightly. – CJ Dennis Jul 31 '16 at 20:36
  • @CJDennis I had no clue that you could search on the map! (On a side note, how do I know if sights are on or off?) – Laurel Jul 31 '16 at 20:40
  • Sights on or off? I've got no idea at the moment! I haven't found a manual for the game yet, so I don't know what the goal of the game is, I'm just fascinated by its spell-checking! – CJ Dennis Jul 31 '16 at 20:43
  • @CJDennis It looks like there's a wiki... It says it toggles a white square, but I can't find the square. – Laurel Jul 31 '16 at 20:57
  • 1
    On the Amstrad version the sights are a broken "X". SIGHTS ON is recognised before SIGHTS OFF as you guessed. – CJ Dennis Aug 1 '16 at 9:04
3

Without having the source code, it is obviously a bit hard to judge, but let's have a shot at it. There are various possibilities to "guess what the player meant":

  • Levenshtein distance, as you said - Possible, but probably a bit heavy for an 8-bit micro and (only) a command line interpreter - Also maybe a bit oversize for a fixed set of strings to match against
  • Soundex algorithm - That is way simpler because it is purely table-driven and the soundex table is typically very small - Look it up, I guess that is how it's done (especially because it ignores vocals completely as in your examples). You can check it here against the keywords understood by the game (Note some soundex algorithms ignore the first letter of the word, some - as the one on the website- don't)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.