Discussion:
Display issue when playing remotely on a public server
(too old to reply)
Janis Papanagnou
2024-08-17 14:24:24 UTC
Permalink
I just noticed an undesired display effect when playing and viewing
games on the Hardfought server (that I access through command line
with ssh)...

I played as usual a game of 'notnotdNethack', usual tty display, and
everything was fine. Then I saved and viewed someone else's 'nndnh'
game; it was played with a game configuration that used some other
display setting (organized with separate sub-windows for inventory,
map, messages, etc.). When I left that view-session to continue my
own game the cursor was gone, and also when leaving the ssh session
the cursor was still gone (and I had to reset my terminal).

I assume that the display functions of the program ('nndnh') were
not properly reset in that runtime environment. I'm not quite sure
whether that would have to be fixed in the executable of the nndnh
program[*] or (as a safety measure) in the Hardfought script that
controls the viewing and playing of games. Or maybe in both tools,
just to be sure and suppor a reliable interface. It's certainly to
be considered a bug.

Janis

[*] In my own programs where I control the display output with ANSI
codes I certainly do an ANSI-reset before exiting my programs, also
in cases where the program gets interrupted roughly by signals such
a cleanup is mandatory.
Ron Nazarov
2024-09-14 20:18:54 UTC
Permalink
Post by Janis Papanagnou
I just noticed an undesired display effect when playing and viewing
games on the Hardfought server (that I access through command line
with ssh)...
I played as usual a game of 'notnotdNethack', usual tty display, and
everything was fine. Then I saved and viewed someone else's 'nndnh'
game; it was played with a game configuration that used some other
display setting (organized with separate sub-windows for inventory,
map, messages, etc.). When I left that view-session to continue my
own game the cursor was gone, and also when leaving the ssh session
the cursor was still gone (and I had to reset my terminal).
I assume that the display functions of the program ('nndnh') were
not properly reset in that runtime environment. I'm not quite sure
whether that would have to be fixed in the executable of the nndnh
program[*] or (as a safety measure) in the Hardfought script that
controls the viewing and playing of games. Or maybe in both tools,
just to be sure and suppor a reliable interface. It's certainly to
be considered a bug.
This cannot be fixed in nndnh as it has no way to know that you are
watching. You are simply watching the ttyrec live and seeing exactly
the same output that's being shown to the player.

Some variants (NetHack 4, FIQHack, NetHack Fourk) support enhanced
watchmode, where the watcher does actually run an instance of the game
and can interact with it in a limited way (for example viewing the
player's inventory). This works by opening the save file in read-only
mode, which can be done since NH4 and its variants since they save
constantly (and the save file is a log of the game that is replayed when
the save is loaded). NH3 (and its variants) have declarative saves and
do not save constantly, so this cannot be implemented.

It would have to be fixed in dgamelaunch.
Post by Janis Papanagnou
Janis
[*] In my own programs where I control the display output with ANSI
codes I certainly do an ANSI-reset before exiting my programs, also
in cases where the program gets interrupted roughly by signals such
a cleanup is mandatory.
Janis Papanagnou
2024-09-15 13:17:56 UTC
Permalink
Post by Ron Nazarov
Post by Janis Papanagnou
I just noticed an undesired display effect when playing and viewing
games on the Hardfought server (that I access through command line
with ssh)...
[ effects of ANSI control characters sent to the client ]
This cannot be fixed in nndnh as it has no way to know that you are
watching. [...]
Yes, that's what also came to my mind after a second thought...
Post by Ron Nazarov
[...]
It would have to be fixed in dgamelaunch.
...so I came to the same conclusion.

Thanks.

Janis

Loading...