Skip to content

justinbeetle/pyDragonWarrior

Repository files navigation

pyDragonWarrior

pyDragonWarrior Title Image

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.

language license Python application mypy Pylint CodeQL Code style: black

Installation

  1. Install python: Install the latest Python 3 version from https://www.python.org/downloads
  2. Install git: Install the latest git version from https://git-scm.com/downloads
  3. Install pyDragonWarrior: git clone https://github.com/justinbeetle/pyDragonWarrior.git

Running

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.

Controls

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:

  1. Talks to an NPC if the player character is facing one
  2. Opens a chest or door if the player character is on or facing one
  3. Takes the stairs if the player character is on a staircase
  4. 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.

Features

  • 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

Building for Distribution

Using PyInstaller on Windows

  1. python -m venv pyinstaller_venv
  2. source pyinstaller_venv/Scripts/activate
  3. pip install .
  4. pip install pyinstaller
  5. pyinstaller --onefile --name pyDragonWarrior --add-data "data;data" --icon data/images/icon.ico --splash data/images/title.png src/pydw/game.py

Using Docker

  1. docker build -t pydw .
  2. docker run pydw (requires X11 forwarding and I haven't tested it yet)

Using Replit

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.

Credits

Source Material

Dragon Warrior

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

Archived Dragon Warrior Materials

Thanks to the people who have preserved the artwork and information from Dragon Warrior to share it with future generations.

Art

Tilesets

I've extended Pita's tilesets for use on this project. Here are some sample images of the new maps.

  • Tantegel Castle Throne Room
    Tantegel Castle Throne Room
  • Map of Alefgard
    Map of Alefgard
  • Brecconary
    Brecconary
  • Erdrick's Tomb
    Erdrick's Tomb Upper Level Erdrick's Tomb Lower Level

Character Sprites

Encounter Backgrounds

  • 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.
Lopez Robin: beach
beach
Rowan Heuvel: beach_jungle
beach_jungle
Arash Bal: deciduous_forest
deciduous_forest
Imat Bagja Gumilar: deciduous_forest_dark
deciduous_forest_dark
Raimond Klavins: deciduous_forest_light
deciduous_forest_light
Keith Hardy: desert
desert
Dann Zepeda: desert_city_ruins
desert_city_ruins
Paul Chambers: desert_cliff
desert_cliff
Austin Anderson: desert_close_mountain
desert_close_mountain
Parastoo Maleki: desert_distant_mountain
desert_distant_mountain
Mostapha Abidour: desert_hill
desert_hill
Ivan Aleksic: gate
gate
Jeremy Cai: hill_distant_mountain
hill_distant_mountain
Isaac Quesada: jungle
jungle
Ehud Neuhaus: jungle_dark
jungle_dark
Conscious Design: jungle_light
jungle_light
Hugo Delauney: pine_forest
pine_forest
Dylan Leagh: pine_forest_dark
pine_forest_dark
Andrey Kigay: pine_forest_light
pine_forest_light
Stanislav Klimanskii: plain
plain
Tim Nieland: plain_cliff
plain_cliff
Edan Cohen: plain_close_mountain
plain_close_mountain
Viateur Hwang: plain_deciduous_forest
plain_deciduous_forest
Kirill Shavlo: plain_deciduous_forest_cliff
plain_deciduous_forest_cliff
Mathew MacQuarrie: plain_deciduous_forest_close_mountain
plain_deciduous_forest_close_mountain
Angela Loria: plain_deciduous_forest_distant_mountain
plain_deciduous_forest_distant_mountain
Achim Ruhnau: plain_deciduous_forest_hill
plain_deciduous_forest_hill
Claudel Rheault: plain_distant_mountain
plain_distant_mountain
Hayarpi Mkhitaryan: plain_hill
plain_hill
Paul Trienekens: plain_pine_forest
plain_pine_forest
Mick Haupt: plain_pine_forest_cliff
plain_pine_forest_cliff
Gabriel Phipps: plain_pine_forest_close_mountain
plain_pine_forest_close_mountain
Christina Brinza: plain_pine_forest_distant_mountain
plain_pine_forest_distant_mountain
Kseniia Rastvorova: plain_pine_forest_hill
plain_pine_forest_hill
Daniil Lobachev: river
river
Jordan McQueen: shore
shore
Yves Sinoir: shore_cliff
shore_cliff
Gunnar Ridderström: swamp
swamp

Fonts

Python Libraries

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:
    • pytmx: Python library to read Tiled maps
    • pyscroll: Python library to render Tiled maps

Tools

Python Development Tools

  • 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

Image and Map Building Tools

About

Python based Dragon Warrior clone

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages