-
Notifications
You must be signed in to change notification settings - Fork 113
Conversation
v_h.set_holder_constructed(true); | ||
}, | ||
py::detail::is_new_style_constructor()) | ||
.def( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have no idea why clang-format decided to change this.
I wish it was more stable version by version.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just a heads up that you should install clang-format in your conda env (conda install clang-format
) to get a recent version, since I've noticed system package managers seem to have very old versions.
@@ -16,6 +16,7 @@ typedef struct nle_observation { | |||
int action; | |||
int done; | |||
char in_normal_game; /* Bool indicating if other obs are set. */ | |||
int how_done; /* If game is really_done, how it ended. */ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This could be a game_end_types
but I think it's better to keep this file standalone.
game_end_types | ||
how_done() | ||
{ | ||
return static_cast<game_end_types>(obs_.how_done); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This will be 0 (DIED) by default, even when the game hasn't finished yet. The way this is done here is that it has to be a member of game_end_types
, which has no value for "not yet ended".
What exactly NH means by score is a bit context-dependent. The value u.urexp factors into botl_score() in botl.c (if enabled) as well as into the computation in really_done() in end.c. In many cases, the result of botl_score() will be what really_done() reports as the end-of-game score. In many other cases, it won't: E.g. after dying (not quitting, escaping, ascending or bug-related exits), score for acquired gold is reduced by 10%. Also if escaped or ascended, valuable gems, artefacts etc will give extra score. The computation in end.c adds to u.urexp, which will reflect the end-of-game score for a few briefs "steps" at the very end of the game (but not before).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks good to me and an important addition!
@@ -224,3 +224,6 @@ def get_current_seeds(self): | |||
|
|||
def in_normal_game(self): | |||
return self._pynethack.in_normal_game() | |||
|
|||
def how_done(self): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
will this crash if its done outside of the end game?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No, but it will return game_end_types.DIED
which corresponds to 0
.
@@ -73,6 +73,8 @@ vt_char_color_extract(TMTCHAR *c) | |||
case (TMT_COLOR_WHITE): | |||
color = (c->a.bold) ? CLR_WHITE : CLR_GRAY; // c = 15:7 | |||
break; | |||
case (TMT_COLOR_MAX): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this is kind of wild but iirc TMT_COLOR_MAX.... i think is actually passed in sometime (by tmt)?!?! Really wild. I may be wrong but my some distant memory is recalling a really bonkers thing with tmt around here... maybe i used to have an assert i got rid of? i cant remember
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is this a helpful comment? probably not.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I added this b/c the compiler doesn't like not checking all enum values. If we should do something special here, let me know.
@@ -256,6 +256,8 @@ NetHackRL::fill_obs(nle_obs *obs) | |||
obs->internal[5] = nle_seeds[0]; /* core */ | |||
obs->internal[6] = nle_seeds[1]; /* disp */ | |||
obs->internal[7] = u.uhunger; | |||
obs->internal[8] = |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We add u.urexp here, but we;re not using it anywhere?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If we at some point decided to use NetHack's "end of game" score, we would get it from here. See the commit message here c5f077c for details.
No description provided.