microsoft/TextWorld

​TextWorld is a sandbox learning environment for the training and evaluation of reinforcement learning (RL) agents on text-based games.

What it solves

TextWorld provides a way to automatically generate text-based games to create a scalable sandbox for training and testing reinforcement learning (RL) agents. It solves the problem of needing diverse, structured environments to evaluate how well an AI can understand and interact with a text-based world.

How it works

The framework allows users to generate custom games using a script (tw-make) where they can specify parameters like world size, number of objects, and quest length. These games are exported as Z-machine files. Users can then interact with these games via a terminal or through a Python API that follows the OpenAI Gym standard, allowing RL agents to send commands and receive observations, scores, and state updates.

Who it’s for

It is designed for researchers and developers working on reinforcement learning, natural language understanding, and AI agents that need to learn from interaction in a simulated text environment.

Highlights

  • Automated Game Generation: Quickly create custom text-based worlds with adjustable complexity.
  • Gym-like API: Seamless integration with standard RL workflows via a Python interface.
  • Visualization Tools: Includes tools to render game states, take screenshots, and show graphs of the world.
  • Extensible Sandbox: Supports the creation of diverse scenarios to test agent robustness.

Related

  • Project
  • Project
  • Project
  • Project