A turn-based Pokémon RPG simulation engine implemented entirely in GNU Prolog. Features open-world grid navigation, dynamic wild Pokémon encounters, a full combat system with elemental type effectiveness, inventory and party management, sidequests, and an endgame boss encounter.
Developed for the IF1221 Computational Logic coursework at Bandung Institute of Technology (ITB).
-
Grid-Based World Exploration
- 2D grid world coordinate system with boundary checking and obstacle detection.
- Directional movement with single-key shortcuts (
w,a,s,d). - Interactive map locations including wild grass zones and PokeCenters for healing party members.
-
Turn-Based Battle Engine
- Four core combat actions: Standard Attack, Defend, Elemental Skills, and Item/Potion usage.
- Elemental type effectiveness chart (Fire, Water, Grass, Electric, etc.) applied dynamically via pattern matching.
- Skill cooldown management and level-gated skill unlocks (e.g. secondary skill unlocked at Level 5).
- Damage calculation engine incorporating base attack, target defense, elemental multipliers, and critical hit probability.
- Opponent AI with randomized tactical action selection.
-
Capture & Party Management
- Wild encounters across Common, Rare, and Legendary tiers.
- Capture mechanic calculating catch rates based on remaining target HP.
- Party management system supporting active roster organization, swapping, and stat scaling.
-
Inventory & Item Management
- Dynamic inventory storage managing Pokéballs, Potions, Super Potions, and Hyper Potions.
- Post-battle item drops and loot tables.
-
Sidequests & Endgame Boss
- Interactive NPC dialogues and trivia mini-games.
- Challenging final boss battle with unique action phases and custom ending screen sequence.
-
ASCII Art Sprites
- Custom ASCII art sprite renderings for Pokémon species, bosses, and game logos.
Pokemon-Prolog/
├── doc/ # Course documentation and milestones
├── image/ # Visual assets and logo
├── src/
│ ├── main.pl # Primary game driver and module loader
│ └── modules/
│ ├── bag/ # Inventory, potions, and item drops
│ │ ├── bag.pl
│ │ ├── itemdrop.pl
│ │ └── usepotions.pl
│ ├── battle/ # Combat engine, damage formulas, actions
│ │ ├── actions.pl
│ │ ├── battle.pl
│ │ ├── crit.pl
│ │ ├── postbattle.pl
│ │ └── prebattle.pl
│ ├── endgame/ # Boss battle mechanics and end screen
│ │ ├── bossactions.pl
│ │ ├── bossbattle.pl
│ │ ├── bossprebattle.pl
│ │ └── endscreen.pl
│ ├── init/ # Game initialization and state reset
│ │ ├── init.pl
│ │ └── reset.pl
│ ├── interact/ # NPC interaction dialogues
│ │ └── interact.pl
│ ├── map/ # Grid map, movement, wild spawns, Pokecenter
│ │ ├── initmap.pl
│ │ ├── move.pl
│ │ ├── movementshortcuts.pl
│ │ ├── pokecenter.pl
│ │ ├── showmap.pl
│ │ ├── turn.pl
│ │ └── wildpokemon.pl
│ ├── party/ # Party roster and active Pokémon status
│ │ ├── setparty.pl
│ │ └── showparty.pl
│ ├── sidequest/ # Mini-games and trivia quiz
│ │ └── quiz.pl
│ ├── utils/ # List helpers and utility predicates
│ │ ├── list.pl
│ │ └── misc.pl
│ ├── facts.pl # Species database, types, and stats
│ ├── formulas.pl # Mathematical formulas (damage, EXP)
│ └── sprites.pl # ASCII art renderings
└── README.md
- GNU Prolog (gprolog): Version 1.4.5 or higher
Linux (Ubuntu/Debian)
Install via apt:
sudo apt update sudo apt install gprolog -y
Windows
Download the installer from the official GNU Prolog Website and ensure gprolog is added to your system PATH.
-
Clone the repository:
git clone https://github.com/Joji0/Pokemon-Prolog.git cd Pokemon-Prolog -
Launch GNU Prolog in the source directory:
cd src gprolog -
Consult the driver file:
| ?- ['main.pl'].
-
Start the game:
| ?- start.
| Command | Action |
|---|---|
start. |
Initialize a new game, register player name, and choose starter Pokémon |
w. / a. / s. / d. |
Move Up / Left / Down / Right on the world map |
map. |
Display current world map and player coordinates |
status. |
View active Pokémon stats, health, and current level |
party. |
View party roster and reserve Pokémon |
bag. |
Inspect bag inventory and potion counts |
heal. |
Heal all party Pokémon (available at the PokeCenter) |
interact. |
Interact with nearby NPCs or world objects |
help. |
View the in-game command reference |
- Philipp Hamara - 13524101
- Muhammad Aufar Rizqi Kusuma - 13524061
- Kevin Wirya Valerian - 13524019
- Jonathan Kris Wicaksono - 13524023
