https://github.com/adrianogil/metagame
JSON-based language for defining text-based games
https://github.com/adrianogil/metagame
interactive-fiction python text-based-game-engine
Last synced: 7 months ago
JSON representation
JSON-based language for defining text-based games
- Host: GitHub
- URL: https://github.com/adrianogil/metagame
- Owner: adrianogil
- Created: 2019-07-14T00:43:47.000Z (over 6 years ago)
- Default Branch: main
- Last Pushed: 2025-06-08T01:00:19.000Z (7 months ago)
- Last Synced: 2025-06-08T01:38:11.185Z (7 months ago)
- Topics: interactive-fiction, python, text-based-game-engine
- Language: Python
- Homepage:
- Size: 97.7 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Metagame
Metagame is a JSON-based language for defining text-based games. It provides a framework for creating and running games based on JSON files that define game concepts and actions.
## Getting Started
To get started with Metagame, you need to set up your environment. Add the Metagame directory to your PYTHONPATH by modifying your bashrc file:
export METAGAME_PYTHON_PATH=/path/to/metagame/python/
export PYTHONPATH=$METAGAME_PYTHON_PATH:$PYTHONPATH
You can also use the provided bashrc.sh script to set up your environment.
## Running a Game
To run a game, use the following command:
python3 -m metagame path/to/game.json
Replace path/to/game.json with the path to your game file.
## How to run "Simple Dialog generation" sample
python3 -m metagame samples/00_textgeneration/sample_0003_dragon_description
## Game Files
Game files are JSON files that define game concepts and actions. The Metagame engine loads these files, parses the data, and runs the game loop.
Here is an example of a simple game file:
```json
{
"concept1": {
"attribute1": "value1",
"attribute2": "value2"
},
"concept2": {
"attribute1": "value1",
"attribute2": "value2"
}
}
```
## Contributing
Feel free to submit PRs. I will do my best to review and merge them if I consider them essential.
## License
Metagame is licensed under the MIT License. See the LICENSE file for more information.