‘Bearly’ Made It Out

A Text-Based Adventure

2019

#C++ #json #C# #WinForms #VisualStudio #SQLite

This is a command-line, text-based adventure game (in the style of the classic game, Zork), written in C++ using Visual Studio. You play as a bear trying to escape a zoo, and as the player, you type out various commands to interact with items, guards, animals, and traverse various locations.
All game data was created in an external tool and loaded in through json files.


bearTransparent.png

Game Overview

As a bear sneaking around the Turonno Zoo at night, you traverse different animal enclosures and the pathways between them. You start off in the bear enclosure and then go off to search for 5 pieces of clothing to create a disguise. Once all items are found, go back to the bear enclosure, type ‘GO TO SLEEP’. The bear will go to sleep, wake up in the morning, put on all of the clothes, and walk out of the zoo unnoticed. You win! You can search, attack, travel (north south, east, west), pickup and drop items. If there is a guard in your location, they will tranquilize you if you perform any actions before attacking them. This is like “dying’ in the game, and you respawn back in your enclosure but your items are dropped. Once a guard is attacked, they go unconscious, and must be hidden. If you don’t hide the body, the next time you visit the location, you’ll get tranquilized by other guards who found the body.

Item Checks

There are some items and directions that are locked unless the player and/or player’s location have specific items. For example, one of the items are unlocked if a banana is in that location.

Saving and Loading

You can save, load, or start a new game at any time using commands.

  • NEW -> Loads a new game with default data from newGameData.game.json

  • SAVE -> Saves data to gameSaveData.json (NOTE: This file is overwritten every time, so there is only one save file.)

  • LOAD-> Loads the default game data from newGameData.game.json and then loads the save data from gameSaveData.json

dataAnalysis.png

Game Data Analysis

While the game is running, there are statistics being recorded based on the user's inputs and actions. This data is stored in an SQLite database, which can then be loaded and visualized in this Analysis Tool. The data is pushed to the database once the user quits, with each game session stored as new a record in the TextBasedGameAnalytics database.

The following are recorded.

The number of times the player:

  • changes location

  • picks up an item

  • drops an item

  • attacks a guard

  • searches a guard

  • hides a guard

  • gets tranquilized


Game Data Editor Tool

A C# Winform application was developed to support this text-based adventure game.
View it here on GitHub.

This tool was used to write all of the information used in the game, and export it to JSON for easy loading into the game. The tool itself also supports saving and loading, so that any work within it can be stopped and continued at a later time.

This tool allows the user to add and edit locations, directions, and items.

The text-base adventure game was designed to have unique location names and item names. Each location has it's own set of directions, which are uniquely named within the location. The items are global, so there can't be more than one with the same name. So, items can be created, and then added to their respective locations after. This tool ensures these constraints.

Note: The game utilizes ItemCheck instances, which are basically given to directions and items to determine conditions. The parameters for these conditions can also be edited in this tool. Examples: if a direction is blocked, what message is shown when blocked, what items are required to unblock it, etc.

Previous
Previous

The Legend Of Sheridan

Next
Next

Divine Intervention