Deployed Site: Here
The Cave is a text adventure RPG game where the player choses their race, class and preferred weapon. These initial decisions impact the player's stats in-game and whether or not they will be able to escape the cave alive! Decisions that impact the game are stored in Google Sheets and are retrieved when relevant to the game.
I wanted to create a text based adventure game based on the "Choose your own adventure" books I used to read as a child, while also incorporating some Dungeons & Dragons elements to the game. My goal was to create something that has been done before but with an added twist of your decisions actually impacting whether or not luck will be on your side.
- Python for the main game-play.
- GitHub as a remote repository.
- Heroku to deploy the website.
- Visual Studio Code as a local IDE & repository.
- Google Sheets API to store player information.
- diagram.net for making the flowchart for the game.
- patorjk.com for converting text to ascii art.
- canva for my README banner.
- Old school RPGers who would have played choose your own adventure novels in their youth
- People who are fans of Dungeons and Dragons
- Those who enjoy basic text adventure games
- Those who enjoy interactive novels
- Intro Screen: The intro screen that shows when the player first loads the game was made using a text to ascii art generator. This section of the program gives the user a clear idea of how the game works and what to expect. The user must press 'Enter' to trigger the start of the game, otherwise the intro screen will stay as it is.
- Player Name: The player can here enter their name. It will then be stored in the database in the linked Google Sheet until the next player begins the game. Note: text speed in these examples is faster as snippets were taken while testing. Speed was increased to help with testing.
- Player Class: Like the player name, the player is then given the choice of three classes to choose from. This is the first choice which will impact the player's statistics. The player class is then uploaded to the Google Sheet also and their statistics are updated.
- Preferred Weapon: The player is then asked to choose which weapon they prefer to use. The weapons offered to the player depend on which class they have chosen before. In this example, because the player chose to be a mage, they were offered a staff or spell tome. Should they have picked warrior or ranger, they would have had the choice of a sword or axe, or a bow or dagger. This choice is important later in the game when the player has the chance to obtain a weapon. If the weapon they find matches their preferred weapon, they get a better attack stat boost.
- Player Race: The last major decision the player must make before really beginning the game is which race they will be. Again, depending on their choice, their stats will be altered. Dwarves have better strength, elves have better dexterity etc.
- Google Sheet: After playing the game as above, our google sheet will now look like below. The player does not see this but the sheet is where their statistics are stored, their inventory etc. Some events only appear to the player if they have a certain object in their inventory for example, such as a light source or the key.
- Exit Game: For every decision, the player is given an opportunity to end the game and exit, usually as option 3. After the player has selected this option, they are then given the option to restart the game and play again. If they type yes, they will be brought back to the section of the game where they input their name and the Google Sheet will be reset.
- Colour : I would like to incorporate some colour into the game if I had the time. I feel like this might help give it some life.
- Store Player Outcomes: Potentially storing each player's name and whether or not they escaped. I'd love to include this as a scoreboard on the intro screen.
- Add more events, weapons, classes and races.
- Add more in-depth enemy encounters. I had initially planned on the fight with the skeleton to have more outcomes, such as him hitting you and doing a certain amount of damage to reduce your HP. Due to time constraints I had to reduce work done on that and make it a bit more basic. In the future I would prefer to have the player's HP make more of a difference to the story.
- Show player HP/Defence/Attack etc in some sort of banner.
- In truth, there are a lot of things I would love to do with this game in the future, but I think to implement them I would have to remove the need for the google spreadsheet and store the player information internally. This would mean quite a lot of re-writing code, which unfortunately I do not have time for at the moment.
Below is the flowchart I made to follow along while coding. I initially wrote this out on paper and then used diagrams.net to create it digitally.
Testing document can be found here
- I am unsure how the game would work if more than one person tried to play at the same time. I believe because one person would overwrite the info of the other it would cause issues.
- I am aware in rare cases, sometimes a player can "cheat" when they die by inputting "3" at a certain stage to go back to an earlier stage in the game. I have reviewed the code and cannot see how this is happening, although it has only happened once during peer review when a fellow student intentionally tried to break the game to find bugs. Thanks Jeffrey! Haha!
- Go to Heroku
- Go to 'New' and select 'Create a new app'
- Input your app name and create app.
- Navigate to 'Settings'
- Install the needed buildpacks. Select Python and install and then node.js and install and then click save. They must be in this order.
- Navigate to the 'Deploy' section.
- Connect to GitHub, search for your repo and confirm.
- Choose branch to deploy.
- Your app should now be available to see. You can choose whether to have your app automatically redeploy with every push or to keep it manual.
- Login/signup to GitHub.
- Locate the relevant repository - in this case gracemcken/the-cave
- Click on the 'Fork' button in the upper left.
- Your forked version of this repo will be generated!
- https://stackoverflow.com/questions/60608275/how-can-i-print-text-so-it-looks-like-its-being-typed-out for help with text speed. Also Eventyret_mentor for his help on this issue!
- https://codeigo.com/python/check-if-user-pressed-enter For the code for intro()!
- Git was used as the version control software. Commands such as git add ., git status, git commit and git push were used to add, save, stage and push the code to the GitHub repository where the source code is stored.
As always, many many thanks to my partner for his patience while I worked on this project and of course my mentor Spencer and my friend Brynjar, who as always was an excellent rubber duck whenever I had an issue I couldn't work past.