Sunday, 8 August 2010

Design A Magic System Redux - Part One (Status Effects)

In the original Designing a Magic System series of articles, I briefly looked at status effects as a way of separately out various incapacitation effects from hit points. Antoine's suggestion of an Enchanter class in Angband has forced me to take a closer look: both to justify my intuition that an Enchanter class would be inherently uninteresting, and set myself the challenge of trying to make this class, or the Sorcerer equivalent in Unangband, an interesting play style. Luckily I'm in the midst of implementing a whole host of new status effects in Unangband, so I'll be able to benefit from this design exercise as well as give you some insight into the decisions I've made.

My original thesis in Designing a Magic System was hit points are a good design compromise between a tug of war between two sides, which could result in games which never resulted in a victory condition, and incapacitating damage which would result in a negative feedback loop where the player could lose the game without being dead.

In this model, status effects become an idealized way of representing various types of incapacitation without being directly linked to hit points. Status effects are almost always timed, to allow the ability limited by the status effect to recover naturally should the player survive long enough, and can be recovered from using a variety of resets. It is important when designing status effects that it is not possible to get a lock on the player, but you can intentionally design traps, which are best suited to multi-player games, to allow a player to get a significant advantage by applying a lock, but at increased risk should the opponent predict that they are attempting this technique.

(If you are not familiar with locks and traps, I recommend that you refer to the original articles).

The canonical example of a status effect is the interrupt - this interrupts whatever the other player is doing and forces them to start again. If the interrupt takes less time than whichever action the other player is attempting, you can keep your opponent constantly interrupted - and if you start your interrupt action before they do, you can get a lock on the other player by interrupting their attempts to interrupt you. If the game has an action which takes less time than an interrupt, but does much less damage than the standard action, you can create a trap: the other player may attempt a standard attack for a lot of damage, but be at risk of your interrupts, or use the weak attack to avoid being interrupted, which exposes them to your standard attack. The trap in this example is only interesting if the other player is a human opponent: because it forces you to build a model of what the other player is thinking - in effect, to second guess them.

The interrupt as a status effect can be problematic for two reasons: the interrupt can be constantly applied if the duration of the interrupt is longer than the time required to apply it, and if there is no way the opponent can get a win if you choose to always interrupt. I've referred to both of these as locks, but these are actually different but related behaviours. (Note in this example, the duration of the interrupt is actually the duration of whichever action your opponent was attempting, plus the duration the interrupt prevents further activity for.)

Even if you are careful to ensure the interrupt action takes longer than the time it interrupts the other player, if you team up with other players, it may be possible to get a lock on a single player through judicious timing of interrupts. (Or conversely, multiple enemies could get a lock on you).

But imagine an interrupt which only affects some of the possible actions the other player could choose. An example in Angband is blindness. Blindness has a partial effect on the player's melee and shooting skills, completely prevents spell casting and reading scrolls, but has no impact on the player's ability to quaff potions, or use rods, staffs or wands. As a designer, you can minimise the risk of constant blindness by designing items which can reset the blindness effect and ensuring that they are usable via a action which blindness does not prevent - as a player, you can minimize the risk by ensuring that you carry these items. The counter-example to be avoided: a helmet of blindness which can only be removed by reading a scroll of remove curse. This would give the player into permanent blindness once they accidentally wear this item - not catastrophic, but a significant impact on the overall game.

(For the Unangband equivalents, you could extend this table to include all the possible status effects to get a feel for what different types of partial incapacitation could do.)

By using partially incapacitating status effects, and allowing resets, we can side step the risk of unintentional locks because the player can always reset themselves out of a lock, or choose an action which is unaffected by the lock that allows them to progress towards winning. (Using rods, staffs and wands are permitted while blind for this very reason).

There is still the risk of cumulative locks as follows: imagine there are some number of partially incapacitating effects, each of which affects the player's ability to do certain things, but when some of these effects are applied together the player is totally incapacitated. You can design your way out of this problem by ensuring that there is always something the player can do - but I think there is a more interesting alternative.

I've been using the term path to victory somewhat loosely: but let's be more rigorous about it. The path to victory is the total distance (number of actions or time) that the player needs to win the game. The shortest path to victory is the player doing the optimal action at every point and the opponent picking the most suboptimal action: the game is unbalanced if both the player and opponent choose their most optimal action and either is guaranteed victory. Unbalanced games are fine against multiple opponents (Angband being a classic example of this).

For this argument, assume the path to victory is always progressed by doing damage to the opponent's hit points. In this instance, the most logical way to win is by using your most damaging attack. A counter strategy to this is to use status effects against you which prevent you using your most optimally damaging attack, and force you to use a more suboptimal attack. Ideally the first status effect to apply would be the one that causes the most difference between the two: but it may also make sense to use a status effect which lasts longer and gives your opponent a bigger window for counter attack.

The path to victory is blocked completely if the opponent is able to use a combination of attacks which prevent you doing any damage at all to them. We call this a lock.

The above is pretty self-explanatory and you can see various techniques for reducing the risk of a lock (always allow a damaging attack and a reset to be available, reduce the duration of the combined status effects so that the time to implement them all exceeds that figure etc).

Here's my theory: the risk of a lock becomes a non-issue, when the distance to achieve a lock (time or actions) is the same as the length of your path to victory. That is, if the effort required to get a lock on an opponent equals or exceeds the effort required for to win against that opponent, from a design point of view you don't have to worry about the risk of a lock being applied. In essence, getting the lock is just as difficult as winning.

(In fact, you can have a more generous margin, because it may not be initially clear whether direct damage or a lock is the correct approach to take.)

Antoine's Enchanter (and Unangband's Sorcerer) then becomes a class which can lock opponents through a combination of status effects with about as much effort as another magic using class would take to kill them.

And in part two, I'll look at which status effects that Unangband has to support this.


Antoine said...

I think you're right in terms of stun/confuse.

I think that slow (as a debuff) and sleep (for crowd control / escape) may have more potential...


Ethan said...

You might also take a look at the Oracle class in Final Fantasy Tactics. FFT is a tactical game that usually involves about 5 of your units against about 5-10 enemy units, and accordingly it does usually wind up being mostly about who lowers the other side's HP the fastest.

However, FFT players will sometimes attempt a "Straight Character Challenge", where all 5 of your units have to be a particular class. Personally, I think the Oracle SCC is actually pretty fun, and makes it sensible to play without relying solely on damage to win your battles. Oracles have a nice variety of positive and negative status effects at their disposal, along with 1 insta-kill status effect (petrification), one spell that does HP damage, and a melee atack that does decent damage despite being a magic-using class.

My intuition is that a pure Oracle party is fun in part because they don't JUST have spells to incapacitate the enemy. For example, they have spells that reduce the enemy's accuracy; cause roguelike-esque confusion in enemies; inflict the "Faith" status effect, which makes magic hugely more effective (including the accuracy of status effect magic); render an enemy unable to take actions other than movement; berserk an enemy; put an enemy to sleep; and a handful of other spells. Plus, the power of magic (in this case, accuracy) can vary tremendously depending on the exact pairing of caster and target.

So, in addition to the standard single/multi target consideration, a player doing an Oracle SCC also has to consider whether they want to go for a low-accuracy, mid-accuracy or high-accuracy spell; what kind of hindrance they want to inflict, or even if they'd prefer to give an ally or enemy a buff that's a bit of a double-edged sword (like Berserk and Faith); and so on.

So, I guess you could actually consider status effect casters sort of similar to your vision for the Unangband druid, except that where the druid does a lot of set-up involving the environment, status effect casters do a lot of set-up involving individual units/monsters/allies.

You'd also want some way to quickly kill fodder enemies, since I would NOT want to have to get a lock on a room full of vanilla Angband cave spiders (haven't played enough Unangband to know if swarms like that are present in your game). Perhaps the ability to charm enemies and turn them into pets? Or even just a low-damage AoE spell that's sufficiently strong to take out fodder.

Anyway, just some food for thought, both on status effects in general, and on a particular implementation that works pretty well (most of the time). Enchanters and similar classes offer a playstyle that I'm rather fond of, but that doesn't get done well very often. So, I look forward to seeing what you come up with :).