Inspiration
This project was inspired by old school text adventure games and interactive fiction titles, such as Colossal Cave and Zork.
What it does
Our code implements a simple five room text-based adventure game to demonstrate the capabilities of the the text based adventure game engine we created.
Our code was written with the goal of being able to create highly customizable entities (such as players and enemies) and usable items (weapons, armor, spells, etc) and game objectives (such as defeating enemies, performing a specific action or solving a series of puzzles). The classes in our project were implemented with the goal of allowing the various game concepts to be implemented simply by a game designer without having to make specific instances of a large number of different game objects.
All of the logic for the game is created dynamically at runtime via user created functions that define specific objects such as enemies, weapons, items and tasks. The game engine then governs the behavior of these objects as the game is played.
The game engine also supplies an intuitive command line parser.
An example of a full game implemented using our engine:

How we built it
Our engine was built entirely in python, using only the basic modules included with python itself and not using any external or third party modules or libraries.
The Game Engine itself is implemented in 5 basic classes (Base, Entity, Room, Statuses, Usable). The demo game itself was implemented by using these 5 classes, as well as a series of small custom functions that define the basic behavior of a specific of an object. For example, a sword object is defined with a simple function that decrements a target's health by a set amount of damage, and a room's tasks are defined as small boolean functions to determine whether or not a given task is complete.
Every function in the code relies on a dictionary called 'state' that holds key information about the given state of a game, such as the player, the tasks completed by the player, unlocked rooms, etc.
Challenges we ran into
Per the retro theme of the Hackathon, we originally planned to create a simple text based adventure game in Fortran. Fortran development proved too slow and complicated (especially given our lack of experience) for us to create the complex behavior we wanted to demonstrate, so we decided to switch to python.
Another surprising issue we ran into was basic game design. Neither of us has any experience with game design itself, and we found ourselves at a loss when, when planning the features of our TBA game, we tried designing the basic game itself. After drafting a few basic ideas, we focused on making out code as modular and reusable as possible so that new rooms, games and entities could be added easily as. This resulted in the project being less focused on making an individual text based adventure game and more about created a suite of basic tools that would allow a team to rapidly develop a text based adventure game that they had designed.
Accomplishments that we're proud of
By the end of the hackathon, we were happy with how simple and intuitive it was to add new entities, items, rooms and tasks, and how we were able to demonstrate different game behavior using the same basic classes. Once a user becomes accustomed to creating basic object instances and creating the small functions that define object behavior, creating game objects becomes a fast and simple process
The engine's underlying code is also quite stable, and will function smoothly so long as the simple functions defining specific object behavior work.
Finally, we are proud of the fact that, with no game design experience or instruction between us whatsoever, we were able to create a basic toolset for game creation.
What we learned
We learned how to create a series of basic objects that could be extensively customized by user-created functions without worrying about implementing the specifics of the underlying objects' interactions. We also learned how to implement basic game behavior in a context removed from specific game design choices.
What's next for Retro-TBA
We would like to develop a more complex game developed using out engine would be the next demonstration of our engine. Our engine is capable of much more complex weapon, item and entity behavior that demonstrated in our demo; for example, the action logic for a given entity ('Goblin Dude) could be created as an AI routine to allow more complex behavior than repeated attacks, and the task logic could be written to demonstrate our engines ability to handle complex, multi-room puzzles. We also did not get a chance to demonstrate the more complicated gameplay aspects our engine is capable of, such as possible status effects like 'poison' or 'slow'.
Built With
- https://github.com/john-whiting/retro-tba
- python
Log in or sign up for Devpost to join the conversation.