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

Add the filepath of the ttyrec if it exists to the xlogfile. #319

Merged
merged 2 commits into from
May 16, 2022

Conversation

cdmatters
Copy link
Contributor

This will make it easier for users to find which ttyrecs correspond to
which metadata. Xlogfiles are only written to with natural endings; not
guaranteed if you call "reset" before "done" is ready. This means if
there is a panic and drop a game, you will not get alignment between
your ttyrec reset number and xlogfile row. This adds an explicit link.

NB: This only works because in nle (vs typical NetHack), we play the
whole game in one ttyrec.

@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 May 12, 2022
@@ -122,6 +122,10 @@ class Nethack
}
strncpy(settings_.scoreprefix, scoreprefix.c_str(),
scoreprefix.length());
std::size_t found = ttyrec.rfind("/");
if (found!=std::string::npos && found + 1 < ttyrec.length())
Copy link
Contributor Author

Choose a reason for hiding this comment

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

why the found+1 check? found points to the "/", so in case someone names their ttyrec "/path/ttyrec.bz2/". Highly unlikely - maybe it would break? Will check.

This will make it easier for users to find which ttyrecs correspond to
which metadata.  Xlogfiles are only written to with natural endings; not
guaranteed if you call "reset" before "done" is ready. This means if
there is a panic and drop a game, you will not get alignment between
your ttyrec reset number and xlogfile row. This adds an explicit link.

NB: This only works because in nle (vs typical NetHack), we play the
whole game in _one_ ttyrec.
@samvelyan samvelyan self-requested a review May 16, 2022 17:36
Copy link
Contributor

@samvelyan samvelyan left a comment

Choose a reason for hiding this comment

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

looks good

@cdmatters cdmatters merged commit e66a31e into main May 16, 2022
@cdmatters cdmatters deleted the eric/xlogfile-filelogging branch May 16, 2022 18:45
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