facebookresearch/minihack

[QUESTION] any way to respawn the agent after death

Closed this issue · 1 comments

Is there any way with des format or some internal tools not to end the episode after death, but to revive the agent at the starting position of the spawn?

For context, I want to make an additional environment to test the agent's memory. For example, fill everything with lava, then add a corridor from one start point to the end point, but limit the agent's FOV. In order to solve it, the agent would have to randomly try directions, dying in the lava and reviving, but remembering the previously opened corridor cells (to eventually get to the end point).

Thanks!

Hi @Howuhh. Thanks for your interest. There are a few solutions.

Solution 1: A quick solution could be just add the code that memorises the trajectory before dying and then recreate the exact state upon which the agent died by just selecting actions from the trajectory one after another. I know this is not perfect, but relatively easy to implement.

Solution 2: Use the wizard mode which is supported by both MiniHack and NLE. This is a debug mode of the NetHack game whereby the player may try out anything they might want to test. In complex environments wizard mode might change the environment significantly, but in your case using it out-of-the-box should be straightforward. When you die in the wizard mode, you have to select whether or not you actually want to die (yes or no question). Note that you'd have to answer this question programmatically.

Hope this help. Let me know if these work!