Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

43 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Text-based RPG

Built in Python with character progression, turn-based combat, map exploration, camping activities, and a menu-driven interface.

Technologies Used:
🐍 Python 3.12+   |   🎨 Rich (terminal UI)   |   🌐 requests 2.32   |   📄 JSON   |   📦 Managed with uv

🎯 Features

Core Systems

  • Character System (src/charactersys.py)

    • Character class with comprehensive stats (life, mana, xp, atk, defense, lvl, agi, int, str, dex, luck)
    • Three distinct character classes: Fighter, Mage, and Rogue
    • Leveling system with XP requirements and stat progression on level up
    • Combat mechanics with damage calculation and status effects
  • Menu System (src/menu.py)

    • ASCII art main menu with emoji decorations
    • New Game setup with class selection and custom name
    • Load Game functionality with save file validation
    • About section with game information and controls
    • GitHub repository integration
    • help / /help command listing all in-game commands
  • Enemy System (src/enemys.py)

    • 8 enemy types: Goblin, Orc, Skeleton, Slime, Bandit, Dark Mage, Ogre, Dragon Whelp
    • Dynamic enemy selection based on player level
    • Enemies use their own skills during combat
    • Enemy phrases and loot drops
  • Combat System (src/combat.py)

    • Turn-based combat with skill-based attacks and a free basic attack
    • Skill cooldowns, mana costs, targets and status effects (freeze, buffs)
    • XP gain and loot from defeating enemies
    • Flee mechanic based on agility with a random component
  • Map System (src/map.py)

    • Procedurally generated 10x10 map with varied terrain
    • Infinite world exploration (new maps generate at the borders)
    • Player position tracking and WASD movement controls
    • Terrain-based encounter rates (forests and mountains are more dangerous)
    • Visual map display with player marker
  • Camping System (src/camping.py)

    • Train a class attribute (Intelligence/Agility/Strength)
    • Fish for consumable items
    • Sleep to restore life and mana
  • Skills System (src/skillsys.py)

    • Comprehensive skill database with multiple categories
    • Level-based skill unlocking system
    • Physical, magical, and support skill types
  • Save/Load System (src/save_load.py)

    • JSON-based save file system with absolute paths
    • Complete game state preservation
    • Save file validation (empty/corrupt saves are handled gracefully)

Game Mechanics

  • Turn-based combat with strategic depth
  • XP gain and leveling with stat improvements
  • Random encounter system based on terrain
  • Inventory management and equipment system
  • Save/load functionality
  • Multiple character classes with unique abilities
  • Dynamic enemy scaling based on player level
  • Camping activities to train and recover

🚀 Getting Started

Prerequisites

  • Python 3.12 or higher

Installation

  1. Clone the repository:
git clone https://github.com/danboy-lab/rpgtext.git
cd rpgtext
  1. (Optional) Create a virtual environment:
python -m venv venv
# On Windows:
venv\Scripts\activate
# On macOS/Linux:
source venv/bin/activate
  1. Installing the requirements
pip install -r requirements.txt

Running the Game

python src/main.py

🎮 How to Play

Game Controls

  • W/A/S/D - Move around the map
  • I - Open inventory
  • O - Open status
  • C - Camp (train, fish, sleep)
  • SV - Save game
  • L - Load game
  • help or /help - Show this help
  • Q - Quit game

Gameplay Flow

  1. Start: Run python src/main.py to launch the game
  2. Menu: Choose from New Game, Load Game, About, or GitHub
  3. Class Selection: Pick Fighter, Mage, or Rogue for different playstyles
  4. Exploration: Use WASD to move around the procedurally generated map
  5. Combat: Random encounters trigger turn-based battles (terrain affects rate)
  6. Progression: Defeat enemies to gain XP and level up (stats increase)
  7. Survival: Try to survive as many turns as possible!

Character Classes

  • 🏆 Fighter: High strength and defense, balanced combat
  • 🔮 Mage: Powerful magic attacks, high intelligence
  • 🗡️ Rogue: High agility and dexterity, stealth-focused

📁 Project Structure

rpgtext/
├── README.md
├── data
│   ├── enemy_phrases.json
│   ├── enemy_skills.json
│   ├── locations.json
│   └── skills.json
├── docs
│   ├── ROADMAP.MD
│   └── TODO.md
├── features
│   └── atribute_tree.py
├── pyproject.toml
├── requirements.txt
├── uv.lock
└── src
    ├── __init__.py
    ├── apis.py
    ├── camping.py
    ├── charactersys.py
    ├── combat.py
    ├── enemys.py
    ├── generate_maps.py
    ├── generate_player.py
    ├── inventory.py
    ├── lvlsys.py
    ├── main.py
    ├── map.py
    ├── map_storage.py
    ├── menu.py
    ├── npcs.py
    ├── save_load.py
    ├── showstats.py
    └── skillsys.py

🛠 Development

Verifying Changes

Run the game and test the main flows (new game, combat, camping, save/load, death and restart):

python src/main.py

Adding New Features

  • Follow the modular structure
  • Update documentation accordingly

📊 Version History

  • v0.1.0: Initial release with core systems integrated
    • Combat with skills, cooldowns and basic attacks
    • 8 enemy types with unique skills and loot
    • Leveling, inventory, camping, save/load
    • Terrain-based encounters and procedural world generation

🤝 Contributing

We welcome contributions from the community! Whether you're fixing bugs, adding features, improving documentation, or helping with testing, your help is appreciated.

How to Contribute

  1. Planned tasks are listed in docs/TODO.md, but don’t hesitate to explore and add your own ideas or improvements!

  2. Fork the repository on GitHub:
    https://github.com/danboy-lab/rpgtext

  3. Clone your fork locally:

git clone https://github.com/danboy-lab/rpgtext.git
cd rpgtext
  1. Create a new branch for your feature or bugfix:
git checkout -b feature/your-feature-name
# or for bug fixes:
git checkout -b fix/issue-description
  1. Make your changes and commit them with clear messages.

  2. Push your branch to your fork:

git push origin feature/your-feature-name
  1. Open a pull request on the original repository.

Guidelines

  • Follow PEP 8 style guidelines.
  • Write clear, concise commit messages.
  • Add tests for new features or bug fixes.
  • Update documentation as needed.

Thank you for helping improve RPG Text Adventure! 🎮

🙏 Acknowledgments

  • Wish to make a cool isekai vibe in the future ;D
  • Inspired by classic text-based RPG games

About

Basic RPG Text Based Game made in Python

Topics

Resources

Stars

2 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages