Skip to content
This repository has been archived by the owner on May 6, 2024. It is now read-only.

Eric/add converter #315

Merged
merged 11 commits into from
Apr 28, 2022
Merged

Eric/add converter #315

merged 11 commits into from
Apr 28, 2022

Conversation

cdmatters
Copy link
Contributor

@cdmatters cdmatters commented Apr 14, 2022

This is the state of the internal main branch when Heiner left. Everything so far has been reviewed internally.

The key feature here is to add a ttyrec converter in C++.

It involves committing the a version of libtmt, which has been modified, and undergoes some changes.

See commits for more details.

@facebook-github-bot facebook-github-bot added the CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. label Apr 14, 2022
@cdmatters cdmatters assigned tscmoo and unassigned tscmoo Apr 14, 2022
@cdmatters cdmatters requested a review from tscmoo April 14, 2022 10:03
@cdmatters cdmatters force-pushed the eric/add-converter branch 3 times, most recently from 998e1e8 to 9e1e973 Compare April 14, 2022 12:25
py::array::ensure attempts to convert an object to python array, if
it already isn't one. Our use case wants to fail instead of create a
new array, so instead we check py::isinstance. We also improved the
error messages and remove the TODO for that.
Note that this involves changing the type of cursor entries from uint16
to unsigned char. Tests ported across, and the `reader` executable.
Taken from github.com:deadpixi/libtmt commit (1da7ba9).
…ange.

This is a commit from interal research repo (cabeefb).
NetHack allows you to use the DEC graphics set to render the dungeon
(https://nethackwiki.com/wiki/DECgraphics). Since DEC graphics mode is
toggled on and off with ESC ( 0, ESC ( B respectively, we add a new
'state' to tmt to indicate when ESC ( have been pressed. Normally
anything following this sequence is ignored, anyway.

Each character then saves whether it was written in DEC mode or not, in
attributes. While this would not work for a general DEC parser (since
some DEC characters include whitespace/new lines etc that would not have
been interpretted correctly by the terminal emulator - cf
https://en.wikipedia.org/wiki/DEC_Special_Graphics) in this case this
is fine because NetHack only uses DEC graphics for rendering particular
glyphs (as suggested in the NetHack Wiki, and as suggested in paxed/dgamelaunch
scriptfor stripping gfx).

A test is added to check rendering.
Copy link
Contributor

@tscmoo tscmoo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

great, awesome, looks good!

@drothermel
Copy link

So many tests, this looks great!

@cdmatters cdmatters merged commit f4f750a into main Apr 28, 2022
@cdmatters cdmatters deleted the eric/add-converter branch April 28, 2022 11:03
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants