Skip to content

Miscast Simplification

Edgar A. Bering IV edited this page Dec 12, 2021 · 1 revision

Current state

The gameplay usage of the internal MiscastEffect is pretty widespread, which presents an obstacle to simplifying miscasts. Here's the full set of usages

  • arena testing
  • Unrands:
    • Scythe of Curses (Necro)
    • Plutonium Sword (Tmut)
    • Spellbinder (Random spell school)
  • Nemelex Wild Magic card
  • Mummy Death curses
  • God Wraths
    • Cheibriados!? (Random spell school)
    • Kiku (Necro)
    • Yred (Necro)
    • Trog (Fire)
    • Lugonu (Tloc)
    • Fedhas (Elemental school)
  • Distortion unwield (Tloc)
  • Passive God Wraths
    • Casting Necro under Kiku wrath (Necro)
    • Casting a Veh spell under Veh wrath (Conj)
  • Spell miscasts
  • Hell effects (Generic: Necro, Summon, Conj, Charm, Hex; Themed: Earth, Fire, Ice, Necro)
  • Zot Traps
  • Xom

To simplify spell miscasts all of these systems will need to be touched in some way or another. This wiki page is for brainstorming a plan for these things.

Current Spell miscast mechanics

When casting a spell, the player rolls spfl = random2avg(100, 3) and compares this to their raw spell fail chance; the spell fails if fail = max(chance-spfl, 0) is nonzero, and the miscast occurs with nastiness = lvl^2 * fail + 250.

First, this results in an immediate increase in contamination of 2 * nastiness.

Then a MiscastEffect is fired, passing the spell level and the value of fail. This is used to determine the miscast severity as follows:

  • severity = ( ( lvl * fail * ( 10 + lvl ) / 7 ) * 150 ) / 100
  • A saving throw checking random2(40) > severity is rolled twice, and on success the miscast stops.
  • Otherwise, severity = min( random2( severity / 100 ), 3) is set, and the miscast is dispatched to the spell school, which does things based on severity.

Miscast Behavior by school

The following flowcharts illustrate how miscasts are dtermined by severity. Arrows are taken with equal probability unless otherwise annotated.

Conjurations

Hexes

Charms

Summonings

Necromancy

Translocations

Transmutations

Fire Magic

Ice Magic

Air Magic

Earth Magic

Poison Magic

Proposed New Mechanics

The "good" thing about internal miscast mechanics is the quadratic dependence of severity on level. This dependence lines up with the quadratic skill point requirement needed to get fail rates down. The punishment for not paying this price needs to be proportional.

The other "good" thing is the presense of severity 0 (contamination only) miscasts for near misses and low level spells; to allow a chance of failure without punishment.

This guides the new mechanics described below. All changes will happen in the handoff to MiscastEffect, so the contamination on spell failure and spellcasting mechanics are not touched.

Determining effects

If nastinesss (from above) is greater than a threshold, suffer miscast damage in addition to contam.

Roll a miscast damage number, something like damage = roll_dice(level, (level * fail)) (exact dice sides and any scaling constants to be determined).

Pick a school from the spell randomly, and use the damage number in the following table to determine effect. Most entries are simply "take damage flavored damage".

School Miscast Effect
Conjurations ac-ignoring unflavored damage
Charms slowed for damage turns
Hexes same as charms
Summonings TODO
Necromancy damage negative energy
Translocations dimension anchor for damage turns
Transmutations damage additional contam (alternate from worms: damage turns uncancellable bad polymorph, malmutate on monsters, fits plut sword)
Fire damage fire
Ice damage cold
Air damage elec
Earth damage physical (or frag maybe?)
Poison damage poison damage (plus poisoning?)

Some caveats to this framework:

  • everywhere damage appears it should be thought of as a function of the overall miscast damage roll, subject to balance/tuning concerns.
  • I (ebering) am a bit leery of dimension anchor as the tloc miscast, since it could be used for "on-demand" -Tele. However, as long as the nastiness threshold ensures damage is sufficiently high this won't be on-demand -Tele and will last quite a while, which makes it a significant tradeoff. Current tloc miscasts already have the problem that sometimes it is worth miscasting tloc spells and the list of cases is longer.

Alternate suggestion for Hexes: noise+mark. There are cases when a player might want this (nice kill hole w/stairs eg). Miscasts should be a punishment so as not to encourage intentionally miscasting spells for their effect.

Summoning suggestions:

  • durably summoned demons (tier and number a function of damage)
  • a "failed summoning" monster made out of some ghost_demon skullduggery to get good severity scaling
  • aboms (size and number a function of damage)
  • recall or durable shadow creatures (number a function of damage)

Consequences for other uses of miscasts

Minor consequence, no extra change

For the following, no additional changes or considerations are needed; the new miscast system can be used for them directly (provided with sensible damage values for monster miscasts).

  • arena testing
  • Spellbinder (Random spell school)
  • Nemelex Wild Magic card
  • Passive God Wraths
    • Casting Necro under Kiku wrath (Necro)
    • Casting a Veh spell under Veh wrath (Conj)

Death Curses

A variety of Necro miscast usages would lose something both flavor-wise and tactical impact-wise if converted to just negative energy. These are:

  • Scythe of Curses (Necro)
  • Mummy Death curses
  • Kiku (Necro)
  • Yred (Necro)

All of these could be unified under a single "nasty effect"-type called a death-curse. That should probably not just be the old Necro miscast but as a short term stop gap could be.

Other items

  • Plutonium Sword This should probably just malmutate monsters on some fraction of hits (and maybe polymorph on a smaller fraction?)
  • Distortion unwield The chance of banishment is a mixed bag; it gives players a (less useful these days) escape at high level, and a strong unwield penalty at low level. Dimension anchor definitely won't work here unless its duration is very long, as we wanted to avoid an easy swappable source of -Tele.

God Wraths

  • Cheibriados Remove this aspect of wrath and find a better, more creative solution or just absorb the weights.

  • Trog Replace with just fireballs (angry, thematic)

  • Lugonu Fold into other paths in the wrath tree (make the forced teleports go near monsters, just up the banishment chance, etc.)

  • Fedhas Same as Chei

  • Xom Not technically wrath but might as well go here. Xom can just stop using miscasts now that they don't have the "wild" flavor. Or keep using them as-is because Xom's gonna Xom.

Hell effects

In the short term the Hell effect use of miscasts can be left as-is. The effect list using miscasts are aimed at preventing resting. Taking random damage or a long slow in the case of Charms and Hexes isn't the best and these need their own look and it would be ideal to decouple them. However, in practice hell-effect miscasts were just damage or a negative effect.

Zot traps

These have their own "spell school" in the miscast code, with the following flowchart. This can be preserved while implementing the above miscast framework, but needs its own overhaul.

Clone this wiki locally