Difference between revisions of "Vt tiledata"

From NetHackWiki
Jump to navigation Jump to search
(Added special glyph flags)
(updated upcoming glyph flags)
 
(11 intermediate revisions by 3 users not shown)
Line 7: Line 7:
 
'''vt_tiledata''' is a community patch for NetHack that adds extra escape codes into the data stream, mainly intended for graphical frontends. The name ''vt_tiledata'' comes from the boolean option used in version 3.4.3 on NAO.
 
'''vt_tiledata''' is a community patch for NetHack that adds extra escape codes into the data stream, mainly intended for graphical frontends. The name ''vt_tiledata'' comes from the boolean option used in version 3.4.3 on NAO.
  
The original patch, called Telnet Tiles, was made by Justin Hiltscher. That patch only sent one type of escape code, the version NAO used for 3.4.3 added some extra codes.
+
The original patch, called Telnet Tiles, was made by Justin Hiltscher. That patch only sent one type of escape code, the version NAO used for 3.4.3 added some extra codes. This option only works for the [[tty]] window mode.
  
 
The Dev Team added this patch to vanilla NetHack for version 3.6.1 with a few changes (see below).
 
The Dev Team added this patch to vanilla NetHack for version 3.6.1 with a few changes (see below).
  
 
==Escape codes==
 
==Escape codes==
All of the escape codes are in the format <tt>ESC [ N z</tt> (3.4.3 patch) or <tt>ESC [ 1 ; N z</tt> (3.6.1), where N can be one or more positive integer values, semicolon-seperated. For example, <tt>ESC [ 0 ; 120 z</tt> (3.4.3 patch) or <tt>ESC [ 1 ; 0 ; 120 z</tt> (3.6.1).
+
All of the escape codes are in the format <tt>ESC [ N z</tt> (3.4.3 patch) or <tt>ESC [ 1 ; N z</tt> (3.6.1), where N can be one or more positive integer values, semicolon-separated. For example, <tt>ESC [ 0 ; 120 z</tt> (3.4.3 patch) or <tt>ESC [ 1 ; 0 ; 120 z</tt> (3.6.1).
  
 
3.4.3-NAO uses the following codes:
 
3.4.3-NAO uses the following codes:
Line 20: Line 20:
 
*'''ESC [ 3 z''': End of data. NetHack has finished sending data to you, and is waiting for your input.
 
*'''ESC [ 3 z''': End of data. NetHack has finished sending data to you, and is waiting for your input.
  
3.6.1 uses the following codes: <ref>[[Source:NetHack_3.6.1/include/config.h#line478]]</ref>
+
3.6.1 uses the following codes: {{refsrc|include/config.h|485|version=NetHack 3.6.6}}
 
*'''ESC [ 1 ; 0 ; ''n'' ; ''m'' z''': Start a glyph (aka a tile) number n, with flags m
 
*'''ESC [ 1 ; 0 ; ''n'' ; ''m'' z''': Start a glyph (aka a tile) number n, with flags m
 
*'''ESC [ 1 ; 1 z''': End a glyph.
 
*'''ESC [ 1 ; 1 z''': End a glyph.
Line 26: Line 26:
 
*'''ESC [ 1 ; 3 z''': End of data. NetHack has finished sending data, and is waiting for input.
 
*'''ESC [ 1 ; 3 z''': End of data. NetHack has finished sending data, and is waiting for input.
  
Special flags of a glyph can be: {{refsrc|hack.h|75|version=NetHack 3.6.1}}
+
Special flags of a glyph can be: {{refsrc|include/hack.h|76|version=NetHack 3.6.6}}
  
* 0x01: corpse
+
* 0x0001: corpse
* 0x02: invisible
+
* 0x0002: invisible
* 0x04: detected
+
* 0x0004: detected
* 0x08: pet
+
* 0x0008: pet
* 0x10: ridden
+
* 0x0010: ridden
* 0x20: statue
+
* 0x0020: statue
* 0x40: object pile
+
* 0x0040: object pile
* 0x80: lava hilight
+
* 0x0080: lava hilight
 +
 
 +
{{ upcoming|Nethack 3.7.0|
 +
* 0x00001: hero
 +
* 0x00002: corpse
 +
* 0x00004: invisible
 +
* 0x00008: detected
 +
* 0x00010: pet
 +
* 0x00020: ridden
 +
* 0x00040: statue
 +
* 0x00080: object pile
 +
* 0x00100: lava hilight
 +
* 0x00200: ice hilight
 +
* 0x00200: sink hilight (same as ice hilight)
 +
* 0x00400: out-of-sight lit areas when [[Options#dark_room|dark_room]] is disabled
 +
* 0x00800: unexplored
 +
* 0x01000: male
 +
* 0x02000: female
 +
* 0x04000: bad coordinates
 +
}}
  
 
Whenever NetHack outputs anything, it will first output the select window code.
 
Whenever NetHack outputs anything, it will first output the select window code.
Line 42: Line 61:
 
==Support==
 
==Support==
 
Currently the escape codes are supported by [[EbonHack]], [[Soiled]], and [http://webhack.webhook.org/ webhack.webhook.org.]
 
Currently the escape codes are supported by [[EbonHack]], [[Soiled]], and [http://webhack.webhook.org/ webhack.webhook.org.]
 +
The 3.4.3-NAO-style escape codes are [https://github.com/chromium/hterm/blob/master/doc/ControlSequences.md#control-sequence-introducer-csi-csi supported] by Chromium's [https://hterm.org/ hterm].
 
Some terminal emulators do not like unknown escape codes - For example gnome-terminal prints these escape codes on the screen.
 
Some terminal emulators do not like unknown escape codes - For example gnome-terminal prints these escape codes on the screen.
  

Latest revision as of 13:53, 1 January 2023

Telnet Tiles Server
Author Justin Hiltscher
Download unknown
NetHack PatchDB 123

vt_tiledata is a community patch for NetHack that adds extra escape codes into the data stream, mainly intended for graphical frontends. The name vt_tiledata comes from the boolean option used in version 3.4.3 on NAO.

The original patch, called Telnet Tiles, was made by Justin Hiltscher. That patch only sent one type of escape code, the version NAO used for 3.4.3 added some extra codes. This option only works for the tty window mode.

The Dev Team added this patch to vanilla NetHack for version 3.6.1 with a few changes (see below).

Escape codes

All of the escape codes are in the format ESC [ N z (3.4.3 patch) or ESC [ 1 ; N z (3.6.1), where N can be one or more positive integer values, semicolon-separated. For example, ESC [ 0 ; 120 z (3.4.3 patch) or ESC [ 1 ; 0 ; 120 z (3.6.1).

3.4.3-NAO uses the following codes:

  • ESC [ 0 ; n z: Start a glyph (aka a tile) number n.
  • ESC [ 1 z: End a glyph.
  • ESC [ 2 ; n z: Select a window n to output to.
  • ESC [ 3 z: End of data. NetHack has finished sending data to you, and is waiting for your input.

3.6.1 uses the following codes: [1]

  • ESC [ 1 ; 0 ; n ; m z: Start a glyph (aka a tile) number n, with flags m
  • ESC [ 1 ; 1 z: End a glyph.
  • ESC [ 1 ; 2 ; n z: Select a window n to output to.
  • ESC [ 1 ; 3 z: End of data. NetHack has finished sending data, and is waiting for input.

Special flags of a glyph can be: [2]

  • 0x0001: corpse
  • 0x0002: invisible
  • 0x0004: detected
  • 0x0008: pet
  • 0x0010: ridden
  • 0x0020: statue
  • 0x0040: object pile
  • 0x0080: lava hilight

The following information pertains to an upcoming version (Nethack 3.7.0). If this version is now released, please verify that it is still accurate, then update the page to incorporate this information.


  • 0x00001: hero
  • 0x00002: corpse
  • 0x00004: invisible
  • 0x00008: detected
  • 0x00010: pet
  • 0x00020: ridden
  • 0x00040: statue
  • 0x00080: object pile
  • 0x00100: lava hilight
  • 0x00200: ice hilight
  • 0x00200: sink hilight (same as ice hilight)
  • 0x00400: out-of-sight lit areas when dark_room is disabled
  • 0x00800: unexplored
  • 0x01000: male
  • 0x02000: female
  • 0x04000: bad coordinates

Whenever NetHack outputs anything, it will first output the select window code. Whenever NetHack outputs a tile, it will first output the start glyph code, then the escape codes for color and the glyph character itself, and then the end glyph code.

Support

Currently the escape codes are supported by EbonHack, Soiled, and webhack.webhook.org. The 3.4.3-NAO-style escape codes are supported by Chromium's hterm. Some terminal emulators do not like unknown escape codes - For example gnome-terminal prints these escape codes on the screen.

References