42 0 25MB
The Theory of Magic 29-07-2022
bstract. The description of Wizards and their relation to magic in Fifth Edition suggests that there should be a way of ``studying’’ it. In this paper we show that we can form a fairly rigorous mathematical model which can describe the phenomena seen in game and provide a basis for inventing new phenomena. This model proposes the existence of what we are calling a ``Gygax-Field’’ - a field that spans all planes and exists in a meta-stable state. This meta-stable state results in a large amount of energy being released back to the caster when a spell slot is utilized. This energy can be used for nondamage or healing purposes, or it could be used less efficiently, being used to create and send a perturbation, in the shape of a 2D Gaussian, by applying force to the GygaxField. If this second is the case damage is then probabilistically chosen and returned to the caster’s plane via an ``aperture’’ controlled by the caster, which determines the shape of the spell in the plane. While less than rigorous in some areas, with definite improvements and further study available, this is an excellent first step into the Theory of Magic.
A q 1.
Introduction
In Fifth Edition, magic is one of the most important core features of the game, being used by many classes, monsters, and races. The relationship between creatures and magic within the game has always been ambiguous at best, but one element has stayed constant. Being academic by nature, wizards have long been a class defined by their study of magic. Furthermore, this study is performed in an exact and quantified manner with a focus on reproducing the results. This leads to the obvious question...Can we quantify magic in Fifth edition by taking a scientific approach from first principals? That is the goal of this paper and the community responsible for its existence. What do we mean by a first principal approach? This means we must build from the simplest foundations we can possibly find, taking nothing as true unless it is absolutely necessary. This includes features of spells as discussed later in Section 2 and even the basic laws of physics. We do not know, for example, which aspects of spells are physically crucial for spell casting and which are features of culture (e.g. are magic schools really distinct physically or a social categorization of magic?). Similar questions are raised regarding the laws of physics: We already know many things in 5e are similar to the real world (Bows fire arrows so there are likely similar laws governing tension and force as in the real world). However, many things like gravity, terminal velocity, and even the basic ideas of Euclidean geometry (moving diagonally across a 5ft x 5ft box is still 5ft, in game) are very different. Finally, there is obviously something different since magic exists in 5e and sadly not in the real world (that we know of). Because of this it is imperative we do not fall into the trap of trying to relate magic to real world laws of physics, using equations built from first principles that no longer apply, or constants that may very well be different. So we must choose to only use the laws we can reasonably assume for the world of 5e to function and the evidence given to us by spell descriptions. This theory focuses entirely on officially released 5e content as homebrew often doesn’t fall in line with an already chaotic games system. The goal of this paper is to describe, within reasonable error, the effects we see of magic to the best of our ability. When we can describe what we have evidence for we will be able to then extend the theory and see what additional predictions we can make for new game features that are not prohibited by the theory and will most likely fall in line with the trends set by the main game.
30
q 2.
Anatomy of Spells
There are a few key features of spells that we will need to discuss: • • • • • • • • • • • • • •
Saving throw required of targets (if applicable as targeting spells are often an attack roll to beat AC as with other attacks in 5e) The damage dice done (usually given in the form nds + m discussed further in Section 3 • The Spell description of the effect Material (M) Components (Materials used during a spell casting, they may or may not be consumed) Somatic (S) Components (Motions and gestures) Verbal (V) Components (Spoken words) Casting Time (Action, Bonus Action, Longer) Range (Over what distance the spell can have an effect) The School of Magic the spell is attributed to Level of spell/Spell slot used The Type of Damage done Number of Targets Spell Duration Area of effect Status Effects
Immediately we can separate spells into two categories: Damage and Non-Damage spells. When considering magic for the development of a theory we decided to begin with Damage spells as they give us hard numbers to make predictions with. Using a data set created by Chiyo#1432 of all the damage spells and their necessary features, we were able to begin looking for correlations within the data. To do this we converted qualitative[1] effects (such as the saving throw and damage type) into coordinates. This was done by creating a set of the available options and assigning values in the data as the index within this set (a list of all unique elements) rather than the string data (or text). e.g. in the set ``{Fire, Cold, Necrotic}'' a spell with a fire damage type will have its string data ``Fire'' replaced with ``0'' as it is in the 0th position, ``Cold'' with ``1'' as it is in the first etc. We do this so that we might be able to investigate the correlations between these effects. This is a crude method but one that will allow for a quick analysis of all given features. This allowed us to produce the table shown in Figure 2.1 where we see how correlated these features are. Figure 2.1
31
Figure 2.1. An annotated correlation matrix with: range, level, school, range, concentration, V, S, M components, material consumed, material cost in copper pieces, area type, ability checks, saving throw, cantrip scaling, damage type, n, s, m, sigma, A, and Spell Slot. Sigma and A are features from the distribution describing the dice relation nds+m discussed further in Section 3. The correlation strength is given between -1 (strong negative correlation) and 1 (strong positive correlation) with 0 representing no correlation From this we can see that there are no clear correlations between features except with some of the mathematical features on the bottom right corner which relate through a function so some correlation is expected. These mathematical features were key to discovering the first key relationship of the theory in Section 3. Another interesting avenue of exploration was to find the least number of features required to uniquely identify every spell. This would give us an indication of what features we had to encode within our theory. For example two points might have the coordinates (1,2,0) and (1,2,1) in the x,y,z coordinate space. If we just look at the x-y plane then the two points will overlap, however if we look in the z-direction as well then we can see they are distinct. From this we were able to find that the key features of any spell was: level, range, n,s,m, area type, Somatic Component, and damage type. This was surprising for multiple reasons, for example it suggests that any feature not in this list is not necessarily vital to spell casting. In fact, it is often said that verbal and material components are more about aiding the caster’s memory. We also find that spell schools are indeed a social construction on our interpretation of spells and their distinction, not a fundamental difference of spells.
q 3.
Dice Statistics
Before continuing it is important to discuss some simple features of statistical distributions of dice. When talking about dice we will use the following notation: n is the number of dice, s is the number of sides on these dice, and m is the modifier. e.g. 4d6 + 2 gives: n = 4, s = 6, m = 2, or 4 six sided die, plus 2. When we roll a single die we get what we call a “flat distribution”, this means that every side of the die (ideally) will have an equal probability of showing. Thing’s get more complicated when there are two dice which we then sum. Take the example of two four-sided dice: There is a 1 in 4 change of getting any side on each individual dice but there is a 1 in 16 chance of any two sides showing, however since we are summing these values there are certain combinations which produce the same result. For example, if we get a result (1,4) (where the first number is die1 and the second is die2) the sum is 5, this is the same as (3,2),(2,3),(4,1). Hence there are four different results, each with a 1 in 16 chance of occurring that give a sum of 5 therefore there is a one in four chance of getting 5. However only one combination (1,1) gives the result 2, and only one gives the maximum result of 8, (4,4). Thus these both have only a 1 in 16 chance of occurring. By going through this process for all combinations we can build a distribution showing that 5 is the average dice roll while 2 and 8 are the least common extremes. When there are two dice we will call the resulting distribution a “triangle” distribution. In most spells there are more than two dice and we begin to see distributions that look more ‘normal’ in the mathematical sense. We will call this distribution the “gaussian” distribution. The mathematical form of this distribution is given by:
(1) A is the amplitude of the distribution, x0 is the distribution’s average, σ is the standard deviation (or standard deviation) of the distribution, and C is the vertical shift. Given that most often we can describe spell’s damage with A,D0 (as we are in damage space[2]D , not spatial x),σ, and C (though C is almost always 0). Since Gaussians can describe most spells for a crude initial theory we will describe all spells with their Gaussian parameters. Examples of these distributions and their Gaussian fits can be seen in Figure 3.1. From these distributions we can see that we can uniquely identify distributions from their Gaussians which reasonably fit them. This is less accurate for lower n and should be taken into consideration for a source for future improvements. However, this provides a basis for the findings in Section 4.1. These Gaussians will also play a crucial role in the development of the main magic theory in Section 5.
32
q 4.
Evidence
Given that this project is an attempt to build a model and theory from first principles it is an important question to ask what we “know”. This proves especially challenging regarding magic. Not only do some spells have severe inconsistencies with our current understanding of physics (for example the same energy is taken using “heat metal” to turn the metal white-hot, regardless of the metal or alloy in question) but spells also rely on principles that do not exist in our universe as far as we know (different planes, an objective good/evil, gods). However, as stated earlier, one piece of hard fact that we do have are the features of the spells and especially their damage (described by nds+m or Equation 1). We later will also explore another method that provides a basis for understanding the energy required in magic.
q 4.1 Damage Relations
The first attempt to find a relationship between damage and level of the spell (or alternatively: how much energy the caster puts into the spell) shows some correlation but not one that we could base an entire theory off of. This can be seen in Figure 4.1.
Figure 3.1. Various dice distributions of 1d6 (top left), 2d6 (top right), 3d6 (bottom left), 4d6 (bottom right) with a randomly generated distribution using the ‘numpy.random’ tool in python and a Gaussian fit to this distribution. This proved problematic at first however we then found that by separating the spells by damage type we could find much clearer correlations as shown in Figure 4.2. While the correlations are not perfect they are much better than Figure 4.1. It should be noted that much of the linearity seen does occur due to upcast spells. It may be possible that the correlation between regular and upcast spells are different however such a prospect is yet to be investigated. These are linear correlations that can be explained by fitting a straight-line to the data:
(2) Another interesting feature is that these correlations hold not only for the average damage ‘D0’ but also for the other Gaussian features ‘A’, and ‘σ’ as shown in Figure 4.3. These correlations will be extremely important later in the theory as they allow us to describe the damage distribution by substituting the values D0, A, and σ with their straight
33
line counterparts, giving us an estimated damage distribution for every level, which can then be approximated into a damage dice representation. i.e.
(3) Becomes:
(4)
Where mA,cA, mD,cd, and mσ, cσ represent the coefficients in Equation 2 as found through Figure 4.2. The specific values are given in Table 1: Using this in Section 5 we will be able to formulate a theory that allows for the existence of damage spells. However, it is obvious, this alone is not sufficient, as we have no understanding of how non-damage spells might be brought into the theory.
Figure 4.1. The correlation between damage spells and the spell slot used to cast them.
q 4.2 Energy Relations
Energy is difficult as how we relate to energy in the real-world using physics often relies on multiple other factors, many of which we do not have in 5e. However, a brilliant insight from Discord members toasterstrudel#3641 and AstroPuppy#5445 gave us a rather unusual method. One peculiar creature in 5e is the gelatinous cube which is a large creature. Many non-damaging telekinetic spells give you the ability to move creatures not by their actual weight in kg or lbs but by their ‘size’ (tiny, small, medium, large, etc.). A Large creature is defined as being 10ft×10ft (2×2 grid squares). Since we know the gelatinous cube is a cube we can say that its maximum volume is 10ft×10ft×10ft. We then define it as having mass “1GC (one gelatinous Cube)”. A basic principle of physics is that it takes energy to apply a force over a distance, since we can assume that the 5e world would look radically different from our own if this principle did not apply, we take this principle to be applicable here. Thus we can find the mass moved (which gives us the force) by relating it to the
34
maximum creature size the spell allows us to move and the distance specified by the spell. By plotting the spell level vs the maximum energy used we find Figure 4.4: This gives us a fit of:
Figure 4.2. The Correlation between average damage and spell slot level when spells are separated by damage type. Due to the data bases wide range of spells included some damage types (such as ‘extra’ are not used later in the theory but have been included here for completeness). Yellow data points are spells cast at their original level while purple are upcast spells. Here we use scipy’s “curve fit” module to find the best fit lines and values shown.
Figure 4.3. The correlation between spell level and the Gaussian features of the damage distribution.
35
Force Damage Extra Radiant Bludgeoning Psychic Piercing Lightning Nonmagical Slashing Cold Necrotic Poison Acid Fire Thunder
mD 0
4.33 2.15 1.00 3.23 3.85 3.09 3.81 3.59 3.59 5.19 3.90 4.27 3.51 3.87 4.07 2.89
cD0
2.53 3.45 1.50 2.76 1.24 4.63 -0.43 5.11 5.11 -1.64 2.61 1.30 4.17 2.88 0.74 5.97
mσ
mσ
mA
cA
0.70 -0.05 -0.04 0.53 0.43 0.52 0.58 0.63 0.63 0.56 0.54 0.62 0.57 0.48 0.58 0.54
1.28 1.62 0.42 1.46 2.28 1.45 1.04 1.06 1.06 0.54 1.54 1.35 1.92 1.29 1.28 1.86
0.21 -0.02 -0.01 0.20 0.15 0.22 0.23 0.31 0.31 0.41 0.24 0.23 0.21 0.28 0.27 0.19
0.64 0.76 0.14 0.62 1.00 0.63 0.47 0.27 0.27 0.35 0.59 0.56 0.60 0.70 0.28 0.67
Table 1. Table giving the values of lines of best fit according to Figure 4.2
Figure 4.4. A plot showing the energy used vs spell slot when using telekinetic spells.
(5) Thus we can say that while damage is linear, the energy of spells is exponential. This is further supported by the omission of one data point in Figure 4.4, “Bigby’s Hand” which does damage, suggesting some level of inefficiency in spell energy output when damage is done. This will become crucial in Section 5.
36
q 5.
Gygax-Fields and the First Theory of Magic
It is now finally time to put this all together and try and include every attribute discussed as ‘essential’ in Section 2. The first step is to describe the basic framework. Imagine a spell caster and their target where we define the spell caster as at the origin (x = 0) and the target some distance away at x = T in the x-direction (which we define as the straight line connecting the caster and the target). This theory proposes that throughout all space there exists a field called the Gygax-Field. When acting a force upon this field we produce magical energy which is then used by the caster. The Gygax-Field has many dimensions, firstly in space (x,y,z, though we will only focus on x for now), damage-directions which we say defines the damage type done by the caster, a healing direction, and a non-damage direction for more direct magical energy. These are all perpendicular to one another. The Gygax-Field sits in a state of zero potential when unperturbed. However, users toasterstrudel#3641 and Toviel#8016 suggest that it can be thought of as only “meta stable”. In this proposition The energy given out by the Gygax-Field, and energy required to perturb it are given by:
(6) These produce what is called ‘meta-stability’ or in other words: the field is stable when unperturbed but when energy is added it can collapse into a new minimum, these minimums grow exponentially small (large in the negative direction, i.e. energy flowing out of the field) while the energy required to cause such collapses increases linearly. This explains the linearity of spell slots and the exponential rise in spell energy. It also gives a reason for the quantization[3] of discrete spell slots at the energy levels required to cause such decay. After perturbing this field with a small amount of energy and retrieving the much larger “reservoir” of energy a caster has options, either use it for non-damage purposes on themselves or move it to the target. In the example of damage spells, there is some inefficiency when using this energy to perturb the field in the damage direction (which grows with spell slot used such that damage is linear). Such perturbations we can describe as a 2D Gaussian in the damage-direction ( ˆd) and the x direction. The damage Gaussian is given by Equation 4 with D and D0 in the ˆd direction to indicate the damage type used (and the straight line fit factors chosen accordingly). The second is given by:
(7) Where λ(t) is described by:
(8)
In essence Equation 7 is a Gaussian in the x-direction that begins at the origin x = 0, it then moves at velocity v over time (given by vt). However, the standard deviation in space (λ(t)) decays as the spell moves, such that it collapses to 0 at x = R the range of the spell. Thus the final, complete form, of a moving damage spell is given by: Figure 5.1. The Energy of the field vs. space where we see that by exciting the field to discreet values causes an exponential decay (not seen in the graph as the exponential fall off is far too great to be able to see details in the positive realm). Positive energy here represents a need for energy to be put into the field while negative represents energy release. We also see that as expected an unperturbed field sits at 0 (i.e. no magic without some amount of forcing).
37
(9) We call this ‘Crawford’s Rule’. When the spell reaches x = T (provided T < R). The caster may then allow the energy to return to the caster’s plane through a controlled “Aperture” described by a spatial profile V (x, y, z). As the spell collapses, a random damage is chosen according to Equation 4 which we will call D1. We can then describe the output ‘O’ as:
(10) Thus the spell has been moved and has applied damage probabilistically to the target incorporating all key elements (other than somatic) as discussed in Section 2. The Efficiency of converting energy to Damage (κ) can be described using a simple:
(11) Unlike damage, it was found that Healing spells actually rise exponentially in average hit points healed (rather than linearly), suggesting that healing is much more efficient than damaging magic. This idea requires further investigation.
q 5.1 Describing Other Phenomena q 5.1.1 Classes
Classes Not every caster has the same relationship to magic as others, wizards study, draconic sorcerers are born with innate abilities, warlocks submit to a patron. In this theory we suggest that these differences have more to do with one’s education and relation to the Gygax-Field rather than anything else. Wizards study and practice the exact energy they must exert, while warlocks are “shown” by their patron, teaching them, magic much different to a wizard’s. Draconic sorcerers are born with this knowledge in their subconscious, while wild magic sorcerers have a chaotic method of learning through experience with their careless applications to the Gygax-Field and the energy released causing fluctuations called wild magic. Casters such as Bards, Clerics, and Paladins I would argue learn in a very similar way to Wizards however unlike a Wizard’s rigorous study from libraries and experiment, dedicated to arcane knowledge, these casters learn magic as a product of their learning in music, medicine, and religion. Druids learn by replicating the magic they see in nature (since we know magic does exist in the natural world so it is not unreasonable to assume one could learn by watching magical creatures). This style of explanation can be extended to all classes with magic. This theory suggests that the difference in classes is more social than innate, that the differences in magic are to do with your learning and training but any magic use requires some level of practice.
q 5.1.2 Concentration
Concentration can be seen as the slow release of energy from the Gygax Field through the “Aperture” as described in Equation 10. In order to maintain this, the caster must concentrate on controlling the flow of energy. Since the damage is predetermined it will not be spread out over time, so this is in line with our understanding of how concentration works mechanically.
q 5.1.3 Spells With Multiple Damage Types
Spells with multiple damage types can be thought of as simple summing versions of Equation 9 with different ‘ ˆd’ since all damage directions are constructed as being perpendicular and hence will not interfere with each other.
38
q 5.1.4 Counter Spell and Anti-Magic fields
Counter spell is simply sending an equal and opposite perturbation along the x-axis such that it negates the energy that would otherwise be outputted. The associated checks are the counterer’s ability to recognize how much to counter by. For high spell slot uses of counter spell we have no distinct explanation however we can assume perhaps that it is sending enough energy to cancel the spell but not enough to cause any ill effect. Anti-Magic fields on the other hand could be seen as using energy to increase the “tension” in the Gygax-Field such that spells cannot be used across it regardless of applied energy.
q 6. New Phenomena q 6.1 Spell Creation
Using the assigned values given in Table 4.1 we can get a rough estimate for the damage output of a spell for any given damage type. Then we can programmatically translate these values to nds+m (as described in Section 3) values by finding the closest approximation. These values will be included in the full publication and not in this paper.
q 6.2 Down Casting
The existence of up-casting suggests that changing the input energy to a spell only alters its damage output, thus we could suggest the existence of down casting: Casting a spell using a lesser spell slot at a reduction of output damage.
q 6.3 Changing Damage Types
Conversion of damage types to create new spells is theoretically possible under Crawford’s rule. The process for converting spells is simple in principle (though there are difficulties still to be overcome entirely): First we must calculate the average damage for the original damage type of the spell at whatever level we are interested in (e.g. fireball cast at 5th level so we find the average A, σ, D0 factors at level 5 according to the correlations) we call these A0, σ0, D00. We then find the A, σ, D0 values given for the spell in question (A1, σ1, D01). We then define multiplying factors
and
We then find the average values of A, σ, D0 at the same level in the new damage type direction. We then multiply these values by our previously calculated ‘f’ factors to get the factors of the spell in a new damage direction. In theory this is the spell now translated, however to translate this into ‘nds+m’ form would be more useful.
q 6.4 Changing Area Types
A skilled enough caster might, in theory be capable of changing the area profile of spells. This is a very powerful ability and a difficult check and GM discretion is advised.
q 6.5 Tenth Level Spells
There is no theoretical limit to the level at which spells can be cast. However for the sake of balance (and for lore reasons) 10th level spells are not available to most casters. It is however feasible for implementation in game so long as there is a significant risk or cost involved.
q 7.
Discussion and Conclusions
In this paper we have shown that it is possible to describe magic by implementing a meta-stable field model. When a small amount of energy is put into the field it results in an exponential return of raw magical energy. This energy can then be used for non-damage purposes and healing, or to perturb the Gygax Field in a particular damage-direction. The efficiency of converting energy to damage decreases such that damage increases linearly with spell slot used. From this theory we are able to explain the differences in magic users as well as existing in game phenomena. While this is very clearly a first step into magic theory (and successor theories are greatly encouraged) it is a very promising first step, allowing explanations for damaging magic, healing magic, and a basis from which non-damage magic
39
might work. There are, of course, flaws within the theory such as the poor correlations with damage and level as well as the rather loose definition of the “aperture” and how a caster might be able to create one. Despite this we have shown a theoretical basis for how a caster might give energy, get huge sums back, and then send or use this magic at their own will. Regardless of flaws I consider this a great success.
Endnotes 1 Qualitative data is data which we cannot describe purely using numbers. e.g. School of Magic is qualitative while Damage is not (i.e. damage is quantitative). 2 “space” here simply refers to an axis with 0 damage at the origin and infinite damage at the other end. It is
like replacing the y-axis with a D-axis where instead of describing the position of something in “y-space” we are describing it’s damage. Similairly, if you were to plot the number of flowers over some line we call ‘x’ we could reasonably say the y-axis is ‘flower space’. 3 Quantization is a term from Quantum mechanics simply meaning that only certain values of a quantity are allowed. For example, quanta of energy in an electron or spell slots.
40