Skip to content
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

Issues with generating treasure hunter challenges #164

Closed
bentrevett opened this issue May 8, 2019 · 3 comments · Fixed by #219
Closed

Issues with generating treasure hunter challenges #164

bentrevett opened this issue May 8, 2019 · 3 comments · Fixed by #219
Milestone

Comments

@bentrevett
Copy link

bentrevett commented May 8, 2019

I am able to generate treasure hunter challenge maps using tw-make tw-treasure_hunter --level x, however when I try and use higher levels the map generation frequently (but not always) produces the following error:

Traceback (most recent call last):
  File "/home/ben/miniconda3/envs/pytorch10/bin/tw-make", line 191, in <module>
    game = make_game(settings=args.__dict__, options=options)
  File "/home/ben/miniconda3/envs/pytorch10/lib/python3.7/site-packages/textworld/challenges/treasure_hunter.py", line 108, in make
    return make_game(mode, options)
  File "/home/ben/miniconda3/envs/pytorch10/lib/python3.7/site-packages/textworld/challenges/treasure_hunter.py", line 211, in make_game
    world.state = chain.initial_state
AttributeError: 'NoneType' object has no attribute 'initial_state'

I can get the above error with with levels 7 onwards - tw-make tw-treasure_hunter --level 7 --seed 5 produces an error, but seeds 1-4 do not.

From experimenting with a few seeds, the success rate seems to drop rapidly as the levels increase and I was not able to generate a single level 20 map, however levels 21 onward seem to generate completely fine all of the time.

@tavianator
Copy link
Contributor

Thanks for this report! For starters, I think maybe sample_quest() should be raising NoSuchQuestError like make_quest() does, rather than returning None only to explode later.

As for why chaining is failing to find any possible quests, I'm not sure. Level 20 corresponds to the longest quest (10 steps), but with only 10 rooms, so maybe there just aren't enough things to do.

@bentrevett
Copy link
Author

bentrevett commented May 8, 2019

Looks like the issue is node.length never being long enough to pass this statement, and thus it never yields:
https://github.com/microsoft/TextWorld/blob/master/textworld/generator/chaining.py#L524

So like you said, the world isn't big enough to fit the desired amount of quest steps.

One possible solution is to increase the number of rooms? +5 for each difficulty level? Either that or reduce the quest lengths.

@MarcCote
Copy link
Contributor

MarcCote commented May 8, 2019

I'm trying to find a way to guarantee it will always work. This code was written before #111 that why it was working before, i.e. we didn't check if the actual quest length was respected. Also, this challenge is broken for higher level (see #85).

@MarcCote MarcCote added this to the 1.3 milestone Feb 13, 2020
MarcCote added a commit to MarcCote/TextWorld that referenced this issue Feb 27, 2020
MarcCote added a commit to MarcCote/TextWorld that referenced this issue Feb 27, 2020
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 a pull request may close this issue.

3 participants