News:

All future registrations will need to be approved before activation
due to the increase in spammers registering.

Main Menu
avatar_Jason

Text Adventures

Started by Jason, November 19, 2019 @ 02:24:11 PM

0 Members and 1 Guest are viewing this topic.

Jason

I'm not sure if we've ever discussed text adventures on here before, but back in the early 80's I used to enjoy the Zork games and programmed a ton of text adeventure games on my VIC-20 computer back in 1982 and 1983. I even owned a copy of the Lost Treasures of Infocom on 3.5" floppy discs in the 90's. The discs are still in my attic, but I doubt they're still readable.

This past year I decided to go back to my PC roots and start programming again. I always planned to be a programmer coming out of college, but it didn't work out that way. Networking (mainly Novell Netware) were all the rage, so I went with what was available and just stayed in that line of work.

I had to figure out what programming language to start with since the ones I learned in college (COBOL, Pascal, FORTRAN) are not really relevant anymore. I have some C/C++ experience, but I decided to go with Python due to its popularity and its general-use features. It's also open-source with a lot of free tools.

I started watching beginner classes on YouTube and purchased some books. I was amazed at how quickly the concepts started coming back to me. Although the syntax of all the computer languages is different, the fundamentals and concepts remain the same, so I was able to move quickly once I learned the Python's syntax.

My younger son asked me to write a text-based adventure once I felt ready and we've been working on it for the past few weeks. My son just turned 9, but the story is his and he's my bug tester. The game is currently small, but I built it on a scalable foundation and programmed all the complicated logic already, and everyday we come up with new additions to the game.

Right now it's a 5 x 5 grid (25 rooms) of a castle. You wake up in the dungeon of the castle and can move North, South, East and West. You must find a sword, book, vault key, lamp and goblet before making your way to the castle exit. You have random encounters with the castle guards (5) and the knight (1). Finding the sword will give you increased odds of defeating the enemies, which is based on random numbers being drawn for you and your enemies.

You must find the vault key before being able the open the vault with the goblet, and the lamp before finding the book. You also need to find the tower key before entering the north, south, east and west towers. My son was critical in testing the logic for these conditions, including trying to access locked areas from different directions.

Our most current addition is an easy and hard choice when playing the game. Choosing easy will give you the location of all the items (they're randomized and different every time you play) and the random numbers generated for battles are increased in your favor.

My son and I can beat it in about 10 minutes right now, but the plan is to expand it to a 10 x 10 grid and of course add more enemies. Currently there's one guard per row who roam randomly within their rows and the one knight who can roam the entire castle randomly. At some point I'll post the code if anyone is interested.

BDSooner72

Sure I would give it a try, sounds interesting. Never played any of the Zorks or other text adventures but I did enjoy playing graphical adventures.

Jason

#2
I'm surprised to hear you've never played any text adventure games.

We're adding some more detail to the rooms and then I'll hopefully find a way to have people play it without the need for Python to be installed.

We are planning to add basic graphics to a later version as I'm just getting started with graphics now.

Ted

Put a file up for testing when it's ready.  I played Zork on my Commodore 64 back in the day, but was terrible at it.  Is that possible?

Jason

Zork 1, 2 and 3 are all available to download for free (http://www.infocom-if.org/downloads/downloads.html). You just need to setup a DOS VM to play them.

My game wouldn't even need to be zipped to upload it here since it's only one file and very small. I still haven't found an easy way to compile it into an .exe to avoid having people need to download Python to play it.

Sent from my LM-Q610(FGN) using Tapatalk