Merged
Conversation
…ading / reloading shared library
heiner
approved these changes
Apr 8, 2025
| chars: A row x columns numpy array of chars. | ||
| colors: A numpy array of colors (0-15), same shape as chars. | ||
| cursor: An optional (row, column) index for the cursor, | ||
| chars: A row x columns numpy array of chars. |
Collaborator
There was a problem hiding this comment.
This was an attempt to follow the Google Python style guide https://google.github.io/styleguide/pyguide.html#383-functions-and-methods
(no harm in changing the style here, but this is why it looked like that before).
| try { | ||
| lgen = pyLgen.cast<unsigned long>(); | ||
| } catch (py::cast_error) { | ||
| /* Is 0 a valid seed number? Does nothing even matter? |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This feature adds the capability to pass an extra parameter
lgento the NLEseed()function for the purposes of having a deterministic dungeon layout, while allowing the in-game play to be randomly guided (e.g. combat etc.)It works by creating a new Random Number Generator using this seed value when the environment
reset()function is called. This RNG is swapped with the NetHackcoreRNG during the level generation (seemaklev.c:1003), where random numbers are sampled from the known RNG. It is then swapped back once the level is created (seemaklev.c:1041), and subsequent random numbers will be sampled fromcore.The RNGs are swapped again each time a new level is generated as the hero descends through the dungeon, ensuring that level generation random number sampling is kept separate from the in-game random number samples.