-
Notifications
You must be signed in to change notification settings - Fork 187
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Can we obtain the game map in a data format? #187
Comments
Hi @ankitvad, the underlying representation can be obtained by looking at the Here a small example. At the moment, the following requires the master branch. import gym
import textworld
import textworld.gym
options = textworld.GameOptions()
options.seeds = 1234
gamefile, game = textworld.make(options)
env_infos = textworld.EnvInfos(facts=True)
env_id = textworld.gym.register_game(gamefile, env_infos)
env = gym.make(env_id)
obs, infos = env.reset()
from pprint import pprint
pprint(infos["facts"])
# Uncomment the next line to see the overview image.
# textworld.render.visualize(game, interactive=True) Running the above code, outputs the following
I hope that helps. Let me know if that's not what you were looking for. |
Hi @MarcCote thanks for the reply. While this is definitely helpful..I was more interested in obtaining the location orientation (wrt each other) information. For example: TextWorld/textworld/challenges/simple.py Line 100 in f1ac489
Something like this. Ideally I’d like the whole map information in a parsable and processable way. Something that’s like a graph where the nodes are the different room, then those have sub graphs with nodes representing objects in the room and the property(exactly like the inventory information in the visualize diagram). Primarily, I’d like to get the location information for each room. Ie. let’s say the kitchen has a connection to the bathroom on the east side, as a result kitchen will be east to the kitchen.. etc. |
Oh.. this is perfect. :D |
Great! |
I’m sorry, I’m not able to see the exit node. Where is that exactly? In the diagram? |
My bad. I was thinking of another figure. There's indeed no exit node. So, another example of graph manipulation would be the For instance,
has been translated to
|
Hi, @MarcCote I had one additional question. If I’m using the EnvInfo filter to obtain all admissible commands at each step, is there a way to retain the env state? Every time I do something like - |
Unfortunately, the only way to achieve what you want at the moment is to do a reset and replay the previous commands. The main reason is that we depend on the state of the game interpreter (here git-glulx) which is running in another process. That said, I can think of a way we could support a "snapshot" functionality but that would require some tinkering. If you don't mind, can you create an issue for this? PS: is that your colab notebook? It looks great. |
@MarcCote Yup. Makes sense. Thanks. Sure, I'll create an issue. |
|
Hi, I've found out the --overview and --save-overview option which can generate an image representation of the generated game map with the locations and the inventory/objective. Is there a way to obtain the generated game graph/map? Which contains the different rooms and the connection label between the rooms? For example, Kitchen and a connection west to room..etc. in a text/JSON/graph format etc.. something other than an image..
Or maybe there is someplace in the repo. from where I can obtain this information?
Thanks.
The text was updated successfully, but these errors were encountered: