A Python based Dragon Warrior clone. Dragon Warrior was chosen as a game with which I have sentimental attachment but the intent is that it eventually evolves into a unique fantasy game in the spirit of Dragon Warrior instead of being an out-and-out clone or reimagining.
- Install python: Install the latest Python 3 version from https://www.python.org/downloads
- Install git: Install the latest git version from https://git-scm.com/downloads
- Install pyDragonWarrior: git clone https://github.com/justinbeetle/pyDragonWarrior.git
Execute pyDragonWarrior/src/pydw/game.py
Note: Running game.py runs a subshell command to install the required Python libraries in a venv using pip.
Control | Keyboard Bindings | Gamepad Bindings |
---|---|---|
Move | WASD or Arrow Keys | D-Pad |
Interact or Make Selection | Enter or E | A |
Enter Menu or Leave Menu | Space or Q | B |
Exit | Escape | Select |
Quick Save | F1 | Menu |
The interact control does the following in order of precedence:
- Talks to an NPC if the player character is facing one
- Opens a chest or door if the player character is on or facing one
- Takes the stairs if the player character is on a staircase
- Searches in all other cases
Note: Gamepad support is based on an XBox One controller. Other controllers have not been tested and may have different button naming schemes.
- Fully playable game with a few deviations from Dragon Warrior. If you get stuck, try using a Dragon Warrior
walkthrough while keeping in mind the following notable
deltas from Dragon Warrior:
- The controls are different. They are streamlined but clumsy and will probably be retooled at some point. Stairs are traversed automatically, which can be really annoying in dungeons.
- Item management is different. Unlike Dragon Warrior, armor and weapons must be manually equipped and multiple pieces can be owned. Items followed by an 'E' are equipped. Items must be unequipped before they can be sold. There are no item caps on the number of herbs and keys you are carrying. The item menus don't support scrolling yet, so collect lots of different items at your own peril.
- Cursed items have no implemented behavior. Implementing them has never made it to the top of my TODO list because no one that knows what they were doing would equip them in the first place.
- Once I make the new Tiled maps using licensed art available, there will be more differences:
- The new maps frequently have more doors. Most of the new doors are not locked and can be opened without a key. They are visually identical to locked doors, so you'll have to try to open them to see. Don't wait until you have keys!
- In the new maps I'm coming up with new ways to hide stuff that was previously hidden by the ridiculously few tiles we could see on screen back in the 1980s. Be prepared.
- Overworld encounter backgrounds are selected based on nearby terrain
- Provides both a classic and math (default) combat mode, where the math mode is hardcoded to reinforce the learning of my fourth grader. Until I make it configurable, you can modify src/pydw/combat_encounter.py to customize the selection of problems in the add_problem_to_use_dialog method.
- Game content is (mostly) configurable, providing a game engine capable of being repurposed to tell alternate stories
- python -m venv pyinstaller_venv
- source pyinstaller_venv/Scripts/activate
- pip install .
- pip install pyinstaller
- pyinstaller --onefile --name pyDragonWarrior --add-data "data;data" --icon data/images/icon.ico --splash data/images/title.png src/pydw/game.py
- docker build -t pydw .
- docker run pydw (requires X11 forwarding and I haven't tested it yet)
With a lot of patience, it can be played at https://replit.com/@justinbeetle/pyDragonWarrior?v=1. It is not a good experience due to the limited memory and CPU.
Any Dragon Warrior inspired project or clone is indebted to the creators of Dragon Warrior. I especially enjoy the 8-bit chip tunes from Dragon Warrior, much to the chagrin of my family!
- Developer: Chunsoft
- Publisher: Enix and Nintendo of America
- Director: Koichi Nakamura
- Producer: Yukinobu Chida
- Designer: Yuji Horii
- Programmer: Koichi Nakamura
- Artist: Akira Toriyama
- Writer: Yuji Horii
- Composer: Koichi Sugiyama
Thanks to the people who have preserved the artwork and information from Dragon Warrior to share it with future generations.
- Formulas: Very informative guide on the mechanics of Dragon Warrior.
- Gameplay: My old NES died at some point after I started, so when I want to compare to the source material now I skip through the speed runs on YouTube.
- Item Info
- Music
- Script
- Sound Effects
- Sprites
- Pita Madgwick: Beautiful 16x16 pixel tilesets. Looking at them -- especially the overworld tileset -- makes me happy! These assets are licenced and as such are not stored in the repo. Distributions of the game will eventually include them.
I've extended Pita's tilesets for use on this project. Here are some sample images of the new maps.
- Mega Tiles: Adorable 16x20 character sprites. These assets are licenced and as such are not stored in the repo. Distributions of the game will eventually include them.
- Unsplash: Encounter background images were sourced from a variety of contributors. Some images have been modified. In game the images are pixelated to better jive with the other pixel graphics.
The pygame library is integral to this project. Migrating to using Tiled maps and leveraging pytmx and pyscroll have been a really nice improvement, but one that you only see with the licensed assets that are not included in the repo. A future distribution of the game will include these.
- pygame: Python library for multimedia applications
- Leif Theden:
- mypy: I wouldn't want to work on a large Python project without type annotations. And without a tool, mypy, to validate them, the type annotations wouldn't be trustworthy.
- PyCharm: Python IDE
- Pylint: Python static code analysis
- GIMP: Image editor
- Thorbjørn Lindeijer:
- Tiled: 2D map editor