microsoft / TextWorld

​TextWorld is a sandbox learning environment for the training and evaluation of reinforcement learning (RL) agents on text-based games.
Other
1.23k stars 189 forks source link

Prevent overwriting quest's description and game's objective. #239

Closed MarcCote closed 4 years ago

MarcCote commented 4 years ago

At the moment, manually providing the description of a quest doesn't work as intended. It gets overwritten by the text generation process when building/compiling the game. The same thing is happening with the game's objective.

Code to reproduce the error:

import textworld

M = textworld.GameMaker()
r1 = M.new_room()
M.set_player(r1)

key = M.new(type="k", name="key", desc="This is a skeleton key.")
r1.add(key)

quest = M.set_quest_from_commands(["take key"])
quest.desc = "Find a valuable object."

game = M.build()
assert key.infos.desc == "This is a skeleton key."
assert quest.desc == "Find a valuable object."