Andy’s Neural Works

A wise folly can lead to great things!


A Text-Based Dungeon Crawler, Part 1 – Defining the Concept and Requirements

Published by

on

Preface

This is a start of a new series. To be clear, I am still working on The All Roads Project. I am also working toward my next step in my career. So, I am very busy now but look forward to my personal projects and experiments. I hope you enjoy this effort starting here.

In this article, I will be discussing the core aspects of a game that I have been working on. The concept is simplistic in nature but has an interesting approach that I will reveal in a future article. The important item to keep in mind is that developing a game requires a blueprint to be developed like other software engineering projects. You always need to keep a sound direction in development.

For sake of nomenclature, you should understand the basic concept of adventuring dice. In games, rolling dice is formatted in a way to show the number of dice being used as well as how many sides for the die. For example, if the roll is listed as 2d6, that means there are 2 dice, 6 sides each. If it were 1d20, that means there is 1, 20-sided dice being used. With that written, it’s time to start.

Introduction

What comes to mind when you consider the idea of making a video game? Do you see a playground where everyone is having a joyous good time? Maybe, you imagine a darkened room lit only by the many screens of developers and artists? Some of both are true based off my knowledge and connections.

What about something simpler?

How about a single person who comes up with an idea and wants to take it through to the end. Is that even possible? Maybe he has some help along the way but one thing for certain, you need to have a blueprint or map of the software. In other words, good software design practices should be followed. Otherwise, the game development effort could go on forever, in many directions, and never reach a conclusion.

For this series, I will take a concept for a game and work it out to completion. Where to start with such an effort? Let’s start with the concept for the game. This will be like a standard software application project that requires a mission statement and functional requirements. This is common practice and should work well here.

Game Concept Overview

I am a fan of text-based, fantasy adventure games. It reminds me of times playing old school, D&D where you must use your imagination. This is a bit different than my previous article on game development but it’s my game, so I get to make the rules.

If you ever play games, there is a genre in gaming called a dungeon crawler1. You progress from one area of the dungeon to the other battling one monster after another. The general concept is to keep going till you meet an enemy you cannot beat. This will be in that genre.

Let’s write the concept down in a dramatic fashion (because we’re having fun):

You are the hero of the local village sent into a nearby dungeon. Your job is to clear out the monsters that have been stalking the villagers. How far can you go before you succumb to the challenge?

Taking a pause of the game concept, we see 2 main types of actors: a hero and monsters. The hero is what the player will be while the monsters will be controlled by the system. Defining the two, I want there to be similar attributes to make it a fair game.

Definition of Hero

There are attributes to every hero that must be part of the system. Each attribute will influence the attacks and defense of the various battles. This can be an extensive list in some titles. For this game, I will keep it simple and focus on:

AttributeDefinition
Hit Points (HPs)This is the life force of the hero. It starts out at 20 points. For each point of damage taken during battle, the total number of HPs are reduced till 0. At 0, the hero is deceased.
StrengthValue out of 20. It will be a modifier on sword attacks as well as defense against sword attacks.
DexterityValue out of 20. It will be a modifier on ranged attacks (bow and arrow) as well as defense against ranged attacks.
WisdomValue out of 20. It will be a modifier on magic attacks as well as defense against magic attacks.
NameFor enjoyment purposes, the hero needs to have a name. The system must generate a random name for the hero.
StatusOne other aspect will be to provide text to give an understanding of how the hero is feeling. As the HPs decrease to 0, the status will update. Here are examples of what can be shown (this can change as development progresses):”You feel great!””You have a flesh wound.””You have seen better days.””It’s starting to hurt.””You’re near death!”
ScoreThis is a numeric representation of how far the hero has progressed. It is incremented for each victory (scoring rules follow below). I hesitate to use “experience points” on this one. I would rather it be a score value for bragging rights. It is quite possible that a version of the game will have a leaderboard but for now, it is merely a score to share with each other.
Future ConsiderationFor future versions of the game, it’s quite possible that more attributes can be added on. That will help when developing the architecture of the hero comes into play.

Rolling the Attributes Values

Each of the strength, dexterity, and wisdom attributes will be determined by the 3 best scores of a 4d6 roll. For example, if the rolls are [3, 5, 1, 2], the value of 1 is dropped given the attribute a score of 3 + 5 + 2 = 10.

Inventory

Every character in the game will have the ability to have inventory. For the standard load of the hero, it will be:

Inventory ItemInitial LoadMaximum
Sword11
Bow11
Arrows55
Magic Spells13
Healing Potions13

The inventory shall be updated when it is used. For example, if the hero shoots an arrow, he will be left with one less than originally given. The only item that does not get updated is the sword.

Definition of Monster

A monster must be matched up with attributes in a similar fashion to the hero for challenge purposes. As the hero progresses, so will the next monster. Each victory by the hero will make the monster’s attributes increase by +1 on top of the dice throws to a maximum of 20, except HPs. The HPs have no limit.

Turn-Based Rules

Given this is a text-based game, it will be turn-based. This is a common approach in Role Playing Games (RPGs). I think this will work well. Let’s define those rules before going any further.

Here are the high-level steps that will happen:

  1. Hero chooses an option from a menu
  2. Hero’s move is executed. 
  3. If the monster is defeated, hero is rewarded and moves to the next monster.
  4. If the monster is still alive, the monster picks an action.
  5. The monster’s move is executed.
  6. If the hero is defeated, it’s a game over scenario.
  7. If the hero is still alive, the cycle goes back to 1.

That’s not all to the game. Again, that’s the high-level steps. Let’s dive deeper into what options the hero and monster can perform. For version 1 of the game, here is what both can perform:

  • 3 options for attack: sword, bow and arrow, or magic
  • 1 option for healing, using a potion.
  • 1 option to try to run from the battle.

For attack, here are the steps:

  1. Roll the dice for an attack roll (1d20).
  2. Add in any modifiers from the attacker’s attributes.
  3. Roll the dice for the opposing player’s defense roll (1d20).
  4. Add in any defense modifiers from the defender’s attributes.
  5. If the attack roll is greater than the defense roll, the attack is successful.

For the damage roll:

  1. Roll the dice again for the attack damage.
  2. Add in the modifier on the attack damage.
  3. Remove the damage from the defender’s hit points

I would like to add in a little extra twist here. I want to add the ability of the defender to parry an attack if it fails:

  1. Roll the defense dice for both parties.
  2. If the defender’s roll is higher, then damage goes to the attacker

Damage Rolls

Each weapon has its own effectiveness. The sword is least damaging but can be used without exhausting supply. The bow and arrow have more damaging attack yet have a limit. Magic is the most powerful, yet it is very limited in use.

WeaponDamage Roll
Sword1d6
Bow and Arrow1d8
Magic2d8

Modifiers

As previously stated, each attribute has a modifier on a certain attack and defense of that attack. When an attack is performed, the related attribute is used as a modifier on the attack roll according to the following table:

Score RangeModifier
<5-2
>=5 and <10-1
100
>10 and <15+1
>=15+2

An example would be a sword attack by a hero that has a strength of 11. If the attack roll is a 7, the modifier would add 1 making it an attack of 8.

It is similar with defense. If the hero attacks a monster whose strength is 7 and defense roll is 8, the monster’s defense roll would have a modifier of -1 making it a roll of 7.

Healing Hit Points

Healing takes place when a potion is used. This results in a dice roll (1d8). The value is added back to the hero’s HP with a limit of their current maximum HPs defined at the start of the battle.

Run Away!

If the attacker chooses to run, a dice roll is executed as a run-away roll (1d20 + dexterity modifier). The defender is also given a dice roll (1d20 + dexterity modifier). If the attacker wins, he escapes the battle. If the defender wins, the attacker loses his turn and is caught in battle till the next round.

If the attacker is the hero, he will lose points on his score and will be humiliated. If the attacker is the monster, then the hero will gain points and abilities as if he won the battle.

Scoring Rules

For every win, the score will be generated based on the monster’s attribute scores. The score is a sum of all values. If the monster runs away, there are no points awarded.

If the hero runs away, there is a penalty equal to the monster’s attributes scores. Negative values are allowed and will be used for humiliation by other players.

Recovering Inventory

To regain lost inventory, the hero must have won a battle. For each victory, he regains 1 arrow automatically till the 5-arrow limit is reached.

For magic, he will only gain 1 spell if he wins a 1d20 recovery roll against a 1d20 dice roll. For example, the 1d20 roll takes place and results in 12. The hero rolls a 1d20 and has 10. This means he does not gain any spells.

For the healing potion, he gains 1 potion for a win of a 1d10 roll against a 1d10 roll. For each victory and successful recovery roll, he will gain 1 potion to a maximum of 3.

Improving Statistics

At the end of every won battle, the hero regains lost HPs based on a dice roll (1d6).

There are also increases to each of the hero’s attributes. The maximum value for the attributes is always 20 while HPs can increase indefinitely. The reason for the ceiling of 20 is to keep the game challenging.

End of Game

The only end to the game happens when the hero loses all HPs or the player quits. The player can choose to start all over again. All attributes and inventory for the hero are reset from the beginning as a new start. The score is reset back to zero.

Next Steps

I will set a stopping point here. The concept, rules, and definitions are in a good state. As you can tell, all that is written is a custom version of a standard functional requirements document. The focus is on the actors, entities, and the system rules. The technical aspects are for future steps. Those will build on the blueprint defined here.

With the basic requirements of the game built, the next step is to layout any data entities and attributes. This will lead to a discussion of data structures. That should be fun. This will be the focus of the next article in the series.

References

[1] Wikipedia. Dungeon crawl. Retrieved from: https://en.wikipedia.org/wiki/Dungeon_crawl