Skip to content

Conversation

@BartekCupial
Copy link
Collaborator

@BartekCupial BartekCupial commented Jan 20, 2025

This PR introduces an AutoMore wrapper to automatically handle the "--More--" prompts that appear when the game's output exceeds the screen size or message. Previously handling of "--More--" prompts was done in a postprocessing step within the clean_message method. This change improves modularity, makes it easier to manage and extend the functionality without altering the core environment logic.

        message = self.nle_language.text_message(obs["tty_chars"]).decode("latin-1")

        while "--More--" in message and not done:
            message = message.replace("--More--", "\n")

            action_index = self.env.actions.index(A.MiscAction.MORE)
            obs, rew, done, info = super().step(action_index)
            add = self.nle_language.text_message(obs["tty_chars"]).decode("latin-1")
            message += add
            reward += rew

@BartekCupial
Copy link
Collaborator Author

@DavidePaglieri should be ready to merge now

Copy link
Contributor

@DavidePaglieri DavidePaglieri left a comment

Choose a reason for hiding this comment

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

LGTM!

@DavidePaglieri DavidePaglieri changed the title Implement AutoMore Wrapper for Handling "--More--" Messages in NLE Environment Better handle "--More--" messages in NLE Mar 6, 2025
@DavidePaglieri DavidePaglieri merged commit 980e1e5 into balrog-ai:main Mar 6, 2025
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants