Text RPG is a console-based role-playing game written in C++, featuring character creation, turn-based combat, and a persistent save/load system.
This project focuses on core game logic, state management, and file I/O, making it a solid demonstration of C++ fundamentals and system-level programming on Windows.
- Character creation (name, stats, progression)
- Turn-based combat system
- Simple enemy encounters
- Text-based exploration and menu navigation
- Manual save and load support
- Persistent character data stored on disk
- Multiple save files supported
- Binary file I/O using the Windows API
- Player stats and leveling
- Combat calculations
- Input validation and error handling
- Game state persistence between sessions
g++ -std=gnu++17 SimpleRPGfinal123.cpp -o TextRPG.exe
TextRPG.exe- Navigate to the
output/folder - Run
TextRPG.exe
TextRPG/
├── SimpleRPGfinal123.cpp
├── save/
│ └── savefile/
│ └── *.sav
├── output/
│ └── TextRPG.exe
└── README.md
- Player stats are stored in a structured data model
- Stats directly affect combat outcomes and progression
- Character data persists across sessions via save files
- Turn-based combat loop
- Player and enemy actions resolved sequentially
- Damage calculated using player stats and enemy attributes
- Game ends when the player’s HP reaches zero
- Save files are stored in the
save/savefile/directory - Each save file contains:
- Character name
- Player stats
- Progress data
- Data is written to and read from disk using binary file operations
- Required directories are created automatically if missing
- Language: C++
- Standard: C++17
- Platform: Windows
- File I/O: Windows API (CreateFile, ReadFile, WriteFile)
- Build Tool: g++ (MinGW)
- C++ control flow and data structures
- Binary file handling
- Game state persistence
- Console-based UI design
- Defensive programming and input validation
- Cross-platform file I/O support
- Inventory and item system
- Expanded enemy variety and basic AI
- Configurable difficulty levels
- Refactor to modern C++ (std::filesystem, RAII, smart pointers)
This project is released under the MIT License. Feel free to use, modify, or extend it for learning purposes.