Skip to main content
Have a personal or library account? Click to login
A NetHack Learning Environment Language Wrapper for Autonomous Agents Cover

A NetHack Learning Environment Language Wrapper for Autonomous Agents

Open Access
|Jun 2023

Figures & Tables

Figure 1

NLE Language Wrapper Block Diagram.

Figure 2

These figures show the computation flow for converting glyphs to the language observation. Figure 2a shows how for each glyph we compute the distance, direction and entity strings to produce a triple. Figure 2b shows the mapping for the collection of triples to the language observation, with example data on the right-hand side.

Figure 3

In this figure, the player is represented by the @ symbol in the center. The color bands around the player represent distances, that are defined in the legend on the right. Glyphs that lie on cardinal or inter-cardinal directions (e.g. north, northeast, east) are defined as being in the direction they lie on. Glyphs that are located between the cardinal and inter-cardinal directions are assigned the direction of the direction band they fall within (e.g. northnortheast), regardless of their exact position within the band. Using this chart we can see how for any glyph position, the distances and directions can be quantized to text relative to the player.

Figure 4

The screen in Figure 4a shows the glyphs included in the language observation listed in Figure 4b. The elements and rays from the Visual View are indicated with red, and the elements from the Fullscreen View are indicated with blue.

Table 1

NLE Language Wrapper Performance.

ENVIRONMENTSPS
NLE15k
NLE with Language Wrapper6k
Table 2

Average reward Mean (Standard Deviation) of 3 runs for 1B steps.

EXPERIMENTAVG REWARD
sample factory baseline566 (16)
language wrapper695 (22)
Table 3

NLE Language Wrapper integration tests.

TEST NAMERESULT
test_message_spell_menuPASSED
test_message_more_endPASSED
test_message_full_stop_endPASSED
test_message_bracket_endPASSED
test_message_parenthesis_endPASSED
test_message_multipagePASSED
test_message_takeoffallPASSED
test_filter_map_from_conductPASSED
test_empty_tty_chars_returns_empty_messagePASSED
test_filter_map_from_namePASSED
test_filter_map_travelPASSED
test_create_env_realPASSED
test_env_language_action_spacePASSED
test_env_discrete_action_spacePASSED
test_env_obsv_spacePASSED
test_step_realPASSED
test_step_invalid_actionPASSED
test_action_actions_maps_reflect_valid_actionsPASSED
test_step_valid_action_not_supportedPASSED
test_obsv_fakePASSED
test_blstats_condition_nonePASSED
test_blstats_condition_flyingPASSED
test_multiple_obsv_fakePASSED
test_step_fakePASSED
test_statuePASSED
test_warningPASSED
test_swallowPASSED
test_zap_beamPASSED
test_explosionPASSED
test_illegal_objectPASSED
test_weaponPASSED
test_armourPASSED
test_ringPASSED
test_amuletPASSED
test_toolPASSED
test_foodPASSED
test_potionPASSED
test_scrollPASSED
test_spellbookPASSED
test_wandPASSED
test_coinPASSED
test_gemPASSED
test_rockPASSED
test_ballPASSED
test_chainPASSED
test_venomPASSED
test_riddenPASSED
test_corpsePASSED
test_invisiblePASSED
test_detectedPASSED
test_tamePASSED
test_monsterPASSED
test_plural_end_eyPASSED
test_plural_end_yPASSED
test_plural_defaultPASSED
test_plural_end_sPASSED
test_plural_end_fPASSED
test_plural_end_ffPASSED
test_plural_lavaPASSED
test_wrapper_only_works_with_nle_envsPASSED
test_wrapper_requires_all_keysPASSED
test_playPASSED
test_time_resetPASSED
test_time_stepPASSED
Table 4

List of core dependencies for the wrapper. The Component column identifies what the dependency is required for, where those marked base are required to use the wrapper, dev are required for development, and agent are required to train or run the included sample factory agent. The Dependency column specifies the library name and the version. Finally, the Function column specifies the role of the library in the project.

COMPONENTDEPENDENCYFUNCTION
basegym>=0.15, gym<=0.23Wrapper base class
baseminihack>=0.1.3Enable wrapper for MiniHack
basenle==0.8.1Base environment
basepybind11>=2.9Implement high performance functions
devblack>=22.6.0Formatting Python
devflake8>=4.0.1Linting Python
devpytest>=7.1.2Test framework
devpytest-cov>=3.0.0Test coverage
devpytest-mock>=3.7.0Test mocks
devpygame>=2.1.2Used for specific test
devisort>=5.10.1Sort dependencies
devnumpy>=1.21.0Used for test framework
agentsample_factory>=1.121.4RL framework
agenttransformers>=4.17.0Language model for agent
DOI: https://doi.org/10.5334/jors.444 | Journal eISSN: 2049-9647
Language: English
Submitted on: Oct 25, 2022
Accepted on: Mar 16, 2023
Published on: Jun 13, 2023
Published by: Ubiquity Press
In partnership with: Paradigm Publishing Services
Publication frequency: 1 issue per year

© 2023 Nikolaj Goodger, Peter Vamplew, Cameron Foale, Richard Dazeley, published by Ubiquity Press
This work is licensed under the Creative Commons Attribution 4.0 License.