# 29

This is a follow-up to last week's D&D.Sci scenario: if you intend to play that, and haven't done so yet, you should do so now before spoiling yourself.

There is a web interactive here you can use to test your answer, or you can read on.

# RULESET

## Mana

Your initial studies of mana missed out something - there are actually six kinds of mana, not five, arranged in three opposed pairs:

• Fire and Water mana are opposed.
• Earth and Air mana are opposed.
• Light and Dark mana are opposed.

Total mana of all six types is 150, at the time of the scenario the strength of Dark is 17.

You didn't in fact need to figure this out to solve the puzzle, but it would make many things fit together better - understanding what spells were powerful when and how elemental counters work is likely much easier once you understand this.

Congratulations to abstractapplic, who was the first to comment on this, and to simon, who had a fairly comprehensive analysis of the mana types.

## Spells

Spells are distinguished by two things:

• Their associated mana types (each spell has two associated mana types, and each pair of mana types that aren't opposed to one another has one associated spell).
• Being an attack or a defense spell (six element pairs have attack spells, six have defense spells, with each element having two attack and two defense options).

simon made an excellent chart of the spells, which I am shamelessly stealing rather than drawing my own:

## Mage Spell Preparation

Mages prepare spells mostly randomly, with two caveats:

• A mage will always bring one attack and one defense spell.  The third spell can be either type.  This was for good reasons - bringing no attack spell makes winning impossible, while bringing no defense spell makes winning unlikely.  Nobody submitted an answer with no attack/no defense, though GuySrinivasan briefly considered it.
• Mages dislike Dark spells, and bring them only half as often.  This set up some skew in how likely to win different spells were, based on elemental counters.

## How a Duel Works

• Each mage starts with 100 Health.
• A random mage wins the initiative and attacks first:
• He selects one of his attack spells to attack with.
• His opponent selects one of their defense spells to defend with.
• The attack spell's power is equal to the sum of the powers of the two elements it uses (e.g. Merinita's Mud Missiles at the time of your duel uses Water 39 + Earth 26 = 65 Power).
• The defense spell's power works similarly, but any element it shares with the attack spell counts as 0 (fire cannot block fire), while any element it has that opposes one in the attack spell counts double (water is extra good at blocking fire).  For example, if you defended aginst Merinita's Mud Missiles with Logain's Lava Levee, you would count Fire twice (24+24) but Earth zero times, for total power 48.
• The attacker rolls 1d[Attack Power], while the defender rolls 1d[Defense Power].
• If the attacker rolls higher than the defender, the defender takes damage equal to the difference.
• Then the other mage attacks, and they take turns attacking until one of them hits 0 Health.

When a mage has multiple attack/defense spells, he doesn't have the benefits of your research, but he still has some ability to sense intuitively how strong each spell seems to be and to see how well it is working against his opponent.

This means that he will be more likely but not certain to use the stronger spell,  using it more often proportionally to how much stronger it is.

For example, if he has one 60-power attack spell and one 40-power attack spell, he will attack with the stronger one 60% of the time and the weaker one 40% of the time.   If one of his defense spells has 40 power against his opponent's attack and the other has 10, he will use the stronger one 80% of the time and the weaker one 20% of the time.

# STRATEGY

## ATTACK

Your opponent has one Defense spell: Solar Shield (Fire/Light).

The attack spells you could bring were:

These spells varied on power level (some using stronger kinds of mana than others), but more importantly varied on how well they performed against your opponent's defense (e.g. Merinita's Mud Missiles is the most powerful attack available, but it lets your opponent defend with doubled Fire plus Light, giving your opponent even higher defense).

The best available attack is Flambeau's Flying Fireball, which manages a reasonable 50 Attack Power while minimizing your opponent's Defense Power (denying him Fire mana and allowing only weak single-counted Light mana).

Bringing a second attack is suboptimal - since your master won't change his usual spell-selection behavior, any other attack spell you bring will make him use fewer Fireballs.

## DEFENSE

Your opponent's attack spells were Merinita's Mud Missiles (Earth/Water, 65 Attack Power) and Flambeau's Flying Fireball (Fire/Air 50 Attack Power).  You were looking for defense spells good against both of them - unlike attacks, however, bringing two defenses can be valuable for you, as your master has some ability to pair the right defense against each attack (since if a defense is high-powered against one attack and low-powered against the other, he'll be more likely to use it against the first).

It's more important for your defenses to be good against Merinita's Mud Missiles, as it's  your opponent's higher-power attack, making it both more dangerous and more frequently used.

Vaporous Vambrace is the stand-out defense spell, with strong defense against both your opponent's attacks.

While they make you a bit more vulnerable against Flying Fireballs, adding in Wall of Wailing Winds (or, as a second-best, Solar Shield) substantially improves your defense against the more dangerous attack of Mud Missiles, and your master will usually be smart enough not to use them against Flying Fireballs.  Adding either of these spells results in slightly better defense than just Vaporous Vambrace alone.

Optimal play was therefore to bring:

• Flambeau's Flying Fireball
• Vaporous Vambrace of Verditius
• Wicked Wiskeria's Wall of Wailing Winds

This gives your master an 83-84% winrate.

N.B: winrates here were Monte-Carlod rather than calculated.

*In addition to selecting a list of 3 spells, gammagurke identified the best 2 spells, and considered asking their master to bring only 2 spells.  I apologize for not making it explicitly clear whether this was allowed, especially since the optimal 2-spell selection performs very nearly as well as the optimal 3-spell selection.

Congratulations to all players, particularly to gammagurke (who submitted the closest-to-optimal 3-spell selection as well as his suggestion of an even-closer-to-optimal 2-spell selection).

# FEEDBACK REQUEST

As usual, I'm interested to hear feedback on what people thought of this scenario.  If you played it, what did you like and what did you not like?  If you might have played it but decided not to, what drove you away?  What would you like to see more of/less of in future?  Do you think the underlying data model was too complicated to decipher?  Or too simple to feel realistic?  Or both at once?

I'm particularly interested in how the existence of Dark mana felt from a player perspective.  I wanted it to be a discovery players could make after exploring the data a bit that would make a lot of different things fall into place, but given that multiple people commented on it very quickly I may have made it too obvious.  (In my defense, the last of these scenarios I did also had such a discovery embedded in it, and that one no-one got, so I may have overcompensated in the opposite direction).

# 29

New Comment

I liked this one a lot. In particular, I appreciate that it defied my expectations of a winning strategy: i.e., I couldn't get an optimal or leaderboard-topping solution with the "throw a GBT at the problem, then iterate over possible inputs" approach which won the last two games like this.

I think the Dark mana thing was a good sub-puzzle, and the fact that it was so soluble is a point in favor of that. It seemed a little unfair that it wasn't directly useful in getting a good answer, but on reflection I consider that unfairness to be a valuable lesson about the real world: the most interesting and cleanly-solvable subproblem isn't necessarily going to help you solve the main problem.

Huh. I kind of imagined it would be very important to understand Dark mana in order to e.g. assign elements to spells, and I don't know how deeper analysis would have been possible without doing that.

To the extent that there was a specific 'intended' use for understanding Dark mana/trap for not doing so, it was this:

Dark heavily anticorrelates with Light.

Therefore, if you don't know about Dark mana, spells that use Dark will naively appear to be stronger when Light is weak and weaker when Light is strong.

At the time of the scenario, though, both Dark and Light are low, and so if you haven't figured out Dark you could get misled into assuming that the Dark-using spells are all strong because Light is low.

simon made an excellent chart of the spells, which I am shamelessly stealing rather than drawing my own:

Nice!

Do you think the underlying data model was too complicated to decipher?

The exact mechanism would have been pretty tricky to figure out, but that's not necessarily a problem?

The general payoff landscape seems fairly discoverable, but with high effort (which I, in the event, didn't end up exerting) because of having to disentangle the interactions of the combinations of different spells and different mana strengths. The outcome being a probabilistic binary one also reduces the effective amount of data points as compared to a numerical outcome, which becomes more of an issue the more different effects you need to disentangle.

I think there is likely plenty of data for this once you take into account the symmetries of the problem, but maybe not quite so much without the symmetries (which are obscured by the different pick rates and the initial missing dark mana). I actually considered the possibility that the pick rates were the only asymmetry source, but didn't look into it, whoops.  Even so, I had been planning on proceeding under the assumptions that asymmetries between the spells were sufficiently unimportant that looking at symmetry equivalence classes of spell combinations would be useful, and that only offensive spells of one mage vs. defensive spells of the other and vice versa matter (i.e. that there are no important interactions between offensive and defensive spells of the same mage, and that there are no important interactions between offensive spells of different mages or defensive spells of the different mages), and also that only the mana types associated with the spells involved matter. In retrospect, this should have succeeded if I put in the effort, because in actual fact all of these assumptions happened to be exactly correct, but I didn't actually know any of these assumptions to be true, which in combination with the effort that would have been required reduced my enthusiasm to proceed. I could also have been probing each of these assumptions, but that also would have taken time.

Or too simple to feel realistic?

Of course, but that's not necessarily a bad thing.

given that multiple people commented on it very quickly I may have made it too obvious.

I had fun finding it (independently though reporting after abstractapplic), even though I literally had not looked at the actual duel results for anything further than the mana results themselves to click into place.

I also had fun in general, and even though I didn't end up proceeding beyond a certain point, I expect I would have had further fun if I had done so.

The exact mechanism would have been pretty tricky to figure out

I was getting close. :) Had I spent 3x as long, I probably would have gotten it. Where I left off:

• convinced it was very likely to be a repeated exchange from HP=X to HP=0, and thought the exact HP number would be static and "nice"
• leaning heavily toward turn-based rather than simultaneous
• had thought of a small handful of possible ways "damage" could be happening, one of which was this exact mechanism (convinced of x0 and x2 because Pokemon/etc)
• plotted calibration curves for potential mechanisms

The things I was missing were:

• automation to easily try out new damage mechanisms and then try all the (relatively small) combinations
• notice that "choose randomly" and "choose best" didn't work quite right, and figure out that it was actually "choose weighted" (this is the hardest part for sure, and it's possible the calibration curves even look fine without it, which would scrap my chances)
• pin down HP=100 rather than HP=20, 50, 200, etc.