Sunday, 28 March 2021

Randomization in chess and roguelikes

 

Chess960: chess with a random setup

Chess960, also known as Fischer random chess, is a variant of standard Western chess in which the home-rank pieces (that is, all pieces except the pawns) are given random starting positions, making it a type of shuffle chess. Published in 1996, the game has increased in prominence in recent years, with 2019 seeing the first official FIDE World Fischer Random Chess Championship.

The effect of varying the starting positions is to reduce the dependence on memorizing openings. This potentially quite interesting game is sadly marred by sharing a name with its creator, Bobby Fischer, the Holocaust-denying Hitler fanboy of the chess world. To avoid giving this vile man any more respect than he deserves, which is to say none at all, I will be referring to the game as Chess960. "Fischerandom" and "Chess960" are both variant names accepted by chess programs.

 

Using polyhedral dice for Chess960 starting positions

Starting positions are mirrored between the two players, so the randomization process for Chess960 needs to only fill in one player's home rank. The second player's starting positions are implied by the first player's.

The starting positions of the pieces have the following constraints:

  • The player's two bishops must be on squares of opposite colours.
  • The player's king must be between the two rooks (to allow castling as in standard chess).

When a computer is not available, we can use a set of polyhedral dice (sometimes called "roleplaying dice" or "D&D dice") to determine the starting positions.



Image 1. The pawns always start at the same positions.

A rank on a chess board has 8 columns/squares, 4 of each color. Thus, there are 4 possible positions for each bishop. Using polyhedral dice, this can be rolled using two d4 (one of each colour).

Let's assume we rolled a 2 and a 2, placing the bishops on columns c and d.


Image 2. The bishops have been placed.

6 squares remain, and the queen is placed next on any one of them. This can be rolled using a d6.

Let's assume we rolled a 5 on the d6, placing the queen on column g.


Image 3. The queen has been placed.

Then, with 5 squares remaining, the two knights are placed randomly on any of them.

Roll a d10. On a result of 1-5, place the first knight on the corresponding free square, and then the second knight on the next free position immediately to its right. On a result of 6-10, place the first knight in the same way (treating a 6 as a 1, and so on), but place the second knight two free positions to the right, instead of one. Wrap the second knight around, so that if there are no more free positions on the right, start counting from the left again.

So, if our free positions are abefh, then the results on the die correspond to the following placements:

d10 First knight Second knight
1 a b
2 b e
3 e f
4 f h
5 h a
6 a e
7 b f
8 e h
9 f a
10 h b

Let's assume we rolled a 10 on the d10. The knights are then placed on columns h and b - or, equivalently, b and h.

 

Image 4. The knights have been placed in b1 and h1.

The 3 remaining squares can only be filled one way, due to the constraint that the king must be between the rooks.


Image 5. The rooks and king have been placed. All positions have been selected. Now, all that remains is to fill out the other player's positions as a mirror image.

Image 6. The final starting positions for both players. White to play.

There are 4 x 4 x 6 x 10 = 960 different starting positions.

Using our example method of generating these positions with polyhedral dice, four dice are needed: a black d4, a white d4, and a d6 and a d10. Or, you can roll the same d4 two times in sequence, once for each bishop.

The method for determining knight positions given here is only one of many possibilities, chosen here because it avoids rerolls and redundancies and seems like something I could remember. I recommend using any rule which you find easy to remember to avoid having to consult a player aid.

 

Other randomized chess variants

Transcendental chess is another randomized chess variant, invented in 1978 by Maxwell Lawrence, (a full 18 years earlier than Chess960). In transcendental chess, the constraint on the rook and king positions does not apply, and castling is removed. Rather than mirroring the board, each player's positions are determined independently. Additionally, a player may use their first turn to swap two pieces on their back row, instead of making a move. As many setups will have one side starting at an advantage, it will perhaps be sporting to play two games for each setup, changing sides in between.

D-chess is similar to transcendental chess, but rather than playing two games, one player gets to choose the side they think is stronger, and the other player gets the option to swap two pieces and also gets the first move.

 

Is there room for randomization in chess?

Traditional chess is fully deterministic, with no random factors. Everything depends on the players' decisions. In many other games and sports, much of the excitement comes from the combination of luck and skill. Their interplay allows for bold risk-taking and dramatic upsets. Far from the usual derision of chance as a factor that makes skill completely irrelevant, taking the right risks at the right time is a skill in itself. Reacting to unlikely chance occurrences can also be a kind of skill, as can knowing and regulating the impact of uncertainty on one's strategy.

In the Wikipedia article linked above, you can read quotes from chess grandmasters on shuffle chess. Some even go as far as saying it's "the future". Reading between the lines, one can get the impression that the game's lack of excitement and human drama is hampering its public profile and influx of new players. Could adding a chance element make chess a bit... well, less boring?

The interplay of chance and skill in games can be broadly divided into two categories: chance that comes after a player's decision, and that which comes before a player's decision. In other words, "randomness of outcome" or output randomness, and "randomness of setup" or input randomness. For example, a chess variant in which the attacker must roll a die to determine the success of a capture has output randomness. This kind of randomness promotes the correct gauging of risk, but it typically has a very large effect on the game's outcome. 

Meanwhile, a chess variant with randomized starting positions would be in the second category, having input randomness. The initial positions may have a large effect on the odds of wining, but beyond that, the only measure of skill is in how the players react and adapt to this new and surprising situation. The player makes an informed decision, and its result is deterministic.

It may be noted that within board games, the output randomness design pattern is more common in American-style boardgames such as Risk, which often include direct conflict, and combat resolution mechanics resembling wargames or Dungeons & Dragons. There, uncertainty is a tool to heighten drama. European-style games, meanwhile, have little or no output randomness, and typically less hidden information. A Eurogame may include input randomness through a randomized initial setup, but from there onward the players' decisions have largely deterministic results. This typically makes for a game that requires careful planning.

Chess, while considered an early wargame, has neither the elements of dice-based combat resolution nor hidden information (fog of war) featured in many wargames starting with the 19th-century Kriegsspiel. It could be argued that adding input randomness to chess through randomized initial setups would turn it into "a Euro-style boardgame".

 

Genres & generations

Arguably the most important games of the 20th century were chess, poker, and Dungeons & Dragons (in increasing order of randomness). D&D's influence has been huge not only in traditional roleplaying games but also in video games and board games. Its dice-based combat system has been passed down through Rogue, Nethack, Dungeon Crawl, Diablo, Elder Scrolls, Final Fantasy, and so on - essentially, the entire "RPG" videogame genre, and beyond.

Although D&D came from the wargaming tradition, it is a cooperative game, not a competitive one. Unlike D&D and the mostly single-player RPGs it inspired, some games in this lineage are competitive. Dota 2 is a multiplayer game of conflict with quite clear D&D-style elements. Dungeon Crawl: Stone Soup is a single-player game in the roguelike genre which is played in competitive tournament formats.

 

Chesslikes?

Interestingly, while the roguelike genre is known for its large degree of randomness, in recent years there has been more experimentation in minimizing output randomness, removing the dice resolution of combat in favour of deterministic models. What is left is just a randomization of maps - input randomness. Often, the entire map is revealed to the player, reducing hidden information as well. This could be seen as a move towards a "Eurogame-ization" of roguelikes. Examples include 868-HACK, Hoplite, and HyperRogue, in which the levels, enemy positions, and powerups are random, but attacks cannot miss and damage is predictable. These games have been described as abstract roguelikes, "tactical puzzles", or even feeling "chess-like". Here, chess-like is being used as an adjective - for now at least, chesslikes are not a recognized game genre.

But... what if? 

 

Image 7. A screenshot from 868-HACK by Michael Brough. Source.

Chess, with its deterministic head-to-head battles, and roguelikes with their iconically chaotic single-player experiences may seem as far apart as games can be. But at their core, both are games of tactics and strategy that play out on a square grid. Both require geometric pattern recognition - and heapings of experience and knowledge. Both are games that can hold a player's interest for 20 years or more.

Perhaps as chess begins to include more random factors, and roguelikes lessen their output randomness, we will see the two genres move closer and closer until they almost seem to merge. Could we even begin to see roguelikes which play out as a battle between two opposing players? Who knows. The future, for now, is under a fog of war.


Sunday, 11 August 2019

Static Weapon Damage: A Problem, and a Solution

If you've read my posts on D&D Without Damage Dice and Ascending Damage, you'll know I use a sort of "wound counting" or "hit counting" system, which by definition has static damage - every hit with a weapon is just "one hit". The design goal is to make combat simpler and faster, but ideally, it should still be interesting and have some variety.


What is static and variable damage?


In the olden days of Chainmail, monsters and men took a certain number of hits to kill, regardless of weapon. The effectiveness of different weapons was modeled by their ability to score a hit against each type of armor, as presented in the dreaded MAN-TO-MAN MELEE TABLE. Then came Original Dungeons & Dragons, which introduced hit dice - instead of 1 hit-to-kill, men could take d6 points before death. LIkewise, all weapons dealt d6 damage. The damage roll introduced some variety to the outcomes of attacks. However, this system is still typically called "static weapon damage" in the sense that weapons were not differentiated.


[mantoman.png]

The Greyhawk supplement introduced the "alternative combat system" with its "damage done by weapon type", or what we would call variable weapon damage. Daggers dealt d4 damage, spears d6, and swords d8, as they do to this day. This was wildly popular and was carried over to Moldvay's Basic - though it should be pointed out that it was presented as an optional rule. The default in Moldvay was still the fixed d6 damage rule.


So, the main ways of differentiating weapons are:
  • variable damage (die size, flat bonus, roll and keep...)
  • damage adjustments against different foes (e.g. bonus against large creatures)
  • adjustments to hit (e.g. against different armor or weapon types)
  • critical hit range (20, 19-20...) and damage (2x, 3x...)
  • secondary special features (spears can attack from 2nd rank, crossbows must be reloaded...)
  • number of attacks
  • tertiary properties such as weight, price, initiative adjustments, durability, social status...


What's the problem with static damage?


I'm not really a simulationist. I'm not aiming to represent historical combat faithfully. But I still want a little mechanical differentiation to support the difference in fiction, obvious to anyone, between stabbing with a dagger vs. swinging a greataxe. And, honestly, combat without damage rolls might end up feeling a bit sterile, so making weapon choice and tactics a meaningful decision will help spice it up.

In my B/X-hack-via-OD&D-and-Blackmoor (name pending), I obviously cannot vary weapon damage, since I'm not using dice for it. Certain weapons doing 2 or 3 hits (or "Wounds" as I'm calling them) instead of 1 would be far too large a difference, when most low-level monsters like skeletons and orcs can only take a single Wound.

I don't usually like double-damage critical hits in D&D, and prefer a natural 20s as simply automatic hits. But when playing with Wounds, I would consider including criticals just to add some variety to the proceedings. However, when facing monsters that always die in a single hit (HD 1 types like orcs), doing "double hits" on criticals does not matter at all.

Is there some solution, some system of differentiating weapons while keeping fixed damage? Ideally, any solution would include a minimum of three "tiers" of weapons in terms of weight/effectiveness: simple weapons like daggers, martial weapons like swords, and two-handed weapons, at least. (If spears don't have their own tier between daggers and swords, then they will have to be combined with either, becoming strictly superior in that damage tier, due to their additional property of reach.)

One possibility is to do something like what Chainmail does: give the weapons different to-hit adjustments against different armors. But that sort of thing is part of the reason I wanted to get away from LotFP in the first place. I don't want to remember what bonus which weapon gets over what AC threshold, and doubtfully do my players either. (Maybe if the LotFP adjustments were stated in terms of "against targets in metal armor" and so on, rather than AC numbers, I would've hated them less.) I don't want "weapon vs. AC" lookup tables. If my goal is to make combat fast, having to consult a table is not going to help.

Weird Tales, Jan 1946 p5.png



The solution: Variable Critical Hit Range by Weapon + Overkill


Yes, there is a solution to all this!

First, the solution to critical hits not mattering against mobs of orcs is the Overkill rule: Whenever your attack kills an enemy with Wounds left over, you can carry over the excess Wounds to another target (as long as its AC is equal or worse than the killed target's.) Thus, when you score a critical against an HD 1 orc, you now kill two of them in one blow.

Secondly, and far more importantly: Critical hit range now depends on weapon type. Variable crit range, in other words. For example, daggers never score critical hits. Spears score them on a natural 20. Greatswords score critical hits on a natural 18-20.


Weapons Critical Range Other
Dagger - Riposte
Club - -
Staff - Two-handed
Rapier 20 Riposte
Spear 20 Reach
Axe/mace/shortsword 20 -
Sword 19+ -
Polearm 19+ Reach, two-handed
Greatsword/greataxe 18+ Two-handed



Sling - -
Shortbow 20 -
Longbow 19+ -
Crossbow 18+ Reload

Thirdly: Fighters score 3 Wounds on critical hits. Everyone else scores 2 Wounds.

Fourthly, a minor point: Specialists/Thieves, when landing a Sneak Attack, automatically deal a critical hit (even if the weapon is not normally capable of critting).

Rationale


Note, firstly, that weapons fit neatly into four tiers. Moving one step down in critical range will usually give you one positive feature, and vice versa: rapiers and spears aren't quite as damaging as standard swords, but they have interesting secondary features. Axes and maces, likewise, have their own situational benefits over swords. Shortswords are strictly worse than standard swords - but hobbits can wield shortswords in one hand, while they require two hands for an axe, mace or sword.

A polearm has reach, and that's why it's not quite as devastating as the undisputed king of damage, the greatsword. If polearms and greatswords were equally damaging, polearms would be the strictly superior option - which may be a historically accurate rendition, but not one I want to adhere to in my swords-and-sorcery inspired campaign.

 

In every case, players will have to choose - do they take axes to chop down doors or spears for reach? Or do they forgo these benefits, focusing on damage? In this aspect, the system works very similarly to one with variable damage dice.

However, critical hits are automatic hits, which means they have interesting interactions with AC that must be analyzed. The number of attacks that critically does not depend on target AC. But the number of regular hits does. Thus, the higher the target's AC, the larger the contribution of criticals to average damage.

The table below shows the relative damage increase from using a critically-hitting weapon, compared to a common baseline. The assumed baseline is a weapon that cannot critically hit for double damage - a dagger, in our case.

Relative improvement over non-crit damage vs. Required d20 roll to hit.
Crit range/damage 8 9 10 11 12 13 14 15 16 17 18 19 20
20 / 2x 8% 8% 9% 10% 11% 13% 14% 17% 20% 25% 33% 50% 100%
20 / 3x 15% 17% 18% 20% 22% 25% 29% 33% 40% 50% 67% 100% 200%
19+ / 2x 15% 17% 18% 20% 22% 25% 29% 33% 40% 50% 67% 100% 200%
19+ / 3x 31% 33% 36% 40% 44% 50% 57% 67% 80% 100% 133% 200% 400%
18+ / 2x 23% 25% 27% 30% 33% 38% 43% 50% 60% 75% 100% 150% 300%
18+ / 3x 46% 50% 55% 60% 67% 75% 86% 100% 120% 150% 200% 300% 600%

Note a couple things.

Firstly, a critical range/damage of 19-20/3x is better than 18-20/2x. In my system, this translates to: a Fighter deals greater (average) damage with a sword than a Thief does with a greatsword. The Thief still gains a benefit from using a greatsword, but the gain is smaller than for a Fighter. This is perfect for me, since I'm not using any class-based weapon restrictions. I want even Magic-Users to use swords if they want to - they just won't be as effective with swords as Fighters or Thieves.

Secondly, the benefit of using a heavier weapon is relatively more important when the required to-hit roll is higher - that is, when target AC is higher. In practical terms: it turns out greatswords and polearms "penetrate" armor better in this system. This may not be entirely realistic, but it's good enough for me. When you're fighting fleshy unarmored peasants, an axe or dagger will do; for dragons or armored paladins, consider bringing something heavier.

I think this system could be incredibly powerful - effectively, it is a "weapon vs. armor type" system without requiring any table lookups, nor any secondary rolls. You simply note the crit range on your sheet when you pick up a new weapon, and it stays the same no matter what foe you're fighting - though it results in different outcomes. The baked-in math does all the magic. I think this counts as following the philosophy which the GLOG states as: "Consolidate ruthlessly. Turn two rolls into one, turn one roll into none. Turn tables into formulas, turn formulas into static numbers."


How does it stack up?


So within the new system, the weapons seem to work great relative to each other. But what about the damage increases overall? Aren't those percentages a bit high, you ask? To compare this to the original games, let's look at how much of a boost variable weapon damage in B/X gives you. Let's choose the d4 as the baseline for comparison, since our earlier copmarison used a non-critting dagger/staff as the baseline.

B/X weapon equivalent Die Average Improvement over d4
Unarmed d2 1.5 -40%
- d3 2 -20%
Dagger d4 2.5 0%
- d5 3 20%
Spear d6 3.5 40%
- d7 4 60%
Sword d8 4.5 80%
Greatsword d10 5.5 120%
- d12 6.5 160%
In our new system, let's say a 1st level PC (+1 to hit) is attacking an enemy in plate (AC 17, roll needed to hit = 16). In the variable crit range system, how does your choice of weapon affect your damage, and what damage die does it correspond to in the variable damage system?

Crit range/damage Damage improvement Example attacker Example weapon Equivalent variable damage  Equivalent bonus to-hit
 20 / 2x 20% Thief spear d5 +1
20 / 3x 40% Fighter spear d6 +2
19+ / 2x 40% Thief polearm/sword d6 +3
19+ / 3x 80% Fighter polearm/sword d8 +4
18+ / 2x 60% Thief greatsword d7 +5
18+ / 3x 120% Fighter greatsword d10 +6

So, against a plate-armored opponent, a Fighter's benefit (in terms of average damage) for grabbing a spear, sword or greatsword is exactly the same as in B/X variable damage! Thieves and Magic-Users are free to use swords and greatswords, but they'll effectively be using a smaller damage die - d6 or d7 - in a system without any damage rolls!

That's for 1st level PCs against a plate armor. Of course, if the enemy's armor is worse, or the attacker's to-hit is better, then weapon choice becomes de-emphasized compared to B/X. That is, greatswords give smaller improvements over daggers than they would under variable damage. Vice versa, if the target is better armored than a human in plate, then bringing a big weapon becomes even more important under this variable crit range system.


Pros and cons of Variable Crit Range


In summary, the pros of using critical hit range to differentiate weapons and critical hit damage multiplier to differentiate classes:
  • The player-facing mechanics work exactly the same regardless of the foe being fought 
  • It a sort of "armor penetration" effect without any need to consult charts
  • There is no need for weapon restrictions by class, yet Fighters still gain more of a boost
 Cons:
  • As a caveat, one should be extremely careful about implementing "advantage" rolls into this system. Effectively doubling the chances of a crit can have quite massive effects when coupled with triple-damage crits.

Minor caveats


(Just to pre-empt a minor point: Daggers not being able to critically hit may go counter to expectations. However, the special-case rule that "any sneak attack that a Specialist/Thief lands is a critical hit regardless of weapon" means that sneak attacks with daggers are just as effective as those with greatswords. If you used variable weapon damage, and doubled damage on sneak attacks, then Thieves would be incentivized to use greatswords. Unless of course you implemented class-based weapon restrictions, which I don't want to do.)

As a side bonus: in addition to, or instead of, +to hit magical weapons, you could have "keen weapons" that have a greater-than-normal critical range - keen rapiers that crit on 19-20, and so on. If you really wanted to get into the weeds incentivizing genre faithfulness, you could even give dwarves an increased critical range with axes and hammers (bringing them up to par with the sword), etc. etc.

By the way, in case you're wondering how a +1 to crit range compares with a +1 to hit, see the last column in the previous table. 20/2x is equivalent (in average damage improvement) to a +1 to hit, 20/3x and 19+/2x to a +2 to hit, and so on. So, if you're not a Fighter, each point of critical range is worth +1 to hit (+1/+2/+3). If you are a Fighter, then each point of critical range is worth +2 to hit (+2/+4/+6). Generally, +2 to hit is equivalent to +1 damage.