Skip to main content
GameDev.net gamedev.net
🔒 Locked

In what ways can a text adventure have combat?

Started by Master thief Dec 10, 2013 at 5:38 PM 27 replies 19.7k views
Original Post
Master thief
Master thief

I've been planning a text adventure for a long time now, and combat is the part that's been giving me some trouble. I'm trying to avoid "dice rolls" in my game, which makes matters worse, and I don't know if I can actually avoid it.

To give you a better idea of what I'm trying to achieve, this is not your ordinary text adventure but rather a more... graphical one, with actual buttons and maps, inventory, item icons, etc, and I'm even considering having some sort of NPC graphics for encounters and dialogues. Otherwise every feedback the player gets is text as usual.

In essence, my goal with the combat system would be, ideally, to provide the player with a chance to be skillful at it. But... again, I'm a bit at a loss on how to do such a thing in this type of game. So for now I'm trying to figure out in what ways can a text based game have combat, so that I can take as much into consideration as I can, and hopefully come up with something. Or if someone has any great ideas I'd be happy with that too. :)

Any help or insights would be greatly appreciated.

I created a pointer of type Toilet so I don't have to go to the bathroom as often.
kseh
kseh

Do you have any thoughts on what sort of experience you want your player to have while engaged in combat? Do you see your player carefully contemplating decisions based on reports of numbers or is he maybe reading an exciting blow by blow account of the action? Do you want the player interacting such that he controls every blow, every block or do you want the player to just decide whether to begin combat at all?

Avoiding dice rolls is entirely possible. If you really take a look at combat and boil it down to its basics, you pretty much know, as the designer, what the outcome should be. Assuming the player is making typical decisions, you'll probably want combat to last X rounds leaving the player at Y health. He will encounter Z instances of combat between points A and B that will provide him enough experience and money needed to proceed to C.

In all honesty, adding in bits of randomization only modifies this result slightly because you still actually want your player to get from A to B and all the way to the end. What you're trying to do with combat is provide an entertaining challenge between those points. Adding randomness does provide a bit of suspense, but it isn't really fun to be at the mercy of a dice roll. It can however be fun to try and work out a strategy to survive getting from A to B, especially if there are several options available to do it.

ActiveUnique
ActiveUnique

Here's a simple and a complex way to do it. I think you want the complex.

Simple, damage based entirely on stats. Essentially you can limit the options as much as possible, and the options are context sensitive and uniform.

you see a pig as tall as a house

the pig sees you

the pig snorts at you

select action: attack, run away

attack

you hit the pig 0 damage

the pig snorts at you

(the player may have about 10 hp and the pig has 30 hp)

Complex, damage based partially on decision. You can assign context sensitive options like push button, as well as allow the player to many standard actions like move or look:

you see tiger

the tiger sees you

the tiger lunges at you

you have time to react

select action: dodge, parry, take, look, drop item

take

list of things you can take: tiger, self

tiger

list of things on the tiger: optionally automatic [, list of body parts[, list of detectable items tiger carries]

front left leg

you reach for the tiger's front left leg

the tiger bites your right hand

your hand is bleeding

report: (status ailments of some kind show up when available)

your right hand is being held by the tiger

you are holding the tiger's front left leg

select action: attack, run away, take, look, drop item

attack

list of things you can attack: tiger, self

self

... I'm skipping the dialogue ...

right hand

you release the tiger's front left leg and strike your right hand

the tiger throttles you

report:

right hand is dismembered

... skipping more since I can't keep it uniform anyway ...

take

self

inventory knife

you equip a knife

the tiger is eating

report:

right hand is dismembered (since it always will be maybe the message should be optionally filtered out)

attack

tiger

automatic

you stab the tiger

the tiger thrashes (unintentionally)

the tiger reacts

the tiger drops something

report:

the tiger's neck is bleeding heavily

you dropped your knife

A player with more experience would have dodged, pulled out their knife, and attacked a specific part of the tiger's body.

This is an example similar to Dwarf Fortress which is not entirely text but it relies heavily on text, each character has limbs and vital organs. The game itself is not entirely combat oriented.

I've read about the idea guy. It's a serious misnomer. You really want to avoid the lazy team.
King of Men
King of Men

Skill in games is largely about resource management. Randomisation does not change this, it only means you have to integrate over a probability distribution. So, allow the player to say (for example) "I hit the monster with 10 mana". This does a deterministic, not stochastic, amount of damage, ranging from blowing a goblin to Jupiter up to scratching the hide of a dragon. The challenge is to maintain your limited mana (and other resources) until you get a chance to stock up; so skill consists of not using 10 mana on a goblin, because that's a waste, but recognising that the dragon must be hit with 100 mana, or it will hit you back and that will not be nice. Add other resources to make the management more multidimensional (also, maybe mana is scarce and even one point is overkill on a goblin - hit it with your sword, instead, thus only expending rapidly-replenishable stamina points). This also allows monsters to have different vulnerabilities, thus allowing the player to acquire "lore skill", that is, skill that consists of knowing water elementals are vulnerable to fire mana, but not to edged-weapon attacks, and deploying their resources optimally accordingly. Of course, all this is basically just bog-standard RPG combat; the only difference is that it doesn't have to be stochastic. Make the damage algorithm deterministic and be done.

To win one hundred victories in one hundred battles is not the acme of skill. To subdue the enemy without fighting is the acme of skill.
Orymus3
Orymus3

Do you want a "system" that is reusable for each encounter, or are you okay tailoring each encounter specifically?

mdamman
mdamman

The problem with eliminating dice rolls is you remove variability from the combat. Say in the course of your game, you'll be fighting multiple goblins. If the player learns that punching twice and kicking once kills a goblin, they will do that to every goblin they see. Dice rolls give the goblin a chance to dodge, parry, take more or less damage from punch to punch. With this kind of combat system, having static values and results to every action gets boring quickly.

One alternative is what a few people have mentioned already: tailor each encounter differently. It creates more of a puzzle solving aspect to the combat. Punching twice and kicking once killed that first goblin, but this one has a shield. What are the actions and sequence I need to use to get around that? It makes winning each battle more akin to solving a puzzle.

Another alternative (that I've only half baked just now) might be to create some variability with selecting the actions themselves. Rather than typing punch every time to punch, maybe there is some code or pattern you need to crack to figure out what to type to throw a punch. Maybe the more damaging actions (a fire spell) are behind more complicated codes. I may not be explaining this very well, but the root of the idea comes from games like Puzzle Quest. A punch will always do the same amount of damage, but the difficulty is in managing to pull it off.

Adam Moore
Adam Moore

There are a lot of great ways to handle combat in a text-based game. Here are some free MUDs with combat for you to experiment with..

  • Godwars 2 - This game has an interesting and complicated combat system that involves a queue of commands for your limbs.
  • Star Wars: Knights of Darkness - This Star Wars themed MUD uses the SWR codebase which has pretty basic combat, but with some interesting additions. The game has ranged combat with blasters which allow players to snipe at enemies in adjacent rooms, as well as space travel and space combat.
  • Iron Realms - Iron Realms isn't a game, it's a company that makes a lot of good MUDs with different themes. Pick the concept that interests you most and experiment with their combat.
Master thief
Master thief
Thanks for all the feedback. You've all given me quite a lot to think about.

Dwarf Fortress' combat system is actually one of my inspirations. I like the blow by blow approach. Is DF's combat based on dice rolls? (I don't play the game in quite some time, I can't recall much of it)
I created a pointer of type Toilet so I don't have to go to the bathroom as often.
Kekko
Kekko

If you can get the The Riddle of Steel Combat Simulator from their support page http://www.driftwoodpublishing.com/support/ to work, then that gives a an overview of how text-based combat can work. It's certainly skill based but with a whole bunch of dice involved so it's random as well. Like Poker.

What kind of "dice rolls" are you trying to avoid? For example, is rock-paper-scissor ok? I choose attack A, enemy (randomly!) chooses attack B. A beats B so I win. As an extra bonus, with markov chains you cam make an AI for it if you want tougher opponents. http://www.nytimes.com/interactive/science/rock-paper-scissors.html?_r=0

I like the King of Men's talk of resource management. Let's say a swashbuckler has stamina, health, durability of his sword, four hidden daggers and two pistol shots. Stamina regenerates quickly, health slowly, sword not at all until you find a new one. Health loss in swordfights is inversely proportional to the amount of stamina expended. Throwing a dagger gives you the opportunity to run away. Pistol shots are instakill but rare obviously.

Master thief
Master thief

reference material
http://dwarffortresswiki.org/index.php/DF2010:Combat#Mechanics

Quite surprising stuff. Also quite a bit... overkill. smile.png

My goal is something simple yet versatile. Though I guess that isn't saying much.

One thing that occurred to me yesterday: Are there any sort of combat mini-games out there that I could take a look at too? I feel like some elements from other genres like adventure games and dungeon crawlers can easily adapt to what I'm trying to achieve. In fact, some things I planned are very much like dungeon crawlers in a way, now that I notice it. But combat in DC's isn't usualy something I find too interesting. I like them, but I feel they're a bit lacking...

What kind of "dice rolls" are you trying to avoid?

I was refering mostly to the typical ones found in most RPGs such as the old Baldur's Gates and Arcanum/Fallout, and even on Bethesda games (mostly on thievery).

The type of dice roll that tells you you have X% chance to fail to pickpocket or hide in shadows or to miss a sword swing, which I always found a bit obnoxious. There are situations in which I don't really mind them, but... And I'm not entirely against them, they just detract me from immersion a bit in those games. If I can't avoid them, so be it. But I always found that, for example, I had more fun being a thief in the Thief series than on any RPGs.
I created a pointer of type Toilet so I don't have to go to the bathroom as often.
ActiveUnique
ActiveUnique




I had more fun being a thief in the Thief series than on any RPGs.

That's a good one. I'll reuse it in a following example. Garrett is a master thief, nobody sees him if there's a single shadow in the room. It's the player that makes mistakes, and whatever enchantment Garrett uses to distort perception is easily broken.

But Thief wasn't about combat, although it's a great game.

It helps me if you can describe what experience you hope for the game to deliver to the player thoroughly. You don't need to give a working example. Just imagine it, and if it's hard to make sense of write it down and revise it for yourself, or for someone else to read.

Example from a different game:

The player is a thief (easy reference, we know what a thief is), the thief can steal, he shouldn't fail to steal too much, and he takes double damage or instantly dies. He has some items but the usefulness is very situational.

The player searches for treasure, and occasionally pickpockets, his goal is to earn money and be a successful thief. The game's difficulty will scale by the user's choice (always a great feature).

I'm obviously replicating Garrett, although not entirely. From this I can tell.

  1. The character is a thief.
  2. The thief can become wealthy, and make other characters poor at the same time ( a good Robin Hood plug ).
  3. Throw out the annoyance of failure right here, he's a master and never fails to steal.
  4. The thief will die too easily, and he has no special attack skills ( this is clearly imbalanced ).
  5. The thief has an arsenal of not yet described situational items.

The rules of the world need to be adjusted or the thief is underpowered, but there's no way to be sure yet.

It may seem logical now that he should be able to hide in the shadows and sneak around unseen, but this is the point where the initial game mechanics are missing. We can figure out what works by taking this as a starting point and then making guesses, trial and error.

I've read about the idea guy. It's a serious misnomer. You really want to avoid the lazy team.
Legendre
Legendre

I am also making a text rpg and is perplexed with designing combat. The main problem for me is implementing ranged combat.

How do you let players fire a ranged weapon when all you have is text? Text based RPGs are usually made like Multi-User Dungeons (MUDs) that only allow you to see what is in the same room as you. Even if there is an overview (e.g. Urban Dead, browser game), how do you select/target and shoot someone two rooms away in an efficient manner? Especially when your graphical system is limited. E.g. only text.

Adam Moore
Adam Moore

I am also making a text rpg and is perplexed with designing combat. The main problem for me is implementing ranged combat.

How do you let players fire a ranged weapon when all you have is text? Text based RPGs are usually made like Multi-User Dungeons (MUDs) that only allow you to see what is in the same room as you. Even if there is an overview (e.g. Urban Dead, browser game), how do you select/target and shoot someone two rooms away in an efficient manner? Especially when your graphical system is limited. E.g. only text.

The Star Wars MUD I mentioned previously handles ranged combat with a low-level skill called snipe.

The syntax for the skill is:


snipe <direction> <target>

Let's say that there is a jawa 5 rooms to the east, and the player is holding a rifle, they would type:


snipe east jawa

The code would first look at the contents of the room directly to the east of this one if there is one. If there are no targets named jawa, it continues by searching any room directly east of the one it just checked until it reaches a certain distance (in number of rooms), finds the target, or there are no more rooms to the east.

The source code for SWR is publicly available if you want to refer to how they handled it. It's written in C. It was developed for Linux, so you'll need something that can work with *.tgz and *.tar files. I'd share snippets of the code if I had it readily available, but I don't have it available right now.

Legendre
Legendre

Let's say that there is a jawa 5 rooms to the east, and the player is holding a rifle, they would type:


snipe east jawa

The code would first look at the contents of the room directly to the east of this one if there is one. If there are no targets named jawa, it continues by searching any room directly east of the one it just checked until it reaches a certain distance (in number of rooms), finds the target, or there are no more rooms to the east.

Thanks for the explanation! I am more perplexed by the design of range combat, rather than the programming.

E.g. how does the player know there is a jawa 5 rooms to the east, without moving there to look? I could implement a "look east" feature that displays the names of all mobs and players 1 to 5 rooms to the east. But players and mobs move around, which means by the time you type "look east" and "snipe east jawa", the jawa could already have moved away.

In fact, in PvP, players would surely move around a lot, making it hard to find and shoot them. Unlike games with graphics, I can't see how to let players "scan" the area and shoot moving targets fast enough. For 2D tile based games, they can click on the target, which selects it, and initial combat. For 3D games, its just typical FPS mechanics.

ActiveUnique
ActiveUnique

@Legendre

I actually have zero experience playing MUDs. But usually a text game makes "look" take 0 time to complete, in a real time game any action takes time to complete except for looking around. Communication between users takes real time. The player may have looked with a command or received a communication informing him to take action. If snipe takes 3 seconds, and movement takes 15 the jawa may have successfully hidden on time if the player was too slow.

If it is something like that then... yay me.

I've read about the idea guy. It's a serious misnomer. You really want to avoid the lazy team.
Legendre
Legendre

@Legendre

I actually have zero experience playing MUDs. But usually a text game makes "look" take 0 time to complete, in a real time game any action takes time to complete except for looking around. Communication between users takes real time. The player may have looked with a command or received a communication informing him to take action. If snipe takes 3 seconds, and movement takes 15 the jawa may have successfully hidden on time if the player was too slow.

If it is something like that then... yay me.

Well, basically a MUD is exactly the same as "text adventure". If you're using only text, there is usually no way to display objects not in the same room. Since you're using only text to describe the room you're in and the content (players, monsters, objects) of the room.

Movement takes place in real time. When someone types "west", he instantly moves 1 room to the west. Are you suggesting making movement take time to complete, essentially slowing things down so people can be shot with ranged weapons? I don't think that will work out very well. Even if movement takes 2-3 seconds to complete, moving around can be pretty frustrating.

Master thief
Master thief

(...)
how does the player know there is a jawa 5 rooms to the east, without moving there to look? I could implement a "look east" feature that displays the names of all mobs and players 1 to 5 rooms to the east. But players and mobs move around, which means by the time you type "look east" and "snipe east jawa", the jawa could already have moved away.


For my part (my project is outdoors heavy) I'm thinking of having perhaps an array that stores a sort of visibility value for each room in each direction. For example, a street may take up 3 rooms, and if I'm in one of its extremities I can see the other two rooms from there. If I'm in the middle room I can only see one at a time (I'm also planning on implementing direction I'm facing). The visibility factor may be also affected by obstacles(a dirty glass window, fog, etc) or distance.

And as you enter the room you may be given a description that includes other visible rooms. And probably there should be a range the character's vision can reach.

I'd love to know if there's any more efficient ways though. As this is only what I have planned and I'm still very inexperienced. smile.png

EDIT: I don't know how to solve the NPC movement issue though. I'm debating whether it would be a good approach to use rogue-like mechanics where the world is static while you're not doing anything. That might solve that issue, as the NPC would wait for your actions, and if, for example you missed the shoot, he would be somewhere else after that, perhaps even not visible any more, and on alert. And probably, observation skills might not take any time to complete, or at least much less time than anything else.

The source code for SWR is publicly available if you want to refer to how they handled it. It's written in C. It was developed for Linux, so you'll need something that can work with *.tgz and *.tar files. I'd share snippets of the code if I had it readily available, but I don't have it available right now.


Thanks for this.
I created a pointer of type Toilet so I don't have to go to the bathroom as often.
ActiveUnique
ActiveUnique




Well, basically a MUD is exactly the same as "text adventure". If you're using only text, there is usually no way to display objects not in the same room. Since you're using only text to describe the room you're in and the content (players, monsters, objects) of the room.

Movement takes place in real time. When someone types "west", he instantly moves 1 room to the west. Are you suggesting making movement take time to complete, essentially slowing things down so people can be shot with ranged weapons? I don't think that will work out very well. Even if movement takes 2-3 seconds to complete, moving around can be pretty frustrating.

Oh, the rooms I imagined were not very granular, I was thinking it could be an instance of any size based on the location's rules. Because a jawa was involved, I expected the scene was a desert where one room could be an entire valley. In outer space each room would be a planet, because you'd want to travel faster, etc.

I don't know how this compares to the player experience you'd expect, so it probably sounds really strange.

I've read about the idea guy. It's a serious misnomer. You really want to avoid the lazy team.
Legendre
Legendre
And as you enter the room you may be given a description that includes other visible rooms. And probably there should be a range the character's vision can reach.

How can we display this information without creating huge text spam? From my experience playing with text adventures/RPGs, displaying the content of one single room generates quite a bit of spam already.

E.g. if your vision is just 2 rooms. North, south, east and west, no diagonals. There are 9 rooms of content to display. I don't think it is feasible. Imagine the amount of text spam just to display a line for each of those 9 room telling the player there is no one in any of them.

Imagine if you're in a heavily populated area.

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.