Pokémon Battle Simulator: A Terminal-Based Adventure
Inspiration
As Pokémon fans and computer science students, we wanted to create a battle simulator that has very good pokemon teams. While we initially dreamed of a graphical interface, our limited experience with GUI frameworks (like Pygame) led us to focus on a terminal-based design instead. We were inspired by classic turn-based RPGs and wanted to implement an AI that could challenge players.
What We Learned
- Object-Oriented Programming (OOP): We structured our code around classes for
Pokémon,Move, andBattleto keep things modular. - AI Decision-Making: We implemented a simple yet effective AI that evaluates moves based on type effectiveness, damage output, and status effects.
- Game Logic: Handling turn order, stat changes, status conditions (like Burn or Paralysis), and move effects required careful planning.
- Testing & Debugging: We learned the importance of unit tests to catch edge cases (like moves missing or critical hits).
How We Built It
1. Core Mechanics
- Pokémon have stats (HP, Attack, Defense, etc.), types, and moves.
- Moves have power, accuracy, and type.
- The battle system follows a turn-based structure with speed determining order.
2. Terminal GUI
- Implemented a number system for move selection and switching Pokémon.
3. AI Opponent
The AI evaluates moves based on:
- Type effectiveness.
- Damage calculation (factoring in STAB—Same-Type Attack Bonus).
- Status moves (e.g., if the player’s Pokémon is low on HP, the AI may try to finish it off).
Challenges We Faced
- Complex Battle Rules: Accounting for all possible interactions (e.g., weather effects, held items) was overwhelming, so we simplified some mechanics.
- AI Balancing: Making the AI challenging but not impossible was tricky. At first, it either made dumb moves or was unbeatable—we had to find a middle ground.
- Terminal Limitations: Without a GUI, displaying battle info clearly was tough.
- Team Coordination: Merging code from three people led to merge conflicts and bugs—Git was both a lifesaver and a headache!
Final Thoughts
Though we didn’t achieve our original vision of a graphical battle simulator, we’re proud of our functional terminal version. The project deepened our understanding of Python, game design, and teamwork. If we revisit this, we’d love to add:
- A proper GUI (maybe with Pygame).
- Online multiplayer support.
For now, we’re happy with our little battle simulator—and the AI can still wipe the floor with you if you’re not careful!
Built With
- pokeapi
- python
Log in or sign up for Devpost to join the conversation.