Python Text Adventure: Objective Impact

Posted by:

|

On:

|

Objective Impact is what I chose to call the mystery text adventure game that I started building in Python. During my first semester of school I took an Intro to Game Development class which taught the basics of game programming as well as the basics to get started with programming in python. For our first major project we were instructed to build a text adventure game using what we’ve learned so far, I admittedly have never played a text adventure game nor did I ever really thought about them aside from passing mention in documentaries and articles about the history of gaming.

Before this project I binged listened to episodes of the podcast Designer Notes and in episode 53 there’s a 2 part episode Soren Johnson interviewed the developer John Ingold, who’s work includes games like 80 day’s and Sorcery! to name a few. Hearing him talk about the development of the first sparked my interest in the design challenge of building a game that can grab the players attention and be entertaining all with the text and player choices. I had no idea where to start nor have I ever even written a story so I started off by brainstorming, research, and just world building so I had a solid foundation for telling a story in the world I’ve created.

Utilizing the GDC Youtube channel I got to work taking notes, learning as much as I could about how games like Sorcery!, All Aboard, and Heaven’s Vault were built. I highly recommend checking out the GDC channel they have some amazing talks from equally amazing developers who shared all the challenges they encountered during development and how they overcame those challenges. Check out a few of the videos at the bottom of the article if you’re interested.

This project helped me learn a lot about programming in python as well. In this series I’ll be talking about how I built the first version of my game as well as the plans for the final version which I’ll be sharing for anyone to download and play as well as alter so you can create you’re own text adventure.

To get the game working I had to be able to write and organize the story text / dialogue in a way that was easy to manage. For the first version I choose a simple text file and wrote a function that would read through and story each line in a list that I could call in any situation. I used a dictionary to store and call functions that used the player options as key values. I built a function that would handle player input by enumerating the key values from the appropriate dictionary so the player could only answer by choosing the number that was paired with the key value option and would ask the player to pick an option from the list if they tried picking an option that was not given as a choice. I also wrote a function that made it easy to call multiple lines of story text with breaks in between so the player doesn’t get a wall of text all at once. I built some mechanics for a mini game to break through a locked barrier in the game as well.

Planning by mapping out the story with the dialogue options
Writing the story text and dialogue in a text file to be called by indexing the line number
The game prototype running in the terminal

The project checked all the boxes I needed to get a good grade in the class but I still struggled to figure out how to make the game fun and felt like it was missing something important still. Since then I’ve done more research and studied other games that manage to really simulate what you’d imagine being a detective is like such as Shadow of Doubt (I highly recommend this game it does an amazing job at putting you in the shoes of a detective solving a mystery).

I’ll be updating this blog series once every 2 weeks and will be going over the code I’ve written so far and the new game mechanics I’m working on. I never thought I’d be into building a game without graphics (other than the UI I’ve began working on inspired by the simplistic presentation of Sorcery!), but I was surprised to find myself excited to focus on only the code and building the systems that made even the simple version of my game work.

2 responses to “Python Text Adventure: Objective Impact”

  1. A WordPress Commenter Avatar

    Hi, this is a comment.
    To get started with moderating, editing, and deleting comments, please visit the Comments screen in the dashboard.
    Commenter avatars come from Gravatar.

  2. Adam Avatar
    Adam

    test