Game freezing / general robustness to wrapped game engine
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 25/100
- Issue type
- Feature
- Clarity
- Mostly clear
- Activity status
- Stale
- Tech stack
- python
- Domain
- machine-learning
Research direction
Run the supplied Balances.z5 reproduction first, then inspect textworld.start(...), env.reset(), and env.step() around the wrapped Jericho engine. Done should be demonstrated by the environment reporting a timeout or game-crashed outcome instead of freezing or segfaulting.
Written by the indexing model from the issue text.
Description
I've noticed that when randomly sampling actions in real text games (e.g. ZMachine games not generated by TextWorld), the game inevitably freezes/segfaults at some point (It seems like Jericho has the same issue). Since TextWorld is a RL environment for text games, can we make it more robust to these problems? For example, having a timeout failure or game crashed failure?
Here's a code snippet that consistently freezes on my machine:
# !mkdir -p games
# !wget -q http://www.ifarchive.org/if-archive/games/zcode/Balances.z5 -O games/Balances.z5
import textworld
import itertools
import tqdm
import numpy as np
np.random.seed(0)
episodes = 50
episode_len = 500
scores = []
for episode in range(episodes):
print('episode {}'.format(episode))
env = textworld.start('./games/Balances.z5')
env.reset()
env.seed(0)
verbs = [w.word for w in env._jericho.get_dictionary() if w.is_verb]
nouns = [w.word for w in env._jericho.get_dictionary() if w.is_noun]
actions = [' '.join(tup) for tup in list(itertools.product(verbs, nouns))]
for step in tqdm.trange(episode_len):
act = np.random.choice(actions)
print(step, act)
game_state, score, done = env.step(act)
if done:
break
scores.append(score)
print(scores)
- Dominant language
- Jupyter Notebook
- Stars
- 1.4k
- Forks
- 207
- Avg merge
- 8d 22h
- Merged PRs (30d)
- 1
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from microsoft/TextWorld
-
Difficulty 2/5 1-3 hours Newbie friendliness 55/100
-
Memory Leaks Open
Difficulty 4/5 3-5 days Newbie friendliness 20/100
-
Difficulty 3/5 1-2 days Newbie friendliness 35/100
-
Difficulty 4/5 3-5 days Newbie friendliness 28/100
-
bug enhancement
Difficulty 5/5 Over a week Newbie friendliness 25/100
All issues in microsoft/TextWorld
Similar issues
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
vllm-project/vllm#57974 · 4 comments ·
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 90/100
torchgeo/torchgeo-bench#400 · 1 comment ·
-
Difficulty 1/5 Under an hour Newbie friendliness 90/100
open-compass/VLMEvalKit#1698 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 84/100