Friday, August 27, 2010

The Parser, No. 1

If you can read German and somehow missed it, check out the new online IF journal The Parser, which is something of a German-language SPAG. (I recommend the PDF-version, because it has stellar production values for a free internet magazine.) This first issue is mostly focused on GerX, the German translation of Inform 7.

It's good to see that the German IF scene is coming back to life!

Special conditions, elemental damage, and resistance I

In this post, I continue thinking about combat systems. As you can guess, this is part of the design phase of a larger game using Inform ATTACK. Today those staples of the RPG genre: poison, diseases, curses, fire damage, and so on.

This topic really falls into two: on the one hand there are attacks that deal something else than damage; on the other hand, there are attacks that deal special types of damage. We will deal with them in turn, focussing on the first in this first post.

Here are some of the special conditions that successful monster attacks can inflict on the player in D&D3: poisoned, diseased, cursed, level drained, ability drained, blinded, deafened, confused, dazed, dazzled, exhausted, frightened, nauseated, paralyzed, petrified, stunned -- and this list is not exhaustive. Apparently, giving monsters such powers was felt to be very important. Why? What's wrong with monsters just doing damage?

The answer is: because damage is either too dangerous or not dangerous enough. Monsters generally need several hits to kill a character; if this were not the case, if damage totals where close to hit point totals, combat would become very random (and increased randomness means increased lethality for the player). But this means that if you are nearly fully healthy, there is little risk in fighting. Even if you meet a strong monster, you have a couple of risk-free turns to see how things turn out.

This obviously deflates the tension of combat. In order to get the tension back, we need bad stuff that can happen at any time, but which is not by itself lethal. This is where poisons, diseases, and so forth come in: fighting that snake is tense, not because he might kill you (you know that you will win before your hit points run out), but because any of his attacks might poison you, which will weaken you for a time that extends beyond the current combat. The snake may not kill you, but he can soften you up for the next monster.

Apart from increase of tension, such special attacks can also be used to influence tactics in several ways. You can give the player a limited supply of "resist poison" potions, and make him decide whether this snake is enough trouble to use them. You can make different combat engines optimal: fighting against the snake requires you not to get hit, which means that ranged attacks, slowing effects, and so on, become much more useful. Or you can temporarily shut down certain combat engines or abilities: for instance, dexterity damage ensures that the rogue can no longer sneak effectively; being blinded makes the wizard unable to read scrolls; being exhausted makes hit-and-run tactics impossible.

When done well, then, such special attacks can really add something to the game. But it is not easy to do them well. Let's think about curing the conditions first. We can put them into three classes: short-term, long-term, permanent.
  • Short-term effects do not last long beyond the current combat. This means that they must significantly raise the danger of that combat, because otherwise they will be of no consequence. It is possible to do this, but the danger of making the effect too deadly looms large.
  • Long-term effects last far beyond the current combat. Generally, they lead to a "rest until over" kind of play -- pressing "." a couple of hundred times in NetHack, or taking some days or weeks rest in D&D. This is generally quite boring; but we want special attacks that raise the tension, not special attack that punish with boredom! Long-term effects only work if you can somehow force the player to go on with the game. (One could put a strict time limit on the game; but it perhaps better to use a carrot, and make the condition go away after a certain number of monsters have been killed, or something like that.)
  • Permanent effects last forever, unless cured. Generally, weakening the player forever is too harsh -- it makes achieving game balance impossible. So we add possibilities to cure the player: potions of extra healing, wands of stone to flesh, cure disease spells, and so on. But the net effect of this is that we turned the game into multi-dimensional attrition warfare: the monsters attempt to inflict conditions X, Y and Z just a little more often than the player can find ways to cure X, Y and Z. Now this may be a matter of taste, but in my experience, such gameplay sucks. Is there anyone who enjoys constantly having to find potions of cure poison, and applying them whenever he is poisoned, and then hoping that he won't be poisoned too often? It offers no tactical depth, and is a bit too much like bookkeeping.
  • Some games have conditions that immediately kill the player. ("Finger of death", anyone?) This either makes the game very lethal in an arbitrary way, or forces the player to find some means of immunity. We'll come back to that below. In general, I'm not a fan of this.
So, we want conditions that are self-curing; and that inspire interesting tactical behaviour, rather than boring behaviour. Being in such a condition should, at a certain level, be fun, at least in the sense that they require you to break your routine. (Conditions that merely make you go through your routine at reduced efficiency are Bad: I'm thinking of you, poisons and diseases and level drains in D&D3!) The same goes for trying to avoid such a condition: in NetHack, voluntarily blinding yourself by wearing a towel over your head when you meet a monster that could blind you for far longer if you don't, is fun.

This, then, is the primary design challenge: to design conditions that can be inflicted on the player as alternatives to damage; in such a way that both trying to avoid and being afflicted with those conditions makes the player abandon his optimal routine (either by sticks or by carrots or by a combination); while not making the optimal curing strategy for such conditions boring.

A last thing: resistances and immunities. Most games that have conditions also have items or skills of whatever that either give you a better chance of resisting them, or make you outright immune.

This is a design failure.

It works somewhat in a game with many characters, like D&D. If the monster inflicts diseases and only the monk is immune to disease, the party can try and formulate a new tactics where only the monk gets next to the monster. This is sometimes interesting. (It rarely works that way in practice, either because there are many monsters with the ability and the monk cannot stop them from approaching the other characters; or because it is one seriously nasty dude and the monk alone doesn't have enough staying power to survive his hits.)

But it absolutely doesn't work in a single player game. As designer, you should have made those conditions a fun part of the experience; otherwise, they shouldn't be in the game. Presumably, you have designed them to give the most fun mix of tension, survivability, and so on. Giving a character resistance to the condition therefore removes some of the fun. Worse, making a character immune to a condition simply removes it from the game.

Take NetHack. A character apparently cannot survive very well without being immune to a whole set of things: poison, sleep, fire, cold, spells, and so on. Once a character has all those immunities, it is as if all those special attacks no longer exist. In other words, you have transformed a vast number of monsters from being interesting, to being run-of-the-mill. There is simply no way that can be a good design decision.

The only kind of resistance that seems really interesting to me, is one that comes at a price. Wearing that towel to be immune against the medusa is a good example, since it also makes you unable to see anything else! Another good example from NetHack is levitation: you can no longer fall into traps and you can walk on water, but you can't take the stairs down or pick anything up from the floor either. Additional examples are easy to think of. Magic resistance that protects you against spells, but with a certain probability that the deflected magical energy turns into something perhaps even nastier. Immunity to sleep that makes you unable to, well, sleep, including getting restful sleep. Immunity to poison gained at the price of becoming undead. That kind of stuff.

Coming soon: elemental damage (and anything that is structurally the same).

Thursday, August 26, 2010

Beta-testers for small combat/conversation game

My post on didn't exactly lead to a huge number of responses, so let's try again here. I'm looking for a few testers for a small game called 'Mid the sagebrush and the cactus that explores the possibilities of combining combat and conversation. (It is also a test game for ATTACK.) If you would be interested in testing, please send an email to [my first name]

(Quite a lot of people mailed be about this, so I now have more than enough testers. Thanks!)

Wednesday, August 25, 2010

Tension, Exploration and IF

I stated in my previous post on NetHack that the game mechanic in Rogue-likes where dying is final, and loses you your character, is a great mechanic to make combat tense. I also stated that part of the fun of the game is to explore the game, learn how everything works, slowly identify all items, and so on.

These two things are partly opposed. The greater the tension, the greater the temptation to look up what every monster, item and dungeon feature does before you interact with it. This opposition can be resolved, or at least lessened, in three ways:
  1. By making the game less deadly, we make exploration more viable.
  2. By randomising that which needs to be explored, we make it impossible to spoil it.
  3. We accept that part of the exploration is done through reading the internet rather than through playing the game.
NetHack chooses the latter two options. The game is quite deadly, and unless you are willing to spend years with it, out-of-game exploration is necessary. But not everything can be explored out-of-game: descriptions of scrolls, potions, and so on, are randomised and they must be re-identified every game.

However, if we wish to implement the combination of deadliness and exploration in interactive fiction, this solution seems to me largely impossible. At least, it becomes largely impossible if we want to tap into that most venerable of IF game elements: puzzles. Puzzles are one of the things IF is really good at, since you can use them to reward the kind of out-of-the-box thinking that can most forcefully be expressed in a game with a parser. Why use IF if you're not going to use its unique abilities to describe anything at all and have the player interact with it in any way she and the author can both imagine? Puzzles can either coexist with tactical combat, by allowing you to win a combat outright if you solve them; or, more interestingly, be integrated with tactical combat, by giving you advantages that you might not otherwise have. For instance, the gnomish inventor might be a lot easier to defeat once you have figured out how to short-circuit his lightning machine.

But here is the problem with puzzles: spoiling them, well, spoils them. Really spoils them. NetHack is still fun with the NetHack wiki at your fingertips; Anchorhead is not much fun if you're constantly looking things up in the walkthrough. So it seems that strategy 3 above is not available to us.

But strategy 2 is problematic as well, since puzzles cannot be randomised in meaningful ways -- at least not puzzles that are worth solving.

So it seems that to lessen the opposition between deadliness and exploration, we must tone down the deadliness. The player must be able to explore the world, and try out different solutions to puzzles, without having a high probability to permanently die. Exploration must be rewarded far more often than it is punished. There are several ways to do this:
  1. The classical solution is to use the save/restore cycle, or its shortcut, the undo-command. You try out some moves, lock yourself out of victory, go back to a previous situation. It solves the problem, but at the cost of almost completely deflating the tension.
  2. Lessen the penalty for failure. Instead of your character dying and being gone, you (a) lose gold, experience, what-have-you, and/or (b) are revived at some distance of the place where you died. You have to strike a fine balance here, because of the penalty is too great, exploration is still discouraged; if it is too small, tension is still deflated. And there is the nagging suspicion that that the "too great" and the "too small" category overlap...
  3. You can make exploration relatively safe while keeping combat dangerous. There are multiple techniques that will achieve this, but it all depends on what kinds of thing you want the player to explore. For instance, you could have the puzzles in rooms without monsters, or in rooms from which the monsters can be first lured away or killed -- but this will not work for puzzles that ought to interact with combat, and it will not allow the player to safely "explore" the special abilities of the monsters. You could have a special mode in which the monsters are passive and invulnerable but the world can be explored -- something like a time stop, or a character who can walk in spirit form, or whatever. Not all puzzles could be easily fitted into this framework, though.
Ideally, then, we would have something of the third category but without the drawbacks of the specific options mentioned there. The best option I can think of right now is this: make combat so that the player will always be able to survive the first several rounds of it, will not be able to kill tough opponents in that time (at least not without using strictly limited resources), but will be able to retreat if things do not go as hoped. This boils down to having a retreat option that is safe as long as you are not in big trouble, and have it take a couple of successful attacks of your enemies before you are in big trouble. This way, you can attempt whatever you wanted to attempt, see that things are going wrong, and retreat before it is too late. I am assuming that you can get back to full strength outside of combat.

All right, but doesn't this deflate the tension as well? No, provided that you need to take risks in order to prevail in combat. If the monster cannot kill you in four turns, but you cannot kill the monster in four turns either, and if the monster heals as quickly as you once you have retreated, then you cannot defeat the monster without running risks. You must at some point fight a more extended battle if you ever want to be victorious.

Let's give an example using a toy combat system that is like ATTACK in one crucial respect: combat becomes deadlier when it goes on for longer. Here is how our toy system works: when you attack, you have a 50% chance of hitting if you are the player, a 40% of hitting if you are the monster. Player and monster both have 20 health. The first hit of the combat deals 1 damage, the second deals 2 damage, and in general the nth hit deals n damage. Finally, when you retreat your enemy gets to make a single attack you which deals double damage if it hits.

In this system, as long as your health is greater than 2 * n, you can retreat without risk. This means that if the player does not attack, she will generally be able to explore for some 7 turns, and still be able to retreat in complete safety. But what if he wants to defeat the monster? Let us take the ideal scenario where the player has delivered the first 5 strikes, dealing a total of 15 damage. Even at this ideal point, the player is no longer safe. If the monster hits now, the player will lose 6 life, and can no longer safely retreat (since 6 + 2 * 7 = 20). Thus, it is impossible in this toy system to kill this monster without running any risks.

ATTACK doesn't quite work that way, but it is certainly possible to implement a good risk/reward-cycle with it. (Remind me to rethink the tension mechanic; this toy example has given me some new ideas.)
So the basic idea is: give the player some time to explore, and to flee if he doesn't like what he sees, but make sure that winning a tough fight requires a commitment to risk. This will give you the best of both worlds.

Engines and Combat (and D&D)

In an interesting series of columns on rogue-likes (such as NetHack and, in this particular case, Crawl), John Harris talks about "engines":
A character with no skill in anything would be quite hard to play. The numbers are stacked against such a character; starting stats and skills tend to be just enough that most players will need to rely on class-specific abilities to get a leg-up on the monsters. These skills make possible the character’s engine, the system by which he kills monsters and earns experience within acceptable levels of risk. Having an engine is not strictly necessary, and for some race/class combinations is as simple as walking up to monsters and hitting them with stuff, but without one the player will have to resort to making use of random items and extreme tactics more often, strategies that bring with them necessary dangers.
(Italics mine.) This idea of an engine is an excellent piece of terminology when we think about the design of tactical games. As soon as part of your aim is to provide the player with different playing styles, different ways of going about combat, you will want to ensure that the game allows the use of different engines. This may sound obvious. However, it is hardly ever done.

Game designers almost always realise that they need to diversify the game, and to this effect they put in different classes, or races, or types of equipment you can find and use. But they rarely realise that this diversity amounts to little if it doesn't add up to different engines, different ways of playing the game. Let me give you some examples from Dungeons & Dragons 3.5, a game with which I am familiar enough and which is perhaps not entirely unknown to most of my readers.

Let's call the system of walking up to an enemy at your maximum possible speed and hitting him with an attack every turn the basic melee engine. Numerous classes use this engine almost exclusively, including the barbarian, the paladin, the fighter, the non-ranged ranger, and the monk. So what have the designers done to vary these classes and change their engines?
Well, they have done a lot to vary the classes, but few of these variations actually change the basic engine.
  • The barbarian's illiteracy and trap sense have little effect on combat; his uncanny dodge, improved uncanny dodge and damage reduction are passive abilities that make him survive a little longer but do not change his strategy. Fast movement has some tactical relevance, but will only rarely make you do something you wouldn't otherwise have done. Finally, his signature rage ability only locks him further into the basic melee engine: once activated, the barbarian hits harder, and loses a couple of combat options he probably would use anyway.
  • The fighter has two specials: he is the only one has really specialise in weapons, and he has a lot of bonus "feats" -- which makes him a bit like a pick-and-choose class. The specialisations are merely a passive bonus without tactical import. The feats are more interesting: some of them actually do change the engine (the mounted combat tree, things like "improved trip" which add combat options, to a certain extent things like "whirlwind attack" which require you to wade into the fray).
  • The monk has lots and lots of specials -- and almost none of them make a difference to the engine. You can attack without weapons, you have a multiple-blow attack, you get armour bonuses (to make up for the fact that you cannot wear armour), you get vast amounts of passive resistances -- fine, but walking up to someone and hitting him is still the only viable thing you can do.
  • Let's look at the paladin last: again, lots of passive resistances, some healing capabilities that are hardly different from having a potion of cure wounds in your inventory, and at higher levels a few minor spells. Once again, you have little choice but to walk up to your enemy and hit.
(There are also examples of "good" variety in D&D3.5, make no mistake. Wizards and sorcerers possess multiple engines, and rogues have a very different fighting style because they have to position themselves carefully in order to deal significant damage. It's especially the pure fighting classes that are all very much the same. This includes the prestige classes, which very often give nothing but passive bonuses.)

It seems to me that any interesting combat game that is either long or wishes to be replayed will need to give the player the choice between multiple engines. What's more, you need to make sure that the things you are putting into your game either enable new engines, or tie in with them. Implementing poison that continues to deal damage to a monster once he has been poisoned is fun even when its just a nice little bonus during your fight; but it becomes much more fun if it enables new tactics, such as a hit & run tactic where you poison some one and then run away, only to come back later when the poison has done its work. Or a hybrid weapon/magic-tactic, where the player poisons his enemies and then takes advantage of their lowered magic resistance (assuming that poison works this way in the game). Or even a hybrid weapon/diplomacy-tactic, where you poison someone and then tell them that you yourself are the only person who knows the cure!

I tried to make a small example of different engines in the ATTACK test dungeon. Combat using the dagger and the cloak of shadows is quite unlike combat using the mace: instead of the back and forth of attacking, defending and concentrating, there is the slowly rising tension as the player decides whether or not to risk another turn of observing the target... and the mad dash out if the attempted assassination fails.

Another matter for careful thought is the availability of engines: you can have the player switch between them at will during the game; you can make him choose in advance and lock him into that choice (i.e., choosing a certain class); you can have him develop skills, such that at a certain point in the game he is more or less locked into the engines he has chosen to develop; and so on. Here, I would intuitively think that locking someone into an engine is the less interesting choice, motivated more by a desire for easy "balance" than by something else.

Some thoughts on Nethack

I once again made the mistake of installing NetHack. This is a mistake because the game is incredibly addictive, easily rivalling, perhaps even surpassing, current big budget RPGs. Not bad for a bunch of ASCII-characters, is it? (Let me immediately admit that I play the graphical version.)

So, what is the secret of this game? What are the design principles that make it such a success? I suspect they are four (or three, depending on how you count):
  1. Tension. In NetHack, your character will often be in a dangerous situation, a situation that could easily lead to his or her demise. These situations can come into existence pretty suddenly. (My character, having gone further than any of my previous ones, met a "quantum mechanic" this evening. Ought to have been no problem... except that this guy had a wand of monster creation, zapped it half a dozen times, and out-of-the-blue I was surrounded by a horde from which I could not escape... another death.) And, even more importantly, these situations are really dangerous, because if your character dies, he or she dies. There is no going back. Your save game will be destroyed. Really. This makes for a kind of tension that no game with save/restore-options can provide.
  2. Complexity. There are so many monsters, items, spells, special abilities, special situations, random effects, special levels, possible actions and so on in this game... it is quite overwhelming. This leads to two effects:
    1. NetHack lends itself to a lot of exploration. It is fun to find out new things.
    2. NetHack possesses great tactical and even strategic complexity.
  3. Hiddenness. For lack of a better term. Even if you use, as I certainly do, the internet to look up the monsters and items you encounter, there is still so much that remains hidden. Every new dungeon level is a mystery, because it is generated randomly. But more importantly than that is the identification of objects. Not only is every object either cursed, uncursed or blessed (which you are generally not told and cannot always easily determine), but all potions, wands, spellbooks, scrolls, rings, amulets and other miscellaneous items start out unidentified. You find a "dark potion", or a "swirly potion", but you do not know what it does. Nor can you look it up on the internet, because these description are mapped onto the kinds of potion randomly in each individual game. There are ways to identify stuff, but they are limited -- you will be spending a large portion of the game slowly finding out more and more. (You could just start drinking all potions, but this is not advisable.) And there are other kinds of hiddenness in the game as well: there is for instance no way to look up your innate abilities (which you can lose and acquire in multiple ways), your luck, your standing with your god, whether you can pray again, and so on. (There are ways to determine these things, but they are limited and not always without danger.) Where most RPGs revel in revealing as much as they can and showing you complex character sheets, NetHack loves keeping you always slightly guessing.
  4. RPG. It's a traditional role playing game, where you get further and further, acquire new items, gain new levels and powers -- everybody knows that this is addictive.
Some of these things could be usefully incorporated into an interactive fiction game using ATTACK, I think. That's certainly something I want to explore. Though I firmly believe that if you go the IF route, you must drop the idea of generating huge random dungeons -- that's not what text is good at. And you would certainly want to add much more story and perhaps narrativistic decisions, because that is something that NetHack certainly doesn't have.

Saturday, August 21, 2010

Inform ATTACK - initial release

I'm pleased to finally publish my Inform 7 combat extension, "Inform ATTACK".

* What is Inform ATTACK?

Inform Advanced TActical Combat Kit is a large (10.000+ word) extension for Inform 7 that allows authors to implement tactical combat in their interactive fiction. The system is powerful out-of-the-box, and very easily extendible. But please read the introductory section of the manual for more information.

* What is the development status of Inform ATTACK?

There are no known bugs and no known missing crucial features. However, ATTACK has only be used by me, and only in two small test games. Thus, there undoubtedly ARE many bugs and missing crucial features. This software should be consider as being beta quality right now, and may be expected to go through non-conservative changes in the near future.

* Where can I get Inform ATTACK?

Download the zip-file at:

* What's in that zip-file?

1. ATTACK-Manual.pdf is the manual.
2. Inform-ATTACK.i7x is the extension. You need to import this into your Inform 7.
3. is the source code of the example game described in the third chapter of the manual.
4. ATTACK-Manual.tex is the LaTeX-file from which the manual was created; you very likely don't need it (but since I release the manual under a free license, it seemed courteous to include it).

* What is sadly lacking?

A polished game integrating combat and story that will prove to the sceptics that tactical combat and IF can be fruitfully combined. (I have a half-finished example game that does this, but I don't know when I'll be able to finish it.) This release contains only the tools for the purpose, not the proof that the purpose is worthy.

* I have questions!

Please read the manual. It has that many pages for a reason.

* I have other questions! I have found bugs! I have things to discuss! I have...

You can react here, or mail me at -- please remove the "q" (added for simple spam protection).