Unstoppable flashing "Unknown command" error during gameplay
issueid=4668 01-12-2017 09:37 PM
Junior Member
Number of reported issues by geekyadam: 1
Unstoppable flashing "Unknown command" error during gameplay
Unstoppable flashing "Unknown command" error during gameplay

The game loads fine but there seems to be some button being spammed during the game, and the button seems to be 'Enter' as when I try to enter a character name it takes the first letter I press as the full name. I made a gif capture to show the issue visually (watch the name enter screen and when the overworld map loads notice the flashing "Unknown command" error):

In that gif, I press 'P' to play, then 'C' to get past the license/version info, then 'S' to start new tutorial game, then 'Space', then I type a single letter 'A' (without pressing Enter but it immediately accepts my input as if I had pressed 'A' then Enter), then 'Z' to remove the tutorial box. When you see the "Unknown command" error flashing at the top I'm not pressing any buttons. I am able to move around and the game plays technically, however I don't see any status messages in the upper-left corner, as the "Unknown command" error won't stop flashing, as if I was holding down an unmapped button the entire time. It seems as if there is an unmapped button held down but I'm sure there isn't. After I quit out, I just press 'asdfasdf' then delete it with 'Backspace' to show that Enter or other keyboard buttons are not being held down. I've ran adom on my Linux server for awhile now and just today it started doing this.

Debug info:
- experienced on two different Ubuntu servers
- I'm using cygwin terminal to SSH to the Ubuntu servers
- adom version r60

What I've tried so far:
- tried both cygwin and putty to SSH to my servers - both have same results; game loads fine as always but the button spamming thing won't go away
- downloaded Windows version of the game and ran it natively on my Windows laptop and it ran fine with no issues
- completely removed .adom-data/ directory and re-ran adom with no configuration files - same issue persists

At this point, I cannot get adom to work normally in linux anymore for some reason. This used to work fine but today it started doing that weird thing. Also, I have no confirmation that there is any kind of "button spamming or held down", that's just what it visually looks like is happening. Furthermore, I should mention that I got to a point where a "(more)" prompt comes up, which is normally passed by pressing the 'Enter' key, but the prompt did not go away on its own, which proves that my SSH client is not spamming the 'Enter' key. I was able to press Enter and the game handled it normally - the "(more)" prompt went away and continued displaying text...however I didn't see the remaining text because that "Unknown command" error immediately began flashing at the top again.
Issue Details
Issue Number 4668
Project ADOM (Ancient Domains Of Mystery)
Category Linux
Status Duplicate
Priority 5 - Medium
Affected Version ADOM r60
Fixed Version (none)
Milestone (none)
Users able to reproduce bug 3
Users unable to reproduce bug 1
Assigned Users jt
Tags (none)




01-13-2017 02:37 PM
Senior Member
That's a pretty bad bug.

Have you tried switching to the graphical version? (I don't play via server or linux so I don't actually know if it has a noteye version or not.)

Also have you tried remapping the enter button to something else? (enter is represented as \n in the adom.kbd file)

01-13-2017 09:29 PM
Junior Member
I tried removing configuration files with no improvement. Didn't try the graphical version for Linux but played the ASCII version for windows fine. I'm new to adom config file button remapping, can you please give me the line to add to adom.kbd so I can test?

01-13-2017 09:30 PM
Junior Member
Also, what is "noteye version"?

01-14-2017 04:49 AM
Senior Member
"noteye" is the graphical version, it is the name of the engine which produces the images in the game.

you shouldn't need to add any lines to the .kbd - there is already a line "OUC: \n" (minus quote marks) - simply change the \n to some other key

so for example if you wanted it to use a capital P you would change "OUC: \n" to "OUC: P" (again minus the quote marks)

I recommend ALT-Z be your enter since it is unused and easy to remember- which means changing "OUC: \n" to "OUC: \Mz"


Make sure you backup the .kbd file before editing it though, just in case something goes wrong.

01-18-2017 08:13 PM
Junior Member
Thanks for the info.
I looked through adom.kbd and didn't find the enter key symbol "\n" or "OUC" anywhere..
Code:
adam@snug:~/.adom.data$ grep -ri "/\n" *
adam@snug:~/.adom.data$ grep -ri "OUC:" *
adam@snug:~/.adom.data$
I tried adding it manually to the end of adom.kbd...
Code:
adam@snug:~/.adom.data$ tail adom.kbd
#  Zap wand
#

ZAP:z

#
# Enter key
#

OUC:\n
adam@snug:~/.adom.data$
...but when I try starting adom I get an error with the "OUC" keycode...
Code:
/*
 * ADOM session aborted due to an external problem.
 * Problem Description: Invalid keycode shortcut (OUC) in line number 828.
 */


[Press ENTER to continue]
Should I be using a different keycode than "OUC"?

Using release 60...
Code:
adam@snug:~$ adom -v

Ancient Domains Of Mystery -- Release 60
(C) Copyright 1994-2015 Thomas Biskup.
All Rights Reserved.

Ancient Domains Of Mystery Release 60

Build: Aug 23 2015 14:29:04

adam@snug:~$

01-20-2017 01:45 PM
Senior Member
Probably.

In my version OUC is the enter command and the /n is what it is mapped too (/n representing the enter button, because the enter "command" and the enter "button" are two separate things so far as the computer is concerned). But that doesn't necessarily mean that it is mapped or represented the same in your version.

From the error message I would guess that the OUC is not representative of the Enter "Command" in linux and from your search I would guess /n is not representative of the Enter "Button" either

However there should be a section at the top of the file that reads something like this.

# (see the 'Wait' command for an example).
#
# The following special characters are used:
#
# \Mx -- press the alt key and some key x (for letters use the
# lowercase letter)
# \Cx -- press the control key and some key x
# \S -- SPACE
# \\ -- the backslash '\' itself
# \L, \R, \U, \D -- the cursor keys left, right, up and down
# \1 -- F1
# \2 -- F2
# \3 -- F3
# \4 -- F4
# \5 -- F5
# \6 -- F6
# \7 -- F7
# \8 -- F8
# \9 -- F9
#
# Attention: not all combinations of meta keys and normal keys might be
# possible. Make sure to check this if you redefine the keyboard.
# Note that the ENTER key is equal to (and thus represented by) \n.

So if enter is set as something else it should/may list it there and you can search for the corresponding thing and replace that instead.




The crash caused when you changed the file is probably a mapping conflict. I noticed you went ahead and put /n after the OUC - if /n is mapped somewhere else and/or OUC doesn't represent enter(which we now know it does not) and/or /n doesn't represent enter, and/or /n does represent enter and it is simply placed somewhere else, then it could cause an error which would crash the game.

So make sure whatever you use as the Enter "Button" isn't already in use somewhere else.

01-23-2017 07:42 PM
Junior Member
Understood. I see that my ENTER key is \Cm...
Code:
#  Attention: not all combinations of meta keys and normal keys might be
#  possible. Make sure to check this if you redefine the keyboard.
#  Note that the ENTER key is equal to (and thus represented by) \Cm.
...however I don't see that used anywhere in the config file. I tried adding OUC:\Cm just for the heck of it, but indeed I got the same error message, confirming your assumption; it looks like OUC isn't used in this version of Adom.

Seems like now that I found the correct ENTER key code "\Cm" now I just need to confirm which keycode shortcut to map it to, since we confirmed that "OUC" isn't used for this revision of Adom. Can anyone using Adom revision 60 confirm what's in their adom.kbd for ENTER key? Would it help investigation if I attach my unedited adom.kbd file in entirety?

01-25-2017 02:17 AM
Ancient Member
Quote Originally Posted by geekyadam
Understood. I see that my ENTER key is \Cm...
Code:
#  Attention: not all combinations of meta keys and normal keys might be
#  possible. Make sure to check this if you redefine the keyboard.
#  Note that the ENTER key is equal to (and thus represented by) \Cm.
...however I don't see that used anywhere in the config file. I tried adding OUC:\Cm just for the heck of it, but indeed I got the same error message, confirming your assumption; it looks like OUC isn't used in this version of Adom.

Seems like now that I found the correct ENTER key code "\Cm" now I just need to confirm which keycode shortcut to map it to, since we confirmed that "OUC" isn't used for this revision of Adom. Can anyone using Adom revision 60 confirm what's in their adom.kbd for ENTER key? Would it help investigation if I attach my unedited adom.kbd file in entirety?
OUC is command for opening submeniu of possible action (actual command is described as act reasonably). If you use older version ENTER key should not be defined (as it is in 1.1.1 kbd).

01-25-2017 08:16 PM
Junior Member
Quote Originally Posted by Soirana
OUC is command for opening submeniu of possible action (actual command is described as act reasonably). If you use older version ENTER key should not be defined (as it is in 1.1.1 kbd).
My fresh adom.kbd doesn't have anything similar to "act reasonably" in it anywhere.
My ENTER key is not defined in kbd but I'm on revision 60, isn't that new?
Code:
adam@snug:~$ adom -v

Ancient Domains Of Mystery -- Release 60
(C) Copyright 1994-2015 Thomas Biskup.
All Rights Reserved.

Ancient Domains Of Mystery Release 60

Build: Aug 23 2015 14:29:04

adam@snug:~$

01-26-2017 03:57 AM
Ancient Member
Quote Originally Posted by geekyadam
My fresh adom.kbd doesn't have anything similar to "act reasonably" in it anywhere.
My ENTER key is not defined in kbd but I'm on revision 60, isn't that new?
I use r60 as latest (well, maybe technically latest is r61) version without NotEye. It does not have '/n' defined (on windows).

The whole OUC thing is from r64 (http://www.adom.de/forums/project.php?issueid=4144), before r64 you are not supoosed to have enter key defined. In other words, problem should not be in kbd.

One thing which surprises me is your kbd mentioning 'enter' keybeiding. I would suggest clean removal of adom and reinstall.

01-26-2017 11:04 PM
Junior Member
Quote Originally Posted by Soirana
One thing which surprises me is your kbd mentioning 'enter' keybeiding. I would suggest clean removal of adom and reinstall.
Reinstalling for Linux is just a matter of removing ~/.adom.data/ then running adom executable again to rebuild .adom.data from scratch, which I've done a few times already. Actually, I have no documentation to confirm that is all that is involved for reinstall on Linux (just similar to some other standalone executable based games/apps I've dealt with in Linux), so would appreciate if any adom devs could confirm that...
In meantime I'll try re-downloading adom executable from site and trying again. Any chance I could try a newer/beta release than what's on site?

03-10-2017 10:46 AM
Senior Member
I get this same issue on Ubuntu both in and outside of the gui. This is when playing the text-only 64 bit Ubuntu build of r60. Unknown command constantly flickering. Game is pretty much unplayable.

03-10-2017 10:53 AM
Senior Member
Note :I don't think it's enter that is being 'held down'. I think it's some other key. It shows a little question mark icon for me, like some unicode character. Could it be that the game is holding down a key that only certain localisations respond to? I use a UK keyboard, if that helps...

03-10-2017 08:39 PM
Junior Member
Quote Originally Posted by sylph
I get this same issue on Ubuntu both in and outside of the gui. This is when playing the text-only 64 bit Ubuntu build of r60. Unknown command constantly flickering. Game is pretty much unplayable.
Glad to hear I'm not alone. Maybe there's a way to get a 32-bit build of r60 running in 64-bit Ubuntu?

Quote Originally Posted by sylph
Note :I don't think it's enter that is being 'held down'. I think it's some other key. It shows a little question mark icon for me, like some unicode character. Could it be that the game is holding down a key that only certain localisations respond to? I use a UK keyboard, if that helps...
I'm on normal, unmodified, US keyboard here.

07-17-2017 02:49 AM
Junior Member
Maybe there's a way to get a 32-bit build of r60 running in 64-bit Ubuntu?
I tried several linux versions adom (Ubuntu 32/64 bit, Debian 6.0.5 32/64 bit, Debian 8 32/64 bit). This bug is repeated on all versions.

4.8.0-54-generic 16.04.1-Ubuntu x86_64

08-10-2017 01:39 AM
Junior Member
Is there any update on this bug? I can confirm it's happening to me as well. Running Linux Mint 18.2 Serena on a Lenovo ThinkPad 11e with an Atom processor.

10-10-2017 03:08 AM
Junior Member
I find this problem persists on my Dell XPS 13 notebook running Ubuntu 16.04 LTS, even when using a virtual terminal instead of the graphical environment.

Running with strace shows rapidfire poll() calls on standard input, followed by read calls returning single letters corresponding to those I actually pressed: p,d,q. So, it is not as if a key is "stuck" (see strace log below). This leads me to believe it is not a keymap or "Gnome" problem.

Debugging with gdb disassembly doesn't tell me much, I just see a lot of calls into ncurses library. Hard to tell what's going on without structured sources.

I guess I'm back to running DosBox...

Code:
cmerck@sagittarion:~/usr/adom$ grep -A 2 -B 2 read\(0 strace.log
poll([{fd=0, events=POLLIN}], 1, 0)     = 0 (Timeout)
poll([{fd=0, events=POLLIN}], 1, 0)     = 1 ([{fd=0, revents=POLLIN}])
read(0, "p", 1)                         = 1
getcwd("/home/cmerck/usr/adom", 511)    = 22
chdir("/home/cmerck/.adom.data")        = 0
--
poll([{fd=0, events=POLLIN}], 1, 0)     = 0 (Timeout)
poll([{fd=0, events=POLLIN}], 1, 0)     = 1 ([{fd=0, revents=POLLIN}])
read(0, "d", 1)                         = 1
rt_sigaction(SIGTSTP, {SIG_IGN, [], SA_RESTORER|SA_RESTART, 0x7f3707969390}, {0x7f3707db2960, [], SA_RESTORER|SA_RESTART, 0x7f3707969390}, 8) = 0
write(1, "\33[39;49m\33[37m\33[40m\33[H\33[2J", 25) = 25
--
rt_sigaction(SIGTSTP, {0x7f3707db2960, [], SA_RESTORER|SA_RESTART, 0x7f3707969390}, NULL, 8) = 0
poll([{fd=0, events=POLLIN}], 1, 0)     = 1 ([{fd=0, revents=POLLIN}])
read(0, "q", 1)                         = 1
write(1, "\33[?25l", 6)                 = 6
rt_sigaction(SIGTSTP, {SIG_IGN, [], SA_RESTORER|SA_RESTART, 0x7f3707969390}, {0x7f3707db2960, [], SA_RESTORER|SA_RESTART, 0x7f3707969390}, 8) = 0
cmerck@sagittarion:~/usr/adom$

10-10-2017 03:46 AM
Qui Qui is offline
Senior Member
It was fixed in 5077 for 2.3.3. Unless it's a different issue.

03-05-2018 01:50 AM
Junior Member
Fixed for me on same machine in 3.0.6 (release 88). Thank you! Life can now go on!

+ Reply