Nemu - Text Adventure Engine
A complete text-based adventure game framework in Rust. Create, play, and share interactive stories with rich narratives and inventory systems.
Quick Start
-
Build the project:
-
Create a new adventure:
-
Play the adventure:
-
Try in-game commands like:
look- examine your surroundingsgo north- move in a directiontake key- pick up itemsinventory- check your items
Features
- Room-based navigation with text descriptions and atmospheric details
- Inventory system with item combinations and usage mechanics
- Save/load game states with multiple slots and quick save/load
- Natural language command parsing
- Story files in TOML format with scripting capabilities
- Complex branching narratives with flags and conditions
Installation
Prerequisites
- Rust (latest stable)
Build from Source
# Clone the repository
# Build the project
# The binary will be available as 'nemu' in target/release/
Usage
Available Commands
# Create a new story template
# Validate a story file
# Play a story
In-Game Commands
Once playing a story, use these commands:
look- Look around the current roomgo [direction]- Move in a direction (north, south, east, west)n/s/e/w- Short forms for directionstake [item]- Pick up an itemdrop [item]- Drop an iteminventory- Check your inventoryhelp- Show available commandsquit- Exit the game
Story Format
Stories are written in TOML format. Here's an example:
[]
= "The Mysterious Forest"
= "forest_entrance"
[]
= "Dark Forest Entrance"
= "You stand at the edge of a dark forest. Ancient trees loom overhead."
= { = "deep_forest", = "clearing" }
= ["stick"]
[]
= "Deep in the Forest"
= "Thick branches block most sunlight. You hear mysterious sounds."
= { = "forest_entrance" }
= ["mushroom", "berries"]
[]
= "wooden stick"
= "A sturdy stick that might be useful."
[]
= "strange mushroom"
= "A glowing mushroom that seems to pulse with light."
[]
= "red berries"
= "Small red berries that smell sweet."
Quick Start Example
-
Create a new story:
-
Look at the generated story:
-
Play the story:
-
In the game, try:
look- to see your surroundingsgo north- to move to another roomtake key- to pick up an iteminventory- to see what you're carrying
Development
Building for Development
# Build in debug mode
# Run directly
# Play included examples:
Project Structure
src/
├── main.rs # CLI entry point
├── lib.rs # Library exports
├── engine/
│ ├── mod.rs # Game engine module
│ ├── game.rs # Main game state
│ ├── room.rs # Room management
│ ├── item.rs # Item system
│ └── parser.rs # Command parsing
├── story/
│ ├── mod.rs # Story loading
│ └── loader.rs # TOML parser
└── cli/
├── mod.rs # CLI commands
├── play.rs # Play command
└── create.rs # Story creation
Contributing
- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-feature) - Make your changes
- Test your changes
- Commit your changes (
git commit -m 'Add some amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
License
MIT