The “Vim keybindings!” Award


Presented by mauve to:

FacilityVI (FacilityVI)
The game about escaping from vi.
(Rogue: Through The Veil)
Rogue: Through The Veil is yet another roguelike. In this twist on the classic game, you are constrained to a dungeon of your normal, everyday monsters and items. However, just beyond the veil there exists a magical world where incredible creatures roam and mystical items await discovery. During your search for the Amulet of Yendor, you will discover how to go beyond the veil, transitioning between the realms of reality and the magical. You will be able to bring magical items back to the real world to aid you in your quest, but beware, the magical world is a dangerous place.

This game is one I've been thinking of since I discovered Rogue a few weeks ago, I'm so glad PyWeek just happened to be around the corner and with a perfect theme! Now I'm going to work flat out all week to try and get a minimal version of this running. Despite the description, there are still many unanswered questions as to how this game will work. It'll need some experimenting to get just right.

In-keeping with Rogue, it will use ASCII graphics, but I will also use colour. It will also have no sound. I'm going to be using tcod, which is a Python interface to libtcod library. The docs are here: https://python-tdl.readthedocs.io/en/latest/

I spend my days as a PhD candidate researching in the field of ontology/knowledge graphs with applications in systems, so also conducting research into systems thinking and mereology.  This means I'm looking forwards to Python 3.7's data-classes with keen-interest. I'm not going to use Python 3.7 for this because it has not been released yet, I am however going to try a programming style I've being mulling over as a result of my research into systems and ontology.

For this project I will use a class to represent a data-type, such as a "Potion of Healing" or "Snake". These classes will have no methods of their own, the only functionality I will give them will be in generating their properties, and perhaps nice __str__ methods. A class will be mutable and in Python I can access their instances in functions without passing them in explicitly, which is what I want. I will also use an ontological perspective on inheritance, so if I assert in a type hint that the arg: MovingObject, then it could also be any child class of MovingObject, such as Player. Child classes are not allowed to overwrite anything in their parent classes, they can only have additional properties and default values for existing properties.

Functions are considered to be mappings of global states, they don't belong to the thing that effects them, therefore no methods are used. Therefore, all functions will be public and able to act on any class that they are capable of acting upon. So the function "move" will be able to act on anything that has an x and y position, whether I intended it to or not. This is closer to reality, I currently have a burnt out old XBox providing the function "door-stop", I'm pretty sure if Microsoft coded the world it would not have had that function. I expect it will also offer greater flexibility and code re-use. This project will be an interesting proving ground for these ideas and a demonstration of how data-classes may be used from Python 3.7 onwards, I will be updating this project to use them at some point.

Finally, I'll be keeping a daily blog on progress at www.paulbrownmagic.com/blog

Enjoy your PyWeek, happy coding!
Paul