TSANCHEZ'S BLOG

Text RPG

This is another one of my really old projects. But I still like how it turned out.

At some point or another, everyone goes about making a text based adventure game. So the question really is: how can I make one that is different?
Let’s start with a screenshot so you can see some of the different features available to the player:

First off, I played around with the console manipulation functions in Windows. This allowed me to add persistent formatting, and colors. Next, (though you can’t tell from a single shot) I have a live-update time of day. Turns progress without your interaction, and events can trigger whenever. And finally, you can see the HP/Strength stats on the side. This is one of those missing features. I had planned to add combat to the game, but never got around to it.

As for the game itself, I wanted to make a very data-driven project. This meant designing a flexable, yet simple file format to describe all the stuff that could be in the game.

Item
{
  type "3rd floor lobby elevator"
  usestate "broken elevator"
  Description { state "all" text "The elevator does not seem operational, but it was at one point. A trail of blood leads to the elevator doors. Someone was brough through here, and they were sevearly injured." }
}

Trigger
{
  Cond { state "broken elevator" }
  Act { state "broken elevator" op "-" }
  Description { state "all" text "Nothing seems to happen when you press the elevator call button." }
}

Room
{
  name "Hospital Hall, 3rd Floor Lobby"
  Passage { dir "west" to "Hospital Hall, 3rd Floor West" }
  Passage { dir "north" to "Hospital Stairs 3rd Floor" }
  Passage { dir "south" to "Hospital Hall, 3rd Floor South" }
  Description { state "all" text "The 3rd floor lobby seems errily desterted. An elevator and stairwell on the north wall provide access to the lower levels." }
  Item { name "elevator" type "3rd floor lobby elevator" }
}

This let me quickly design items, rooms, and interactions between things.

Taking a look at the code, I borrowed a lot of ideas from the Enginuity Engine tutorials on Gamedev.Net. This means there is a lot of invented code, like the LList class, that should probably be replaced with std::list and the like. But, it all compiles! Thing is, that I never did get around to finishing all the features I wanted in the game. There were plans to add creature combat of some sort, as well as player stats and equipment to modify that combat. There were also plans to add spells. What is there, can atleast make for some interesting puzzles, even if it does lack the action.

Win32 Download – Contains Win32 executable, updated VS2010 project, and full source.

Copyright © 2002-2019 Travis Sanchez. All rights reserved.